From b40ef082c843a50992dbfefd214743f82d0ef481 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Mar 2007 11:41:29 +0100 Subject: [PATCH 1/6] MySQL versions before 5.0 still use cygwin, no need to convert path --- mysql-test/lib/mtr_misc.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index 880368be170..ef7dda358f2 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -54,6 +54,12 @@ sub mtr_short_hostname () { sub mtr_native_path($) { my $path= shift; + + # MySQL version before 5.0 still use cygwin, no need + # to convert path + return $path + if ($::mysql_version_id < 50000); + $path=~ s/\//\\/g if ($::glob_win32); return $path; From a01e8043de80c166f739e7603aa9cebf19da0abd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Mar 2007 18:30:29 +0100 Subject: [PATCH 2/6] Don't set the "is_windows" flag if using cygwin --- client/mysqltest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/mysqltest.c b/client/mysqltest.c index 9141f9c518e..f678eb98eec 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -5933,7 +5933,9 @@ int main(int argc, char **argv) init_builtin_echo(); #ifdef __WIN__ +#ifndef USE_CYGWIN is_windows= 1; +#endif init_tmp_sh_file(); init_win_path_patterns(); #endif From ec38bd7a32115f70280d9047026ee7395225ccfc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Mar 2007 18:31:09 +0100 Subject: [PATCH 3/6] Fix bug in mtr.pl where slave wes using same query log file as master --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 21960d2bfcd..73396f2255b 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3651,7 +3651,7 @@ sub mysqld_arguments ($$$$$) { if ( $mysql_version_id <= 50106 ) { # Force mysqld to use log files up until 5.1.6 - mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'}); + mtr_add_arg($args, "%s--log=%s", $prefix, $slave->[0]->{'path_mylog'}); } else { From 115a299ff3ce27b85d62ebc1b836c77e6fa4b5de Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Mar 2007 19:09:43 +0100 Subject: [PATCH 4/6] Add two more USE_CYGWIN ifdefs to mysqltest --- client/mysqltest.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/mysqltest.c b/client/mysqltest.c index f678eb98eec..d9f1f25e093 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1677,12 +1677,14 @@ void do_exec(struct st_command *command) } #ifdef __WIN__ +#ifndef USE_CYGWIN /* Replace /dev/null with NUL */ while(replace(&ds_cmd, "/dev/null", 9, "NUL", 3) == 0) ; /* Replace "closed stdout" with non existing output fd */ while(replace(&ds_cmd, ">&-", 3, ">&4", 3) == 0) ; +#endif #endif DBUG_PRINT("info", ("Executing '%s' as '%s'", @@ -1847,10 +1849,12 @@ void do_system(struct st_command *command) do_eval(&ds_cmd, command->first_argument, command->end, !is_windows); #ifdef __WIN__ +#ifndef USE_CYGWIN /* Replace /dev/null with NUL */ while(replace(&ds_cmd, "/dev/null", 9, "NUL", 3) == 0) ; #endif +#endif DBUG_PRINT("info", ("running system command '%s' as '%s'", From 6e6fa326da3a41aac8768ddb22923d5f6291c762 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Mar 2007 20:59:08 +0100 Subject: [PATCH 5/6] After merge fixes --- mysql-test/r/mysqlbinlog.result | 3 +-- mysql-test/t/mysqlbinlog.test | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 8097657c629..217d3e5f64a 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -233,7 +233,6 @@ call p1(); drop procedure p1; call p1(); ERROR 42000: PROCEDURE test.p1 does not exist - /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -254,6 +253,7 @@ ROLLBACK /* added by mysqlbinlog */; call p1(); 1 1 +drop procedure p1; flush logs; create table t1 (a varchar(64) character set utf8); load data infile '../std_data_ln/loaddata6.dat' into table t1; @@ -312,5 +312,4 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; -drop table t1, t2, t5; End of 5.0 tests diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 0d61a36af8c..97239360507 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -179,7 +179,6 @@ drop procedure p1; --exec $MYSQL_BINLOG --version 2>&1 > /dev/null --exec $MYSQL_BINLOG --help 2>&1 > /dev/null --enable_query_log -drop table t1, t2, t5; # # Bug#15126 character_set_database is not replicated @@ -203,6 +202,6 @@ select hex(a) from t1; drop table t1; flush logs; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000011 +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000009 --echo End of 5.0 tests From f7414b28971e89bb7a8df03835b5ab250c8e24ee Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Mar 2007 14:30:28 -0700 Subject: [PATCH 6/6] Manual merge --- mysql-test/r/trigger.result | 37 +++++++++++++++++++ mysql-test/t/trigger.test | 74 +++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index fe0e444f87d..aa511ca27a7 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -1335,4 +1335,41 @@ SELECT fubar_id FROM t2; fubar_id 1 DROP TABLE t1,t2; +DROP TABLE IF EXISTS bug21825_A; +DROP TABLE IF EXISTS bug21825_B; +CREATE TABLE bug21825_A (id int(10)); +CREATE TABLE bug21825_B (id int(10)); +CREATE TRIGGER trgA AFTER INSERT ON bug21825_A +FOR EACH ROW +BEGIN +INSERT INTO bug21825_B (id) values (1); +END// +INSERT INTO bug21825_A (id) VALUES (10); +INSERT INTO bug21825_A (id) VALUES (20); +DROP TABLE bug21825_B; +DELETE FROM bug21825_A WHERE id = 20; +DROP TABLE bug21825_A; +DROP TABLE IF EXISTS bug22580_t1; +DROP PROCEDURE IF EXISTS bug22580_proc_1; +DROP PROCEDURE IF EXISTS bug22580_proc_2; +CREATE TABLE bug22580_t1 (a INT, b INT); +CREATE PROCEDURE bug22580_proc_2() +BEGIN +DROP TABLE IF EXISTS bug22580_tmp; +CREATE TEMPORARY TABLE bug22580_tmp (a INT); +DROP TABLE bug22580_tmp; +END|| +CREATE PROCEDURE bug22580_proc_1() +BEGIN +CALL bug22580_proc_2(); +END|| +CREATE TRIGGER t1bu BEFORE UPDATE ON bug22580_t1 +FOR EACH ROW +BEGIN +CALL bug22580_proc_1(); +END|| +INSERT INTO bug22580_t1 VALUES (1,1); +DROP TABLE bug22580_t1; +DROP PROCEDURE bug22580_proc_1; +DROP PROCEDURE bug22580_proc_2; End of 5.0 tests diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 825f1fec6b9..5c95004c901 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -1625,4 +1625,78 @@ SELECT fubar_id FROM t2; DROP TABLE t1,t2; +# +# Bug#21285 (Incorrect message error deleting records in a table with a +# trigger for inserting) +# + +--disable_warnings +DROP TABLE IF EXISTS bug21825_A; +DROP TABLE IF EXISTS bug21825_B; +--enable_warnings + +CREATE TABLE bug21825_A (id int(10)); +CREATE TABLE bug21825_B (id int(10)); + +delimiter //; + +CREATE TRIGGER trgA AFTER INSERT ON bug21825_A +FOR EACH ROW +BEGIN + INSERT INTO bug21825_B (id) values (1); +END// +delimiter ;// + +INSERT INTO bug21825_A (id) VALUES (10); +INSERT INTO bug21825_A (id) VALUES (20); + +DROP TABLE bug21825_B; + +# Must pass, the missing table in the insert trigger should not matter. +DELETE FROM bug21825_A WHERE id = 20; + +DROP TABLE bug21825_A; + +# +# Bug#22580 (DROP TABLE in nested stored procedure causes strange dependancy +# error) +# + +--disable_warnings +DROP TABLE IF EXISTS bug22580_t1; +DROP PROCEDURE IF EXISTS bug22580_proc_1; +DROP PROCEDURE IF EXISTS bug22580_proc_2; +--enable_warnings + +CREATE TABLE bug22580_t1 (a INT, b INT); + +DELIMITER ||; + +CREATE PROCEDURE bug22580_proc_2() +BEGIN + DROP TABLE IF EXISTS bug22580_tmp; + CREATE TEMPORARY TABLE bug22580_tmp (a INT); + DROP TABLE bug22580_tmp; +END|| + +CREATE PROCEDURE bug22580_proc_1() +BEGIN + CALL bug22580_proc_2(); +END|| + +CREATE TRIGGER t1bu BEFORE UPDATE ON bug22580_t1 +FOR EACH ROW +BEGIN + CALL bug22580_proc_1(); +END|| + +DELIMITER ;|| + +# Must pass, the actions of the update trigger should not matter +INSERT INTO bug22580_t1 VALUES (1,1); + +DROP TABLE bug22580_t1; +DROP PROCEDURE bug22580_proc_1; +DROP PROCEDURE bug22580_proc_2; + --echo End of 5.0 tests