From 455352b0b892252fdb060a1da71bd008da36f4ac Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 May 2007 19:38:34 +0300 Subject: Bug#22855: Conversion errors when constructing the condition for an IN predicates were treated as if the affected column contains NULL. If such a IN predicate is inside NOT we get wrong results. Corrected the handling of conversion errors in an IN predicate that is resolved by unique_subquery (through subselect_uniquesubquery_engine). mysql-test/r/subselect3.result: Bug#22855: test case mysql-test/t/subselect3.test: Bug#22855: test case sql/item_subselect.cc: Bug#22855: corrected the handling of conversion errors and NULL key values in IN predicate that is resolved by index lookup. --- mysql-test/r/bdb_notembedded.result | 35 +++++++++++++++++++++++++++++++++++ mysql-test/r/subselect3.result | 18 ++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 mysql-test/r/bdb_notembedded.result (limited to 'mysql-test/r') diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result index 96a3ee00a59..65637a2d0db 100644 --- a/mysql-test/r/subselect3.result +++ b/mysql-test/r/subselect3.result @@ -692,3 +692,21 @@ a MAX(b) test 2 3 h 3 4 i DROP TABLE t1, t2; +CREATE TABLE t1 (a INT NOT NULL); +INSERT INTO t1 VALUES (1),(-1), (65),(66); +CREATE TABLE t2 (a INT UNSIGNED NOT NULL PRIMARY KEY); +INSERT INTO t2 VALUES (65),(66); +SELECT a FROM t1 WHERE a NOT IN (65,66); +a +1 +-1 +SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2); +a +1 +-1 +EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where +2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY PRIMARY 4 func 1 Using index +DROP TABLE t1; +End of 5.0 tests -- cgit v1.2.1 From 59a7e066e3a86bb4371ce5027b4ad6b79ac91ce2 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 20 May 2007 21:22:57 +0500 Subject: bug #28361 Buffer overflow in DECIMAL code on Windows my_decimal in some cases can contain more decimal digits than is officially supported (DECIMAL_MAX_PRECISION), so we need to prepare bigger buffer for the resulting string. mysql-test/r/type_newdecimal.result: bug #28361 Buffer overflow in DECIMAL code on Windows test result mysql-test/t/type_newdecimal.test: bug #28361 Buffer overflow in DECIMAL code on Windows test case This test case doesn't fall in most cases even without the fix Still valgrind shows the problemn sql/my_decimal.h: bug #28361 Buffer overflow in DECIMAL code on Windows DECIMAL_MAX_POSSIBLE_PRECISION introduced to be used in places, when we need to check for the number of digits technicaly possible in my_decimal. DECIMAL_MAX_STR_LENGTH fixed as it has to fit for the MAX_POSSIBLE_PRECISION --- mysql-test/r/type_newdecimal.result | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index cbcab126439..d91baaa0394 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1465,4 +1465,7 @@ Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at r Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1 Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1 Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1 +create table t1 (s varchar(100)); +insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875); +drop table t1; End of 5.0 tests -- cgit v1.2.1 From d2c985e3543194436c836fa6bad2b45c27ea5060 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 May 2007 13:02:03 +0500 Subject: Bug #28361 Buffer overflow in DECIMAL code on Windows result max length changed for the 'decimal' fields so test results have to be fixed mysql-test/r/ps_2myisam.result: Bug #28361 Buffer overflow in DECIMAL code on Windows test result fixed mysql-test/r/ps_3innodb.result: Bug #28361 Buffer overflow in DECIMAL code on Windows test result fixed mysql-test/r/ps_4heap.result: Bug #28361 Buffer overflow in DECIMAL code on Windows test result fixed mysql-test/r/ps_5merge.result: Bug #28361 Buffer overflow in DECIMAL code on Windows test result fixed mysql-test/r/ps_7ndb.result: Bug #28361 Buffer overflow in DECIMAL code on Windows test result fixed --- mysql-test/r/ps_2myisam.result | 32 ++++++++++----------- mysql-test/r/ps_3innodb.result | 32 ++++++++++----------- mysql-test/r/ps_4heap.result | 32 ++++++++++----------- mysql-test/r/ps_5merge.result | 64 +++++++++++++++++++++--------------------- mysql-test/r/ps_7ndb.result | 32 ++++++++++----------- 5 files changed, 96 insertions(+), 96 deletions(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 2b2a29b2122..a2f0fff086e 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1927,8 +1927,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1974,8 +1974,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2024,8 +2024,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2064,8 +2064,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2112,8 +2112,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2156,8 +2156,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2202,8 +2202,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2240,8 +2240,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index f30262ef219..17c83bdc87a 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1910,8 +1910,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1957,8 +1957,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2007,8 +2007,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2047,8 +2047,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2095,8 +2095,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2139,8 +2139,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2185,8 +2185,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2223,8 +2223,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index a012e516404..114891f1145 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1911,8 +1911,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1958,8 +1958,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2008,8 +2008,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2048,8 +2048,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2096,8 +2096,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2140,8 +2140,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2186,8 +2186,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2224,8 +2224,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index ac9c8ae55ff..245d5766efd 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1847,8 +1847,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1894,8 +1894,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1944,8 +1944,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1984,8 +1984,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2032,8 +2032,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2076,8 +2076,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2122,8 +2122,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2160,8 +2160,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -4861,8 +4861,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -4908,8 +4908,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -4958,8 +4958,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -4998,8 +4998,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -5046,8 +5046,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -5090,8 +5090,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -5136,8 +5136,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -5174,8 +5174,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 2673448489a..65e9121a35e 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -1910,8 +1910,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1957,8 +1957,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2007,8 +2007,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2047,8 +2047,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2095,8 +2095,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2139,8 +2139,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2185,8 +2185,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2223,8 +2223,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 -- cgit v1.2.1 From 84966af9fc33a4cfa72f24a57da170db28f1c55a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 May 2007 10:27:33 +0200 Subject: bug#23856 --- mysql-test/r/func_gconcat.result | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 71419b5b2c3..0f41db3fa84 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -737,4 +737,51 @@ SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1; GROUP_CONCAT(DISTINCT UCASE(b)) ONE.1,TWO.2,ONE.3 DROP TABLE t1; +SET group_concat_max_len= 65535; +CREATE TABLE t1( a TEXT, b INTEGER ); +INSERT INTO t1 VALUES ( 'a', 0 ), ( 'b', 1 ); +SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1; +GROUP_CONCAT( a ORDER BY b ) +a,b +SELECT GROUP_CONCAT(DISTINCT a ORDER BY b) FROM t1; +GROUP_CONCAT(DISTINCT a ORDER BY b) +a,b +SELECT GROUP_CONCAT(DISTINCT a) FROM t1; +GROUP_CONCAT(DISTINCT a) +a,b +SET group_concat_max_len= 10; +SELECT GROUP_CONCAT(a ORDER BY b) FROM t1; +GROUP_CONCAT(a ORDER BY b) +a,b +SELECT GROUP_CONCAT(DISTINCT a ORDER BY b) FROM t1; +GROUP_CONCAT(DISTINCT a ORDER BY b) +a,b +SELECT GROUP_CONCAT(DISTINCT a) FROM t1; +GROUP_CONCAT(DISTINCT a) +a,b +SET group_concat_max_len= 65535; +CREATE TABLE t2( a TEXT ); +INSERT INTO t2 VALUES( REPEAT( 'a', 5000 ) ); +INSERT INTO t2 VALUES( REPEAT( 'b', 5000 ) ); +INSERT INTO t2 VALUES( REPEAT( 'a', 5000 ) ); +SELECT LENGTH( GROUP_CONCAT( DISTINCT a ) ) FROM t2; +LENGTH( GROUP_CONCAT( DISTINCT a ) ) +10001 +CREATE TABLE t3( a TEXT, b INT ); +INSERT INTO t3 VALUES( REPEAT( 'a', 65534 ), 1 ); +INSERT INTO t3 VALUES( REPEAT( 'a', 65535 ), 2 ); +INSERT INTO t3 VALUES( REPEAT( 'a', 65536 ), 3 ); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 1; +LENGTH( GROUP_CONCAT( a ) ) +65534 +SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 2; +LENGTH( GROUP_CONCAT( a ) ) +65535 +SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 3; +LENGTH( GROUP_CONCAT( a ) ) +65535 +SET group_concat_max_len= DEFAULT; +DROP TABLE t1, t2, t3; End of 5.0 tests -- cgit v1.2.1 From 786adf870b13695b9db5c12283dc475201f3e0e4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 May 2007 17:53:55 +0500 Subject: test result fixed --- mysql-test/r/ps_6bdb.result | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 407dddb6f53..6f6ecbb20b8 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1910,8 +1910,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1957,8 +1957,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2007,8 +2007,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2047,8 +2047,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2095,8 +2095,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2139,8 +2139,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2185,8 +2185,8 @@ def @arg07 253 23 1 Y 128 31 63 def @arg08 253 23 1 Y 128 31 63 def @arg09 253 23 1 Y 128 31 63 def @arg10 253 23 1 Y 128 31 63 -def @arg11 253 67 6 Y 128 30 63 -def @arg12 253 67 6 Y 128 30 63 +def @arg11 253 83 6 Y 128 30 63 +def @arg12 253 83 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2223,8 +2223,8 @@ def @arg07 253 23 0 Y 128 31 63 def @arg08 253 23 0 Y 128 31 63 def @arg09 253 23 0 Y 128 31 63 def @arg10 253 23 0 Y 128 31 63 -def @arg11 253 67 0 Y 128 30 63 -def @arg12 253 67 0 Y 128 30 63 +def @arg11 253 83 0 Y 128 30 63 +def @arg12 253 83 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 -- cgit v1.2.1 From cfb9378b3d7a1041752f0e2099494ec20d970baf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 May 2007 22:22:47 +0500 Subject: Bug #27984 Long Decimal Maths produces truncated results. decimal_round failed to perform a correct rounding of a decimal number if its first nine digits were '9'. It just sets those digits to 0. mysql-test/r/type_newdecimal.result: Bug #27984 Long Decimal Maths produces truncated results. test result mysql-test/t/type_newdecimal.test: Bug #27984 Long Decimal Maths produces truncated results. test case strings/decimal.c: Bug #27984 Long Decimal Maths produces truncated results. when to == from we break the data if we do to->buf[0]=0 So now doing this after the data is moved and only if we really need to set to->buf[0] to zero --- mysql-test/r/type_newdecimal.result | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index cbcab126439..92a5e4fc39c 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1465,4 +1465,7 @@ Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at r Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1 Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1 Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1 +SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b; +a b +0.9999999999999800000000000000 0.9999999999999800000000000000 End of 5.0 tests -- cgit v1.2.1 From f3b78f34e511305fec193f4cdbc8710f26baf993 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 May 2007 00:22:53 +0400 Subject: Bug#27507: Wrong DATETIME value was allowed by ALTER TABLE in the NO_ZERO_DATE mode. When a new DATE/DATETIME field without default value is being added by the ALTER TABLE the '0000-00-00' value is used as the default one. But it wasn't checked whether such value was allowed by the set sql mode. Due to this '0000-00-00' values was allowed for DATE/DATETIME fields even in the NO_ZERO_DATE mode. Now the mysql_alter_table() function checks whether the '0000-00-00' value is allowed for DATE/DATETIME fields by the set sql mode. The new error_if_not_empty flag is used in the mysql_alter_table() function to indicate that it should abort if the table being altered isn't empty. The new new_datetime_field field is used in the mysql_alter_table() function for error throwing purposes. The new error_if_not_empty parameter is added to the copy_data_between_tables() function to indicate the it should return error if the source table isn't empty. mysql-test/t/alter_table.test: Added a test case for the bug#27507: Wrong DATETIME value was allowed by ALTER TABLE in the NO_ZERO_DATE mode. mysql-test/r/alter_table.result: Added a test case for the bug#27507: Wrong DATETIME value was allowed by ALTER TABLE in the NO_ZERO_DATE mode. sql/sql_table.cc: Bug#27507: Wrong DATETIME value was allowed by ALTER TABLE in the NO_ZERO_DATE mode. Now the mysql_alter_table() function checks whether the '0000-00-00' value is allowed for DATE/DATETIME fields by the set sql mode. The new error_if_not_empty flag is used in the mysql_alter_table() function to indicate that it should abort if the table being altered isn't empty. The new new_datetime_field field is used in the mysql_alter_table() function for error throwing purposes. The new error_if_not_empty parameter is added to the copy_data_between_tables() function to indicate the it should return error if the source table isn't empty. --- mysql-test/r/alter_table.result | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 280cedb8b89..4eace9ac628 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -884,3 +884,22 @@ id 50 51 drop table t1; +set @orig_sql_mode = @@sql_mode; +set sql_mode="no_zero_date"; +create table t1(f1 int); +alter table t1 add column f2 datetime not null, add column f21 date not null; +insert into t1 values(1,'2000-01-01','2000-01-01'); +alter table t1 add column f3 datetime not null; +ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'f3' at row 1 +alter table t1 add column f3 date not null; +ERROR 22007: Incorrect date value: '0000-00-00' for column 'f3' at row 1 +alter table t1 add column f4 datetime not null default '2002-02-02', +add column f41 date not null; +ERROR 22007: Incorrect date value: '0000-00-00' for column 'f41' at row 1 +alter table t1 add column f4 datetime not null default '2002-02-02', +add column f41 date not null default '2002-02-02'; +select * from t1; +f1 f2 f21 f4 f41 +1 2000-01-01 00:00:00 2000-01-01 2002-02-02 00:00:00 2002-02-02 +drop table t1; +set sql_mode= @orig_sql_mode; -- cgit v1.2.1 From 3332b80130172656c1e483e5bc9aa2bcfe741a8f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 May 2007 15:58:30 +0300 Subject: Bug #28476: force index on a disabled myisam index gives error 124 When processing the USE/FORCE index hints the optimizer was not checking if the indexes specified are enabled (see ALTER TABLE). Fixed by: Backporting the fix for bug 20604 to 5.0 mysql-test/r/key.result: Test for BUG 20604. The important part of the test is the explain output that tests what indexes are used. mysql-test/r/myisam.result: Bug #28476: test cases mysql-test/t/key.test: Bug 20604: The minimal test case that reveals the bug. The optimizer for aggregates relies on keys disabled with ALTER TABLE ... DISABLE KEYS not being in the set TABLE::keys_in_use_for_query. When the execution engine tries to use a disabled index, MyISAM returns an error. mysql-test/t/myisam.test: Bug #28476: test cases sql/sql_base.cc: Bug #28476: - Ignore disabled indexes in USE/FORCE index sql/sql_select.cc: Bug 20604 : The intersection operation between table->s->keys_in_use and table->keys_in_use_for_query is no longer necessary. We can trust that the latter is a subset of the former. sql/table.h: Bug 20604: Added comments to TABLE_SHARE::keys_in_use and TABLE::keys_in_use_for_query. --- mysql-test/r/key.result | 8 ++++++++ mysql-test/r/myisam.result | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index ec15eaa97f5..3abc95ec3bf 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -455,3 +455,11 @@ ORDER BY c.b, c.d a b c d e f g h i j a b c d 2 2 1 2004-11-30 12:00:00 1 0 0 0 0 0 2 3388000 -553000 NULL DROP TABLE t1, t2; +CREATE TABLE t1( a TINYINT, KEY(a) ) ENGINE=MyISAM; +INSERT INTO t1 VALUES( 1 ); +ALTER TABLE t1 DISABLE KEYS; +EXPLAIN SELECT MAX(a) FROM t1 FORCE INDEX(a); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +DROP TABLE t1; +End of 5.0 tests. diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 94f2f1f72b3..7fc29cd13ca 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -1780,4 +1780,30 @@ create table t3 (c1 int) engine=myisam pack_keys=default; create table t4 (c1 int) engine=myisam pack_keys=2; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2' at line 1 drop table t1, t2, t3; +CREATE TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM; +INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5); +SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1; +a +1 +ALTER TABLE t1 DISABLE KEYS; +SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1; +a +1 +SELECT a FROM t1 USE INDEX (inx) WHERE a=1; +a +1 +SELECT b FROM t1 FORCE INDEX (uinx) WHERE b=1; +b +1 +SELECT b FROM t1 USE INDEX (uinx) WHERE b=1; +b +1 +SELECT a FROM t1 FORCE INDEX (inx,uinx) WHERE a=1; +a +1 +ALTER TABLE t1 ENABLE KEYS; +SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1; +a +1 +DROP TABLE t1; End of 5.0 tests -- cgit v1.2.1 From 1734b4e99068a135c0b7d49f8bb3b463b3cb0ef3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 May 2007 23:24:16 +0400 Subject: Bug#27563: Stored functions and triggers wasn't throwing an error when killed. If a stored function or a trigger was killed it had aborted but no error was thrown. This allows the caller statement to continue without a notice. This may lead to a wrong data being inserted/updated to/deleted as in such cases the correct result of a stored function isn't guaranteed. In the case of triggers it allows the caller statement to ignore kill signal and to waste time because of re-evaluation of triggers that always will fail because thd->killed flag is still on. Now the Item_func_sp::execute() and the sp_head::execute_trigger() functions check whether a function or a trigger were killed during execution and throws an appropriate error if so. Now the fill_record() function stops filling record if an error was reported through thd->net.report_error. sql/item_func.cc: Bug#27563: Stored functions and triggers wasn't throwing an error when killed. Now the Item_func_sp::execute() function checks whether a trigger was killed during execution and throws an appropriate error if so. sql/sp_head.cc: Bug#27563: Stored functions and triggers wasn't throwing an error when killed. Now the sp_head::execute_trigger() function checks whether a function was killed during execution and throws an appropriate error if so. sql/sql_base.cc: Bug#27563: Stored functions and triggers wasn't throwing an error when killed. Now the fill_record() function stops filling record if an error was reported through thd->net.report_error. mysql-test/r/kill.result: Added a test case for the bug#27563: Stored functions and triggers wasn't throwing an error when killed. mysql-test/t/kill.test: Added a test case for the bug#27563: Stored functions and triggers wasn't throwing an error when killed. --- mysql-test/r/kill.result | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result index cf5486d1091..4bc04c6de3c 100644 --- a/mysql-test/r/kill.result +++ b/mysql-test/r/kill.result @@ -41,3 +41,85 @@ select 1; select RELEASE_LOCK("a"); RELEASE_LOCK("a") 1 +create table t1(f1 int); +create function bug27563() returns int(11) +deterministic +begin +declare continue handler for sqlstate '70100' set @a:= 'killed'; +declare continue handler for sqlexception set @a:= 'exception'; +set @a= get_lock("lock27563", 10); +return 1; +end| +select get_lock("lock27563",10); +get_lock("lock27563",10) +1 +insert into t1 values (bug27563()); +ERROR 70100: Query execution was interrupted +select @a; +@a +NULL +select * from t1; +f1 +insert into t1 values(0); +update t1 set f1= bug27563(); +ERROR 70100: Query execution was interrupted +select @a; +@a +NULL +select * from t1; +f1 +0 +insert into t1 values(1); +delete from t1 where bug27563() is null; +ERROR 70100: Query execution was interrupted +select @a; +@a +NULL +select * from t1; +f1 +0 +1 +select * from t1 where f1= bug27563(); +ERROR 70100: Query execution was interrupted +select @a; +@a +NULL +create procedure proc27563() +begin +declare continue handler for sqlstate '70100' set @a:= 'killed'; +declare continue handler for sqlexception set @a:= 'exception'; +select get_lock("lock27563",10); +select "shouldn't be selected"; +end| +call proc27563(); +get_lock("lock27563",10) +NULL +ERROR 70100: Query execution was interrupted +select @a; +@a +NULL +create table t2 (f2 int); +create trigger trg27563 before insert on t1 for each row +begin +declare continue handler for sqlstate '70100' set @a:= 'killed'; +declare continue handler for sqlexception set @a:= 'exception'; +set @a:= get_lock("lock27563",10); +insert into t2 values(1); +end| +insert into t1 values(2),(3); +ERROR 70100: Query execution was interrupted +select @a; +@a +NULL +select * from t1; +f1 +0 +1 +select * from t2; +f2 +select release_lock("lock27563"); +release_lock("lock27563") +1 +drop table t1, t2; +drop function bug27563; +drop procedure proc27563; -- cgit v1.2.1 From 48af05a8e90d5a81e03257d31ed0f5166559ab88 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 May 2007 19:04:12 -0700 Subject: Fixed bug #28561: assertion abort for update on multi-table view with CHECK OPTION and a subquery in WHERE condition. The abort was triggered by setting the value of join->tables for subqueries in the function JOIN::cleanup. This function was called after an invocation of the JOIN::join_free method for subqueries used in WHERE condition. mysql-test/r/view.result: Added a test case for bug #28561. mysql-test/t/view.test: Added a test case for bug #28561. sql/sql_select.cc: Fixed bug #28561: assertion abort for update on multi-table view with CHECK OPTION and a subquery in WHERE condition. The abort was triggered by setting the value of join->tables for subqueries in the function JOIN::cleanup. This function was called after an invocation of the JOIN::join_free method for subqueries used in WHERE condition. Setting the value of join->tables to for a subquery created serious problems for checking WHERE condition after update of the multi-table view as this check is performed in the do_select function right after a call of the JOIN::join_free method. In fact setting join->tables to 0 in JOIN::cleanup is not needed anywhere in the current code. --- mysql-test/r/view.result | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 8d9d802949d..13239af41ad 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3367,4 +3367,14 @@ SHOW CREATE VIEW v1; View Create View v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(1.23456789 as decimal(8,0)) AS `col` DROP VIEW v1; +CREATE TABLE t1 (id int); +CREATE TABLE t2 (id int, c int DEFAULT 0); +INSERT INTO t1 (id) VALUES (1); +INSERT INTO t2 (id) VALUES (1); +CREATE VIEW v1 AS +SELECT t2.c FROM t1, t2 +WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; +UPDATE v1 SET c=1; +DROP VIEW v1; +DROP TABLE t1,t2; End of 5.0 tests. -- cgit v1.2.1 From c326457d78af9a27ad58a74c31125594d9fc2a75 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 May 2007 17:24:17 +0500 Subject: Fixed bug #28522: sometimes `mysqldump --hex-blob' overruned output buffer by '\0' byte. The dump_table() function has been fixed to reserve 1 byte more for the last '\0' byte of dumped string. client/mysqldump.c: Fixed bug #28522. The dump_table() function has been fixed to reserve 1 byte more for the last '\0' byte of dumped string. mysql-test/t/mysqldump.test: Updated test case for bug #28522. mysql-test/r/mysqldump.result: Updated test case for bug #28522. --- mysql-test/r/mysqldump.result | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index d9198ffeb48..25c4199e7a3 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -3310,5 +3310,16 @@ drop user user1; drop user user2; drop database mysqldump_test_db; # +# Bug #28522: buffer overrun by '\0' byte using --hex-blob. +# +CREATE TABLE t1 (c1 INT, c2 LONGBLOB); +INSERT INTO t1 SET c1=11, c2=REPEAT('q',509); +CREATE TABLE `t1` ( + `c1` int(11) default NULL, + `c2` longblob +); +INSERT INTO `t1` VALUES (11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171); +DROP TABLE t1; +# # End of 5.0 tests # -- cgit v1.2.1 From 90484de3f73cb943fd6e31b974e3a13a709dac08 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 26 May 2007 10:33:01 -0700 Subject: Fixed bug #28571. Outer join queries with ON conditions over constant outer tables did not return null complemented rows when conditions were evaluated to FALSE. Wrong results were returned because the conditions over constant outer tables, when being pushed down, were erroneously enclosed into the guard function used for WHERE conditions. mysql-test/r/join_outer.result: Added a test case for bug #28571. mysql-test/t/join_outer.test: Added a test case for bug #28571. sql/sql_select.cc: Fixed bug #28571. Outer join queries with ON conditions over constant outer tables did not return null complemented rows when conditions were evaluated to FALSE. Wrong results were returned because the conditions over constant outer tables, when being pushed down, were erroneously enclosed into the guard function used for WHERE conditions. The problem is fixed in the function make_join_select. Now the conditions over constant tables from ON expressions are pushed down after the conditions from WHERE has been pushed down. --- mysql-test/r/join_outer.result | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index c62601946c2..1366a8fe97a 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -1239,3 +1239,18 @@ Handler_read_prev 0 Handler_read_rnd 0 Handler_read_rnd_next 6 DROP TABLE t1,t2; +CREATE TABLE t1 (c int PRIMARY KEY, e int NOT NULL); +INSERT INTO t1 VALUES (1,0), (2,1); +CREATE TABLE t2 (d int PRIMARY KEY); +INSERT INTO t2 VALUES (1), (2), (3); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d IS NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 +1 SIMPLE t2 index NULL PRIMARY 4 NULL 3 Using where; Using index; Not exists +SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d IS NULL; +c e d +1 0 NULL +SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d<=>NULL; +c e d +1 0 NULL +DROP TABLE t1,t2; -- cgit v1.2.1