From 33c78e328f4d8238b7b53c246e28bb44a97ee3c0 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Wed, 12 Jan 2011 17:02:41 +0400 Subject: Bug #57321 crashes and valgrind errors from spatial types Item_func_spatial_collection::fix_length_and_dec didn't call parent's method, so the maybe_null was set to '0' after it. But in this case the result was just NULL, that caused wrong behaviour. per-file comments: mysql-test/r/gis.result Bug #57321 crashes and valgrind errors from spatial types test result updated. mysql-test/t/gis.test Bug #57321 crashes and valgrind errors from spatial types test case added. sql/item_geofunc.h Bug #57321 crashes and valgrind errors from spatial types Item_func_geometry::fix_length_and_dec() called in Item_func_spatial_collection::fix_length_and_dec(). --- mysql-test/r/gis.result | 8 ++++++++ mysql-test/t/gis.test | 10 ++++++++++ 2 files changed, 18 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 3b18ee61336..f4aa361ffcf 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1014,4 +1014,12 @@ SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000 SET @a=POLYFROMWKB(@a); SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440; SET @a=POLYFROMWKB(@a); +create table t1(a polygon NOT NULL)engine=myisam; +insert into t1 values (geomfromtext("point(0 1)")); +insert into t1 values (geomfromtext("point(1 0)")); +select * from (select polygon(t1.a) as p from t1 order by t1.a) d; +p +NULL +NULL +drop table t1; End of 5.1 tests diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index fd0a18ab4dd..97fc6f94b6a 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -744,4 +744,14 @@ SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000 SET @a=POLYFROMWKB(@a); +# +# Bug #57321 crashes and valgrind errors from spatial types +# + +create table t1(a polygon NOT NULL)engine=myisam; +insert into t1 values (geomfromtext("point(0 1)")); +insert into t1 values (geomfromtext("point(1 0)")); +select * from (select polygon(t1.a) as p from t1 order by t1.a) d; +drop table t1; + --echo End of 5.1 tests -- cgit v1.2.1 From 5e9cb07b66cb3ac8db9daec5f55c736db2a33990 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 12 Jan 2011 19:32:45 +0000 Subject: BUG#59177: mysqlbinlog_row_big fails on Windows with out of memory The test case fails with out of memory while updating a table with several multi-megabytes sized rows. This can probably be too exhausting for PB2 env. The quick fix here is to reduce the size of the biggest row (256MB) so that it becomes a little smaller (64MB). --- mysql-test/r/mysqlbinlog_row_big.result | 8 ++++---- mysql-test/t/mysqlbinlog_row_big.test | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqlbinlog_row_big.result b/mysql-test/r/mysqlbinlog_row_big.result index 46fa0dc79cd..0bdbfdcee3a 100644 --- a/mysql-test/r/mysqlbinlog_row_big.result +++ b/mysql-test/r/mysqlbinlog_row_big.result @@ -36,8 +36,8 @@ c1 LONGTEXT # # Insert some big rows. # -256MB -INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 16777216)); +64MB +INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 4194304)); affected rows: 1 32MB INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152)); @@ -53,7 +53,7 @@ affected rows: 1 # Do not display the column value itself, just its length. # SELECT LENGTH(c1) FROM t1; -LENGTH(c1) 268435456 +LENGTH(c1) 67108864 LENGTH(c1) 33554432 LENGTH(c1) 4194304 LENGTH(c1) 524288 @@ -69,7 +69,7 @@ info: Rows matched: 4 Changed: 4 Warnings: 0 # Do not display the column value itself, just its length. # SELECT LENGTH(c1) FROM t1; -LENGTH(c1) 536870912 +LENGTH(c1) 134217728 LENGTH(c1) 1048576 LENGTH(c1) 67108864 LENGTH(c1) 8388608 diff --git a/mysql-test/t/mysqlbinlog_row_big.test b/mysql-test/t/mysqlbinlog_row_big.test index 75f3b90269f..ffd1b79af34 100644 --- a/mysql-test/t/mysqlbinlog_row_big.test +++ b/mysql-test/t/mysqlbinlog_row_big.test @@ -79,8 +79,8 @@ eval CREATE TABLE t1 ( --echo # Insert some big rows. --echo # ---echo 256MB -INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 16777216)); +--echo 64MB +INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 4194304)); --echo 32MB INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152)); -- cgit v1.2.1 From 716b64cdb050ff9a22457990f336ef20a7b3663a Mon Sep 17 00:00:00 2001 From: Martin Hansson Date: Thu, 13 Jan 2011 08:57:15 +0100 Subject: Bug#58165: "my_empty_string" gets modified and causes LOAD DATA to fail and other crashes Some string manipulating SQL functions use a shared string object intended to contain an immutable empty string. This object was used by the SQL function SUBSTRING_INDEX() to return an empty string when one argument was of the wrong datatype. If the string object was then modified by the sql function INSERT(), undefined behavior ensued. Fixed by instead modifying the string object representing the function's result value whenever string manipulating SQL functions return an empty string. Relevant code has also been documented. --- mysql-test/r/func_str.result | 16 ++++++++++++++++ mysql-test/t/func_str.test | 11 +++++++++++ 2 files changed, 27 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 0321b2d85ad..8f4038e1239 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -2612,4 +2612,20 @@ CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)) 1 Warnings: Warning 1292 Truncated incorrect DECIMAL value: '' +# +# Bug#58165: "my_empty_string" gets modified and causes LOAD DATA to fail +# and other crashes +# +CREATE TABLE t1 ( a TEXT ); +SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'bug58165.txt'; +SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ); +insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ) +x +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'b' +LOAD DATA INFILE 'bug58165.txt' INTO TABLE t1; +SELECT * FROM t1; +a +aaaaaaaaaaaaaa +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index fdcfbcf519e..92c4bae5327 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1369,4 +1369,15 @@ DROP TABLE t1; SELECT '1' IN ('1', SUBSTRING(-9223372036854775809, 1)); SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)); +--echo # +--echo # Bug#58165: "my_empty_string" gets modified and causes LOAD DATA to fail +--echo # and other crashes +--echo # +CREATE TABLE t1 ( a TEXT ); +SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'bug58165.txt'; +SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ); +LOAD DATA INFILE 'bug58165.txt' INTO TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + --echo End of 5.1 tests -- cgit v1.2.1 From faafae781adc87d80dc0e7c5e631996ed015f8ed Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Fri, 14 Jan 2011 11:33:12 +0100 Subject: BUG#59063: rpl_migration_crash_safe fails on Windows Backported the fix to 5.1. Problem: the auxiliary test files rpl_start_server.inc and rpl_stop_server.inc write a file that is later read by mtr. The bug was that the file was written with platform-dependent newline terminators, i.e., \r\n on windows, whereas mtr only understands \n. Fix: write the file so that it uses \n on all platforms. mysql-test/include/rpl_start_server.inc: Force test to use \n instead of platform-dependent newline terminator. mysql-test/include/rpl_stop_server.inc: Force test to use \n instead of platform-dependent newline terminator. --- mysql-test/include/rpl_start_server.inc | 10 +++++++++- mysql-test/include/rpl_stop_server.inc | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/rpl_start_server.inc b/mysql-test/include/rpl_start_server.inc index c59c7759910..ac8106f141c 100644 --- a/mysql-test/include/rpl_start_server.inc +++ b/mysql-test/include/rpl_start_server.inc @@ -45,7 +45,15 @@ if ($rpl_server_parameters) --source include/rpl_connection.inc # Write file to make mysql-test-run.pl start up the server again ---exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect +--let WRITE_TO_FILE= $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect +--let WRITE_TO_VAR= $_rpl_start_server_command +perl; +my $file= $ENV{'WRITE_TO_FILE'}; +my $var= $ENV{'WRITE_TO_VAR'}; +open WRITE_FILE, ">> $file" or die "Error opening $file: $!"; +print WRITE_FILE $var, "\n" or die "Error appending to $file: $!"; +close WRITE_FILE or die "Error closing $file: $!"; +EOF --source include/rpl_reconnect.inc diff --git a/mysql-test/include/rpl_stop_server.inc b/mysql-test/include/rpl_stop_server.inc index e1f8839dd69..a90981d6de8 100644 --- a/mysql-test/include/rpl_stop_server.inc +++ b/mysql-test/include/rpl_stop_server.inc @@ -44,7 +44,9 @@ if ($rpl_debug) # Write file to make mysql-test-run.pl expect the "crash", but don't start # it until it's told to ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect +wait +EOF # Send shutdown to the connected server and give # it 10 seconds to die before zapping it -- cgit v1.2.1 From ab2d29ec6b84eb4531d2d63887ac29f7d9617e60 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 14 Jan 2011 19:50:34 +0530 Subject: Bug#13618 : mysqldump --xml omits comment on table field When mysqldump tries to dump information in xml format, the result does not contain field level comments. In order to retrieve various informations for a field/column, mysqldump currently uses 'show fields from ' statement. The attributes returned by the statement lacks the information regarding field comments. Fixed by changing the query to one that probes I_S to retrieve required field informations, including the field comment. client/mysqldump.c: Bug#13618 : mysqldump --xml omits comment on table field. Replaced the 'show fields' command by a statement that queries I_S, in order to retrieve information on all the attributes that 'show fields' returns along-with an additional column_comment information. mysql-test/r/client_xml.result: Result modifications for bug#13618. mysql-test/r/mysqldump.result: Result modifications for bug#13618. mysql-test/t/mysqldump.test: Added a testcase for bug#13618. --- mysql-test/r/client_xml.result | 6 +++--- mysql-test/r/mysqldump.result | 37 ++++++++++++++++++++++++++----------- mysql-test/t/mysqldump.test | 9 +++++++++ 3 files changed, 38 insertions(+), 14 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/client_xml.result b/mysql-test/r/client_xml.result index aa4bdb2bd61..7f74a092af7 100644 --- a/mysql-test/r/client_xml.result +++ b/mysql-test/r/client_xml.result @@ -21,9 +21,9 @@ insert into t1 values (1, 2, 'a&b ab'); - - - + + + diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index d26eaac7a93..289e7f66406 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -14,7 +14,7 @@ INSERT INTO t1 VALUES (1), (2); - + @@ -150,9 +150,9 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES"); - - - + + + @@ -178,7 +178,7 @@ INSERT INTO t1 VALUES ("1\""), ("\"2"); - + @@ -1612,10 +1612,10 @@ CREATE TABLE `t2` ( - + - + @@ -1623,10 +1623,10 @@ CREATE TABLE `t2` ( - + - + @@ -3644,8 +3644,8 @@ INSERT INTO t1 VALUES(1,0xff00fef0); - - + + @@ -4576,5 +4576,20 @@ LENGTH(a) 800 DROP TABLE t1, t2; # +# Bug #13618 : mysqldump --xml ommit comment on table field +# +CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT'; + + + + + + + + + + +DROP TABLE `comment_table`; +# # End of 5.1 tests # diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 9246d488dd8..fe0b05dbb42 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2164,6 +2164,15 @@ SELECT LENGTH(a) FROM t2; DROP TABLE t1, t2; ########################################################################### + +--echo # +--echo # Bug #13618 : mysqldump --xml ommit comment on table field +--echo # + +CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT'; +--exec $MYSQL_DUMP --compact --skip-create --xml test +DROP TABLE `comment_table`; + --echo # --echo # End of 5.1 tests --echo # -- cgit v1.2.1 From 335fcd91b300f1670eb57378b5391a52be152add Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Sat, 15 Jan 2011 00:56:09 +0400 Subject: Bug#52208 gis fails on some platforms (Solaris, HP-UX, Linux) IA64 and some other arcitectures use different float rounding mode and i find no decent way to make it consistent. So the test changed to be insensitive to this. per-file messages: mysql-test/t/gis.test Bug#52208 gis fails on some platforms (Solaris, HP-UX, Linux) --replace_result added --- mysql-test/t/gis.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 97fc6f94b6a..bdbbfc7c064 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -358,7 +358,7 @@ t1 where object_id=85998; # Expected result is 36.3310176346905, but IA64 returns 36.3310176346904 # due to fused multiply-add instructions. ---replace_result 36.3310176346904 36.3310176346905 +--replace_result 36.3310176346904 36.3310176346905 -114.87787186923326 -114.87787186923313 36.33101763469053 36.33101763469059 36.33101763469043 36.33101763469059 select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from t1 where object_id=85984; -- cgit v1.2.1 From 208b677637ef9d140c1629a0de4d4963c02ea533 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Sun, 16 Jan 2011 02:04:08 +0530 Subject: Bug#58221 : mysqladmin --sleep=x --count=x keeps looping When mysqldadmin is run with sleep and count options, it goes into an infinite loop and keeps executing the specified command. This happened because the statement, responsible for decrementing the count value, was missing. Fixed by adding a statement which will decrement the count value for each iteration. client/mysqladmin.cc: Bug#58221 : mysqladmin --sleep=x --count=x keeps looping Added a condition to check and decrement the count value stored in nr_iterations per iteration. mysql-test/r/mysqladmin.result: Added a testcase for Bug#58221. mysql-test/t/mysqladmin.test: Added a testcase for Bug#58221. --- mysql-test/r/mysqladmin.result | 8 ++++++++ mysql-test/t/mysqladmin.test | 12 ++++++++++++ 2 files changed, 20 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqladmin.result b/mysql-test/r/mysqladmin.result index 57927f8aa67..748152bffcc 100644 --- a/mysql-test/r/mysqladmin.result +++ b/mysql-test/r/mysqladmin.result @@ -2,3 +2,11 @@ mysqld is alive mysqladmin: unknown variable 'database=db1' Warning: mysqladmin: unknown variable 'loose-database=db2' mysqld is alive +# +# Bug#58221 : mysqladmin --sleep=x --count=x keeps looping +# +# Executing mysqladmin with --sleep=1 and --count=2. +# Done. +# Displaying the output : +mysqld is alive +mysqld is alive diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test index 839ecf00b60..a2b12dbc9b6 100644 --- a/mysql-test/t/mysqladmin.test +++ b/mysql-test/t/mysqladmin.test @@ -33,3 +33,15 @@ EOF --exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf; + +--echo # +--echo # Bug#58221 : mysqladmin --sleep=x --count=x keeps looping +--echo # + +--echo # Executing mysqladmin with --sleep=1 and --count=2. +--exec $MYSQLADMIN -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --sleep=1 --count=2 ping > $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp +--echo # Done. +--echo # Displaying the output : +--cat_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp + +--remove_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp -- cgit v1.2.1