From 454c003a5c5a31a8d59ba4ab54d3b3a90a609752 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Mar 2010 19:57:33 +0800 Subject: Bug #50407 mysqlbinlog --database=X produces bad output for SAVEPOINTs When mysqlbinlog was given the --database=X flag, it always printed 'ROLLBACK TO', but the corresponding 'SAVEPOINT' statement was not printed. The replicated filter(replicated-do/ignore-db) and binlog filter (binlog-do/ignore-db) has the same problem. They are solved in this patch together. After this patch, We always check whether the query is 'SAVEPOINT' statement or not. Because this is a literal check, 'SAVEPOINT' and 'ROLLBACK TO' statements are also binlogged in uppercase with no any comments. The binlog before this patch can be handled correctly except one case that any comments are in front of the keywords. for example: /* bla bla */ SAVEPOINT a; /* bla bla */ ROLLBACK TO a; --- mysql-test/r/mysqlbinlog.result | 75 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 2 deletions(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index b7aa981f834..69d19b5e87f 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -479,7 +479,7 @@ FLUSH LOGS; RESET MASTER; FLUSH LOGS; # -# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified is exist +# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified exists /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -532,7 +532,7 @@ DELIMITER ; ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; # -# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified is not exist +# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified does not exist /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -565,5 +565,76 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +# +# Test if the 'SAVEPOINT', 'ROLLBACK TO' are output if the database specified exists +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +SET TIMESTAMP=1266652094/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +BEGIN +/*!*/; +use test/*!*/; +SET TIMESTAMP=1266652094/*!*/; +SavePoint mixed_cases +/*!*/; +use db1/*!*/; +SET TIMESTAMP=1266652094/*!*/; +INSERT INTO db1.t2 VALUES("in savepoint mixed_cases") +/*!*/; +SET TIMESTAMP=1266652094/*!*/; +INSERT INTO db1.t1 VALUES(40) +/*!*/; +use test/*!*/; +SET TIMESTAMP=1266652094/*!*/; +ROLLBACK TO mixed_cases +/*!*/; +use db1/*!*/; +SET TIMESTAMP=1266652094/*!*/; +INSERT INTO db1.t2 VALUES("after rollback to") +/*!*/; +SET TIMESTAMP=1266652094/*!*/; +INSERT INTO db1.t1 VALUES(50) +/*!*/; +COMMIT/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +# +# Test if the 'SAVEPOINT', 'ROLLBACK TO' are output if the database specified does not exist +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +SET TIMESTAMP=1266652094/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +BEGIN +/*!*/; +use test/*!*/; +SET TIMESTAMP=1266652094/*!*/; +SavePoint mixed_cases +/*!*/; +SET TIMESTAMP=1266652094/*!*/; +ROLLBACK TO mixed_cases +/*!*/; +COMMIT/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; End of 5.0 tests End of 5.1 tests -- cgit v1.2.1 From 28e95ba535e175dc696fe7a739736ae9bf2a2b36 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Mon, 29 Mar 2010 03:32:30 +0100 Subject: Bug#48525: trigger changes "Column 'id' cannot be null" behaviour CHECK_FIELD_IGNORE was treated as CHECK_FIELD_ERROR_FOR_NULL; UPDATE...SET...NULL on NOT NULL fields behaved differently after a trigger. Now distinguishes between IGNORE and ERROR_FOR_NULL and save/restores check-field options. mysql-test/r/trigger.result: Show that UPDATE...SET...NULL on NOT NULL columns doesn't behave differently when run after a trigger. mysql-test/t/trigger.test: Show that UPDATE...SET...NULL on NOT NULL columns doesn't behave differently when run after a trigger. sql/field_conv.cc: CHECK_FIELD_IGNORE was treated as CHECK_FIELD_ERROR_FOR_NULL. Distinguish between the two. sql/sp_head.cc: Raise error as needed. sql/sql_class.cc: Save and restore check-fields options. sql/sql_class.h: Make room so we can save check-fields options. sql/sql_insert.cc: Raise error as needed. --- mysql-test/r/trigger.result | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index 5758f5b93d7..3446babbb52 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -2111,4 +2111,21 @@ SET @bug51650 = 1; INSERT IGNORE INTO t2 SET a = '777'; DROP TRIGGER trg1; DROP TABLE t1, t2; +CREATE TABLE t1 (id INT NOT NULL); +CREATE TABLE t2 (id INT NOT NULL); +INSERT t1 VALUES (1),(2),(3); +UPDATE t1 SET id=NULL; +Warnings: +Warning 1048 Column 'id' cannot be null +Warning 1048 Column 'id' cannot be null +Warning 1048 Column 'id' cannot be null +CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW +INSERT INTO t2 VALUES (3); +UPDATE t1 SET id=NULL; +Warnings: +Warning 1048 Column 'id' cannot be null +Warning 1048 Column 'id' cannot be null +Warning 1048 Column 'id' cannot be null +DROP TRIGGER t1_bu; +DROP TABLE t1,t2; End of 5.1 tests. -- cgit v1.2.1 From 5167451a92cfd070713be4d57e211ea483a8826b Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 23 Mar 2010 16:54:16 +0200 Subject: Bug #51893: crash with certain characters given to load_file function on windows When making sure that the directory path ends up with a slash/backslash we need to check for the correct length of the buffer and trim at the appropriate location so we don't write past the end of the buffer. --- mysql-test/r/loaddata.result | 7 +++++++ 1 file changed, 7 insertions(+) mode change 100644 => 100755 mysql-test/r/loaddata.result (limited to 'mysql-test/r') diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result old mode 100644 new mode 100755 index 0c3f8d04463..8ad830ca9d4 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -495,4 +495,11 @@ SELECT * FROM t1; col0 test DROP TABLE t1; +# +# Bug #51893: crash with certain characters given to load_file +# function on windows +# +select load_file(0x0A9FB76C661B409C4BEC88098C5DD71B1072F9691F2E827D7EC8F092B299868A3CE196C04F0FB18CAB4E1557EB72331D812379DE7A75CA21C32E7C722C59E5CC33EF262EF04187B0F0EE756FA984DF2EAD37B1E4ADB064C3C5038F2E3B2D661B1C1150AAEB5425512E14D7506166D92D4533872E662F4B2D1428AAB5CCA72E75AA2EF325E196A5A02E2E8278873C64375845994B0F39BE2FF7B478332A7B0AA5E48877C47B6F513E997848AF8CCB8A899F3393AB35333CF0871E36698193862D486B4B9078B70C0A0A507B8A250F3F876F5A067632D5E65193E4445A1EC3A2C9B4C6F07AC334F0F62BC33357CB502E9B1C19D2398B6972AEC2EF21630F8C9134C4F7DD662D8AD7BDC9E19C46720F334B66C22D4BF32ED275144E20E7669FFCF6FC143667C9F02A577F32960FA9F2371BE1FA90E49CBC69C01531F140556854D588DD0E55E1307D78CA38E975CD999F9AEA604266329EE62BFB5ADDA67F549E211ECFBA906C60063696352ABB82AA782D25B17E872EA587871F450446DB1BAE0123D20404A8F2D2698B371002E986C8FCB969A99FF0E150A2709E2ED7633D02ADA87D5B3C9487D27B2BD9D21E2EC3215DCC3CDCD884371281B95A2E9987AAF82EB499C058D9C3E7DC1B66635F60DB121C72F929622DD47B6B2E69F59FF2AE6B63CC2EC60FFBA20EA50569DBAB5DAEFAEB4F03966C9637AB55662EDD28439155A82D053A5299448EDB2E7BEB0F62889E2F84E6C7F34B3212C9AAC32D521D5AB8480993F1906D5450FAB342A0FA6ED223E178BAC036B81E15783604C32A961EA1EF20BE2EBB93D34ED37BC03142B7583303E4557E48551E4BD7CBDDEA146D5485A5D212C35189F0BD6497E66912D2780A59A53B532E12C0A5ED1EC0445D96E8F2DD825221CFE4A65A87AA21DC8750481B9849DD81694C3357A0ED9B78D608D8EDDE28FAFBEC17844DE5709F41E121838DB55639D77E32A259A416D7013B2EB1259FDE1B498CBB9CAEE1D601DF3C915EA91C69B44E6B72062F5F4B3C73F06F2D5AD185E1692E2E0A01E7DD5133693681C52EE13B2BE42D03BDCF48E4E133CF06662339B778E1C3034F9939A433E157449172F7969ACCE1F5D2F65A4E09E4A5D5611EBEDDDBDB0C0C0A); +load_file(0x0A9FB76C661B409C4BEC88098C5DD71B1072F9691F2E827D7EC8F092B299868A3CE196C04F0FB18CAB4E1557EB72331D812379DE7A75CA21C32E7C722C59E5CC33EF262EF04187B0F0EE756FA984DF2EAD37B1E4ADB064C3C5038F2E3B2D661B1C1150AAEB5425512E14D7506166D92D4533872E662F4B2D142 +NULL End of 5.1 tests -- cgit v1.2.1 From f57839cd6060ff2d8edb4bf0875b67d0176d88e4 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Fri, 26 Mar 2010 11:44:24 +0400 Subject: Bug#52177 crash with explain, row comparison, join, text field The crash is the result of an attempt made by JOIN::optimize to evaluate the WHERE condition when no records have been actually read. The fix is to remove erroneous 'outer_join' variable check. mysql-test/r/join.result: test result mysql-test/t/join.test: test case sql/sql_select.cc: removed erroneous 'outer_join' variable check. --- mysql-test/r/join.result | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index bacfa81160a..2585bf7a26e 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -930,4 +930,16 @@ Warnings: Note 1003 select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((1 = 1)) left join (`test`.`t1` left join `test`.`t1` `t2` on((1 = 1))) on(rand()) where 1 DROP VIEW v1; DROP TABLE t1; +# +# Bug#52177 crash with explain, row comparison, join, text field +# +CREATE TABLE t1 (a TINYINT, b TEXT, KEY (a)); +INSERT INTO t1 VALUES (0,''),(0,''); +FLUSH TABLES; +EXPLAIN SELECT 1 FROM t1 LEFT JOIN t1 a ON 1 +WHERE ROW(t1.a, 1111.11) = ROW(1111.11, 1111.11) AND +ROW(t1.b, 1111.11) <=> ROW('',''); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +DROP TABLE t1; End of 5.0 tests. -- cgit v1.2.1 From 89989ffb168e1bc35cb2f50ff18530a0f63b38be Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 30 Mar 2010 15:03:50 +0300 Subject: Bug #51893: crash with certain characters given to load_file function on windows When making sure that the directory path ends up with a slash/backslash we need to check for the correct length of the buffer and trim at the appropriate location so we don't write past the end of the buffer. --- mysql-test/r/loaddata.result | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 6e879114119..30f4dbfc6ef 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -447,4 +447,11 @@ LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt") set session sql_mode=@OLD_SQL_MODE; DROP TABLE t1,t2; +# +# Bug #51893: crash with certain characters given to load_file +# function on windows +# +select load_file(0x0A9FB76C661B409C4BEC88098C5DD71B1072F9691F2E827D7EC8F092B299868A3CE196C04F0FB18CAB4E1557EB72331D812379DE7A75CA21C32E7C722C59E5CC33EF262EF04187B0F0EE756FA984DF2EAD37B1E4ADB064C3C5038F2E3B2D661B1C1150AAEB5425512E14D7506166D92D4533872E662F4B2D1428AAB5CCA72E75AA2EF325E196A5A02E2E8278873C64375845994B0F39BE2FF7B478332A7B0AA5E48877C47B6F513E997848AF8CCB8A899F3393AB35333CF0871E36698193862D486B4B9078B70C0A0A507B8A250F3F876F5A067632D5E65193E4445A1EC3A2C9B4C6F07AC334F0F62BC33357CB502E9B1C19D2398B6972AEC2EF21630F8C9134C4F7DD662D8AD7BDC9E19C46720F334B66C22D4BF32ED275144E20E7669FFCF6FC143667C9F02A577F32960FA9F2371BE1FA90E49CBC69C01531F140556854D588DD0E55E1307D78CA38E975CD999F9AEA604266329EE62BFB5ADDA67F549E211ECFBA906C60063696352ABB82AA782D25B17E872EA587871F450446DB1BAE0123D20404A8F2D2698B371002E986C8FCB969A99FF0E150A2709E2ED7633D02ADA87D5B3C9487D27B2BD9D21E2EC3215DCC3CDCD884371281B95A2E9987AAF82EB499C058D9C3E7DC1B66635F60DB121C72F929622DD47B6B2E69F59FF2AE6B63CC2EC60FFBA20EA50569DBAB5DAEFAEB4F03966C9637AB55662EDD28439155A82D053A5299448EDB2E7BEB0F62889E2F84E6C7F34B3212C9AAC32D521D5AB8480993F1906D5450FAB342A0FA6ED223E178BAC036B81E15783604C32A961EA1EF20BE2EBB93D34ED37BC03142B7583303E4557E48551E4BD7CBDDEA146D5485A5D212C35189F0BD6497E66912D2780A59A53B532E12C0A5ED1EC0445D96E8F2DD825221CFE4A65A87AA21DC8750481B9849DD81694C3357A0ED9B78D608D8EDDE28FAFBEC17844DE5709F41E121838DB55639D77E32A259A416D7013B2EB1259FDE1B498CBB9CAEE1D601DF3C915EA91C69B44E6B72062F5F4B3C73F06F2D5AD185E1692E2E0A01E7DD5133693681C52EE13B2BE42D03BDCF48E4E133CF06662339B778E1C3034F9939A433E157449172F7969ACCE1F5D2F65A4E09E4A5D5611EBEDDDBDB0C0C0A); +load_file(0x0A9FB76C661B409C4BEC88098C5DD71B1072F9691F2E827D7EC8F092B299868A3CE196C04F0FB18CAB4E1557EB72331D812379DE7A75CA21C32E7C722C59E5CC33EF262EF04187B0F0EE756FA984DF2EAD37B1E4ADB064C3C5038F2E3B2D661B1C1150AAEB5425512E14D7506166D92D4533872E662F4B2D142 +NULL End of 5.0 tests -- cgit v1.2.1 From 55852670ccc6f8173fef7b26b544213ac0829dc0 Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Wed, 31 Mar 2010 17:00:56 +0400 Subject: Fix for bug#52397: another crash with explain extended and group_concat Problem: EXPLAIN EXTENDED was trying to resolve references to freed temporary table fields for GROUP_CONCAT()'s ORDER BY arguments. Fix: use stored original GROUP_CONCAT()'s arguments in such a case. mysql-test/r/func_gconcat.result: Fix for bug#52397: another crash with explain extended and group_concat - test result. mysql-test/t/func_gconcat.test: Fix for bug#52397: another crash with explain extended and group_concat - test case. sql/item_sum.cc: Fix for bug#52397: another crash with explain extended and group_concat - use "pargs", printing ORDER BY arguments in the Item_func_group_concat::print() instead of "order" to avoid possible reference resolving to (freed) temporary table fields. --- mysql-test/r/func_gconcat.result | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 8d1fcade88d..766f3b6bfaa 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -995,4 +995,19 @@ SELECT 1 FROM 1 1 DROP TABLE t1; +# +# Bug #52397: another crash with explain extended and group_concat +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (0), (0); +EXPLAIN EXTENDED SELECT 1 FROM +(SELECT GROUP_CONCAT(t1.a ORDER BY t1.a ASC) FROM +t1 t2, t1 GROUP BY t1.a) AS d; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY system NULL NULL NULL NULL 1 100.00 +2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort +2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer +Warnings: +Note 1003 select 1 AS `1` from (select group_concat(`test`.`t1`.`a` order by `test`.`t1`.`a` ASC separator ',') AS `GROUP_CONCAT(t1.a ORDER BY t1.a ASC)` from `test`.`t1` `t2` join `test`.`t1` group by `test`.`t1`.`a`) `d` +DROP TABLE t1; End of 5.0 tests -- cgit v1.2.1 From e65caec1387ecc3b25a3a97c5ccedb9c16caa0ef Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Wed, 31 Mar 2010 16:12:37 +0300 Subject: Bug #37168: Missing variable - skip_name_resolve Added a read-only global boolean variable skip_name_resolve. --- mysql-test/r/skip_name_resolve.result | 27 +++++++++++++++++++++++++++ mysql-test/r/variables.result | 9 +++++++++ 2 files changed, 36 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/skip_name_resolve.result b/mysql-test/r/skip_name_resolve.result index 8aa9877a8e9..1d92d52110d 100644 --- a/mysql-test/r/skip_name_resolve.result +++ b/mysql-test/r/skip_name_resolve.result @@ -9,3 +9,30 @@ SELECT USER(); USER() # SHOW PROCESSLIST; +# +# Bug #37168: Missing variable - skip_name_resolve +# +SHOW VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SHOW GLOBAL VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SHOW SESSION VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve ON +SELECT @@skip_name_resolve; +@@skip_name_resolve +1 +SELECT @@LOCAL.skip_name_resolve; +ERROR HY000: Variable 'skip_name_resolve' is a GLOBAL variable +SELECT @@GLOBAL.skip_name_resolve; +@@GLOBAL.skip_name_resolve +1 +SET @@skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +SET @@LOCAL.skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +SET @@GLOBAL.skip_name_resolve=0; +ERROR HY000: Variable 'skip_name_resolve' is a read only variable +End of 5.1 tests diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index ff6d4cf85d9..94a7661d327 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1495,4 +1495,13 @@ SELECT @@GLOBAL.max_binlog_cache_size; @@GLOBAL.max_binlog_cache_size 5368709120 SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size; +# +# Bug #37168 : Missing variable - skip_name_resolve +# +SELECT @@skip_name_resolve; +@@skip_name_resolve +0 +SHOW VARIABLES LIKE 'skip_name_resolve'; +Variable_name Value +skip_name_resolve OFF End of 5.1 tests -- cgit v1.2.1