3661 Sergey Glukhov 2011-04-15
Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
Some multibyte sequences could be considered by my_mbcharlen() functions
as multibyte character but more exact my_ismbchar() does not think so.
In such a case this multibyte sequences is pushed into 'stack' buffer which
is too small to accommodate the sequence.
The fix is to allocate stack buffer in
compliance with max character length.
@ mysql-test/r/loaddata.result
test case
@ mysql-test/t/loaddata.test
test case
@ sql/sql_load.cc
allocate stack buffer in compliance with max character length.
modified:
mysql-test/r/loaddata.result
mysql-test/t/loaddata.test
sql/sql_load.cc
3660 Tor Didriksen 2011-04-14
Bug#11765713 58705: OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES CREATED BY OPT_SUM_QU
Valgrind warnings were caused by comparing index values to an un-initialized field.
@ mysql-test/r/subselect.result
New test cases.
@ mysql-test/t/subselect.test
New test cases.
@ sql/opt_sum.cc
Add thd to opt_sum_query enabling it to test for errors.
If we have a non-nullable index, we cannot use it to match null values,
since set_null() will be ignored, and we might compare uninitialized data.
@ sql/sql_select.cc
Add thd to opt_sum_query, enabling it to test for errors.
@ sql/sql_select.h
Add thd to opt_sum_query, enabling it to test for errors.
modified:
mysql-test/r/subselect.result
mysql-test/t/subselect.test
sql/opt_sum.cc
sql/sql_select.cc
sql/sql_select.h
=== modified file 'mysql-test/r/loaddata.result'
--- a/mysql-test/r/loaddata.result 2010-07-14 11:54:51 +0000
+++ b/mysql-test/r/loaddata.result 2011-04-15 08:51:34 +0000
@@ -532,4 +532,11 @@ a
0
1
DROP TABLE t1;
+#
+# Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
+#
+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;
End of 5.1 tests
=== modified file 'mysql-test/t/loaddata.test'
--- a/mysql-test/t/loaddata.test 2010-07-14 11:54:51 +0000
+++ b/mysql-test/t/loaddata.test 2011-04-15 08:51:34 +0000
@@ -611,5 +611,18 @@ DROP TABLE t1;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/tmpp2.txt;
+--echo #
+--echo # Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
+--echo #
+
+CREATE TABLE t1(f1 INT);
+EVAL SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
+--disable_warnings
+LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
+--enable_warnings
+
+DROP TABLE t1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/t1.dat;
--echo End of 5.1 tests
=== modified file 'sql/sql_load.cc'
--- a/sql/sql_load.cc 2010-12-17 13:05:50 +0000
+++ b/sql/sql_load.cc 2011-04-15 08:51:34 +0000
@@ -1109,7 +1109,7 @@ READ_INFO::READ_INFO(File file_par, uint
/* Set of a stack for unget if long terminators */
- uint length=max(field_term_length,line_term_length)+1;
+ uint length= max(cs->mbmaxlen, max(field_term_length, line_term_length)) + 1;
set_if_bigger(length,line_start.length());
stack=stack_pos=(int*) sql_alloc(sizeof(int)*length);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.1 branch (sergey.glukhov:3660 to 3661) Bug#11765139 | Sergey Glukhov | 15 Apr |