From 665004c8e0a83e72b735acd2721b91cc9e15e8a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 4 Dec 2006 17:06:25 +0400 Subject: [PATCH 1/3] fix for bug #23938: ISNULL on DATE AND CAST AS DATE returns false for null values Set null_value in case of wrong data. mysql-test/r/cast.result: fix for bug #23938: ISNULL on DATE AND CAST AS DATE returns false for null values - test result. mysql-test/t/cast.test: fix for bug #23938: ISNULL on DATE AND CAST AS DATE returns false for null values - test case. sql/item_timefunc.cc: fix for bug #23938: ISNULL on DATE AND CAST AS DATE returns false for null values - set null_value in case of error. --- mysql-test/r/cast.result | 4 ++++ mysql-test/t/cast.test | 8 +++++++- sql/item_timefunc.cc | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 101b9ac3f7e..23c38bb792c 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -278,3 +278,7 @@ double_val cast_val -1e+30 -9223372036854775808 1e+30 9223372036854775807 DROP TABLE t1; +select isnull(date(NULL)), isnull(cast(NULL as DATE)); +isnull(date(NULL)) isnull(cast(NULL as DATE)) +1 1 +End of 4.1 tests diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index b214cef10fa..7e8ef031e6b 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -167,4 +167,10 @@ INSERT INTO t1 SET f1 = +1.0e+30 ; SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1; DROP TABLE t1; -# End of 4.1 tests +# +# Bug #23938: cast(NULL as DATE) +# + +select isnull(date(NULL)), isnull(cast(NULL as DATE)); + +--echo End of 4.1 tests diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index c1bca7afc60..8687ccc5f10 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2507,7 +2507,10 @@ longlong Item_date_typecast::val_int() DBUG_ASSERT(fixed == 1); TIME ltime; if (args[0]->get_date(<ime, TIME_FUZZY_DATE)) + { + null_value= 1; return 0; + } return (longlong) (ltime.year * 10000L + ltime.month * 100 + ltime.day); } From 04b5225122a1fca7ecb5ce567ed9299cd14ea206 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Feb 2007 14:19:07 +0100 Subject: [PATCH 2/3] Bug#24805 mtr.pl can't handle test with --disable-log-bin - Don't give mysqld the --log-bin argument if .opt file contains --skip-log-bin - Enable flush2 test mysql-test/mysql-test-run.pl: Don't give mysqld the --log-bin argument if .opt file contains --skip-log-bin Don't pass mysqld --binlog-format=s if --skip-log-bin mysql-test/t/disabled.def: Enable flush2 mysql-test/t/flush2-master.opt: Use --skip-log-bin in flush2 to test flush without bin logging --- mysql-test/mysql-test-run.pl | 11 ++++++++--- mysql-test/t/disabled.def | 1 - mysql-test/t/flush2-master.opt | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index ffc27ecabdb..b0854a7c54b 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3554,13 +3554,14 @@ sub mysqld_arguments ($$$$$) { } } - my $pidfile; + # Check if "extra_opt" contains --skip-log-bin + my $skip_binlog= grep('--skip-log-bin', @$extra_opt); if ( $type eq 'master' ) { my $id= $idx > 0 ? $idx + 101 : 1; - if (! $opt_skip_master_binlog) + if (! ($opt_skip_master_binlog || $skip_binlog) ) { mtr_add_arg($args, "%s--log-bin=%s/log/master-bin%s", $prefix, $opt_vardir, $sidx); @@ -3619,7 +3620,7 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--datadir=%s", $prefix, $slave->[$idx]->{'path_myddir'}); mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix); - if (! $opt_skip_slave_binlog) + if (! ( $opt_skip_slave_binlog || $skip_binlog )) { mtr_add_arg($args, "%s--log-bin=%s/log/slave%s-bin", $prefix, $opt_vardir, $sidx); # FIXME use own dir for binlogs @@ -3756,6 +3757,10 @@ sub mysqld_arguments ($$$$$) { { $found_skip_core= 1; } + elsif ($skip_binlog and mtr_match_prefix($arg, "--binlog-format")) + { + ; # Dont add --binlog-format when running without binlog + } else { mtr_add_arg($args, "%s%s", $prefix, $arg); diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 53b73363c22..eaea7c710b0 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -12,5 +12,4 @@ ndb_load : Bug#17233 user_limits : Bug#23921 random failure of user_limits.test -flush2 : Bug#24805 Pushbuild can't handle test with --disable-log-bin diff --git a/mysql-test/t/flush2-master.opt b/mysql-test/t/flush2-master.opt index ccbd01c91d3..789275fa25e 100644 --- a/mysql-test/t/flush2-master.opt +++ b/mysql-test/t/flush2-master.opt @@ -1 +1 @@ ---disable-log-bin +--skip-log-bin From 2470806f9a39e3d2709fb51731e0625140a97f5a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Feb 2007 15:03:28 +0100 Subject: [PATCH 3/3] Fix windows build --- server-tools/instance-manager/instance.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc index 2c94689c664..31e060e27fe 100644 --- a/server-tools/instance-manager/instance.cc +++ b/server-tools/instance-manager/instance.cc @@ -17,7 +17,7 @@ #pragma implementation #endif - +#include #include #include