diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 226776e4404..bf4920c6f77 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1010,10 +1010,11 @@ static struct my_option my_long_options[] = "row-based events; 'decode-rows' decodes row events into commented SQL " "statements if the --verbose option is also given; 'auto' prints base64 " "only when necessary (i.e., for row-based events and format description " - "events); 'always' prints base64 whenever possible. 'always' is for " - "debugging only and should not be used in a production system. If this " - "argument is not given, the default is 'auto'; if it is given with no " - "argument, 'always' is used.", + "events); 'always' prints base64 whenever possible. 'always' is " + "deprecated, will be removed in a future version, and should not be used " + "in a production system. --base64-output with no 'name' argument is " + "equivalent to --base64-output=always and is also deprecated. If no " + "--base64-output[=name] option is given at all, the default is 'auto'.", &opt_base64_output_mode_str, &opt_base64_output_mode_str, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, /* @@ -2024,6 +2025,13 @@ int main(int argc, char** argv) if (opt_base64_output_mode == BASE64_OUTPUT_UNSPEC) opt_base64_output_mode= BASE64_OUTPUT_AUTO; + if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS) + warning("The --base64-output=always flag and the --base64-output flag " + "(with '=MODE' omitted), are deprecated. " + "The output generated when these flags are used cannot be " + "parsed by mysql 5.6.0 and later. " + "The flags will be removed in a future version. " + "Please use --base64-output=auto instead."); my_set_max_open_files(open_files_limit); diff --git a/configure.in b/configure.in index d8a45214a5c..9f986e068cb 100644 --- a/configure.in +++ b/configure.in @@ -27,7 +27,7 @@ dnl dnl When changing the major version number please also check the switch dnl statement in mysqlbinlog::check_master_version(). You may also need dnl to update version.c in ndb. -AC_INIT([MySQL Server], [5.5.8-ga], [], [mysql]) +AC_INIT([MySQL Server], [5.5.8-rc], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 29046e9b8bc..ce3f50f5f94 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -24,7 +24,6 @@ main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeou rpl.rpl_heartbeat_basic # BUG#54820 2010-06-26 alik rpl.rpl_heartbeat_basic fails sporadically again rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically rpl.rpl_innodb_bug28430* # Bug#46029 -rpl.rpl_innodb_bug30888* @solaris # Bug#47646 2009-09-25 alik rpl.rpl_innodb_bug30888 fails sporadically on Solaris rpl.rpl_killed_ddl @windows # Bug#47638 2010-01-20 alik The rpl_killed_ddl test fails on Windows sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 0e8fe328589..d79265b29c7 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -1425,7 +1425,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varbinary(10) NOT NULL DEFAULT '' + `c1` varbinary(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index b1e9ff38d26..babed8951a2 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -1507,7 +1507,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' + `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 6216819d172..6edddecb88f 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -1835,7 +1835,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(10) NOT NULL DEFAULT '' + `c1` varchar(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index c2fb90ecfa6..1008f201366 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -2667,7 +2667,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' + `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index e14b54b59a3..122d722be71 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -3511,7 +3511,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' + `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index f1b2196ebfa..0ed46ba270b 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1315,6 +1315,20 @@ SELECT 1 FROM t1 ORDER BY @x:=makedate(a,a); 1 1 DROP TABLE t1; +# +# Bug #52160: crash and inconsistent results when grouping +# by a function and column +# +CREATE TABLE t1(a CHAR(10) NOT NULL); +INSERT INTO t1 VALUES (''),(''); +SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a); +COUNT(*) +2 +Warnings: +Warning 1292 Truncated incorrect time value: '' +Warning 1292 Truncated incorrect time value: '' +Warning 1292 Truncated incorrect time value: '' +DROP TABLE t1; End of 5.1 tests # # Bug#57039: constant subtime expression returns incorrect result. diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 51fad679909..ce83fe5b79b 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -879,3 +879,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; End of 5.0 tests End of 5.1 tests +# Expect deprecation warning. +WARNING: The --base64-output=always flag and the --base64-output flag (with '=MODE' omitted), are deprecated. The output generated when these flags are used cannot be parsed by mysql 5.6.0 and later. The flags will be removed in a future version. Please use --base64-output=auto instead. +# Expect deprecation warning again. +WARNING: The --base64-output=always flag and the --base64-output flag (with '=MODE' omitted), are deprecated. The output generated when these flags are used cannot be parsed by mysql 5.6.0 and later. The flags will be removed in a future version. Please use --base64-output=auto instead. diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 78f31286ea7..e3363fcabf9 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -975,4 +975,14 @@ SELECT LENGTH(c) FROM t2; LENGTH(c) 65535 DROP TABLE t1, t2; +# Bug #52160: crash and inconsistent results when grouping +# by a function and column +CREATE FUNCTION f1() RETURNS TINYBLOB RETURN 1; +CREATE TABLE t1(a CHAR(1)); +INSERT INTO t1 VALUES ('0'), ('0'); +SELECT COUNT(*) FROM t1 GROUP BY f1(), a; +COUNT(*) +2 +DROP FUNCTION f1; +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 08c09adb093..0a2b473ca59 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -832,6 +832,16 @@ INSERT INTO t1 VALUES (0),(9.216e-096); SELECT 1 FROM t1 ORDER BY @x:=makedate(a,a); DROP TABLE t1; +--echo # +--echo # Bug #52160: crash and inconsistent results when grouping +--echo # by a function and column +--echo # + +CREATE TABLE t1(a CHAR(10) NOT NULL); +INSERT INTO t1 VALUES (''),(''); +SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a); +DROP TABLE t1; + --echo End of 5.1 tests --echo # diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 3a9dae35476..76f6c63fc1d 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -487,3 +487,18 @@ diff_files $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn $MYSQLTEST_VARDIR/tmp/mysqlbin # Cleanup for this part of test remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty; remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn; + +# +# WL#5625: Deprecate mysqlbinlog options --base64-output=always and --base64-output +# + +--echo # Expect deprecation warning. +--exec $MYSQL_BINLOG --base64-output=always std_data/master-bin.000001 > /dev/null 2> $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn +--cat_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn + +--echo # Expect deprecation warning again. +--exec $MYSQL_BINLOG --base64-output std_data/master-bin.000001 > /dev/null 2> $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn +--cat_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn + +# Clean up this part of the test. +--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index c06d8ac97e0..fa67afa48e8 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -617,4 +617,17 @@ SELECT LENGTH(c) FROM t2; DROP TABLE t1, t2; +--echo # Bug #52160: crash and inconsistent results when grouping +--echo # by a function and column + +CREATE FUNCTION f1() RETURNS TINYBLOB RETURN 1; + +CREATE TABLE t1(a CHAR(1)); +INSERT INTO t1 VALUES ('0'), ('0'); + +SELECT COUNT(*) FROM t1 GROUP BY f1(), a; + +DROP FUNCTION f1; +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/sql/field.cc b/sql/field.cc index ce1b1fc6eb0..a9b5fedda2d 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -8408,6 +8408,8 @@ uchar *Field_enum::pack(uchar *to, const uchar *from, default: DBUG_ASSERT(0); } + MY_ASSERT_UNREACHABLE(); + DBUG_RETURN(NULL); } const uchar *Field_enum::unpack(uchar *to, const uchar *from, @@ -8430,6 +8432,8 @@ const uchar *Field_enum::unpack(uchar *to, const uchar *from, default: DBUG_ASSERT(0); } + MY_ASSERT_UNREACHABLE(); + DBUG_RETURN(NULL); } diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 004eb83cbeb..72a5aa0c296 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -361,6 +361,7 @@ public: const char *func_name() const { return "time_to_sec"; } void fix_length_and_dec() { + maybe_null= TRUE; decimals=0; max_length=10*MY_CHARSET_BIN_MB_MAXLEN; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index d9fefe35bd8..e9373bc455f 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -15220,6 +15220,8 @@ calc_group_buffer(JOIN *join,ORDER *group) { key_length+= 8; } + else if (type == MYSQL_TYPE_BLOB) + key_length+= MAX_BLOB_WIDTH; // Can't be used as a key else { /*