diff options
69 files changed, 951 insertions, 215 deletions
diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index 5a9b839489f..5df64e1b26c 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,4 @@ [MYSQL] post_commit_to = "commits@lists.mysql.com" post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-5.6-next-mr" +tree_name = "mysql-5.6-next-mr-bugfixing" diff --git a/client/mysql.cc b/client/mysql.cc index ca0584df0cd..5e3260e486b 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1122,7 +1122,11 @@ int main(int argc,char *argv[]) close(stdout_fileno_copy); /* Clean up dup(). */ } - load_defaults("my",load_default_groups,&argc,&argv); + if (load_defaults("my",load_default_groups,&argc,&argv)) + { + my_end(0); + exit(1); + } defaults_argv=argv; if (get_options(argc, (char **) argv)) { diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 05eb80e5455..1a3f61559d6 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -819,7 +819,8 @@ int main(int argc, char **argv) init_dynamic_string(&conn_args, "", 512, 256)) die("Out of memory"); - load_defaults("my", load_default_groups, &argc, &argv); + if (load_defaults("my", load_default_groups, &argc, &argv)) + die(NULL); defaults_argv= argv; /* Must be freed by 'free_defaults' */ if (handle_options(&argc, &argv, my_long_options, get_one_option)) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 808919fbd0c..2c4a20f2786 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -304,7 +304,8 @@ int main(int argc,char *argv[]) MY_INIT(argv[0]); mysql_init(&mysql); - load_defaults("my",load_default_groups,&argc,&argv); + if (load_defaults("my",load_default_groups,&argc,&argv)) + exit(1); save_argv = argv; /* Save for free_defaults */ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) { diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 874b5a3d77a..1fb56fae076 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -2031,7 +2031,8 @@ int main(int argc, char** argv) my_init_time(); // for time functions - load_defaults("my", load_default_groups, &argc, &argv); + if (load_defaults("my", load_default_groups, &argc, &argv)) + exit(1); defaults_argv= argv; parse_args(&argc, (char***)&argv); diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 5c801eb6e26..980cfd9b3ea 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -344,9 +344,8 @@ static int get_options(int *argc, char ***argv) exit(0); } - load_defaults("my", load_default_groups, argc, argv); - - if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) + if ((ho_error= load_defaults("my", load_default_groups, argc, argv)) || + (ho_error=handle_options(argc, argv, my_long_options, get_one_option))) exit(ho_error); if (!what_to_do) diff --git a/client/mysqldump.c b/client/mysqldump.c index ebf0add4590..9920cfc1904 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -890,7 +890,8 @@ static int get_options(int *argc, char ***argv) opt_net_buffer_length= *mysql_params->p_net_buffer_length; md_result_file= stdout; - load_defaults("my",load_default_groups,argc,argv); + if (load_defaults("my",load_default_groups,argc,argv)) + return 1; defaults_argv= *argv; if (my_hash_init(&ignore_table, charset_info, 16, 0, 0, diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 969cff929d2..f8432c95548 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -592,7 +592,8 @@ int main(int argc, char **argv) char **argv_to_free; MY_INIT(argv[0]); - load_defaults("my",load_default_groups,&argc,&argv); + if (load_defaults("my",load_default_groups,&argc,&argv)) + return 1; /* argv is changed in the program */ argv_to_free= argv; if (get_options(&argc, &argv)) diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 206b86d07cf..588ee049546 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -63,7 +63,9 @@ int main(int argc, char **argv) char *wild; MYSQL mysql; MY_INIT(argv[0]); - load_defaults("my",load_default_groups,&argc,&argv); + if (load_defaults("my",load_default_groups,&argc,&argv)) + exit(1); + get_options(&argc,&argv); wild=0; diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 21b40824be7..6ff2a868a21 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -299,7 +299,11 @@ int main(int argc, char **argv) MY_INIT(argv[0]); - load_defaults("my",load_default_groups,&argc,&argv); + if (load_defaults("my",load_default_groups,&argc,&argv)) + { + my_end(0); + exit(1); + } defaults_argv=argv; if (get_options(&argc,&argv)) { diff --git a/client/mysqltest.cc b/client/mysqltest.cc index a6d7c7c1a8e..79ee7fe9990 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -6038,7 +6038,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int parse_args(int argc, char **argv) { - load_defaults("my",load_default_groups,&argc,&argv); + if (load_defaults("my",load_default_groups,&argc,&argv)) + exit(1); + default_argv= argv; if ((handle_options(&argc, &argv, my_long_options, get_one_option))) diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index 42a5cbd6877..2614946a712 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -189,6 +189,7 @@ int main(int argc, char **argv) config_file); } error= 2; + exit(error); } for (argument= arguments+1 ; *argument ; argument++) @@ -197,5 +198,5 @@ int main(int argc, char **argv) my_free((char*) load_default_groups,MYF(0)); free_defaults(arguments); - exit(error); + exit(0); } diff --git a/include/my_sys.h b/include/my_sys.h index 5c1dd062355..2e59e227255 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -60,7 +60,7 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MY_WME 16 /* Write message on error */ #define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */ #define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */ -#define MY_SYNC_DIR 1024 /* my_create/delete/rename: sync directory */ +#define MY_SYNC_DIR 8192 /* my_create/delete/rename: sync directory */ #define MY_RAID 64 /* Support for RAID */ #define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */ #define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */ diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id.test b/mysql-test/extra/rpl_tests/rpl_insert_id.test index b076e73a215..f6543195f5b 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_id.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_id.test @@ -117,6 +117,7 @@ sync_slave_with_master; --echo # connection master; +set @@session.sql_auto_is_null=1; eval create table t1(a int auto_increment, key(a)) engine=$engine_type; eval create table t2(a int) engine=$engine_type; insert into t1 (a) values (null); @@ -552,4 +553,5 @@ connection master; drop table t1, t2; drop procedure foo; SET @@global.concurrent_insert= @old_concurrent_insert; +set @@session.sql_auto_is_null=default; sync_slave_with_master; diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 47797af3cbe..bf0bc07c50e 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -70,3 +70,14 @@ we_ivo NULL we_martin NULL we_toshko NULL drop table t1; +CREATE TABLE t1 ( +e1 enum('ÿáúëêà'), +e2 enum('ìëÿêî') +) ENGINE=MYISAM character set cp1251; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `e1` enum('ÿáúëêà') DEFAULT NULL, + `e2` enum('ìëÿêî') DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 +DROP TABLE t1; diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result index 00da0db1735..222351cd5e2 100644 --- a/mysql-test/r/ctype_ldml.result +++ b/mysql-test/r/ctype_ldml.result @@ -1,8 +1,40 @@ drop table if exists t1; +In the following tests we change the order of letter "b" +making it equal to letter "a", and check that it works +with all Unicode character sets set names utf8; show variables like 'character_sets_dir%'; Variable_name Value character_sets_dir MYSQL_TEST_DIR/std_data/ +show collation like 'utf8_phone_ci'; +Collation Charset Id Default Compiled Sortlen +utf8_phone_ci utf8 352 8 +CREATE TABLE t1 ( +name VARCHAR(64), +phone VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_phone_ci +); +INSERT INTO t1 VALUES ('Svoj','+7 912 800 80 02'); +INSERT INTO t1 VALUES ('Hf','+7 (912) 800 80 04'); +INSERT INTO t1 VALUES ('Bar','+7-912-800-80-01'); +INSERT INTO t1 VALUES ('Ramil','(7912) 800 80 03'); +INSERT INTO t1 VALUES ('Sanja','+380 (912) 8008005'); +SELECT * FROM t1 ORDER BY phone; +name phone +Sanja +380 (912) 8008005 +Bar +7-912-800-80-01 +Svoj +7 912 800 80 02 +Ramil (7912) 800 80 03 +Hf +7 (912) 800 80 04 +SELECT * FROM t1 WHERE phone='+7(912)800-80-01'; +name phone +Bar +7-912-800-80-01 +SELECT * FROM t1 WHERE phone='79128008001'; +name phone +Bar +7-912-800-80-01 +SELECT * FROM t1 WHERE phone='7 9 1 2 8 0 0 8 0 0 1'; +name phone +Bar +7-912-800-80-01 +DROP TABLE t1; show collation like 'utf8_test_ci'; Collation Charset Id Default Compiled Sortlen utf8_test_ci utf8 353 8 @@ -341,6 +373,7 @@ select "foo" = "foo " collate latin1_test; The following tests check that two-byte collation IDs work select * from information_schema.collations where id>256 order by id; COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN +utf8_phone_ci utf8 352 8 utf8_test_ci utf8 353 8 ucs2_test_ci ucs2 358 8 ucs2_vn_ci ucs2 359 8 diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 4ff48bd380a..668b1b0febe 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1881,6 +1881,23 @@ CONVERT(a, CHAR) CONVERT(b, CHAR) DROP TABLE t1; End of 5.0 tests Start of 5.4 tests +CREATE TABLE t1 ( +clipid INT NOT NULL, +Tape TINYTEXT, +PRIMARY KEY (clipid), +KEY tape(Tape(255)) +) CHARACTER SET=utf8; +ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `clipid` int(11) NOT NULL, + `mos` tinyint(4) DEFAULT '0', + `Tape` tinytext, + PRIMARY KEY (`clipid`), + KEY `tape` (`Tape`(255)) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( predicted_order int NOT NULL, diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index abab18e0e99..40f408b0fc8 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -49,7 +49,7 @@ a b Full-text indexes are called collections Only MyISAM tables support collections select * from t1 where MATCH(a,b) AGAINST ("indexes" IN BOOLEAN MODE WITH QUERY EXPANSION); -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 'WITH QUERY EXPANSION)' at line 1 +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 'QUERY EXPANSION)' at line 1 explain select * from t1 where MATCH(a,b) AGAINST ("collections"); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 fulltext a a 0 1 Using where diff --git a/mysql-test/r/func_isnull.result b/mysql-test/r/func_isnull.result index 20ddc87ee78..79aecc7d82b 100644 --- a/mysql-test/r/func_isnull.result +++ b/mysql-test/r/func_isnull.result @@ -5,3 +5,8 @@ flush tables; select * from t1 where isnull(to_days(mydate)); id mydate drop table t1; +CREATE TABLE t1 (id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY(id)); +INSERT INTO t1( id ) VALUES ( NULL ); +SELECT t1.id FROM t1 WHERE (id is not null and id is null ); +id +DROP TABLE t1; diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 5f32561798b..ff060f02c06 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -21,7 +21,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -67,7 +67,7 @@ DELIMITER /*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -99,7 +99,7 @@ DELIMITER /*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -121,7 +121,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -167,7 +167,7 @@ DELIMITER /*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -199,7 +199,7 @@ DELIMITER /*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -299,7 +299,7 @@ DELIMITER /*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -349,7 +349,7 @@ DELIMITER /*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result index dba9bdc9d70..62df4731d47 100644 --- a/mysql-test/r/mysqlbinlog2.result +++ b/mysql-test/r/mysqlbinlog2.result @@ -22,7 +22,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -65,7 +65,7 @@ SET INSERT_ID=1/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -104,7 +104,7 @@ SET INSERT_ID=4/*!*/; use test/*!*/; SET TIMESTAMP=1579609946/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -130,7 +130,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -165,7 +165,7 @@ SET INSERT_ID=4/*!*/; use test/*!*/; SET TIMESTAMP=1579609946/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -188,7 +188,7 @@ SET INSERT_ID=3/*!*/; use test/*!*/; SET TIMESTAMP=1579609944/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -218,7 +218,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -249,7 +249,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -284,7 +284,7 @@ SET INSERT_ID=6/*!*/; use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -307,7 +307,7 @@ SET INSERT_ID=1/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -338,7 +338,7 @@ SET INSERT_ID=6/*!*/; use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -361,7 +361,7 @@ SET INSERT_ID=4/*!*/; use test/*!*/; SET TIMESTAMP=1579609946/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -380,7 +380,7 @@ SET INSERT_ID=6/*!*/; use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -402,7 +402,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -448,7 +448,7 @@ SET INSERT_ID=3/*!*/; use test/*!*/; SET TIMESTAMP=1579609944/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -471,7 +471,7 @@ SET INSERT_ID=6/*!*/; use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -493,7 +493,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -523,7 +523,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -566,7 +566,7 @@ SET INSERT_ID=1/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -604,7 +604,7 @@ SET INSERT_ID=4/*!*/; use test/*!*/; SET TIMESTAMP=1579609946/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -630,7 +630,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -664,7 +664,7 @@ SET INSERT_ID=4/*!*/; use test/*!*/; SET TIMESTAMP=1579609946/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -687,7 +687,7 @@ SET INSERT_ID=3/*!*/; use test/*!*/; SET TIMESTAMP=1579609944/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -717,7 +717,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -747,7 +747,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -782,7 +782,7 @@ SET INSERT_ID=6/*!*/; use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -805,7 +805,7 @@ SET INSERT_ID=1/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -836,7 +836,7 @@ SET INSERT_ID=6/*!*/; use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -858,7 +858,7 @@ SET INSERT_ID=4/*!*/; use test/*!*/; SET TIMESTAMP=1579609946/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -877,7 +877,7 @@ SET INSERT_ID=6/*!*/; use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -899,7 +899,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -945,7 +945,7 @@ SET INSERT_ID=3/*!*/; use test/*!*/; SET TIMESTAMP=1579609944/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -968,7 +968,7 @@ SET INSERT_ID=6/*!*/; use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -990,7 +990,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -1020,7 +1020,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; diff --git a/mysql-test/r/mysqlbinlog_row.result b/mysql-test/r/mysqlbinlog_row.result index 9b562ac0fff..85416138c6d 100644 --- a/mysql-test/r/mysqlbinlog_row.result +++ b/mysql-test/r/mysqlbinlog_row.result @@ -339,7 +339,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; diff --git a/mysql-test/r/mysqlbinlog_row_innodb.result b/mysql-test/r/mysqlbinlog_row_innodb.result index 86f0b67ebb3..cf59d23bcf1 100644 --- a/mysql-test/r/mysqlbinlog_row_innodb.result +++ b/mysql-test/r/mysqlbinlog_row_innodb.result @@ -2256,7 +2256,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; @@ -3879,7 +3879,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; @@ -4246,7 +4246,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; @@ -4807,7 +4807,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; diff --git a/mysql-test/r/mysqlbinlog_row_myisam.result b/mysql-test/r/mysqlbinlog_row_myisam.result index b9366d941f8..973786d698e 100644 --- a/mysql-test/r/mysqlbinlog_row_myisam.result +++ b/mysql-test/r/mysqlbinlog_row_myisam.result @@ -2256,7 +2256,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; @@ -3901,7 +3901,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; @@ -4274,7 +4274,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; @@ -4845,7 +4845,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; diff --git a/mysql-test/r/mysqlbinlog_row_trans.result b/mysql-test/r/mysqlbinlog_row_trans.result index 9c3348a9e76..43a9a6182f8 100644 --- a/mysql-test/r/mysqlbinlog_row_trans.result +++ b/mysql-test/r/mysqlbinlog_row_trans.result @@ -135,7 +135,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; diff --git a/mysql-test/r/odbc.result b/mysql-test/r/odbc.result index 5629d3dab33..3dbac12ca7c 100644 --- a/mysql-test/r/odbc.result +++ b/mysql-test/r/odbc.result @@ -1,4 +1,5 @@ drop table if exists t1; +set @@session.sql_auto_is_null=1; select {fn length("hello")}, { date "1997-10-20" }; {fn length("hello")} 1997-10-20 5 1997-10-20 @@ -7,9 +8,9 @@ insert into t1 SET A=NULL,B=1; insert into t1 SET a=null,b=2; select * from t1 where a is null and b=2; a b -2 2 select * from t1 where a is null; a b +2 2 explain select * from t1 where b is null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE @@ -25,3 +26,4 @@ SELECT sql_no_cache a, last_insert_id() FROM t1; a last_insert_id() 1 1 DROP TABLE t1; +set @@session.sql_auto_is_null=default; diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 20e0fe2f1cc..b67fa9322ee 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -342,19 +342,18 @@ create table mysqltest.t1 (i int not null auto_increment, a int, primary key (i) insert into mysqltest.t1 (a) values (1); select * from mysqltest.t1 where i is null; i a -1 1 create table t1(a int); select * from t1; a show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 1 +Qcache_queries_in_cache 2 select * from mysqltest.t1; i a 1 1 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 2 +Qcache_queries_in_cache 3 drop database mysqltest; show status like "Qcache_queries_in_cache"; Variable_name Value diff --git a/mysql-test/r/sp-ucs2.result b/mysql-test/r/sp-ucs2.result index ce6be5b0a65..3806a84a849 100644 --- a/mysql-test/r/sp-ucs2.result +++ b/mysql-test/r/sp-ucs2.result @@ -12,3 +12,111 @@ a foo string drop function bug17615| drop table t3| +CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci) +RETURNS VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_danish_ci +BEGIN +DECLARE f2 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_swedish_ci; +DECLARE f3 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_bin; +SET f1= concat(collation(f1), ' ', collation(f2), ' ', collation(f3)); +RETURN f1; +END| +SELECT f('a')| +f('a') +ucs2_unicode_ci ucs2_swedish_ci ucs2_bin +SELECT collation(f('a'))| +collation(f('a')) +ucs2_danish_ci +DROP FUNCTION f| +CREATE FUNCTION f() +RETURNS VARCHAR(64) UNICODE BINARY +BEGIN +RETURN ''; +END| +SHOW CREATE FUNCTION f; +DROP FUNCTION f; +CREATE FUNCTION f() +RETURNS VARCHAR(64) BINARY UNICODE +BEGIN +RETURN ''; +END| +Function sql_mode Create Function character_set_client collation_connection Database Collation +f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin +BEGIN +RETURN ''; +END latin1 latin1_swedish_ci latin1_swedish_ci +SHOW CREATE FUNCTION f; +DROP FUNCTION f; +# +# Testing keywords ASCII + BINARY +# +CREATE FUNCTION f() +RETURNS VARCHAR(64) ASCII BINARY +BEGIN +RETURN ''; +END| +Function sql_mode Create Function character_set_client collation_connection Database Collation +f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin +BEGIN +RETURN ''; +END latin1 latin1_swedish_ci latin1_swedish_ci +SHOW CREATE FUNCTION f; +DROP FUNCTION f; +CREATE FUNCTION f() +RETURNS VARCHAR(64) BINARY ASCII +BEGIN +RETURN ''; +END| +Function sql_mode Create Function character_set_client collation_connection Database Collation +f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin +BEGIN +RETURN ''; +END latin1 latin1_swedish_ci latin1_swedish_ci +SHOW CREATE FUNCTION f; +DROP FUNCTION f; +# +# Testing COLLATE in OUT parameter +# +CREATE PROCEDURE p1(IN f1 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_czech_ci, +OUT f2 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_polish_ci) +BEGIN +SET f2= f1; +SET f2= concat(collation(f1), ' ', collation(f2)); +END| +Function sql_mode Create Function character_set_client collation_connection Database Collation +f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin +BEGIN +RETURN ''; +END latin1 latin1_swedish_ci latin1_swedish_ci +CREATE FUNCTION f1() +RETURNS VARCHAR(64) CHARACTER SET ucs2 +BEGIN +DECLARE f1 VARCHAR(64) CHARACTER SET ucs2; +DECLARE f2 VARCHAR(64) CHARACTER SET ucs2; +SET f1='str'; +CALL p1(f1, f2); +RETURN f2; +END| +SELECT f1()| +f1() +ucs2_czech_ci ucs2_polish_ci +DROP PROCEDURE p1| +DROP FUNCTION f1| +CREATE FUNCTION f(f1 VARCHAR(64) COLLATE ucs2_unicode_ci) +RETURNS VARCHAR(64) CHARACTER SET ucs2 +BEGIN +RETURN 'str'; +END| +ERROR 42000: This version of MySQL doesn't yet support 'COLLATE with no CHARACTER SET in SP parameters, RETURNS, DECLARE' +CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2) +RETURNS VARCHAR(64) COLLATE ucs2_unicode_ci +BEGIN +RETURN 'str'; +END| +ERROR 42000: This version of MySQL doesn't yet support 'COLLATE with no CHARACTER SET in SP parameters, RETURNS, DECLARE' +CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2) +RETURNS VARCHAR(64) CHARACTER SET ucs2 +BEGIN +DECLARE f2 VARCHAR(64) COLLATE ucs2_unicode_ci; +RETURN 'str'; +END| +ERROR 42000: This version of MySQL doesn't yet support 'COLLATE with no CHARACTER SET in SP parameters, RETURNS, DECLARE' diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 05efea79fe7..b9587bedc05 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -22,7 +22,7 @@ SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/; use test/*!*/; SET TIMESTAMP=10000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index c097b70680f..c66b05c7db7 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3959,6 +3959,19 @@ DROP TABLE t1; # ----------------------------------------------------------------- # -- End of 5.1 tests. # ----------------------------------------------------------------- +drop table if exists t_9801; +drop view if exists v_9801; +create table t_9801 (s1 int); +create view v_9801 as +select sum(s1) from t_9801 with check option; +ERROR HY000: CHECK OPTION on non-updatable view 'test.v_9801' +create view v_9801 as +select sum(s1) from t_9801 group by s1 with check option; +ERROR HY000: CHECK OPTION on non-updatable view 'test.v_9801' +create view v_9801 as +select sum(s1) from t_9801 group by s1 with rollup with check option; +ERROR HY000: CHECK OPTION on non-updatable view 'test.v_9801' +drop table t_9801; # # Bug #47335 assert in get_table_share # diff --git a/mysql-test/std_data/Index.xml b/mysql-test/std_data/Index.xml index 40fe70ebca0..4feb868583e 100644 --- a/mysql-test/std_data/Index.xml +++ b/mysql-test/std_data/Index.xml @@ -1,10 +1,20 @@ <charsets> <charset name="utf8"> + <collation name="utf8_phone_ci" id="352"> + <rules> + <reset>\u0000</reset> + <i>\u0020</i> <!-- space --> + <i>\u0028</i> <!-- left parenthesis --> + <i>\u0029</i> <!-- right parenthesis --> + <i>\u002B</i> <!-- plus --> + <i>\u002D</i> <!-- hyphen --> + </rules> + </collation> <collation name="utf8_test_ci" id="353"> <rules> <reset>a</reset> - <s>b</s> + <i>b</i> </rules> </collation> diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result index 8daed8d5c25..f0519a9d724 100644 --- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result @@ -16,7 +16,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; SET TIMESTAMP=10000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result index b7edf7fedb8..7214d07c783 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result @@ -16,7 +16,7 @@ SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/; use test/*!*/; SET TIMESTAMP=10000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result index eb9713e4bdd..9511aa973e5 100644 --- a/mysql-test/suite/funcs_1/r/innodb_views.result +++ b/mysql-test/suite/funcs_1/r/innodb_views.result @@ -3546,11 +3546,11 @@ CREATE VIEW v1 or REPLACE AS Select * from tb2 my_table; 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 'or REPLACE AS Select * from tb2 my_table' at line 1 CREATE VIEW v1 WITH CASCADED CHECK OPTION AS Select * from tb2 my_table limit 50; -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 'WITH CASCADED CHECK OPTION AS Select * +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 'CASCADED CHECK OPTION AS Select * from tb2 my_table limit 50' at line 1 CREATE VIEW v1 WITH LOCAL CHECK OPTION AS Select * from tb2 my_table limit 50; -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 'WITH LOCAL CHECK OPTION AS Select * +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 'LOCAL CHECK OPTION AS Select * from tb2 my_table limit 50' at line 1 SELECT * FROM tb2 my_table CREATE VIEW As v1; 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 'CREATE VIEW As v1' at line 1 @@ -3580,7 +3580,7 @@ FROM test.tb2 my_table CHECK OPTION WITH CASCADED; 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 'CHECK OPTION WITH CASCADED' at line 2 CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table; -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 'WITH CASCADED CHECK OPTION +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 'CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table' at line 1 CREATE OR REPLACE AS SELECT F59, F60 FROM test.tb2 my_table VIEW v1 WITH CASCADED CHECK OPTION; @@ -3609,7 +3609,7 @@ FROM test.tb2 my_table CHECK OPTION WITH LOCAL; 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 'CHECK OPTION WITH LOCAL' at line 2 CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table; -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 'WITH CASCADED CHECK OPTION +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 'CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table' at line 1 CREATE OR REPLACE AS SELECT F59, F60 FROM test.tb2 my_table VIEW v1 WITH LOCAL CHECK OPTION; diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result index b018a5ad863..7f3a0efb8b8 100644 --- a/mysql-test/suite/funcs_1/r/memory_views.result +++ b/mysql-test/suite/funcs_1/r/memory_views.result @@ -3547,11 +3547,11 @@ CREATE VIEW v1 or REPLACE AS Select * from tb2 my_table; 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 'or REPLACE AS Select * from tb2 my_table' at line 1 CREATE VIEW v1 WITH CASCADED CHECK OPTION AS Select * from tb2 my_table limit 50; -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 'WITH CASCADED CHECK OPTION AS Select * +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 'CASCADED CHECK OPTION AS Select * from tb2 my_table limit 50' at line 1 CREATE VIEW v1 WITH LOCAL CHECK OPTION AS Select * from tb2 my_table limit 50; -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 'WITH LOCAL CHECK OPTION AS Select * +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 'LOCAL CHECK OPTION AS Select * from tb2 my_table limit 50' at line 1 SELECT * FROM tb2 my_table CREATE VIEW As v1; 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 'CREATE VIEW As v1' at line 1 @@ -3581,7 +3581,7 @@ FROM test.tb2 my_table CHECK OPTION WITH CASCADED; 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 'CHECK OPTION WITH CASCADED' at line 2 CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table; -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 'WITH CASCADED CHECK OPTION +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 'CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table' at line 1 CREATE OR REPLACE AS SELECT F59, F60 FROM test.tb2 my_table VIEW v1 WITH CASCADED CHECK OPTION; @@ -3610,7 +3610,7 @@ FROM test.tb2 my_table CHECK OPTION WITH LOCAL; 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 'CHECK OPTION WITH LOCAL' at line 2 CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table; -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 'WITH CASCADED CHECK OPTION +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 'CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table' at line 1 CREATE OR REPLACE AS SELECT F59, F60 FROM test.tb2 my_table VIEW v1 WITH LOCAL CHECK OPTION; diff --git a/mysql-test/suite/funcs_1/r/myisam_views.result b/mysql-test/suite/funcs_1/r/myisam_views.result index a228245483e..65ad319d642 100644 --- a/mysql-test/suite/funcs_1/r/myisam_views.result +++ b/mysql-test/suite/funcs_1/r/myisam_views.result @@ -4049,11 +4049,11 @@ CREATE VIEW v1 or REPLACE AS Select * from tb2 my_table; 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 'or REPLACE AS Select * from tb2 my_table' at line 1 CREATE VIEW v1 WITH CASCADED CHECK OPTION AS Select * from tb2 my_table limit 50; -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 'WITH CASCADED CHECK OPTION AS Select * +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 'CASCADED CHECK OPTION AS Select * from tb2 my_table limit 50' at line 1 CREATE VIEW v1 WITH LOCAL CHECK OPTION AS Select * from tb2 my_table limit 50; -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 'WITH LOCAL CHECK OPTION AS Select * +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 'LOCAL CHECK OPTION AS Select * from tb2 my_table limit 50' at line 1 SELECT * FROM tb2 my_table CREATE VIEW As v1; 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 'CREATE VIEW As v1' at line 1 @@ -4083,7 +4083,7 @@ FROM test.tb2 my_table CHECK OPTION WITH CASCADED; 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 'CHECK OPTION WITH CASCADED' at line 2 CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table; -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 'WITH CASCADED CHECK OPTION +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 'CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table' at line 1 CREATE OR REPLACE AS SELECT F59, F60 FROM test.tb2 my_table VIEW v1 WITH CASCADED CHECK OPTION; @@ -4112,7 +4112,7 @@ FROM test.tb2 my_table CHECK OPTION WITH LOCAL; 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 'CHECK OPTION WITH LOCAL' at line 2 CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table; -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 'WITH CASCADED CHECK OPTION +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 'CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table' at line 1 CREATE OR REPLACE AS SELECT F59, F60 FROM test.tb2 my_table VIEW v1 WITH LOCAL CHECK OPTION; diff --git a/mysql-test/suite/funcs_1/r/ndb_views.result b/mysql-test/suite/funcs_1/r/ndb_views.result index 0f35649b393..79020adbc50 100644 --- a/mysql-test/suite/funcs_1/r/ndb_views.result +++ b/mysql-test/suite/funcs_1/r/ndb_views.result @@ -3546,11 +3546,11 @@ CREATE VIEW v1 or REPLACE AS Select * from tb2 my_table; 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 'or REPLACE AS Select * from tb2 my_table' at line 1 CREATE VIEW v1 WITH CASCADED CHECK OPTION AS Select * from tb2 my_table limit 50; -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 'WITH CASCADED CHECK OPTION AS Select * +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 'CASCADED CHECK OPTION AS Select * from tb2 my_table limit 50' at line 1 CREATE VIEW v1 WITH LOCAL CHECK OPTION AS Select * from tb2 my_table limit 50; -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 'WITH LOCAL CHECK OPTION AS Select * +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 'LOCAL CHECK OPTION AS Select * from tb2 my_table limit 50' at line 1 SELECT * FROM tb2 my_table CREATE VIEW As v1; 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 'CREATE VIEW As v1' at line 1 @@ -3580,7 +3580,7 @@ FROM test.tb2 my_table CHECK OPTION WITH CASCADED; 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 'CHECK OPTION WITH CASCADED' at line 2 CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table; -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 'WITH CASCADED CHECK OPTION +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 'CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table' at line 1 CREATE OR REPLACE AS SELECT F59, F60 FROM test.tb2 my_table VIEW v1 WITH CASCADED CHECK OPTION; @@ -3609,7 +3609,7 @@ FROM test.tb2 my_table CHECK OPTION WITH LOCAL; 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 'CHECK OPTION WITH LOCAL' at line 2 CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table; -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 'WITH CASCADED CHECK OPTION +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 'CASCADED CHECK OPTION AS SELECT F59, F60 FROM test.tb2 my_table' at line 1 CREATE OR REPLACE AS SELECT F59, F60 FROM test.tb2 my_table VIEW v1 WITH LOCAL CHECK OPTION; diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result index fc05dbc889f..cda55e92ac8 100644 --- a/mysql-test/suite/funcs_1/r/storedproc.result +++ b/mysql-test/suite/funcs_1/r/storedproc.result @@ -2806,7 +2806,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp SELECT * from t1 where f2=f1' at line 1 CREATE PROCEDURE with() SELECT * from t1 where f2=f1; -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 'with() +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 '() SELECT * from t1 where f2=f1' at line 1 CREATE PROCEDURE write() SELECT * from t1 where f2=f1; @@ -5660,7 +5660,7 @@ CREATE PROCEDURE sp1() with:BEGIN SELECT @x; END// -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 'with:BEGIN +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 ':BEGIN SELECT @x; END' at line 2 DROP PROCEDURE IF EXISTS sp1; @@ -9220,7 +9220,7 @@ CREATE PROCEDURE sp1() BEGIN declare with char; END// -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 'with char; +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 'char; END' at line 3 DROP PROCEDURE IF EXISTS sp1; Warnings: @@ -11576,8 +11576,9 @@ BEGIN declare with condition for sqlstate '02000'; declare exit handler for with set @var2 = 1; END// -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 'with condition for sqlstate '02000'; -declare exit handler for with set @var2 = 1' at line 3 +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 'condition for sqlstate '02000'; +declare exit handler for with set @var2 = 1; +END' at line 3 DROP PROCEDURE IF EXISTS sp1; Warnings: Note 1305 PROCEDURE sp1 does not exist @@ -13681,7 +13682,7 @@ CREATE PROCEDURE sp1( ) BEGIN declare with handler for sqlstate '02000' set @var2 = 1; END// -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 'with handler for sqlstate '02000' set @var2 = 1; +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 'handler for sqlstate '02000' set @var2 = 1; END' at line 3 DROP PROCEDURE IF EXISTS sp1; Warnings: diff --git a/mysql-test/suite/rpl/r/rpl_insert_id.result b/mysql-test/suite/rpl/r/rpl_insert_id.result index e171e247b6c..f0be00c9966 100644 --- a/mysql-test/suite/rpl/r/rpl_insert_id.result +++ b/mysql-test/suite/rpl/r/rpl_insert_id.result @@ -97,6 +97,7 @@ drop table t1; # # Bug#14553: NULL in WHERE resets LAST_INSERT_ID # +set @@session.sql_auto_is_null=1; create table t1(a int auto_increment, key(a)) engine=myisam; create table t2(a int) engine=myisam; insert into t1 (a) values (null); @@ -531,3 +532,4 @@ id last_id drop table t1, t2; drop procedure foo; SET @@global.concurrent_insert= @old_concurrent_insert; +set @@session.sql_auto_is_null=default; diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result index 2cb316c6a1f..b5adcefe373 100644 --- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result +++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result @@ -159,7 +159,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -181,7 +181,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -290,7 +290,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; @@ -321,7 +321,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result index 58c0280aafe..33d8267ad91 100644 --- a/mysql-test/suite/rpl/r/rpl_sp.result +++ b/mysql-test/suite/rpl/r/rpl_sp.result @@ -608,7 +608,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; SET TIMESTAMP=t/*!*/; 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.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@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 *//*!*/; diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test index 463a9cea4bc..b6a1cfc3f98 100644 --- a/mysql-test/t/ctype_cp1251.test +++ b/mysql-test/t/ctype_cp1251.test @@ -47,4 +47,14 @@ insert into t1 (a) values ('air'), select * from t1 where a like 'we_%'; drop table t1; +# +# Bug#158 ENUM and SET types does not accept valid cp1251 character +# +CREATE TABLE t1 ( + e1 enum('ÿáúëêà'), + e2 enum('ìëÿêî') +) ENGINE=MYISAM character set cp1251; +SHOW CREATE TABLE t1; +DROP TABLE t1; + # End of 4.1 tests diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test index 0fcfd603aad..7e469321d5b 100644 --- a/mysql-test/t/ctype_ldml.test +++ b/mysql-test/t/ctype_ldml.test @@ -4,11 +4,30 @@ drop table if exists t1; --enable_warnings +--echo In the following tests we change the order of letter "b" +--echo making it equal to letter "a", and check that it works +--echo with all Unicode character sets set names utf8; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR show variables like 'character_sets_dir%'; +show collation like 'utf8_phone_ci'; +CREATE TABLE t1 ( + name VARCHAR(64), + phone VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_phone_ci +); +INSERT INTO t1 VALUES ('Svoj','+7 912 800 80 02'); +INSERT INTO t1 VALUES ('Hf','+7 (912) 800 80 04'); +INSERT INTO t1 VALUES ('Bar','+7-912-800-80-01'); +INSERT INTO t1 VALUES ('Ramil','(7912) 800 80 03'); +INSERT INTO t1 VALUES ('Sanja','+380 (912) 8008005'); +SELECT * FROM t1 ORDER BY phone; +SELECT * FROM t1 WHERE phone='+7(912)800-80-01'; +SELECT * FROM t1 WHERE phone='79128008001'; +SELECT * FROM t1 WHERE phone='7 9 1 2 8 0 0 8 0 0 1'; +DROP TABLE t1; + show collation like 'utf8_test_ci'; create table t1 (c1 char(1) character set utf8 collate utf8_test_ci); insert into t1 values ('a'); diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index bb3eaa84391..3cf87c2bd22 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1431,6 +1431,19 @@ DROP TABLE t1; --echo Start of 5.4 tests # +# Bug#26180: Can't add columns to tables created with utf8 text indexes +# +CREATE TABLE t1 ( + clipid INT NOT NULL, + Tape TINYTEXT, + PRIMARY KEY (clipid), + KEY tape(Tape(255)) +) CHARACTER SET=utf8; +ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# # Bug#26474: Add Sinhala script (Sri Lanka) collation to MySQL # --disable_warnings diff --git a/mysql-test/t/func_isnull.test b/mysql-test/t/func_isnull.test index 6218efb882f..424f6dc6640 100644 --- a/mysql-test/t/func_isnull.test +++ b/mysql-test/t/func_isnull.test @@ -13,3 +13,15 @@ select * from t1 where isnull(to_days(mydate)); drop table t1; # End of 4.1 tests + +# +# Bug #41371 Select returns 1 row with condition "col is not null and col is null" +# + +CREATE TABLE t1 (id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY(id)); +INSERT INTO t1( id ) VALUES ( NULL ); +SELECT t1.id FROM t1 WHERE (id is not null and id is null ); +DROP TABLE t1; + +# End of 5.1 tests + diff --git a/mysql-test/t/odbc.test b/mysql-test/t/odbc.test index 6a754bb32a7..f1d60e15bc8 100644 --- a/mysql-test/t/odbc.test +++ b/mysql-test/t/odbc.test @@ -3,6 +3,8 @@ drop table if exists t1; --enable_warnings +set @@session.sql_auto_is_null=1; + # # Test some ODBC compatibility # @@ -32,3 +34,5 @@ SELECT sql_no_cache a, last_insert_id() FROM t1; DROP TABLE t1; # End of 4.1 tests + +set @@session.sql_auto_is_null=default; diff --git a/mysql-test/t/sp-ucs2.test b/mysql-test/t/sp-ucs2.test index 7dd88b04871..0480d8f0799 100644 --- a/mysql-test/t/sp-ucs2.test +++ b/mysql-test/t/sp-ucs2.test @@ -25,4 +25,124 @@ drop function bug17615| drop table t3| +# +# Testing COLLATE clause in +# - IN parameter +# - RETURNS +# - DELCARE +# + +CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci) + RETURNS VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_danish_ci +BEGIN + DECLARE f2 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_swedish_ci; + DECLARE f3 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_bin; + SET f1= concat(collation(f1), ' ', collation(f2), ' ', collation(f3)); + RETURN f1; +END| +SELECT f('a')| +SELECT collation(f('a'))| +DROP FUNCTION f| + +# +# Testing keywords UNICODE + BINARY +# +CREATE FUNCTION f() + RETURNS VARCHAR(64) UNICODE BINARY +BEGIN + RETURN ''; +END| +SHOW CREATE FUNCTION f; +DROP FUNCTION f; + +CREATE FUNCTION f() + RETURNS VARCHAR(64) BINARY UNICODE +BEGIN + RETURN ''; +END| +SHOW CREATE FUNCTION f; +DROP FUNCTION f; + + +# +# Testing keywords ASCII + BINARY +# +CREATE FUNCTION f() + RETURNS VARCHAR(64) ASCII BINARY +BEGIN + RETURN ''; +END| +SHOW CREATE FUNCTION f; +DROP FUNCTION f; + +CREATE FUNCTION f() + RETURNS VARCHAR(64) BINARY ASCII +BEGIN + RETURN ''; +END| +SHOW CREATE FUNCTION f; +DROP FUNCTION f; + +# +# Testing COLLATE in OUT parameter +# + +CREATE PROCEDURE p1(IN f1 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_czech_ci, + OUT f2 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_polish_ci) +BEGIN + SET f2= f1; + SET f2= concat(collation(f1), ' ', collation(f2)); +END| + + +CREATE FUNCTION f1() + RETURNS VARCHAR(64) CHARACTER SET ucs2 +BEGIN + DECLARE f1 VARCHAR(64) CHARACTER SET ucs2; + DECLARE f2 VARCHAR(64) CHARACTER SET ucs2; + SET f1='str'; + CALL p1(f1, f2); + RETURN f2; +END| + + +SELECT f1()| +DROP PROCEDURE p1| +DROP FUNCTION f1| + + +# +# COLLATE with no CHARACTER SET in IN param +# +--error ER_NOT_SUPPORTED_YET +CREATE FUNCTION f(f1 VARCHAR(64) COLLATE ucs2_unicode_ci) + RETURNS VARCHAR(64) CHARACTER SET ucs2 +BEGIN + RETURN 'str'; +END| + + +# +# COLLATE with no CHARACTER SET in RETURNS +# +--error ER_NOT_SUPPORTED_YET +CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2) + RETURNS VARCHAR(64) COLLATE ucs2_unicode_ci +BEGIN + RETURN 'str'; +END| + + +# +# COLLATE with no CHARACTER SET in DECLARE +# +--error ER_NOT_SUPPORTED_YET +CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2) + RETURNS VARCHAR(64) CHARACTER SET ucs2 +BEGIN + DECLARE f2 VARCHAR(64) COLLATE ucs2_unicode_ci; + RETURN 'str'; +END| + + delimiter ;| diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 880b4b6a645..8297013611f 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3908,6 +3908,31 @@ DROP TABLE t1; --echo # -- End of 5.1 tests. --echo # ----------------------------------------------------------------- +# +# Bug#9801 (Views: imperfect error message) +# + +--disable_warnings +drop table if exists t_9801; +drop view if exists v_9801; +--enable_warnings + +create table t_9801 (s1 int); + +--error ER_VIEW_NONUPD_CHECK +create view v_9801 as + select sum(s1) from t_9801 with check option; + +--error ER_VIEW_NONUPD_CHECK +create view v_9801 as + select sum(s1) from t_9801 group by s1 with check option; + + --error ER_VIEW_NONUPD_CHECK +create view v_9801 as + select sum(s1) from t_9801 group by s1 with rollup with check option; + +drop table t_9801; + --echo # --echo # Bug #47335 assert in get_table_share --echo # diff --git a/mysys/default.c b/mysys/default.c index 6468cf2b35d..f7c18ed83eb 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -503,9 +503,13 @@ int my_load_defaults(const char *conf_file, const char **groups, ctx.args= &args; ctx.group= &group; - error= my_search_option_files(conf_file, argc, argv, &args_used, - handle_default_option, (void *) &ctx, - dirs); + if ((error= my_search_option_files(conf_file, argc, argv, &args_used, + handle_default_option, (void *) &ctx, + dirs))) + { + free_root(&alloc,MYF(0)); + DBUG_RETURN(error); + } /* Here error contains <> 0 only if we have a fully specified conf_file or a forced default file @@ -557,10 +561,10 @@ int my_load_defaults(const char *conf_file, const char **groups, exit(0); } - if (error == 0 && default_directories) + if (default_directories) *default_directories= dirs; - DBUG_RETURN(error); + DBUG_RETURN(0); err: fprintf(stderr,"Fatal error in defaults handling. Program aborted\n"); diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 95c4419273f..70b9b9f630e 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -160,7 +160,13 @@ parse_arguments() { fi for arg do - val=`echo "$arg" | sed -e "s;--[^=]*=;;"` + # the parameter after "=", or the whole $arg if no match + val=`echo "$arg" | sed -e 's;^--[^=]*=;;'` + # what's before "=", or the whole $arg if no match + optname=`echo "$arg" | sed -e 's/^\(--[^=]*\)=.*$/\1/'` + # replace "_" by "-" ; mysqld_safe must accept "_" like mysqld does. + optname_subst=`echo "$optname" | sed 's/_/-/g'` + arg=`echo $arg | sed "s/^$optname/$optname_subst/"` case "$arg" in # these get passed explicitly to mysqld --basedir=*) MY_BASEDIR_VERSION="$val" ;; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 68aa52f561c..f72b64fc66e 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -29,6 +29,18 @@ #include "sql_select.h" /** + Calculate the affordable RAM limit for structures like TREE or Unique + used in Item_sum_* +*/ + +ulonglong Item_sum::ram_limitation(THD *thd) +{ + return min(thd->variables.tmp_table_size, + thd->variables.max_heap_table_size); +} + + +/** Prepare an aggregate function item for checking context conditions. The function initializes the members of the Item_sum object created @@ -833,7 +845,7 @@ bool Aggregator_distinct::setup(THD *thd) } DBUG_ASSERT(tree == 0); tree= new Unique(compare_key, cmp_arg, tree_key_length, - thd->variables.max_heap_table_size); + item_sum->ram_limitation(thd)); /* The only time tree_key_length could be 0 is if someone does count(distinct) on a char(0) field - stupid thing to do, @@ -902,7 +914,7 @@ bool Aggregator_distinct::setup(THD *thd) are converted to binary representation as well. */ tree= new Unique(simple_raw_key_cmp, &tree_key_length, tree_key_length, - thd->variables.max_heap_table_size); + item_sum->ram_limitation(thd)); DBUG_RETURN(tree == 0); } @@ -3514,7 +3526,7 @@ bool Item_func_group_concat::setup(THD *thd) unique_filter= new Unique(group_concat_key_cmp_with_distinct, (void*)this, tree_key_length, - thd->variables.max_heap_table_size); + ram_limitation(thd)); DBUG_RETURN(FALSE); } diff --git a/sql/item_sum.h b/sql/item_sum.h index 6d7418204fc..9e062ce1d16 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -364,6 +364,7 @@ protected: Item **orig_args, *tmp_orig_args[2]; table_map used_tables_cache; bool forced_const; + static ulonglong ram_limitation(THD *thd); public: diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index f90ded07599..1a171705dae 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -880,6 +880,8 @@ bool check_string_char_length(LEX_STRING *str, const char *err_msg, bool no_error); bool check_host_name(LEX_STRING *str); +CHARSET_INFO *merge_charset_and_collation(CHARSET_INFO *cs, CHARSET_INFO *cl); + bool parse_sql(THD *thd, Parser_state *parser_state, Object_creation_ctx *creation_ctx); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ed1572853bc..71fcef2479a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3265,7 +3265,8 @@ static int init_common_variables(const char *conf_file_name, int argc, orig_argc=argc; orig_argv=argv; - load_defaults(conf_file_name, groups, &argc, &argv); + if (load_defaults(conf_file_name, groups, &argc, &argv)) + return 1; defaults_argv=argv; defaults_argc=argc; if (get_options(&defaults_argc, defaults_argv)) @@ -7754,7 +7755,7 @@ static int mysql_init_variables(void) log_error_file_ptr= log_error_file; lc_messages_dir_ptr= lc_messages_dir; mysql_data_home= mysql_real_data_home; - thd_startup_options= (OPTION_AUTO_IS_NULL | OPTION_BIN_LOG | + thd_startup_options= (OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE | OPTION_SQL_NOTES); protocol_version= PROTOCOL_VERSION; what_to_log= ~ (1L << (uint) COM_TIME); diff --git a/sql/sp.cc b/sql/sp.cc index a8bd419cdcc..279f0d44890 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -687,6 +687,11 @@ sp_returns_type(THD *thd, String &result, sp_head *sp) { result.append(STRING_WITH_LEN(" CHARSET ")); result.append(field->charset()->csname); + if (!(field->charset()->state & MY_CS_PRIMARY)) + { + result.append(STRING_WITH_LEN(" COLLATE ")); + result.append(field->charset()->name); + } } delete field; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index f6dd1fae90a..c443f092d9b 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -24,6 +24,8 @@ #include "sp.h" #include "sp_head.h" +static int lex_one_token(void *arg, void *yythd); + /* We are using pointer to this variable for distinguishing between assignment to NEW row field (when parsing trigger definition) and structured variable. @@ -124,6 +126,8 @@ Lex_input_stream::Lex_input_stream(THD *thd, yylineno(1), yytoklen(0), yylval(NULL), + lookahead_token(-1), + lookahead_yylval(NULL), m_ptr(buffer), m_tok_start(NULL), m_tok_end(NULL), @@ -788,6 +792,60 @@ bool consume_comment(Lex_input_stream *lip, int remaining_recursions_permitted) int MYSQLlex(void *arg, void *yythd) { + THD *thd= (THD *)yythd; + Lex_input_stream *lip= & thd->m_parser_state->m_lip; + YYSTYPE *yylval=(YYSTYPE*) arg; + int token; + + if (lip->lookahead_token >= 0) + { + /* + The next token was already parsed in advance, + return it. + */ + token= lip->lookahead_token; + lip->lookahead_token= -1; + *yylval= *(lip->lookahead_yylval); + lip->lookahead_yylval= NULL; + return token; + } + + token= lex_one_token(arg, yythd); + + switch(token) { + case WITH: + /* + Parsing 'WITH' 'ROLLUP' or 'WITH' 'CUBE' requires 2 look ups, + which makes the grammar LALR(2). + Replace by a single 'WITH_ROLLUP' or 'WITH_CUBE' token, + to transform the grammar into a LALR(1) grammar, + which sql_yacc.yy can process. + */ + token= lex_one_token(arg, yythd); + switch(token) { + case CUBE_SYM: + return WITH_CUBE_SYM; + case ROLLUP_SYM: + return WITH_ROLLUP_SYM; + default: + /* + Save the token following 'WITH' + */ + lip->lookahead_yylval= lip->yylval; + lip->yylval= NULL; + lip->lookahead_token= token; + return WITH; + } + break; + default: + break; + } + + return token; +} + +int lex_one_token(void *arg, void *yythd) +{ reg1 uchar c= 0; bool comment_closed; int tokval, result_state; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index c10e0fc20fe..1b64df51a89 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1425,6 +1425,17 @@ public: /** Interface with bison, value of the last token parsed. */ LEX_YYSTYPE yylval; + /** + LALR(2) resolution, look ahead token. + Value of the next token to return, if any, + or -1, if no token was parsed in advance. + Note: 0 is a legal token, and represents YYEOF. + */ + int lookahead_token; + + /** LALR(2) resolution, value of the look ahead token.*/ + LEX_YYSTYPE lookahead_yylval; + private: /** Pointer to the current position in the raw input stream. */ const char *m_ptr; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 6ea6c3e850b..15832b99192 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -7614,3 +7614,37 @@ bool parse_sql(THD *thd, /** @} (end of group Runtime_Environment) */ + + + +/** + Check and merge "CHARACTER SET cs [ COLLATE cl ]" clause + + @param cs character set pointer. + @param cl collation pointer. + + Check if collation "cl" is applicable to character set "cs". + + If "cl" is NULL (e.g. when COLLATE clause is not specified), + then simply "cs" is returned. + + @return Error status. + @retval NULL, if "cl" is not applicable to "cs". + @retval pointer to merged CHARSET_INFO on success. +*/ + + +CHARSET_INFO* +merge_charset_and_collation(CHARSET_INFO *cs, CHARSET_INFO *cl) +{ + if (cl) + { + if (!my_charset_same(cs, cl)) + { + my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), cl->name, cs->csname); + return NULL; + } + return cl; + } + return cs; +} diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2195719a3e9..3810eed2d2c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9159,18 +9159,26 @@ optimize_cond(JOIN *join, COND *conds, List<TABLE_LIST> *join_list, /** - Remove const and eq items. + Handles the reqursive job for remove_eq_conds() - @return - Return new item, or NULL if no condition @n - cond_value is set to according: - - COND_OK : query is possible (field = constant) - - COND_TRUE : always true ( 1 = 1 ) - - COND_FALSE : always false ( 1 = 2 ) + Remove const and eq items. Return new item, or NULL if no condition + cond_value is set to according: + COND_OK query is possible (field = constant) + COND_TRUE always true ( 1 = 1 ) + COND_FALSE always false ( 1 = 2 ) + + SYNPOSIS + remove_eq_conds() + thd THD environment + cond the condition to handle + cond_value the resulting value of the condition + + RETURN + *COND with the simplified condition */ -COND * -remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value) +static COND * +internal_remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value) { if (cond->type() == Item::COND_ITEM) { @@ -9184,7 +9192,7 @@ remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value) Item *item; while ((item=li++)) { - Item *new_item=remove_eq_conds(thd, item, &tmp_cond_value); + Item *new_item=internal_remove_eq_conds(thd, item, &tmp_cond_value); if (!new_item) li.remove(); else if (item != new_item) @@ -9233,6 +9241,86 @@ remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value) else if (cond->type() == Item::FUNC_ITEM && ((Item_func*) cond)->functype() == Item_func::ISNULL_FUNC) { + Item_func_isnull *func=(Item_func_isnull*) cond; + Item **args= func->arguments(); + if (args[0]->type() == Item::FIELD_ITEM) + { + Field *field=((Item_field*) args[0])->field; + /* fix to replace 'NULL' dates with '0' (shreeve@uci.edu) */ + /* + datetime_field IS NULL has to be modified to + datetime_field == 0 + */ + if (((field->type() == MYSQL_TYPE_DATE) || + (field->type() == MYSQL_TYPE_DATETIME)) && + (field->flags & NOT_NULL_FLAG) && !field->table->maybe_null) + { + COND *new_cond; + if ((new_cond= new Item_func_eq(args[0],new Item_int("0", 0, 2)))) + { + cond=new_cond; + /* + Item_func_eq can't be fixed after creation so we do not check + cond->fixed, also it do not need tables so we use 0 as second + argument. + */ + cond->fix_fields(thd, &cond); + } + } + } + if (cond->const_item()) + { + *cond_value= eval_const_cond(cond) ? Item::COND_TRUE : Item::COND_FALSE; + return (COND*) 0; + } + } + else if (cond->const_item()) + { + *cond_value= eval_const_cond(cond) ? Item::COND_TRUE : Item::COND_FALSE; + return (COND*) 0; + } + else if ((*cond_value= cond->eq_cmp_result()) != Item::COND_OK) + { // boolan compare function + Item *left_item= ((Item_func*) cond)->arguments()[0]; + Item *right_item= ((Item_func*) cond)->arguments()[1]; + if (left_item->eq(right_item,1)) + { + if (!left_item->maybe_null || + ((Item_func*) cond)->functype() == Item_func::EQUAL_FUNC) + return (COND*) 0; // Compare of identical items + } + } + *cond_value=Item::COND_OK; + return cond; // Point at next and level +} + + +/** + Remove const and eq items. Return new item, or NULL if no condition + cond_value is set to according: + COND_OK query is possible (field = constant) + COND_TRUE always true ( 1 = 1 ) + COND_FALSE always false ( 1 = 2 ) + + SYNPOSIS + remove_eq_conds() + thd THD environment + cond the condition to handle + cond_value the resulting value of the condition + + NOTES + calls the inner_remove_eq_conds to check all the tree reqursively + + RETURN + *COND with the simplified condition +*/ + +COND * +remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value) +{ + if (cond->type() == Item::FUNC_ITEM && + ((Item_func*) cond)->functype() == Item_func::ISNULL_FUNC) + { /* Handles this special case for some ODBC applications: The are requesting the row that was just updated with a auto_increment @@ -9275,52 +9363,16 @@ remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value) clear for next row */ thd->substitute_null_with_insert_id= FALSE; + + *cond_value= Item::COND_OK; + return cond; } - /* fix to replace 'NULL' dates with '0' (shreeve@uci.edu) */ - else if (((field->type() == MYSQL_TYPE_DATE) || - (field->type() == MYSQL_TYPE_DATETIME)) && - (field->flags & NOT_NULL_FLAG) && - !field->table->maybe_null) - { - COND *new_cond; - if ((new_cond= new Item_func_eq(args[0],new Item_int("0", 0, 2)))) - { - cond=new_cond; - /* - Item_func_eq can't be fixed after creation so we do not check - cond->fixed, also it do not need tables so we use 0 as second - argument. - */ - cond->fix_fields(thd, &cond); - } - } - } - if (cond->const_item()) - { - *cond_value= eval_const_cond(cond) ? Item::COND_TRUE : Item::COND_FALSE; - return (COND*) 0; - } - } - else if (cond->const_item()) - { - *cond_value= eval_const_cond(cond) ? Item::COND_TRUE : Item::COND_FALSE; - return (COND*) 0; - } - else if ((*cond_value= cond->eq_cmp_result()) != Item::COND_OK) - { // boolan compare function - Item *left_item= ((Item_func*) cond)->arguments()[0]; - Item *right_item= ((Item_func*) cond)->arguments()[1]; - if (left_item->eq(right_item,1)) - { - if (!left_item->maybe_null || - ((Item_func*) cond)->functype() == Item_func::EQUAL_FUNC) - return (COND*) 0; // Compare of identical items } } - *cond_value=Item::COND_OK; - return cond; // Point at next and level + return internal_remove_eq_conds(thd, cond, cond_value); // Scan all the condition } + /* Check if equality can be used in removing components of GROUP BY/DISTINCT diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 759afe79be9..941352cb963 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5793,6 +5793,35 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled, } /** + maximum possible length for certain blob types. + + @param[in] type Blob type (e.g. MYSQL_TYPE_TINY_BLOB) + + @return + length +*/ + +static uint +blob_length_by_type(enum_field_types type) +{ + switch (type) + { + case MYSQL_TYPE_TINY_BLOB: + return 255; + case MYSQL_TYPE_BLOB: + return 65535; + case MYSQL_TYPE_MEDIUM_BLOB: + return 16777215; + case MYSQL_TYPE_LONG_BLOB: + return 4294967295U; + default: + DBUG_ASSERT(0); // we should never go here + return 0; + } +} + + +/** Prepare column and key definitions for CREATE TABLE in ALTER TABLE. This function transforms parse output of ALTER TABLE - lists of @@ -6087,6 +6116,14 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, BLOBs may have cfield->length == 0, which is why we test it before checking whether cfield->length < key_part_length (in chars). + + In case of TEXTs we check the data type maximum length *in bytes* + to key part length measured *in characters* (i.e. key_part_length + devided to mbmaxlen). This is because it's OK to have: + CREATE TABLE t1 (a tinytext, key(a(254)) character set utf8); + In case of this example: + - data type maximum length is 255. + - key_part_length is 1016 (=254*4, where 4 is mbmaxlen) */ if (!Field::type_can_have_key_part(cfield->field->type()) || !Field::type_can_have_key_part(cfield->sql_type) || @@ -6094,8 +6131,11 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, (key_info->flags & HA_SPATIAL) || (cfield->field->field_length == key_part_length && !f_is_blob(key_part->key_type)) || - (cfield->length && (cfield->length < key_part_length / - key_part->field->charset()->mbmaxlen))) + (cfield->length && (((cfield->sql_type >= MYSQL_TYPE_TINY_BLOB && + cfield->sql_type <= MYSQL_TYPE_BLOB) ? + blob_length_by_type(cfield->sql_type) : + cfield->length) < + key_part_length / key_part->field->charset()->mbmaxlen))) key_part_length= 0; // Use whole field } key_part_length /= key_part->field->charset()->mbmaxlen; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1e6a7c4d50f..738745b918c 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -519,10 +519,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %pure_parser /* We have threads */ /* - Currently there are 169 shift/reduce conflicts. + Currently there are 167 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 168 +%expect 167 /* Comments for TOKENS. @@ -1115,6 +1115,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token WHERE /* SQL-2003-R */ %token WHILE_SYM %token WITH /* SQL-2003-R */ +%token WITH_CUBE_SYM /* INTERNAL */ +%token WITH_ROLLUP_SYM /* INTERNAL */ %token WORK_SYM /* SQL-2003-N */ %token WRAPPER_SYM %token WRITE_SYM /* SQL-2003-N */ @@ -1167,7 +1169,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); text_string opt_gconcat_separator %type <num> - type int_type real_type order_dir lock_option + type type_with_opt_collate int_type real_type order_dir lock_option udf_type if_exists opt_local opt_table_options table_options table_option opt_if_not_exists opt_no_write_to_binlog delete_option opt_temporary all_or_any opt_distinct @@ -1289,7 +1291,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); handler opt_precision opt_ignore opt_column opt_restrict grant revoke set lock unlock string_list field_options field_option - field_opt_list opt_binary table_lock_list table_lock + field_opt_list opt_binary ascii unicode table_lock_list table_lock ref_list opt_on_delete opt_on_delete_list opt_on_delete_item use opt_delete_options opt_delete_option varchar nchar nvarchar opt_outer table_list table_name table_alias_ref_list table_alias_ref @@ -2253,7 +2255,7 @@ sp_init_param: ; sp_fdparam: - ident sp_init_param type + ident sp_init_param type_with_opt_collate { LEX *lex= Lex; sp_pcontext *spc= lex->spcont; @@ -2290,7 +2292,7 @@ sp_pdparams: ; sp_pdparam: - sp_opt_inout sp_init_param ident type + sp_opt_inout sp_init_param ident type_with_opt_collate { LEX *lex= Lex; sp_pcontext *spc= lex->spcont; @@ -2370,7 +2372,7 @@ sp_decl: lex->sphead->reset_lex(YYTHD); lex->spcont->declare_var_boundary($2); } - type + type_with_opt_collate sp_opt_default { THD *thd= YYTHD; @@ -4904,14 +4906,14 @@ default_collation: HA_CREATE_INFO *cinfo= &Lex->create_info; if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) && cinfo->default_table_charset && $4 && - !my_charset_same(cinfo->default_table_charset,$4)) - { - my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), - $4->name, cinfo->default_table_charset->csname); - MYSQL_YYABORT; - } - Lex->create_info.default_table_charset= $4; - Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET; + !($4= merge_charset_and_collation(cinfo->default_table_charset, + $4))) + { + MYSQL_YYABORT; + } + + Lex->create_info.default_table_charset= $4; + Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET; } ; @@ -5434,6 +5436,28 @@ attribute: } ; + +type_with_opt_collate: + type opt_collate + { + $$= $1; + + if (Lex->charset) /* Lex->charset is scanned in "type" */ + { + if (!(Lex->charset= merge_charset_and_collation(Lex->charset, $2))) + MYSQL_YYABORT; + } + else if ($2) + { + my_error(ER_NOT_SUPPORTED_YET, MYF(0), + "COLLATE with no CHARACTER SET " + "in SP parameters, RETURNS, DECLARE"); + MYSQL_YYABORT; + } + } + ; + + now_or_signed_literal: NOW_SYM optional_braces { @@ -5516,11 +5540,21 @@ opt_default: | DEFAULT {} ; -opt_binary: - /* empty */ { Lex->charset=NULL; } - | ASCII_SYM opt_bin_mod { Lex->charset=&my_charset_latin1; } - | BYTE_SYM { Lex->charset=&my_charset_bin; } - | UNICODE_SYM opt_bin_mod + +ascii: + ASCII_SYM { Lex->charset= &my_charset_latin1; } + | BINARY ASCII_SYM + { + Lex->charset= &my_charset_latin1_bin; + } + | ASCII_SYM BINARY + { + Lex->charset= &my_charset_latin1_bin; + } + ; + +unicode: + UNICODE_SYM { if (!(Lex->charset=get_charset_by_csname("ucs2", MY_CS_PRIMARY,MYF(0)))) @@ -5529,8 +5563,40 @@ opt_binary: MYSQL_YYABORT; } } + | UNICODE_SYM BINARY + { + if (!(Lex->charset=get_charset_by_name("ucs2_bin", MYF(0)))) + { + my_error(ER_UNKNOWN_COLLATION, MYF(0), "ucs2_bin"); + MYSQL_YYABORT; + } + } + | BINARY UNICODE_SYM + { + if (!(Lex->charset=get_charset_by_name("ucs2_bin", MYF(0)))) + { + my_error(ER_UNKNOWN_COLLATION, MYF(0), "ucs2_bin"); + MYSQL_YYABORT; + } + } + ; + +opt_binary: + /* empty */ { Lex->charset=NULL; } + | ascii + | unicode + | BYTE_SYM { Lex->charset=&my_charset_bin; } | charset charset_name opt_bin_mod { Lex->charset=$2; } - | BINARY opt_bin_charset { Lex->type|= BINCMP_FLAG; } + | BINARY + { + Lex->charset= NULL; + Lex->type|= BINCMP_FLAG; + } + | BINARY charset charset_name + { + Lex->charset= $3; + Lex->type|= BINCMP_FLAG; + } ; opt_bin_mod: @@ -5538,20 +5604,6 @@ opt_bin_mod: | BINARY { Lex->type|= BINCMP_FLAG; } ; -opt_bin_charset: - /* empty */ { Lex->charset= NULL; } - | ASCII_SYM { Lex->charset=&my_charset_latin1; } - | UNICODE_SYM - { - if (!(Lex->charset=get_charset_by_csname("ucs2", - MY_CS_PRIMARY,MYF(0)))) - { - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2"); - MYSQL_YYABORT; - } - } - | charset charset_name { Lex->charset=$2; } - ; opt_primary: /* empty */ @@ -9220,8 +9272,15 @@ group_list: olap_opt: /* empty */ {} - | WITH CUBE_SYM + | WITH_CUBE_SYM { + /* + 'WITH CUBE' is reserved in the MySQL syntax, but not implemented, + and cause LALR(2) conflicts. + This syntax is not standard. + MySQL syntax: GROUP BY col1, col2, col3 WITH CUBE + SQL-2003: GROUP BY ... CUBE(col1, col2, col3) + */ LEX *lex=Lex; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) { @@ -9231,10 +9290,17 @@ olap_opt: } lex->current_select->olap= CUBE_TYPE; my_error(ER_NOT_SUPPORTED_YET, MYF(0), "CUBE"); - MYSQL_YYABORT; /* To be deleted in 5.1 */ + MYSQL_YYABORT; } - | WITH ROLLUP_SYM + | WITH_ROLLUP_SYM { + /* + 'WITH ROLLUP' is needed for backward compatibility, + and cause LALR(2) conflicts. + This syntax is not standard. + MySQL syntax: GROUP BY col1, col2, col3 WITH ROLLUP + SQL-2003: GROUP BY ... ROLLUP(col1, col2, col3) + */ LEX *lex= Lex; if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE) { @@ -13647,7 +13713,7 @@ sf_tail: lex->interval_list.empty(); lex->type= 0; } - type /* $11 */ + type_with_opt_collate /* $11 */ { /* $12 */ LEX *lex= Lex; sp_head *sp= lex->sphead; diff --git a/storage/archive/archive_reader.c b/storage/archive/archive_reader.c index 84d4e318b49..0d641de3e15 100644 --- a/storage/archive/archive_reader.c +++ b/storage/archive/archive_reader.c @@ -390,7 +390,8 @@ static void print_version(void) static void get_options(int *argc, char ***argv) { - load_defaults("my", load_default_groups, argc, argv); + if (load_defaults("my", load_default_groups, argc, argv)) + exit(1); default_argv= *argv; handle_options(argc, argv, my_long_options, get_one_option); diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index b53a1009ba2..e4eccdc1dc6 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -740,7 +740,9 @@ static void get_options(register int *argc,register char ***argv) { int ho_error; - load_defaults("my", load_default_groups, argc, argv); + if (load_defaults("my", load_default_groups, argc, argv)) + exit(1); + default_argv= *argv; if (isatty(fileno(stdout))) check_param.testflag|=T_WRITE_LOOP; diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index 36e3b1e8cbb..1d8d2e2fcfe 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -210,7 +210,9 @@ int main(int argc, char **argv) char **default_argv; MY_INIT(argv[0]); - load_defaults("my",load_default_groups,&argc,&argv); + if (load_defaults("my",load_default_groups,&argc,&argv)) + exit(1); + default_argv= argv; get_options(&argc,&argv); diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 541eb7afeb9..56f3ddccae4 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -7661,6 +7661,13 @@ static my_coll_lexem_num my_coll_lexem_next(MY_COLL_LEXEM *lexem) goto ex; } + if (beg[0] == '=') + { + beg++; + rc= MY_COLL_LEXEM_DIFF; + goto ex; + } + if (beg[0] == '<') { for (beg++, lexem->diff= 1; @@ -7821,6 +7828,10 @@ static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems, item.diff[1]= 0; item.diff[2]= 0; } + else if (lexem.diff == 0) + { + item.diff[0]= item.diff[1]= item.diff[2]= 0; + } if (nitems >= mitems) { my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Too many rules"); diff --git a/strings/ctype.c b/strings/ctype.c index 75d76aceea3..4891e657b6e 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -74,6 +74,7 @@ struct my_cs_file_section_st #define _CS_DIFF1 19 #define _CS_DIFF2 20 #define _CS_DIFF3 21 +#define _CS_IDENTICAL 22 static struct my_cs_file_section_st sec[] = @@ -108,6 +109,7 @@ static struct my_cs_file_section_st sec[] = {_CS_DIFF1, "charsets/charset/collation/rules/p"}, {_CS_DIFF2, "charsets/charset/collation/rules/s"}, {_CS_DIFF3, "charsets/charset/collation/rules/t"}, + {_CS_IDENTICAL, "charsets/charset/collation/rules/i"}, {0, NULL} }; @@ -269,6 +271,7 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len) case _CS_DIFF1: case _CS_DIFF2: case _CS_DIFF3: + case _CS_IDENTICAL: { /* Convert collation description from @@ -276,7 +279,7 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len) into ICU Collation Customization expression. */ char arg[16]; - const char *cmd[]= {"&","<","<<","<<<"}; + const char *cmd[]= {"&","<","<<","<<<","="}; i->cs.tailoring= i->tailoring; mstr(arg,attr,len,sizeof(arg)-1); if (i->tailoring_length + 20 < sizeof(i->tailoring)) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 56e1d609754..866c63ae1d3 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -19379,7 +19379,9 @@ int main(int argc, char **argv) MY_INIT(argv[0]); - load_defaults("my", client_test_load_default_groups, &argc, &argv); + if (load_defaults("my", client_test_load_default_groups, &argc, &argv)) + exit(1); + defaults_argv= argv; get_options(&argc, &argv); diff --git a/tests/thread_test.c b/tests/thread_test.c index 760b72fc5d1..def133f4a3f 100644 --- a/tests/thread_test.c +++ b/tests/thread_test.c @@ -176,9 +176,8 @@ static void get_options(int argc, char **argv) { int ho_error; - load_defaults("my",load_default_groups,&argc,&argv); - - if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + if ((ho_error= load_defaults("my",load_default_groups,&argc,&argv)) || + (ho_error= handle_options(&argc, &argv, my_long_options, get_one_option))) exit(ho_error); free_defaults(argv); diff --git a/vio/viosocket.c b/vio/viosocket.c index 8dcf978f2fa..fb272a430b9 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -800,6 +800,7 @@ int vio_close_pipe(Vio * vio) int r; DBUG_ENTER("vio_close_pipe"); + CancelIo(vio->hPipe); CloseHandle(vio->pipe_overlapped.hEvent); DisconnectNamedPipe(vio->hPipe); r= CloseHandle(vio->hPipe); |