Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
08bf3ddd
Commit
08bf3ddd
authored
Apr 07, 2011
by
Guilhem Bichot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for Bug#11765141 - "58072: LOAD DATA INFILE: LEAKS IO CACHE MEMORY WHEN ERROR OCCURS"
parent
e7079a32
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
5 deletions
+28
-5
mysql-test/r/loaddata.result
mysql-test/r/loaddata.result
+9
-0
mysql-test/t/loaddata.test
mysql-test/t/loaddata.test
+15
-0
sql/sql_load.cc
sql/sql_load.cc
+4
-5
No files found.
mysql-test/r/loaddata.result
View file @
08bf3ddd
...
...
@@ -539,4 +539,13 @@ CREATE TABLE t1(f1 INT);
SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
DROP TABLE t1;
#
# Bug#11765141 - 58072: LOAD DATA INFILE: LEAKS IO CACHE MEMORY
# WHEN ERROR OCCURS
#
SELECT '1\n' INTO DUMPFILE 'MYSQLTEST_VARDIR/tmp/bug11735141.txt';
create table t1(a point);
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug11735141.txt' INTO TABLE t1;
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
End of 5.1 tests
mysql-test/t/loaddata.test
View file @
08bf3ddd
...
...
@@ -625,4 +625,19 @@ DROP TABLE t1;
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
remove_file
$MYSQLD_DATADIR
/
test
/
t1
.
dat
;
--
echo
#
--
echo
# Bug#11765141 - 58072: LOAD DATA INFILE: LEAKS IO CACHE MEMORY
--
echo
# WHEN ERROR OCCURS
--
echo
#
--
let
$file
=
$MYSQLTEST_VARDIR
/
tmp
/
bug11735141
.
txt
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
eval
SELECT
'1\n'
INTO
DUMPFILE
'$file'
create
table
t1
(
a
point
);
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
error
ER_CANT_CREATE_GEOMETRY_OBJECT
--
eval
LOAD
DATA
INFILE
'$file'
INTO
TABLE
t1
drop
table
t1
;
--
echo
End
of
5.1
tests
sql/sql_load.cc
View file @
08bf3ddd
...
...
@@ -1075,9 +1075,10 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
String
&
field_term
,
String
&
line_start
,
String
&
line_term
,
String
&
enclosed_par
,
int
escape
,
bool
get_it_from_net
,
bool
is_fifo
)
:
file
(
file_par
),
escape_char
(
escape
)
:
file
(
file_par
),
buff_length
(
tot_length
),
escape_char
(
escape
),
found_end_of_line
(
false
),
eof
(
false
),
need_end_io_cache
(
false
),
error
(
false
),
line_cuted
(
false
),
found_null
(
false
),
read_charset
(
cs
)
{
read_charset
=
cs
;
field_term_ptr
=
(
char
*
)
field_term
.
ptr
();
field_term_length
=
field_term
.
length
();
line_term_ptr
=
(
char
*
)
line_term
.
ptr
();
...
...
@@ -1104,8 +1105,6 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
(
uchar
)
enclosed_par
[
0
]
:
INT_MAX
;
field_term_char
=
field_term_length
?
(
uchar
)
field_term_ptr
[
0
]
:
INT_MAX
;
line_term_char
=
line_term_length
?
(
uchar
)
line_term_ptr
[
0
]
:
INT_MAX
;
error
=
eof
=
found_end_of_line
=
found_null
=
line_cuted
=
0
;
buff_length
=
tot_length
;
/* Set of a stack for unget if long terminators */
...
...
@@ -1151,7 +1150,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
READ_INFO
::~
READ_INFO
()
{
if
(
!
error
&&
need_end_io_cache
)
if
(
need_end_io_cache
)
::
end_io_cache
(
&
cache
);
my_free
(
buffer
,
MYF
(
MY_ALLOW_ZERO_PTR
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment