diff options
116 files changed, 642 insertions, 369 deletions
diff --git a/BitKeeper/triggers/pre-commit b/BitKeeper/triggers/pre-commit index 524321e8b80..f4664ccf1fe 100755 --- a/BitKeeper/triggers/pre-commit +++ b/BitKeeper/triggers/pre-commit @@ -20,4 +20,3 @@ then echo "Set REAL_EMAIL and retry." exit 1 fi - diff --git a/cmd-line-utils/libedit/el_term.h b/cmd-line-utils/libedit/el_term.h index 9e5588ee96f..00ca48e38e2 100644 --- a/cmd-line-utils/libedit/el_term.h +++ b/cmd-line-utils/libedit/el_term.h @@ -90,6 +90,16 @@ extern char* tgoto(const char*, int, int); extern char* tgetstr(char*, char**); #endif + +#if !HAVE_DECL_TGOTO +/* + 'tgoto' is not declared in the system header files, this causes + problems on 64-bit systems. The function returns a 64 bit pointer + but caller see it as "int" and it's thus truncated to 32-bit +*/ +extern char* tgoto(const char*, int, int); +#endif + protected void term_move_to_line(EditLine *, int); protected void term_move_to_char(EditLine *, int); protected void term_clear_EOL(EditLine *, int); diff --git a/configure.in b/configure.in index cb71a67126b..21f4920f12a 100644 --- a/configure.in +++ b/configure.in @@ -761,9 +761,6 @@ AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt])) # For the sched_yield() function on Solaris AC_CHECK_FUNC(sched_yield, , AC_CHECK_LIB(posix4, sched_yield)) -# For the sem_*() functions on BSDish -AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(rt, sem_init)) - MYSQL_CHECK_ZLIB_WITH_COMPRESS # For large pages support @@ -1867,6 +1864,19 @@ else fi AC_SUBST(TERMCAP_LIB) +# Check if the termcap function 'tgoto' is already declared in +# system header files or if it need to be declared locally +AC_CHECK_DECLS(tgoto,,,[ +#ifdef HAVE_CURSES_H +# include <curses.h> +#elif HAVE_NCURSES_H +# include <ncurses.h> +#endif +#ifdef HAVE_TERM_H +# include <term.h> +#endif +]) + LIBEDIT_LOBJECTS="" AC_CHECK_FUNC(strunvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS unvis.o"]) AC_CHECK_FUNC(strvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS vis.o"]) diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index c59685a0e65..779ac122f93 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -4,6 +4,7 @@ -- source include/not_embedded.inc -- source include/have_innodb.inc +-- source include/have_log_bin.inc -- source include/have_debug.inc --disable_warnings diff --git a/mysql-test/extra/binlog_tests/blackhole.test b/mysql-test/extra/binlog_tests/blackhole.test index 9f842a9a4eb..1ca59955d76 100644 --- a/mysql-test/extra/binlog_tests/blackhole.test +++ b/mysql-test/extra/binlog_tests/blackhole.test @@ -4,6 +4,11 @@ # -- source include/not_embedded.inc -- source include/have_blackhole.inc +-- source include/have_log_bin.inc + +# The server need to be started in $MYSQLTEST_VARDIR since it +# uses ../std_data_ln/ +-- source include/uses_vardir.inc --disable_warnings drop table if exists t1,t2; @@ -109,7 +114,7 @@ insert into t1 values(1); insert ignore into t1 values(1); replace into t1 values(100); create table t2 (a varchar(200)) engine=blackhole; -load data infile '../std_data_ln/words.dat' into table t2; +eval load data infile '../std_data_ln/words.dat' into table t2; alter table t1 add b int; alter table t1 drop b; create table t3 like t1; diff --git a/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test b/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test index 30585ece71c..5c172afd122 100644 --- a/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test +++ b/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test @@ -1,5 +1,6 @@ -- source include/not_embedded.inc -- source include/have_cp932.inc +-- source include/have_log_bin.inc --character_set cp932 --disable_warnings diff --git a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test index e1a9dba7775..fa374502997 100644 --- a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test +++ b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test @@ -1,5 +1,6 @@ --source include/not_embedded.inc --source include/have_ucs2.inc +--source include/have_log_bin.inc # # Check correct binlogging of UCS2 user variables (BUG#3875) diff --git a/mysql-test/extra/binlog_tests/drop_temp_table.test b/mysql-test/extra/binlog_tests/drop_temp_table.test index 87f94eff987..75e3afc9380 100644 --- a/mysql-test/extra/binlog_tests/drop_temp_table.test +++ b/mysql-test/extra/binlog_tests/drop_temp_table.test @@ -1,5 +1,5 @@ -# Embedded server doesn't support binlog --- source include/not_embedded.inc +--source include/have_log_bin.inc + --disable_warnings drop database if exists `drop-temp+table-test`; diff --git a/mysql-test/extra/binlog_tests/insert_select-binlog.test b/mysql-test/extra/binlog_tests/insert_select-binlog.test index b09eebcb996..ef22373a628 100644 --- a/mysql-test/extra/binlog_tests/insert_select-binlog.test +++ b/mysql-test/extra/binlog_tests/insert_select-binlog.test @@ -1,5 +1,6 @@ # Embedded server doesn't support binlog -- source include/not_embedded.inc +-- source include/have_log_bin.inc --disable_warnings drop table if exists t1,t2; @@ -13,7 +14,7 @@ insert into t1 values(2); create table t2(a int); insert into t2 values(1),(2); reset master; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 select * from t2; # The above should produce an error, but still be in the binlog; # verify the binlog : @@ -27,7 +28,7 @@ drop table t1, t2; create table t1(a int); insert into t1 values(1),(1); reset master; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY create table t2(unique(a)) select a from t1; # The above should produce an error, *and* not appear in the binlog let $VERSION=`select version()`; diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test index d6ccc403ce9..7141bd1abb9 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test @@ -5,9 +5,7 @@ # did some tests manually on a slave; tables are replicated fine and # Exec_Master_Log_Pos advances as expected. -# Embedded server doesn't support binlogging --- source include/not_embedded.inc - +-- source include/have_log_bin.inc -- source include/have_innodb.inc -- source include/have_debug.inc @@ -246,12 +244,12 @@ set autocommit=0; CREATE TABLE t1 (a int, b int) engine=myisam; reset master; INSERT INTO t1 values (1,1),(1,2); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TABLE t2 (primary key (a)) engine=innodb select * from t1; # This should give warning DROP TABLE if exists t2; INSERT INTO t1 values (3,3); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TEMPORARY TABLE t2 (primary key (a)) engine=innodb select * from t1; ROLLBACK; # This should give warning @@ -259,12 +257,12 @@ DROP TABLE IF EXISTS t2; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb; INSERT INTO t1 VALUES (4,4); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; SELECT * from t2; TRUNCATE table t2; INSERT INTO t1 VALUES (5,5); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t2 select * from t1; SELECT * FROM t2; DROP TABLE t2; @@ -274,25 +272,25 @@ CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb ; INSERT INTO t1 values (7,7); ROLLBACK; INSERT INTO t1 values (8,8); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; COMMIT; INSERT INTO t1 values (9,9); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; ROLLBACK; SELECT * from t2; TRUNCATE table t2; INSERT INTO t1 values (10,10); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t2 select * from t1; SELECT * from t1; INSERT INTO t2 values (100,100); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; COMMIT; INSERT INTO t2 values (101,101); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; ROLLBACK; SELECT * from t2; diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test index 410aeecb7ee..1fa3cf034f6 100644 --- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test +++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test @@ -76,7 +76,7 @@ insert into t1 values (NULL),(5),(NULL),(NULL); insert into t1 values (500),(NULL),(502),(NULL),(NULL); select * from t1; set @@insert_id=600; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values(600),(NULL),(NULL); set @@insert_id=600; insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL); @@ -119,7 +119,7 @@ set auto_increment_increment=11; set auto_increment_offset=4; insert into t1 values(null); insert into t1 values(null); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values(null); select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a; diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test index a8a3e33b8cd..abeef5f2903 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test @@ -138,7 +138,7 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS @@ -183,7 +183,7 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS @@ -228,7 +228,7 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS @@ -274,7 +274,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS @@ -427,7 +427,7 @@ sync_slave_with_master; #connection slave; #--echo *** Select from T9 *** -#wait_for_slave_to_stop; +#--source include/wait_for_slave_sql_to_stop.inc #--replace_result $MASTER_MYPORT MASTER_PORT #--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # #--query_vertical SHOW SLAVE STATUS @@ -469,7 +469,7 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS @@ -513,7 +513,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS @@ -723,7 +723,7 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5; --echo *** Expect slave to fail with Error 1060 *** --echo ******************************************** connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS @@ -832,7 +832,7 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); --echo *** Expect slave to fail with Error 1522 *** --echo ******************************************** connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS diff --git a/mysql-test/extra/rpl_tests/rpl_foreign_key.test b/mysql-test/extra/rpl_tests/rpl_foreign_key.test index 8558650fd04..583f2d85554 100644 --- a/mysql-test/extra/rpl_tests/rpl_foreign_key.test +++ b/mysql-test/extra/rpl_tests/rpl_foreign_key.test @@ -22,8 +22,8 @@ SET TIMESTAMP=1000000000; CREATE TABLE t3 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; # Had to add 1022 for run with ndb as ndb uses different -# error and error code for error ER_DUP_ENTRY_WITH_KEY_NAME. Bug 16677 ---error 1022, ER_DUP_ENTRY_WITH_KEY_NAME +# error and error code for error ER_DUP_ENTRY. Bug 16677 +--error 1022, ER_DUP_ENTRY INSERT INTO t3 VALUES (1),(1); sync_slave_with_master; diff --git a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test index 2cba7ab64c8..11856953959 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test @@ -42,7 +42,7 @@ if ($binlog_format_statement) { # statement below will be converted to non-delayed INSERT and so # will stop at first error, guaranteeing replication. - --error ER_DUP_ENTRY_WITH_KEY_NAME + --error ER_DUP_ENTRY insert delayed into t1 values(10, "is Bond"), (20, "James Bond"); } if (!$binlog_format_statement) @@ -64,7 +64,7 @@ if ($binlog_format_statement) # statement below will be converted to non-delayed INSERT and so # will be binlogged with its ER_DUP_ENTRY error code, guaranteeing # replication (slave will hit the same error code and so be fine). - --error ER_DUP_ENTRY_WITH_KEY_NAME + --error ER_DUP_ENTRY insert delayed into t1 values(20, "is Bond"), (10, "James Bond"); } if (!$binlog_format_statement) diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id.test b/mysql-test/extra/rpl_tests/rpl_insert_id.test index bd2abbac6de..8ee98e0bc76 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_id.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_id.test @@ -97,7 +97,7 @@ SET TIMESTAMP=1000000000; CREATE TABLE t1 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; # Duplicate Key Errors ---error 1022, ER_DUP_ENTRY_WITH_KEY_NAME +--error 1022, ER_DUP_ENTRY INSERT INTO t1 VALUES (1),(1); sync_slave_with_master; connection master; diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test index 5a646bd49e3..844f93d0906 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test @@ -80,7 +80,7 @@ SET TIMESTAMP=1000000000; CREATE TABLE t1 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; # Duplicate Key Errors codes ---error 1022, ER_DUP_ENTRY_WITH_KEY_NAME +--error 1022, ER_DUP_ENTRY INSERT INTO t1 VALUES (1),(1); sync_slave_with_master; connection master; diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test index dea83f65898..acd8fd48234 100644 --- a/mysql-test/extra/rpl_tests/rpl_loaddata.test +++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test @@ -68,7 +68,7 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t1; save_master_pos; connection slave; # The SQL slave thread should be stopped now. -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc # Skip the bad event and see if error is cleared in SHOW SLAVE STATUS by START # SLAVE, even though we are not executing any event (as sql_slave_skip_counter @@ -93,7 +93,7 @@ connection slave; # The SQL slave thread should be stopped now. # Exec_Master_Log_Pos should point to the start of Execute event # for last load data. -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc # CHANGE MASTER and see if error is cleared in SHOW SLAVE STATUS. stop slave; @@ -116,7 +116,7 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t1; save_master_pos; connection slave; # The SQL slave thread should be stopped now. -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc # RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS. stop slave; @@ -131,7 +131,7 @@ connection master; reset master; eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), unique(day)) engine=$engine_type; # no transactions ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; @@ -147,12 +147,12 @@ select * from t2; alter table t2 drop key day; connection master; delete from t2; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc drop table t2; connection master; drop table t2; @@ -161,7 +161,7 @@ drop table t1; # BUG#17233 LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1; --disable warnings diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 9ba06096faf..055e1eeb2d8 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -195,11 +195,11 @@ eval CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = $t # First we make sure that the constraints are correctly set. INSERT INTO t8 VALUES (99,99,99); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t8 VALUES (99,22,33); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t8 VALUES (11,99,33); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t8 VALUES (11,22,99); SELECT * FROM t8 ORDER BY a; diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test index 0cf43d45348..3903c0b0be1 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test +++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test @@ -113,7 +113,7 @@ sync_slave_with_master; connection master; INSERT INTO t1_nodef VALUES (1,2); connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS @@ -127,7 +127,7 @@ sync_slave_with_master; connection master; INSERT INTO t2 VALUES (2,4); connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS @@ -141,7 +141,7 @@ sync_slave_with_master; connection master; INSERT INTO t4 VALUES (4); connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS @@ -155,7 +155,7 @@ sync_slave_with_master; connection master; INSERT INTO t5 VALUES (5,10,25); connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS @@ -169,7 +169,7 @@ sync_slave_with_master; connection master; INSERT INTO t6 VALUES (6,12,36); connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --query_vertical SHOW SLAVE STATUS diff --git a/mysql-test/extra/rpl_tests/rpl_stm_000001.test b/mysql-test/extra/rpl_tests/rpl_stm_000001.test index 8673ae31305..d007e433ab6 100644 --- a/mysql-test/extra/rpl_tests/rpl_stm_000001.test +++ b/mysql-test/extra/rpl_tests/rpl_stm_000001.test @@ -98,7 +98,7 @@ reap; connection slave; # The SQL slave thread should now have stopped because the query was killed on # the master (so it has a non-zero error code in the binlog). -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc # The following test can't be done because the result of Pos will differ # on different computers diff --git a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test index 654cb523f74..3304a0ff46d 100644 --- a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test +++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test @@ -19,12 +19,12 @@ set sql_log_bin=0; insert into t1 values(2); set sql_log_bin=1; save_master_pos; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values(1),(2); drop table t1; save_master_pos; connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc # End of 4.1 tests diff --git a/mysql-test/extra/rpl_tests/rpl_trig004.test b/mysql-test/extra/rpl_tests/rpl_trig004.test index 5144943bc64..45cb11f2787 100644 --- a/mysql-test/extra/rpl_tests/rpl_trig004.test +++ b/mysql-test/extra/rpl_tests/rpl_trig004.test @@ -29,7 +29,7 @@ delimiter ;// INSERT INTO test.t2 VALUES (1, 0.0); # Expect duplicate error 1022 == ndb ---error 1022, ER_DUP_ENTRY_WITH_KEY_NAME +--error 1022, ER_DUP_ENTRY INSERT INTO test.t2 VALUES (1, 0.0); #show binlog events; diff --git a/mysql-test/include/have_binlog_format_mixed.inc b/mysql-test/include/have_binlog_format_mixed.inc index fc5ca61c5a0..fc1dc8324c6 100644 --- a/mysql-test/include/have_binlog_format_mixed.inc +++ b/mysql-test/include/have_binlog_format_mixed.inc @@ -1,3 +1,5 @@ +--source include/have_log_bin.inc + -- require r/have_binlog_format_mixed.require disable_query_log; show variables like "binlog_format"; diff --git a/mysql-test/include/have_binlog_format_mixed_or_row.inc b/mysql-test/include/have_binlog_format_mixed_or_row.inc index c38b8f3d601..fcba9eef883 100644 --- a/mysql-test/include/have_binlog_format_mixed_or_row.inc +++ b/mysql-test/include/have_binlog_format_mixed_or_row.inc @@ -1,3 +1,5 @@ +--source include/have_log_bin.inc + --require r/have_binlog_format_row.require --disable_query_log --replace_result MIXED ROW diff --git a/mysql-test/include/have_binlog_format_mixed_or_statement.inc b/mysql-test/include/have_binlog_format_mixed_or_statement.inc index 8ee6f2cc030..700b58a77fb 100644 --- a/mysql-test/include/have_binlog_format_mixed_or_statement.inc +++ b/mysql-test/include/have_binlog_format_mixed_or_statement.inc @@ -1,3 +1,6 @@ +source include/have_log_bin.inc; + + --require r/have_binlog_format_statement.require --disable_query_log --replace_result MIXED STATEMENT diff --git a/mysql-test/include/have_binlog_format_row.inc b/mysql-test/include/have_binlog_format_row.inc index 2992b8e0f32..f24bca52b5a 100644 --- a/mysql-test/include/have_binlog_format_row.inc +++ b/mysql-test/include/have_binlog_format_row.inc @@ -1,3 +1,5 @@ +--source include/have_log_bin.inc + -- require r/have_binlog_format_row.require disable_query_log; show variables like "binlog_format"; diff --git a/mysql-test/include/have_binlog_format_statement.inc b/mysql-test/include/have_binlog_format_statement.inc index c99297c10e5..ca863293d1d 100644 --- a/mysql-test/include/have_binlog_format_statement.inc +++ b/mysql-test/include/have_binlog_format_statement.inc @@ -1,3 +1,5 @@ +--source include/have_log_bin.inc + -- require r/have_binlog_format_statement.require disable_query_log; show variables like "binlog_format"; diff --git a/mysql-test/include/is_debug_build.inc b/mysql-test/include/is_debug_build.inc deleted file mode 100644 index 23a2814e2bb..00000000000 --- a/mysql-test/include/is_debug_build.inc +++ /dev/null @@ -1,4 +0,0 @@ --- require r/is_debug_build.require ---disable_query_log -select instr(version(), "debug") > 0; ---enable_query_log diff --git a/mysql-test/include/master-slave.inc b/mysql-test/include/master-slave.inc index fe1dacb433e..e0eb87f02f7 100644 --- a/mysql-test/include/master-slave.inc +++ b/mysql-test/include/master-slave.inc @@ -1,3 +1,6 @@ +# Replication tests need binlog +source include/have_log_bin.inc; + connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,); connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,); diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index 79ba01cadb2..cc2f0e0588e 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -680,24 +680,24 @@ DROP TABLE t1,t2,t3; CREATE TABLE t1 (a int, b int); insert into t1 values (1,1),(1,2); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TABLE t2 (primary key (a)) select * from t1; # This should give warning drop table if exists t2; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1; # This should give warning drop table if exists t2; CREATE TABLE t2 (a int, b int, primary key (a)); BEGIN; INSERT INTO t2 values(100,100); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; ROLLBACK; SELECT * from t2; TRUNCATE table t2; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t2 select * from t1; SELECT * from t2; drop table t2; @@ -705,19 +705,19 @@ drop table t2; CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)); BEGIN; INSERT INTO t2 values(100,100); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; COMMIT; BEGIN; INSERT INTO t2 values(101,101); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; ROLLBACK; SELECT * from t2; TRUNCATE table t2; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t2 select * from t1; SELECT * from t2; drop table t1,t2; diff --git a/mysql-test/include/mix2.inc b/mysql-test/include/mix2.inc index 76666cb7bc0..b4c4a9b8836 100644 --- a/mysql-test/include/mix2.inc +++ b/mysql-test/include/mix2.inc @@ -96,7 +96,7 @@ INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2), update t1 set parent_id=parent_id+100; select * from t1 where parent_id=102; update t1 set id=id+1000; --- error ER_DUP_ENTRY_WITH_KEY_NAME,1022 +-- error ER_DUP_ENTRY,1022 update t1 set id=1024 where id=1009; select * from t1; update ignore t1 set id=id+1; # This will change all rows @@ -179,13 +179,13 @@ commit; select n, "after commit" from t1; commit; insert into t1 values (5); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 values (4); commit; select n, "after commit" from t1; set autocommit=1; insert into t1 values (6); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 values (4); select n from t1; set autocommit=0; @@ -259,7 +259,7 @@ drop table t1; eval CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=$engine_type; insert into t1 values ('pippo', 12); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 values ('pippo', 12); # Gives error delete from t1; delete from t1 where id = 'pippo'; @@ -390,9 +390,9 @@ eval CREATE TABLE t1 ( insert into t1 (ggid,passwd) values ('test1','xxx'); insert into t1 (ggid,passwd) values ('test2','yyy'); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 (ggid,passwd) values ('test2','this will fail'); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 (ggid,id) values ('this will fail',1); select * from t1 where ggid='test1'; @@ -401,7 +401,7 @@ select * from t1 where id=2; replace into t1 (ggid,id) values ('this will work',1); replace into t1 (ggid,passwd) values ('test2','this will work'); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY update t1 set id=100,ggid='test2' where id=1; select * from t1; select * from t1 where id=1; @@ -572,7 +572,7 @@ drop table t1; eval create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=$engine_type; insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); LOCK TABLES t1 WRITE; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values (99,1,2,'D'),(1,1,2,'D'); select id from t1; select id from t1; @@ -583,7 +583,7 @@ eval create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 c insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); LOCK TABLES t1 WRITE; begin; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values (99,1,2,'D'),(1,1,2,'D'); select id from t1; insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D'); @@ -1513,7 +1513,7 @@ eval create table t1 (rowid int not null auto_increment, val int not null,primar key (rowid), unique(val)) engine=$engine_type; replace into t1 (val) values ('1'),('2'); replace into t1 (val) values ('1'),('2'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 (val) values ('1'),('2'); select * from t1; drop table t1; @@ -1528,7 +1528,7 @@ eval create table t1 (a int not null auto_increment primary key, val int) engine insert into t1 (val) values (1); update t1 set a=2 where a=1; # We should get the following error because InnoDB does not update the counter ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 (val) values (1); select * from t1; drop table t1; @@ -1894,13 +1894,13 @@ eval create table t3 (s1 varchar(2) binary,primary key (s1)) engine=$engine_type eval create table t4 (s1 char(2) binary,primary key (s1)) engine=$engine_type; insert into t1 values (0x41),(0x4120),(0x4100); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t2 values (0x41),(0x4120),(0x4100); insert into t2 values (0x41),(0x4120); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t3 values (0x41),(0x4120),(0x4100); insert into t3 values (0x41),(0x4100); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t4 values (0x41),(0x4120),(0x4100); insert into t4 values (0x41),(0x4100); select hex(s1) from t1; diff --git a/mysql-test/include/ps_modify.inc b/mysql-test/include/ps_modify.inc index 9e38671263f..f66f888261d 100644 --- a/mysql-test/include/ps_modify.inc +++ b/mysql-test/include/ps_modify.inc @@ -193,7 +193,7 @@ prepare stmt1 from 'insert into t1 values(6, ? )'; execute stmt1 using @arg00; select a,b from t1 where b = @arg00; # the second insert fails, because the first column is primary key ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY execute stmt1 using @arg00; set @arg00=NULL ; prepare stmt1 from 'insert into t1 values(0, ? )'; @@ -272,7 +272,7 @@ execute stmt1 using @arg00, @arg01; select * from t1 order by a; set @arg00=81 ; set @arg01=1 ; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY execute stmt1 using @arg00, @arg01; ## insert, autoincrement column and ' SELECT LAST_INSERT_ID() ' diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc index b54976886bd..fdd6bc50eae 100644 --- a/mysql-test/include/query_cache.inc +++ b/mysql-test/include/query_cache.inc @@ -90,7 +90,7 @@ delete from t3 where t1_id = 1 and t2_id = 1; select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; begin; insert into t3 VALUES ( NULL, 1, 1, 2 ); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t3 VALUES ( NULL, 1, 1, 2 ); commit; select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; diff --git a/mysql-test/include/uses_vardir.inc b/mysql-test/include/uses_vardir.inc new file mode 100644 index 00000000000..950de698a43 --- /dev/null +++ b/mysql-test/include/uses_vardir.inc @@ -0,0 +1,14 @@ +# +# Some tests uses LOAD DATA with a relative path +# and need to see for example ../std_data +# +# Also if an absolute path was used, the server might be started +# with --secure-file-priv and wouldn't be allowed to LOAD a file +# outside of it's vardir anyway +# + + +if (`select LOCATE('$MYSQLTEST_VARDIR', REPLACE(@@datadir, '\\\\', '/')) != 1`) +{ + skip Need mysqld in MYSQLTEST_VARDIR; +} diff --git a/mysql-test/include/varchar.inc b/mysql-test/include/varchar.inc index 2d683a15030..15306ed8385 100644 --- a/mysql-test/include/varchar.inc +++ b/mysql-test/include/varchar.inc @@ -81,7 +81,7 @@ explain select count(*) from t1 where v between 'a' and 'a '; --replace_column 9 # explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY alter table t1 add unique(v); alter table t1 add key(v); select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a'; @@ -179,17 +179,17 @@ drop table t1; create table t1 (a char(10), unique (a)); insert into t1 values ('a '); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '); alter table t1 modify a varchar(10); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '),('a '),('a '),('a '); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '); update t1 set a='a ' where a like 'a%'; select concat(a,'.') from t1; diff --git a/mysql-test/include/wait_for_slave_io_to_stop.inc b/mysql-test/include/wait_for_slave_io_to_stop.inc new file mode 100644 index 00000000000..004f8bbbd8d --- /dev/null +++ b/mysql-test/include/wait_for_slave_io_to_stop.inc @@ -0,0 +1,33 @@ +################################################### +#Author: Jeb +#Date: 2007-06-11 +#Purpose: used for io errors on the slave. If Slave gets an io +# error, the io trhead should stop +#Details: +# 1) Fill in and setup variables +# 2) loop through looking for +# sql threads to stop +# 3) If loops too long die. +#################################################### +connection slave; +let $my_show= SHOW SLAVE STATUS; +let $sql_running= Slave_IO_Running; +let $row_number= 1; +let $run= 1; +let $counter= 300; + +while ($run) +{ + let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number); + if (`SELECT '$io_result' = 'No'`){ + let $run= 0; + } + sleep 0.1; + if (!$counter){ + --echo "Failed while waiting for slave IO thread to stop" + SHOW SLAVE STATUS; + exit; + } + dec $counter; +} + diff --git a/mysql-test/include/wait_for_slave_sql_to_stop.inc b/mysql-test/include/wait_for_slave_sql_to_stop.inc new file mode 100644 index 00000000000..ee765c81f6a --- /dev/null +++ b/mysql-test/include/wait_for_slave_sql_to_stop.inc @@ -0,0 +1,30 @@ +################################################### +#Author: Jeb +#Date: 2007-06-11 +#Purpose: used for SQL errors on the slave. If Slave gets a sql +# error, the SQL trhead should stop +#Details: +# 1) Fill in and setup variables +# 2) loop through looking for +# sql threads to stop +# 3) If loops too long die. +#################################################### +connection slave; +let $row_number= 1; +let $run= 1; +let $counter= 300; + +while ($run) +{ + let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number); + if (`SELECT '$sql_result' = 'No'`){ + let $run= 0; + } + sleep 0.1; + if (!$counter){ + --echo "Failed while waiting for slave SQL thread to stop" + SHOW SLAVE STATUS; + exit; + } + dec $counter; +} diff --git a/mysql-test/include/wait_for_slave_to_start.inc b/mysql-test/include/wait_for_slave_to_start.inc new file mode 100644 index 00000000000..84e1d646efe --- /dev/null +++ b/mysql-test/include/wait_for_slave_to_start.inc @@ -0,0 +1,35 @@ +################################################### +#Author: Jeb +#Date: 2007-06-11 +#Purpose: To wait a brief time for slave to start +#Details: +# 1) Fill in and setup variables +# 2) loop through looking for both +# io and sql threads to start +# 3) If loops too long die. +#################################################### +connection slave; +let $row_number= 1; +let $run= 1; +let $counter= 300; + +while ($run) +{ + let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number); + if (`SELECT '$io_result' = 'Yes'`){ + + let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number); + if (`SELECT '$sql_result' = 'Yes'`){ + let $run= 0; + } + } + sleep 0.1; + if (!$counter){ + --echo "Failed while waiting for slave to start" + SHOW SLAVE STATUS; + exit; + } + dec $counter; +} + + diff --git a/mysql-test/include/wait_for_slave_to_stop.inc b/mysql-test/include/wait_for_slave_to_stop.inc new file mode 100644 index 00000000000..13acbecb835 --- /dev/null +++ b/mysql-test/include/wait_for_slave_to_stop.inc @@ -0,0 +1,37 @@ +################################################### +#Author: Jeb +#Date: 2007-06-11 +#Purpose: To replace the mysqltest.c executable +# wait_for_slave_to_stop function and +# return this to the test language. +#Details: +# 1) Fill in and setup variables +# 2) loop through looking for both +# io and sql threads to stop +# 3) If loops too long die. +#################################################### +connection slave; +let $row_number= 1; +let $run= 1; +let $counter= 300; + +while ($run) +{ + let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number); + if (`SELECT '$io_result' = 'No'`){ + + let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number); + if (`SELECT '$sql_result' = 'No'`){ + let $run= 0; + } + } + sleep 0.1; + if (!$counter){ + --echo "Failed while waiting for slave to stop" + SHOW SLAVE STATUS; + exit; + } + dec $counter; +} + + diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index d3db3471e1e..11ff85818a7 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -596,6 +596,25 @@ sub collect_one_test_case($$$$$$$) { } } + if ( $tinfo->{'need_binlog'} ) + { + if (grep(/^--skip-log-bin/, @::opt_extra_mysqld_opt) ) + { + $tinfo->{'skip'}= 1; + $tinfo->{'comment'}= "Test need binlog"; + return; + } + } + else + { + if ( $::mysql_version_id >= 50100 ) + { + # Test does not need binlog, add --skip-binlog to + # the options used when starting it + push(@{$tinfo->{'master_opt'}}, "--skip-log-bin"); + } + } + } } @@ -606,6 +625,7 @@ our @tags= ( ["include/have_innodb.inc", "innodb_test", 1], ["include/have_binlog_format_row.inc", "binlog_format", "row"], + ["include/have_log_bin.inc", "need_binlog", 1], ["include/have_binlog_format_statement.inc", "binlog_format", "statement"], ["include/have_binlog_format_mixed.inc", "binlog_format", "mixed"], ["include/big_test.inc", "big_test", 1], diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index dc272d79cdb..a14acd37b65 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -771,7 +771,7 @@ sub command_line_setup () { # Find out type of logging that are being used # -------------------------------------------------------------------------- # NOTE if the default binlog format is changed, this has to be changed - $used_binlog_format= "stmt"; + $used_binlog_format= "statement"; if (!$opt_extern && $mysql_version_id >= 50100 ) { $used_binlog_format= "mixed"; # Default value for binlog format @@ -912,6 +912,9 @@ sub command_line_setup () { $opt_skip_ndbcluster= 1; # Turn off use of NDB cluster $opt_skip_ssl= 1; # Turn off use of SSL + # Turn off use of bin log + push(@opt_extra_mysqld_opt, "--skip-log-bin"); + if ( $opt_extern ) { mtr_error("Can't use --extern with --embedded-server"); diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index f570f6eb75c..e73b74ccac3 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -285,7 +285,7 @@ ERROR 23000: Duplicate entry '3' for key 'PRIMARY' show warnings; Level Code Message Note 1050 Table 't1' already exists -Error 1582 Duplicate entry '3' for key 'PRIMARY' +Error 1062 Duplicate entry '3' for key 'PRIMARY' show status like "Opened_tables"; Variable_name Value Opened_tables 2 diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 62eeb4b2fbf..11717679b42 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -1,15 +1,13 @@ drop table if exists t1; -SHOW GLOBAL VARIABLES WHERE Variable_name LIKE "%_format%" AND Variable_name != "binlog_format"; +SHOW GLOBAL VARIABLES LIKE "%e_format"; Variable_name Value date_format %d.%m.%Y datetime_format %Y-%m-%d %H:%i:%s -default_week_format 0 time_format %H.%i.%s -SHOW SESSION VARIABLES WHERE Variable_name LIKE "%_format%" AND Variable_name != "binlog_format"; +SHOW SESSION VARIABLES LIKE "%e_format"; Variable_name Value date_format %d.%m.%Y datetime_format %Y-%m-%d %H:%i:%s -default_week_format 0 time_format %H.%i.%s SET time_format='%H%i%s'; SET time_format='%H:%i:%s.%f'; @@ -28,11 +26,10 @@ set datetime_format= '%H:%i:%s %Y-%m-%d'; set datetime_format= '%H:%i:%s.%f %m-%d-%Y'; set datetime_format= '%h:%i:%s %p %Y-%m-%d'; set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d'; -SHOW SESSION VARIABLES WHERE Variable_name LIKE "%format" AND Variable_name != "binlog_format"; +SHOW SESSION VARIABLES LIKE "%e_format"; Variable_name Value date_format %m-%d-%Y datetime_format %h:%i:%s.%f %p %Y-%m-%d -default_week_format 0 time_format %h:%i:%s%p SET time_format='%h:%i:%s'; ERROR 42000: Variable 'time_format' can't be set to the value of '%h:%i:%s' diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 498a38d863b..54b29353fb8 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -432,37 +432,40 @@ insert into t2 values(13491727406643098568), (0x8000000400000001), (0x8000004000000001), (0x8000040000000001); -SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42); +SELECT HEX(a) FROM t2 WHERE a IN +(CAST(0xBB3C3E98175D33C8 AS UNSIGNED), +42); HEX(a) BB3C3E98175D33C8 SELECT HEX(a) FROM t2 WHERE a IN -(0xBB3C3E98175D33C8, -0x7fffffffffffffff, -0x8000000000000000, -0x8000000000000400, -0x8000000000000401, +(CAST(0xBB3C3E98175D33C8 AS UNSIGNED), +CAST(0x7fffffffffffffff AS UNSIGNED), +CAST(0x8000000000000000 AS UNSIGNED), +CAST(0x8000000000000400 AS UNSIGNED), +CAST(0x8000000000000401 AS UNSIGNED), 42); HEX(a) BB3C3E98175D33C8 -7FFFFFFFFFFFFEFF -7FFFFFFFFFFFFFEF -7FFFFFFFFFFFFFFE 7FFFFFFFFFFFFFFF 8000000000000000 -8000000000000001 -8000000000000002 -8000000000000300 8000000000000400 8000000000000401 -SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001); +SELECT HEX(a) FROM t2 WHERE a IN +(CAST(0x7fffffffffffffff AS UNSIGNED), +CAST(0x8000000000000001 AS UNSIGNED)); HEX(a) 7FFFFFFFFFFFFFFF 8000000000000001 -SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff); +SELECT HEX(a) FROM t2 WHERE a IN +(CAST(0x7ffffffffffffffe AS UNSIGNED), +CAST(0x7fffffffffffffff AS UNSIGNED)); HEX(a) 7FFFFFFFFFFFFFFE 7FFFFFFFFFFFFFFF -SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc'); +SELECT HEX(a) FROM t2 WHERE a IN +(0x7ffffffffffffffe, +0x7fffffffffffffff, +'abc'); HEX(a) 7FFFFFFFFFFFFFFE 7FFFFFFFFFFFFFFF diff --git a/mysql-test/r/long_tmpdir.result b/mysql-test/r/long_tmpdir.result new file mode 100644 index 00000000000..7e6dd34ced1 --- /dev/null +++ b/mysql-test/r/long_tmpdir.result @@ -0,0 +1,3 @@ +create view v1 as select table_name from information_schema.tables; +drop view v1; +End of 5.0 tests diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 090ee4b7734..5d985d053fc 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1235,6 +1235,20 @@ aaa 2 drop table t1; create table t1 (s1 bigint) partition by list (s1) (partition p1 values in (-9223372036854775808)); drop table t1; +create table t1(a int auto_increment, b int, primary key (b, a)) +partition by hash(b) partitions 2; +insert into t1 values (null, 1); +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 10 Fixed 1 9 9 0 0 0 1 NULL NULL NULL latin1_swedish_ci NULL partitioned +drop table t1; +create table t1(a int auto_increment primary key) +partition by key(a) partitions 2; +insert into t1 values (null), (null), (null); +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 10 Fixed 3 7 21 0 0 0 4 NULL NULL NULL latin1_swedish_ci NULL partitioned +drop table t1; CREATE TABLE t1(a INT NOT NULL, b TINYBLOB, KEY(a)) PARTITION BY RANGE(a) ( PARTITION p0 VALUES LESS THAN (32)); INSERT INTO t1 VALUES (1, REPEAT('a', 10)); diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index 6dc3be94e32..208c46c5fab 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -107,7 +107,7 @@ call foo4(); ERROR 23000: Duplicate entry '20' for key 'a' show warnings; Level Code Message -Error 1582 Duplicate entry '20' for key 'a' +Error 1062 Duplicate entry '20' for key 'a' select * from t2; a 20 @@ -241,7 +241,7 @@ return 10; end| do fn1(100); Warnings: -Error 1582 Duplicate entry '100' for key 'a' +Error 1062 Duplicate entry '100' for key 'a' select fn1(20); ERROR 23000: Duplicate entry '20' for key 'a' select * from t2; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 86ede7a8f00..6c0330537ca 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -1497,10 +1497,10 @@ insert into t3 (a) values (1)| create procedure h_ee() deterministic begin -declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME +declare continue handler for 1062 -- ER_DUP_ENTRY select 'Outer (bad)' as 'h_ee'; begin -declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME +declare continue handler for 1062 -- ER_DUP_ENTRY select 'Inner (good)' as 'h_ee'; insert into t3 values (1); end; @@ -1508,7 +1508,7 @@ end| create procedure h_es() deterministic begin -declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME +declare continue handler for 1062 -- ER_DUP_ENTRY select 'Outer (good)' as 'h_es'; begin -- integrity constraint violation @@ -1545,7 +1545,7 @@ end| create procedure h_ex() deterministic begin -declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME +declare continue handler for 1062 -- ER_DUP_ENTRY select 'Outer (good)' as 'h_ex'; begin declare continue handler for sqlexception @@ -1560,7 +1560,7 @@ begin declare continue handler for sqlstate '23000' select 'Outer (bad)' as 'h_se'; begin -declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME +declare continue handler for 1062 -- ER_DUP_ENTRY select 'Inner (good)' as 'h_se'; insert into t3 values (1); end; @@ -1700,7 +1700,7 @@ begin declare continue handler for sqlexception select 'Outer (bad)' as 'h_xe'; begin -declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME +declare continue handler for 1062 -- ER_DUP_ENTRY select 'Inner (good)' as 'h_xe'; insert into t3 values (1); end; @@ -4705,10 +4705,10 @@ insert into t3 values (1)| create procedure bug15011() deterministic begin -declare continue handler for 1582 +declare continue handler for 1062 select 'Outer' as 'Handler'; begin -declare continue handler for 1582 +declare continue handler for 1062 select 'Inner' as 'Handler'; insert into t3 values (1); end; diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result index 51d131f0044..0a32b3b3fcd 100644 --- a/mysql-test/r/view_grant.result +++ b/mysql-test/r/view_grant.result @@ -603,9 +603,9 @@ Warnings: Note 1449 There is no 'no-such-user'@'localhost' registered SHOW CREATE VIEW v; View Create View -v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `t1`.`a` AS `a` from `t1` +v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `test`.`t1`.`a` AS `a` from `t1` Warnings: -Note 1449 There is no 'no-such-user'@'localhost' registered +Warning 1356 View 'test.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them SELECT * FROM v; ERROR HY000: There is no 'no-such-user'@'localhost' registered DROP VIEW v; @@ -889,23 +889,23 @@ Warnings: Note 1449 There is no 'no_such'@'user_1' registered SHOW CREATE VIEW v1; View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` Warnings: -Note 1449 There is no 'no_such'@'user_1' registered +Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1; SHOW CREATE VIEW v1; View Create View -v1 CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +v1 CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` Warnings: -Note 1449 There is no 'no_such'@'user_1' registered +Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1; Warnings: Note 1449 There is no 'no_such'@'user_2' registered SHOW CREATE VIEW v1; View Create View -v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`no_such`@`user_2` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`no_such`@`user_2` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` Warnings: -Note 1449 There is no 'no_such'@'user_2' registered +Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them DROP VIEW v1; DROP TABLE t1; End of 5.1 tests. diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index f9a4a49d447..99e9b783d55 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -101,10 +101,10 @@ insert into t1 set i = 254; insert into t1 set i = null; select last_insert_id(); explain extended select last_insert_id(); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 set i = 254; select last_insert_id(); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 set i = null; select last_insert_id(); drop table t1; @@ -122,7 +122,7 @@ insert into t1 values (NULL, 10); select last_insert_id(); insert into t1 values (NULL, 15); select last_insert_id(); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values (NULL, 10); select last_insert_id(); @@ -277,7 +277,7 @@ create table t1 (rowid int not null auto_increment, val int not null,primary key (rowid), unique(val)); replace into t1 (val) values ('1'),('2'); replace into t1 (val) values ('1'),('2'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 (val) values ('1'),('2'); select * from t1; drop table t1; @@ -300,7 +300,7 @@ drop table t1; CREATE TABLE t1 (t1 INT(10) PRIMARY KEY, t2 INT(10)); INSERT INTO t1 VALUES(0, 0); INSERT INTO t1 VALUES(1, 1); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY ALTER TABLE t1 CHANGE t1 t1 INT(10) auto_increment; DROP TABLE t1; diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index d737e292bb1..0b4b9b84094 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -1,3 +1,8 @@ + +# The server need to be started in $MYSQLTEST_VARDIR since it +# uses ../std_data_ln/ +-- source include/uses_vardir.inc + # # This test is a bit tricky as we can't use backup table to overwrite an old # table diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index fb589a5d11e..149982e23c5 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -153,7 +153,7 @@ drop table if exists t1,t2; CREATE TABLE t1 (a int not null); INSERT INTO t1 values (1),(2),(1); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TABLE t2 (primary key(a)) SELECT * FROM t1; --error 1146 SELECT * from t2; @@ -232,7 +232,7 @@ insert into t1 values (1,1); create table if not exists t1 select 2; select * from t1; create table if not exists t1 select 3 as 'a',4 as 'b'; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY create table if not exists t1 select 3 as 'a',3 as 'b'; show warnings; show status like "Opened_tables"; @@ -698,7 +698,7 @@ create table t1 (a int); create table if not exists t1 select 1 as a, 2 as b; drop table t1; # Finally error which happens during insert ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY create table t1 (primary key (a)) (select 1 as a) union all (select 1 as a); # What happens if table already exists ? create table t1 (i int); @@ -712,7 +712,7 @@ create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1 select * from t1; # Error which happens during insertion of rows alter table t1 add primary key (i); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY create table if not exists t1 (select 2 as i) union all (select 2 as i); select * from t1; drop table t1; @@ -798,30 +798,30 @@ drop table t1; CREATE TABLE t1 (a int, b int); insert into t1 values (1,1),(1,2); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TABLE t2 (primary key (a)) select * from t1; # This should give warning drop table if exists t2; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1; # This should give warning drop table if exists t2; CREATE TABLE t2 (a int, b int, primary key (a)); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; TRUNCATE table t2; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t2 select * from t1; SELECT * from t2; drop table t2; CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; TRUNCATE table t2; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t2 select * from t1; SELECT * from t2; drop table t1,t2; diff --git a/mysql-test/t/create_select_tmp.test b/mysql-test/t/create_select_tmp.test index eacea1ac376..a61f9f2466c 100644 --- a/mysql-test/t/create_select_tmp.test +++ b/mysql-test/t/create_select_tmp.test @@ -14,19 +14,19 @@ drop table if exists t1, t2; --enable_warnings CREATE TABLE t1 ( a int ); INSERT INTO t1 VALUES (1),(2),(1); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1; --error 1146 select * from t2; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1; --error 1146 select * from t2; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1; --error 1146 select * from t2; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1; --error 1146 select * from t2; diff --git a/mysql-test/t/ctype_ucs2_def.test b/mysql-test/t/ctype_ucs2_def.test index dcd8af0bbe1..050710b208b 100644 --- a/mysql-test/t/ctype_ucs2_def.test +++ b/mysql-test/t/ctype_ucs2_def.test @@ -25,7 +25,7 @@ CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL, col2 VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL, UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY; INSERT INTO t1 VALUES('A', 'A'), ('B', 'B'), ('C', 'C'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t1 VALUES('A ', 'A '); DROP TABLE t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 7db651a2a24..03b3df44c73 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -230,9 +230,9 @@ drop table t2; create table t1 (c varchar(30) character set utf8, unique(c(10))); insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); insert into t1 values ('aaaaaaaaaa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaaaaaaaaaa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaaaaaaaaaaa'); insert into t1 values (repeat('b',20)); select c c1 from t1 where c='1'; @@ -254,9 +254,9 @@ create table t1 (c varchar(30) character set utf8, unique(c(10))) engine=innodb; --enable_warnings insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); insert into t1 values ('aaaaaaaaaa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaaaaaaaaaa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaaaaaaaaaaa'); insert into t1 values (repeat('b',20)); select c c1 from t1 where c='1'; @@ -276,23 +276,23 @@ create table t1 (c char(3) character set utf8, unique (c(2))); insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); insert into t1 values ('a'); insert into t1 values ('aa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaa'); insert into t1 values ('b'); insert into t1 values ('bb'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('bbb'); insert into t1 values ('а'); insert into t1 values ('аа'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ааа'); insert into t1 values ('б'); insert into t1 values ('бб'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ббб'); insert into t1 values ('ꪪ'); insert into t1 values ('ꪪꪪ'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ꪪꪪꪪ'); drop table t1; # @@ -305,23 +305,23 @@ create table t1 (c char(3) character set utf8, unique (c(2))) engine=innodb; insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); insert into t1 values ('a'); insert into t1 values ('aa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaa'); insert into t1 values ('b'); insert into t1 values ('bb'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('bbb'); insert into t1 values ('а'); insert into t1 values ('аа'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ааа'); insert into t1 values ('б'); insert into t1 values ('бб'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ббб'); insert into t1 values ('ꪪ'); insert into t1 values ('ꪪꪪ'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ꪪꪪꪪ'); drop table t1; # @@ -334,14 +334,14 @@ unique key a using hash (c(1)) ) engine=heap; show create table t1; insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaa'); insert into t1 values ('б'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('бб'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ббб'); select c as c_all from t1 order by c; select c as c_a from t1 where c='a'; @@ -358,14 +358,14 @@ unique key a using btree (c(1)) ) engine=heap; show create table t1; insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaa'); insert into t1 values ('б'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('бб'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ббб'); select c as c_all from t1 order by c; select c as c_a from t1 where c='a'; @@ -383,14 +383,14 @@ unique key a (c(1)) ) engine=innodb; --enable_warnings insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaa'); insert into t1 values ('б'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('бб'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ббб'); select c as c_all from t1 order by c; select c as c_a from t1 where c='a'; @@ -404,9 +404,9 @@ drop table t1; create table t1 (c varchar(30) character set utf8 collate utf8_bin, unique(c(10))); insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); insert into t1 values ('aaaaaaaaaa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaaaaaaaaaa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaaaaaaaaaaa'); insert into t1 values (repeat('b',20)); select c c1 from t1 where c='1'; @@ -427,23 +427,23 @@ create table t1 (c char(3) character set utf8 collate utf8_bin, unique (c(2))); insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); insert into t1 values ('a'); insert into t1 values ('aa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaa'); insert into t1 values ('b'); insert into t1 values ('bb'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('bbb'); insert into t1 values ('а'); insert into t1 values ('аа'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ааа'); insert into t1 values ('б'); insert into t1 values ('бб'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ббб'); insert into t1 values ('ꪪ'); insert into t1 values ('ꪪꪪ'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ꪪꪪꪪ'); drop table t1; @@ -457,14 +457,14 @@ unique key a using hash (c(1)) ) engine=heap; show create table t1; insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaa'); insert into t1 values ('б'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('бб'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ббб'); select c as c_all from t1 order by c; select c as c_a from t1 where c='a'; @@ -481,14 +481,14 @@ unique key a using btree (c(1)) ) engine=heap; show create table t1; insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaa'); insert into t1 values ('б'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('бб'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ббб'); select c as c_all from t1 order by c; select c as c_a from t1 where c='a'; @@ -506,14 +506,14 @@ unique key a (c(1)) ) engine=innodb; --enable_warnings insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('aaa'); insert into t1 values ('б'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('бб'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('ббб'); select c as c_all from t1 order by c; select c as c_a from t1 where c='a'; diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index a121439c12e..abf09942d1c 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -6,8 +6,10 @@ drop table if exists t1; --enable_warnings -SHOW GLOBAL VARIABLES WHERE Variable_name LIKE "%_format%" AND Variable_name != "binlog_format"; -SHOW SESSION VARIABLES WHERE Variable_name LIKE "%_format%" AND Variable_name != "binlog_format"; +--replace_result ROW <format> STATEMENT <format> MIXED <format> +SHOW GLOBAL VARIABLES LIKE "%e_format"; +--replace_result ROW <format> STATEMENT <format> MIXED <format> +SHOW SESSION VARIABLES LIKE "%e_format"; # # Test setting a lot of different formats to see which formats are accepted and @@ -34,7 +36,8 @@ set datetime_format= '%H:%i:%s.%f %m-%d-%Y'; set datetime_format= '%h:%i:%s %p %Y-%m-%d'; set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d'; -SHOW SESSION VARIABLES WHERE Variable_name LIKE "%format" AND Variable_name != "binlog_format"; +--replace_result ROW <format> STATEMENT <format> MIXED <format> +SHOW SESSION VARIABLES LIKE "%e_format"; --error 1231 SET time_format='%h:%i:%s'; diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index a44288da9ec..396c06f43e7 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -184,7 +184,7 @@ INSERT INTO t1 VALUES( 49, 71), (NULL, 72), (NULL, 73); INSERT INTO t1 VALUES(NULL, 81), (NULL, 82), (NULL, 83); # Create a duplicate value. SET insert_id= 114; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t1 VALUES(NULL, 91); INSERT INTO t1 VALUES (NULL, 92), (NULL, 93); # Check what we have now diff --git a/mysql-test/t/flush_block_commit_notembedded.test b/mysql-test/t/flush_block_commit_notembedded.test index 25eb093226e..4a0300acf78 100644 --- a/mysql-test/t/flush_block_commit_notembedded.test +++ b/mysql-test/t/flush_block_commit_notembedded.test @@ -6,7 +6,7 @@ -- source include/have_log_bin.inc # And it requires InnoDB --- source include/not_embedded.inc +-- source include/have_log_bin.inc -- source include/have_innodb.inc connect (con1,localhost,root,,); diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index e9583f982ff..2c5ed6a22d3 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -336,19 +336,28 @@ insert into t2 values(13491727406643098568), (0x8000004000000001), (0x8000040000000001); -SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42); +SELECT HEX(a) FROM t2 WHERE a IN + (CAST(0xBB3C3E98175D33C8 AS UNSIGNED), + 42); SELECT HEX(a) FROM t2 WHERE a IN -(0xBB3C3E98175D33C8, - 0x7fffffffffffffff, - 0x8000000000000000, - 0x8000000000000400, - 0x8000000000000401, - 42); - -SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001); -SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff); -SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc'); + (CAST(0xBB3C3E98175D33C8 AS UNSIGNED), + CAST(0x7fffffffffffffff AS UNSIGNED), + CAST(0x8000000000000000 AS UNSIGNED), + CAST(0x8000000000000400 AS UNSIGNED), + CAST(0x8000000000000401 AS UNSIGNED), + 42); + +SELECT HEX(a) FROM t2 WHERE a IN + (CAST(0x7fffffffffffffff AS UNSIGNED), + CAST(0x8000000000000001 AS UNSIGNED)); +SELECT HEX(a) FROM t2 WHERE a IN + (CAST(0x7ffffffffffffffe AS UNSIGNED), + CAST(0x7fffffffffffffff AS UNSIGNED)); +SELECT HEX(a) FROM t2 WHERE a IN + (0x7ffffffffffffffe, + 0x7fffffffffffffff, + 'abc'); CREATE TABLE t3 (a BIGINT UNSIGNED); INSERT INTO t3 VALUES (9223372036854775551); diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index b47a5fc2033..3f91b9966e7 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -128,7 +128,7 @@ SELECT * FROM t1 WHERE b=NULL; explain SELECT * FROM t1 WHERE b IS NULL; SELECT * FROM t1 WHERE b<=>NULL; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t1 VALUES (1,3); DROP TABLE t1; @@ -270,7 +270,7 @@ explain select count(*) from t1 where v like 'a%'; explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY alter table t1 add unique(v); select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*')); explain select * from t1 where v='a'; @@ -296,17 +296,17 @@ drop table t1; create table t1 (a char(10), unique (a)); insert into t1 values ('a'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '); alter table t1 modify a varchar(10); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '),('a '),('a '),('a '); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '); update t1 set a='a ' where a like 'a '; update t1 set a='a ' where a like 'a '; @@ -357,7 +357,7 @@ explain select count(*) from t1 where v between 'a' and 'a '; --replace_column 9 # explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY alter table t1 add unique(v); select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*')); # Number of rows is not constant for b-trees keys @@ -372,17 +372,17 @@ drop table t1; create table t1 (a char(10), unique using btree (a)) engine=heap; insert into t1 values ('a'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '); alter table t1 modify a varchar(10); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '),('a '),('a '),('a '); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ('a '); update t1 set a='a ' where a like 'a '; update t1 set a='a ' where a like 'a '; @@ -432,7 +432,7 @@ create table t1 (a int not null, b int not null auto_increment, # create table t1 (c char(255), primary key(c(90))); insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); drop table t1; diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test index 4e7102806d6..0e8cc71dab5 100644 --- a/mysql-test/t/heap_btree.test +++ b/mysql-test/t/heap_btree.test @@ -143,7 +143,7 @@ SELECT * FROM t1 WHERE b=NULL; explain SELECT * FROM t1 WHERE b IS NULL; SELECT * FROM t1 WHERE b<=>NULL; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t1 VALUES (1,3); DROP TABLE t1; diff --git a/mysql-test/t/heap_hash.test b/mysql-test/t/heap_hash.test index 3b9262e73f1..1e3491f89a9 100644 --- a/mysql-test/t/heap_hash.test +++ b/mysql-test/t/heap_hash.test @@ -128,7 +128,7 @@ SELECT * FROM t1 WHERE b=NULL; explain SELECT * FROM t1 WHERE b IS NULL; SELECT * FROM t1 WHERE b<=>NULL; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t1 VALUES (1,3); DROP TABLE t1; @@ -272,14 +272,14 @@ CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, col2 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY; INSERT INTO t1 VALUES('A', 'A'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t1 VALUES('A ', 'A '); DROP TABLE t1; CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, col2 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY; INSERT INTO t1 VALUES('A', 'A'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t1 VALUES('A ', 'A '); DROP TABLE t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 439a7adc669..92714492dcf 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -13,6 +13,7 @@ -- source include/not_embedded.inc -- source include/have_innodb.inc +-- source include/have_log_bin.inc # # Small basic test with ignore @@ -53,7 +54,7 @@ INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2), update t1 set parent_id=parent_id+100; select * from t1 where parent_id=102; update t1 set id=id+1000; --- error ER_DUP_ENTRY_WITH_KEY_NAME,1022 +-- error ER_DUP_ENTRY,1022 update t1 set id=1024 where id=1009; select * from t1; update ignore t1 set id=id+1; # This will change all rows @@ -134,13 +135,13 @@ commit; select n, "after commit" from t1; commit; insert into t1 values (5); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 values (4); commit; select n, "after commit" from t1; set autocommit=1; insert into t1 values (6); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 values (4); select n from t1; set autocommit=0; @@ -214,7 +215,7 @@ drop table t1; CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb; insert into t1 values ('pippo', 12); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 values ('pippo', 12); # Gives error delete from t1; delete from t1 where id = 'pippo'; @@ -342,9 +343,9 @@ CREATE TABLE t1 ( insert into t1 (ggid,passwd) values ('test1','xxx'); insert into t1 (ggid,passwd) values ('test2','yyy'); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 (ggid,passwd) values ('test2','this will fail'); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 (ggid,id) values ('this will fail',1); select * from t1 where ggid='test1'; @@ -353,7 +354,7 @@ select * from t1 where id=2; replace into t1 (ggid,id) values ('this will work',1); replace into t1 (ggid,passwd) values ('test2','this will work'); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY update t1 set id=100,ggid='test2' where id=1; select * from t1; select * from t1 where id=1; @@ -524,7 +525,7 @@ drop table t1; create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb; insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); LOCK TABLES t1 WRITE; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values (99,1,2,'D'),(1,1,2,'D'); select id from t1; select id from t1; @@ -535,7 +536,7 @@ create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(3 insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); LOCK TABLES t1 WRITE; begin; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values (99,1,2,'D'),(1,1,2,'D'); select id from t1; insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D'); @@ -1408,7 +1409,7 @@ create table t1 (rowid int not null auto_increment, val int not null,primary key (rowid), unique(val)) engine=innodb; replace into t1 (val) values ('1'),('2'); replace into t1 (val) values ('1'),('2'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 (val) values ('1'),('2'); select * from t1; drop table t1; @@ -1421,7 +1422,7 @@ create table t1 (a int not null auto_increment primary key, val int) engine=Inno insert into t1 (val) values (1); update t1 set a=2 where a=1; # We should get the following error because InnoDB does not update the counter ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 (val) values (1); select * from t1; drop table t1; @@ -1744,13 +1745,13 @@ create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb; create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb; insert into t1 values (0x41),(0x4120),(0x4100); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t2 values (0x41),(0x4120),(0x4100); insert into t2 values (0x41),(0x4120); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t3 values (0x41),(0x4120),(0x4100); insert into t3 values (0x41),(0x4100); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t4 values (0x41),(0x4120),(0x4100); insert into t4 values (0x41),(0x4100); select hex(s1) from t1; diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 95a55b732c5..655b43d65ad 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -10,7 +10,7 @@ create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLI insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12); create table t2 (payoutID SMALLINT UNSIGNED NOT NULL PRIMARY KEY); insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t2 (payoutID) SELECT payoutID+10 FROM t1; insert ignore into t2 (payoutID) SELECT payoutID+10 FROM t1; select * from t2; @@ -101,7 +101,7 @@ create table t1 (a int not null primary key, b char(10)); create table t2 (a int not null, b char(10)); insert into t1 values (1,"t1:1"),(3,"t1:3"); insert into t2 values (2,"t2:2"), (3,"t2:3"); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 select * from t2; select * from t1; # REPLACE .. SELECT is not yet supported by PS diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index e7afc896586..67f21731afe 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -12,7 +12,7 @@ INSERT t1 VALUES (8,4,50) ON DUPLICATE KEY UPDATE c=c+1000; SELECT * FROM t1; INSERT t1 VALUES (1,4,60) ON DUPLICATE KEY UPDATE c=c+10000; SELECT * FROM t1; --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY INSERT t1 VALUES (1,9,70) ON DUPLICATE KEY UPDATE c=c+100000, b=4; SELECT * FROM t1; TRUNCATE TABLE t1; @@ -63,7 +63,7 @@ INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000; SELECT * FROM t1; INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000; SELECT * FROM t1; --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4; SELECT * FROM t1; TRUNCATE TABLE t1; diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index 708a618f10f..35aec71ebb8 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -97,7 +97,7 @@ WHERE t1.uniq_id = 4 ORDER BY t2.c_amount; INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes'); INSERT INTO t2 VALUES (7,3,1000,2000,0,0,746294,937484,'yes'); diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 99736e0f11f..f1eb8e68b49 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -150,7 +150,7 @@ create table t1 ); INSERT INTO t1 VALUES (1, 1, 1, 1, 'a'); INSERT INTO t1 VALUES (1, 1, 1, 1, 'b'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t1 VALUES (1, 1, 1, 1, 'a'); drop table t1; @@ -243,13 +243,13 @@ show create table t1; insert t1 values ('cccc', 'tttt'), (0xD0B1212223D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1212223D0B1D0B1D0B1D0B1), (0xD0B1222123D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1222123D0B1D0B1D0B1D0B1); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert t1 (c) values ('cc22'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert t1 (t) values ('ttt22'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert t1 (c) values (0xD0B1212322D0B1D0B1D0B1D0B1D0B1); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert t1 (t) values (0xD0B1D0B1212322D0B1D0B1D0B1D0B1); select c from t1 where c='cccc'; select t from t1 where t='tttt'; @@ -438,7 +438,7 @@ insert into t1 values(1, 'b', 'b', NULL); # Drop some indexes for new adds. alter table t1 drop index i3, drop index i2, drop index i1; # Add indexes, one is unique on non-unique values. ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY alter table t1 add index i3 (c3), add index i2 (c2), add unique index i1 (c1); drop table t1; diff --git a/mysql-test/t/long_tmpdir-master.opt b/mysql-test/t/long_tmpdir-master.opt new file mode 100644 index 00000000000..398abfc4632 --- /dev/null +++ b/mysql-test/t/long_tmpdir-master.opt @@ -0,0 +1 @@ +--tmpdir=$MYSQLTEST_VARDIR/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789 diff --git a/mysql-test/t/long_tmpdir-master.sh b/mysql-test/t/long_tmpdir-master.sh new file mode 100644 index 00000000000..318955fbcca --- /dev/null +++ b/mysql-test/t/long_tmpdir-master.sh @@ -0,0 +1,3 @@ +d="$MYSQLTEST_VARDIR/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789" +test -d "$d" || mkdir "$d" +rm -f "$d"/* diff --git a/mysql-test/t/long_tmpdir.test b/mysql-test/t/long_tmpdir.test new file mode 100644 index 00000000000..cf0bed29918 --- /dev/null +++ b/mysql-test/t/long_tmpdir.test @@ -0,0 +1,9 @@ +# +# Bug #29015: Stack overflow in processing temporary table name when tmpdir path +# is long +# + +create view v1 as select table_name from information_schema.tables; +drop view v1; + +--echo End of 5.0 tests diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 69e0b19ebf0..e136dc0ca3c 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -195,9 +195,9 @@ select * from t6 order by a,b; insert into t1 values (99,NULL); select * from t4 where a+0 > 90; # bug#4008 - cannot determine a unique key that caused "dupl. key error" ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert t5 values (1,1); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert t6 values (2,1); insert t5 values (1,1) on duplicate key update b=b+10; insert t6 values (2,1) on duplicate key update b=b+20; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index e66534f0cb9..b06fd536f45 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -453,9 +453,9 @@ create table t1 (a int not null auto_increment primary key, b text not null, uni insert into t1 (b) values ('a'),('b'),('c'); select concat(b,'.') from t1; update t1 set b='b ' where a=2; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY update t1 set b='b ' where a > 1; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 (b) values ('b'); select * from t1; delete from t1 where b='b'; diff --git a/mysql-test/t/mysqlbinlog-cp932.test b/mysql-test/t/mysqlbinlog-cp932.test index 5a5b7646cf4..4ca0eedaece 100644 --- a/mysql-test/t/mysqlbinlog-cp932.test +++ b/mysql-test/t/mysqlbinlog-cp932.test @@ -3,6 +3,7 @@ -- source include/have_binlog_format_mixed_or_statement.inc -- source include/have_cp932.inc +-- source include/have_log_bin.inc # Bug#16217 (mysql client did not know how not switch its internal charset) flush logs; diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index f4785baa9db..39a84304ebd 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -4,9 +4,6 @@ -- source include/have_log_bin.inc -# Embedded server doesn't support binlogging --- source include/not_embedded.inc - # we need this for getting fixed timestamps inside of this test set timestamp=1000000000; diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index ac647f772b1..9e56b7a07c7 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -4,8 +4,6 @@ # TODO: Need to look at making row based version once new binlog client is complete. -- source include/have_binlog_format_mixed_or_statement.inc -# Embedded server doesn't support binlogging --- source include/not_embedded.inc --disable_warnings drop table if exists t1; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index ca8d6a47fa2..0f1fee453a5 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1,5 +1,6 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc +--source include/have_log_bin.inc # Binlog is required --source include/have_log_bin.inc diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index 870c7435d3e..c4fbbaaef66 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -767,7 +767,7 @@ drop table t1,t2; # insert ignore create table t1 (a int not null primary key, b int not null) engine=ndb; insert into t1 values (1,10), (2,20), (3,30); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 set a=1, b=100; insert ignore into t1 set a=1, b=100; select * from t1 order by a; @@ -780,12 +780,12 @@ create table t1 (a int not null primary key, b int not null) engine=ndb; create table t2 (c int not null primary key, d int not null) engine=ndb; insert into t1 values (1,10), (2,10), (3,30), (4, 30); insert into t2 values (1,10), (2,10), (3,30), (4, 30); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY update t1 set a = 1 where a = 3; select * from t1 order by a; update t1 set b = 1 where a > 1 order by a desc limit 1; select * from t1 order by a; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY update t1,t2 set a = 1, c = 1 where a = 3 and c = 3; select * from t1 order by a; update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3; diff --git a/mysql-test/t/ndb_charset.test b/mysql-test/t/ndb_charset.test index 2cdb1972225..2d9f66564bc 100644 --- a/mysql-test/t/ndb_charset.test +++ b/mysql-test/t/ndb_charset.test @@ -38,9 +38,9 @@ create table t1 ( # ok insert into t1 values('aAa'); # fail ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values('aaa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values('AAA'); # 1 select * from t1 order by a; @@ -61,9 +61,9 @@ create table t1 ( ) engine=ndb; # insert into t1 values ('A'),('b '),('C '),('d '),('E'),('f'); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 values('b'); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 values('a '); # select a,length(a) from t1 order by a; @@ -106,9 +106,9 @@ create table t1 ( # ok insert into t1 values(1, 'aAa'); # fail ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values(2, 'aaa'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values(3, 'AAA'); # 1 select * from t1 order by p; @@ -131,9 +131,9 @@ create table t1 ( ) engine=ndb; # insert into t1 values (1,'A'),(2,'b '),(3,'C '),(4,'d '),(5,'E'),(6,'f'); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 values(99,'b'); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 values(99,'a '); # select a,length(a) from t1 order by a; @@ -231,7 +231,7 @@ drop table t1; # ('a','A '),('B ','b'),('c','C '),('D','d'),('e ','E'),('F','f '), # ('A','b '),('b ','C'),('C','d '),('d','E'),('E ','f'), # ('a','C '),('B ','d'),('c','E '),('D','f'); -#-- error ER_DUP_ENTRY_WITH_KEY_NAME +#-- error ER_DUP_ENTRY #insert into t1 values('d','f'); # #select a,b,length(a),length(b) from t1 order by a,b limit 3; diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test index e6d3fbb87a0..78757c3bcf7 100644 --- a/mysql-test/t/ndb_index_unique.test +++ b/mysql-test/t/ndb_index_unique.test @@ -22,7 +22,7 @@ select * from t1 where b = 4 order by b; insert into t1 values(7,8,3); select * from t1 where b = 4 order by a; --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 values(8, 2, 3); select * from t1 order by a; delete from t1 where a = 1; @@ -59,7 +59,7 @@ select * from t1 use index (bc) where b IS NULL and c IS NULL order by a; select * from t1 use index (bc) where b IS NULL and c = 2 order by a; select * from t1 use index (bc) where b < 4 order by a; select * from t1 use index (bc) where b IS NOT NULL order by a; --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t1 values(5,1,1); drop table t1; @@ -82,7 +82,7 @@ select * from t2 where c = 6; insert into t2 values(7,8,3); select * from t2 where b = 4 order by a; --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t2 values(8, 2, 3); select * from t2 order by a; delete from t2 where a = 1; @@ -91,7 +91,7 @@ select * from t2 order by a; # Bug #24818 CREATE UNIQUE INDEX (...) USING HASH on a NDB table crashes mysqld create unique index bi using hash on t2(b); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY insert into t2 values(9, 3, 1); alter table t2 drop index bi; insert into t2 values(9, 3, 1); @@ -154,7 +154,7 @@ insert into t1 values (-1,NULL), (0,0), (1,NULL),(2,2),(3,NULL),(4,4); select * from t1 order by pk; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values (5,0); select * from t1 order by pk; delete from t1 where a = 0; @@ -173,7 +173,7 @@ insert into t2 values (-1,1,17,NULL),(0,NULL,18,NULL),(1,3,19,'abc'); select * from t2 order by pk; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t2 values(2,3,19,'abc'); select * from t2 order by pk; delete from t2 where c IS NOT NULL; @@ -342,7 +342,7 @@ create table t1 (a int primary key, b varchar(1000) not null, unique key (b)) engine=ndb charset=utf8; insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200)); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200)); select a, sha1(b) from t1; diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test index 092bebe2a37..bffb2edb54c 100644 --- a/mysql-test/t/ndb_insert.test +++ b/mysql-test/t/ndb_insert.test @@ -433,7 +433,7 @@ SELECT COUNT(*) FROM t1; # # Insert duplicate rows # ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t1 VALUES (1,1,1); --error 1022 diff --git a/mysql-test/t/ndb_replace.test b/mysql-test/t/ndb_replace.test index fcbefe710ca..aa2072b98dd 100644 --- a/mysql-test/t/ndb_replace.test +++ b/mysql-test/t/ndb_replace.test @@ -21,7 +21,7 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1); insert into t1 (gesuchnr, benutzer_id) value (3,2); replace into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); select * from t1 order by gesuchnr; diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test index 335c43bc796..73a0ebc69cb 100644 --- a/mysql-test/t/ndb_update.test +++ b/mysql-test/t/ndb_update.test @@ -23,11 +23,11 @@ UPDATE t1 set b = c; select * from t1 order by pk1; UPDATE t1 set pk1 = 4 where pk1 = 1; select * from t1 order by pk1; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY UPDATE t1 set pk1 = 4 where pk1 = 2; UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2; select * from t1 order by pk1; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4; UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4; select * from t1 order by pk1; diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 358b0501e32..d2b9a5bcf83 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1449,6 +1449,21 @@ create table t1 (s1 bigint) partition by list (s1) (partition p1 values in (-922 drop table t1; # +# Bug #28806: Running SHOW TABLE STATUS during high INSERT load crashes server +# +create table t1(a int auto_increment, b int, primary key (b, a)) + partition by hash(b) partitions 2; +insert into t1 values (null, 1); +--replace_column 9 0 12 NULL 13 NULL 14 NULL +show table status; +drop table t1; + +create table t1(a int auto_increment primary key) + partition by key(a) partitions 2; +insert into t1 values (null), (null), (null); +--replace_column 9 0 12 NULL 13 NULL 14 NULL +show table status; +drop table t1; # Bug #28488: Incorrect information in file: './test/t1_test#.frm' # diff --git a/mysql-test/t/replace.test b/mysql-test/t/replace.test index 4e88379241c..ff910bdf5cf 100644 --- a/mysql-test/t/replace.test +++ b/mysql-test/t/replace.test @@ -25,9 +25,9 @@ drop table t1; create table t1 (a tinyint not null auto_increment primary key, b char(20) default "default_value"); insert into t1 values (126,"first"),(63, "middle"),(0,"last"); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values (0,"error"); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY replace into t1 values (0,"error"); replace into t1 values (126,"first updated"); replace into t1 values (63,default); diff --git a/mysql-test/t/rpl_000015.test b/mysql-test/t/rpl_000015.test index 4c557a7c713..9daa765084b 100644 --- a/mysql-test/t/rpl_000015.test +++ b/mysql-test/t/rpl_000015.test @@ -1,3 +1,4 @@ +-- source include/have_log_bin.inc ##################### # Change Author: JBM # Change Date: 2006-01-17 diff --git a/mysql-test/t/rpl_critical_errors.test b/mysql-test/t/rpl_critical_errors.test index ffe00050b01..abf827c8d1f 100644 --- a/mysql-test/t/rpl_critical_errors.test +++ b/mysql-test/t/rpl_critical_errors.test @@ -53,7 +53,7 @@ connection slave; # Here the slave will only stop if the query above actually started # inserting some rows into t2. Otherwise, it will hang forever. -wait_for_slave_to_stop; +--source include/wait_for_slave_to_stop.inc # The following should be 0 SELECT COUNT(*) FROM t2; diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test index 074aeec63b1..27c920a3186 100644 --- a/mysql-test/t/rpl_dual_pos_advance.test +++ b/mysql-test/t/rpl_dual_pos_advance.test @@ -61,7 +61,7 @@ sync_with_master; # select master_pos_wait("slave-bin.000001",137); -# wait_for_slave_to_stop; +# --source include/wait_for_slave_to_stop.inc # then BUG#13861 causes t3 to show up below (because stopped too # late). diff --git a/mysql-test/t/rpl_err_ignoredtable.test b/mysql-test/t/rpl_err_ignoredtable.test index 4d4be6ae786..4e06a6a7096 100644 --- a/mysql-test/t/rpl_err_ignoredtable.test +++ b/mysql-test/t/rpl_err_ignoredtable.test @@ -11,7 +11,7 @@ connection master; create table t1 (a int primary key); create table t4 (a int primary key); # generate an error that goes to the binlog ---error 1022, ER_DUP_ENTRY_WITH_KEY_NAME +--error 1022, ER_DUP_ENTRY insert into t1 values (1),(1); insert into t4 values (1),(2); save_master_pos; diff --git a/mysql-test/t/rpl_known_bugs_detection.test b/mysql-test/t/rpl_known_bugs_detection.test index ce3debf3c5b..b300603f454 100644 --- a/mysql-test/t/rpl_known_bugs_detection.test +++ b/mysql-test/t/rpl_known_bugs_detection.test @@ -25,7 +25,7 @@ connection master; INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10; SELECT * FROM t1; connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc # show the error message --replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 # --query_vertical show slave status; @@ -79,7 +79,7 @@ ON DUPLICATE KEY UPDATE t1.field_3 = t2.field_c; SELECT * FROM t1; connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc # show the error message --replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 # --query_vertical show slave status; diff --git a/mysql-test/t/rpl_ndb_do_table.test b/mysql-test/t/rpl_ndb_do_table.test index 700c79766e1..55a40d85172 100644 --- a/mysql-test/t/rpl_ndb_do_table.test +++ b/mysql-test/t/rpl_ndb_do_table.test @@ -32,11 +32,11 @@ SELECT COUNT(*) FROM t1; # connection master; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t1 VALUES (3, repeat('bad',1)); connection slave; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t1 VALUES (3, repeat('bad too',1)); # cleanup diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index 37248746c19..155f9f4b6e0 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -1,6 +1,8 @@ # This test uses chmod, can't be run with root permissions -- source include/not_as_root.inc +-- source include/have_log_bin.inc + # # Test is run with max_binlog_size=2048 to force automatic rotation of the # binary log @@ -94,7 +96,7 @@ connection master; set insert_id=1234; insert into t2 values(NULL); connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc #restart slave skipping one event set global sql_slave_skip_counter=1; diff --git a/mysql-test/t/rpl_row_create_table.test b/mysql-test/t/rpl_row_create_table.test index d1b26f9e3f4..be10d48b757 100644 --- a/mysql-test/t/rpl_row_create_table.test +++ b/mysql-test/t/rpl_row_create_table.test @@ -67,7 +67,7 @@ SELECT * FROM t6 ORDER BY a,b,c; connection master; # Test for erroneous constructions ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; # Shouldn't be written to the binary log --replace_column 1 # 4 # @@ -76,7 +76,7 @@ SHOW BINLOG EVENTS FROM 1098; # Test that INSERT-SELECT works the same way as for SBR. CREATE TABLE t7 (a INT, b INT UNIQUE); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY INSERT INTO t7 SELECT a,b FROM tt3; SELECT * FROM t7 ORDER BY a,b; # Should be written to the binary log diff --git a/mysql-test/t/rpl_row_inexist_tbl.test b/mysql-test/t/rpl_row_inexist_tbl.test index 741cc8b7ba3..803c214b6c5 100644 --- a/mysql-test/t/rpl_row_inexist_tbl.test +++ b/mysql-test/t/rpl_row_inexist_tbl.test @@ -23,7 +23,7 @@ insert into t1 values (1); connection slave; # slave should have stopped because can't find table t1 -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc # see if we have a good error message: --replace_result $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 7 # 8 # 9 # 23 # 33 # diff --git a/mysql-test/t/rpl_sf.test b/mysql-test/t/rpl_sf.test index 2b1e0350f1b..ecf91a723fa 100644 --- a/mysql-test/t/rpl_sf.test +++ b/mysql-test/t/rpl_sf.test @@ -1,3 +1,5 @@ +-- source include/have_log_bin.inc + # Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR # save status diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test index 84154e549b8..f363b64558a 100644 --- a/mysql-test/t/rpl_sp.test +++ b/mysql-test/t/rpl_sp.test @@ -153,7 +153,7 @@ create procedure foo4() delimiter ;| ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY call foo4(); show warnings; @@ -308,7 +308,7 @@ delimiter ;| do fn1(100); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY select fn1(20); select * from t2; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 60e680c63f3..09b21db062f 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -30,7 +30,7 @@ check table t1 changed; check table t1 medium; check table t1 extended; show index from t1; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values (5,5,5); optimize table t1; optimize table t1; diff --git a/mysql-test/t/sp-code.test b/mysql-test/t/sp-code.test index 3bfa2ad74ea..66d5323d2e2 100644 --- a/mysql-test/t/sp-code.test +++ b/mysql-test/t/sp-code.test @@ -2,7 +2,7 @@ # Test the debugging feature "show procedure/function code <name>" # --- source include/is_debug_build.inc +-- source include/have_debug.inc --disable_warnings drop procedure if exists empty; diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index a6005c3611a..69b1f77aa35 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -586,7 +586,7 @@ begin end| set @x = 0| ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY call bug3279(@x)| select @x| drop procedure bug3279| diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 08a01be0fd2..8972e8bae4a 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -1767,11 +1767,11 @@ insert into t3 (a) values (1)| create procedure h_ee() deterministic begin - declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME + declare continue handler for 1062 -- ER_DUP_ENTRY select 'Outer (bad)' as 'h_ee'; begin - declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME + declare continue handler for 1062 -- ER_DUP_ENTRY select 'Inner (good)' as 'h_ee'; insert into t3 values (1); @@ -1781,7 +1781,7 @@ end| create procedure h_es() deterministic begin - declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME + declare continue handler for 1062 -- ER_DUP_ENTRY select 'Outer (good)' as 'h_es'; begin @@ -1827,7 +1827,7 @@ end| create procedure h_ex() deterministic begin - declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME + declare continue handler for 1062 -- ER_DUP_ENTRY select 'Outer (good)' as 'h_ex'; begin @@ -1846,7 +1846,7 @@ begin select 'Outer (bad)' as 'h_se'; begin - declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME + declare continue handler for 1062 -- ER_DUP_ENTRY select 'Inner (good)' as 'h_se'; insert into t3 values (1); @@ -2019,7 +2019,7 @@ begin select 'Outer (bad)' as 'h_xe'; begin - declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME + declare continue handler for 1062 -- ER_DUP_ENTRY select 'Inner (good)' as 'h_xe'; insert into t3 values (1); @@ -4511,7 +4511,7 @@ begin select bug12379(); end| ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY select bug12379()| select 1| # statement-based binlogging will show warning which row-based won't; @@ -4522,7 +4522,7 @@ select 2| call bug12379_2()| --enable_warnings select 3| ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY call bug12379_3()| select 4| @@ -4604,7 +4604,7 @@ end| call bug6127()| select * from t3| ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY call bug6127()| select * from t3| set sql_mode=@sm| @@ -5532,11 +5532,11 @@ insert into t3 values (1)| create procedure bug15011() deterministic begin - declare continue handler for 1582 + declare continue handler for 1062 select 'Outer' as 'Handler'; begin - declare continue handler for 1582 + declare continue handler for 1062 select 'Inner' as 'Handler'; insert into t3 values (1); diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index bd5e6e33cf7..0b04b9d7668 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -90,7 +90,7 @@ create function bug10015_5(i int) returns int end if; return i; end| ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values (bug10015_5(4)), (bug10015_5(5))| select * from t1| drop function bug10015_5| diff --git a/mysql-test/t/sp_trans_log.test b/mysql-test/t/sp_trans_log.test index 9b85981e2e1..447ec19b132 100644 --- a/mysql-test/t/sp_trans_log.test +++ b/mysql-test/t/sp_trans_log.test @@ -32,7 +32,7 @@ begin end| reset master| ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t2 values (bug23333(),1)| --replace_column 2 # 5 # 6 # show binlog events from 106 /* with fixes for #23333 will show there is the query */| diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index e10fd386bd3..d1ad7ab8ffa 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -73,7 +73,7 @@ drop table t1,t2; # create temporary table t1 (a int not null); insert into t1 values (1),(1); --- error ER_DUP_ENTRY_WITH_KEY_NAME +-- error ER_DUP_ENTRY alter table t1 add primary key (a); drop table t1; diff --git a/mysql-test/t/type_binary.test b/mysql-test/t/type_binary.test index a09e487f6cb..4d5a5312472 100644 --- a/mysql-test/t/type_binary.test +++ b/mysql-test/t/type_binary.test @@ -31,7 +31,7 @@ drop table t1; create table t1 (s1 binary(2) primary key); insert into t1 values (0x01); insert into t1 values (0x0120); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 values (0x0100); select hex(s1) from t1 order by s1; # check index search diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test index d0751549fae..ae725b3b235 100644 --- a/mysql-test/t/type_bit.test +++ b/mysql-test/t/type_bit.test @@ -39,7 +39,7 @@ drop table t1; create table t1 (a bit); insert into t1 values (b'0'), (b'1'), (b'000'), (b'100'), (b'001'); select hex(a) from t1; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY alter table t1 add unique (a); drop table t1; diff --git a/mysql-test/t/type_bit_innodb.test b/mysql-test/t/type_bit_innodb.test index 4ee97782452..85c9127b2f6 100644 --- a/mysql-test/t/type_bit_innodb.test +++ b/mysql-test/t/type_bit_innodb.test @@ -40,7 +40,7 @@ drop table t1; create table t1 (a bit) engine=innodb; insert into t1 values (b'0'), (b'1'), (b'000'), (b'100'), (b'001'); select hex(a) from t1; ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY alter table t1 add unique (a); drop table t1; diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index e08b2de0f85..b6febf8e76d 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -333,9 +333,9 @@ drop table t1; # create table t1 (id integer primary key auto_increment, txt text not null, unique index txt_index (txt (20))); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 (txt) values ('Chevy'), ('Chevy '); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY insert into t1 (txt) values ('Chevy'), ('CHEVY'); alter table t1 drop index txt_index, add index txt_index (txt(20)); insert into t1 (txt) values ('Chevy '); diff --git a/mysql-test/t/type_varchar.test b/mysql-test/t/type_varchar.test index 1b27a92e95c..1eb949a21e3 100644 --- a/mysql-test/t/type_varchar.test +++ b/mysql-test/t/type_varchar.test @@ -25,7 +25,7 @@ select v='a' from t1; select binary v='a' from t1; select binary v='a ' from t1; insert into t1 values('a'); ---error ER_DUP_ENTRY_WITH_KEY_NAME +--error ER_DUP_ENTRY alter table t1 add primary key (v); drop table t1; create table t1 (v varbinary(20)); diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test index fc534cc357a..70f2f0fa7a6 100644 --- a/mysql-test/t/user_var-binlog.test +++ b/mysql-test/t/user_var-binlog.test @@ -1,9 +1,6 @@ # Requires statement logging -- source include/have_binlog_format_mixed_or_statement.inc # TODO: Create row based version once $MYSQL_BINLOG has new RB version -# Embedded server does not support binlogging ---source include/not_embedded.inc ---source include/have_log_bin.inc # Check that user variables are binlogged correctly (BUG#3875) create table t1 (a varchar(50)); diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 79a28ef04b0..cc33ac3f21c 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -87,20 +87,21 @@ my_bool my_thread_global_init(void) fprintf(stderr,"Can't initialize threads: error %d\n", pth_ret); return 1; } - + #ifdef NPTL_PTHREAD_EXIT_BUG /* - BUG#24507: Race conditions inside current NPTL pthread_exit() + BUG#24507: Race conditions inside current NPTL pthread_exit() implementation. To avoid a possible segmentation fault during concurrent executions of pthread_exit(), a dummy thread is spawned which initializes internal variables of pthread lib. See bug description for a full explanation. - + TODO: Remove this code when fixed versions of glibc6 are in common use. */ + if (thd_lib_detected == THD_LIB_NPTL) { pthread_t dummy_thread; pthread_attr_t dummy_thread_attr; diff --git a/sql-common/client.c b/sql-common/client.c index 49bb038a479..50da5298591 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -411,7 +411,7 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout) shared_memory_base_name is unique value for each server unique_part is uniquel value for each object (events and file-mapping) */ - suffix_pos = strxmov(tmp,shared_memory_base_name,"_",NullS); + suffix_pos = strxmov(tmp, "Global\\", shared_memory_base_name, "_", NullS); strmov(suffix_pos, "CONNECT_REQUEST"); if (!(event_connect_request= OpenEvent(event_access_rights, FALSE, tmp))) { @@ -465,8 +465,8 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout) unique_part is uniquel value for each object (events and file-mapping) number_of_connection is number of connection between server and client */ - suffix_pos = strxmov(tmp,shared_memory_base_name,"_",connect_number_char, - "_",NullS); + suffix_pos = strxmov(tmp, "Global\\", shared_memory_base_name, "_", connect_number_char, + "_", NullS); strmov(suffix_pos, "DATA"); if ((handle_file_map = OpenFileMapping(FILE_MAP_WRITE,FALSE,tmp)) == NULL) { diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index e9f4bc4c745..0c4f3cf708f 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4253,22 +4253,16 @@ int ha_partition::info(uint flag) if (flag & HA_STATUS_AUTO) { - ulonglong nb_reserved_values; + ulonglong auto_increment_value= 0; DBUG_PRINT("info", ("HA_STATUS_AUTO")); - /* we don't want to reserve any values, it's pure information */ - - if (table->found_next_number_field) + file_array= m_file; + do { - /* - Can only call get_auto_increment for tables that actually - have auto_increment columns, otherwise there will be - problems in handlers that don't expect get_auto_increment - for non-autoincrement tables. - */ - get_auto_increment(0, 0, 0, &stats.auto_increment_value, - &nb_reserved_values); - release_auto_increment(); - } + file= *file_array; + file->info(HA_STATUS_AUTO); + set_if_bigger(auto_increment_value, file->stats.auto_increment_value); + } while (*(++file_array)); + stats.auto_increment_value= auto_increment_value; } if (flag & HA_STATUS_VARIABLE) { diff --git a/sql/handler.cc b/sql/handler.cc index 7fc4e5e12b0..1a468f306e3 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2066,8 +2066,7 @@ void handler::print_keydup_error(uint key_nr, const char *msg) { /* Key is unknown */ str.copy("", 0, system_charset_info); - my_printf_error(ER_DUP_ENTRY_WITH_KEY_NAME, msg, - MYF(0), str.c_ptr(), "*UNKNOWN*"); + my_printf_error(ER_DUP_ENTRY, msg, MYF(0), str.c_ptr(), "*UNKNOWN*"); } else { @@ -2079,7 +2078,7 @@ void handler::print_keydup_error(uint key_nr, const char *msg) str.length(max_length-4); str.append(STRING_WITH_LEN("...")); } - my_printf_error(ER_DUP_ENTRY_WITH_KEY_NAME, msg, + my_printf_error(ER_DUP_ENTRY, msg, MYF(0), str.c_ptr(), table->key_info[key_nr].name); } } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 59e3c0a7dd4..1b57e9363e4 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1110,14 +1110,15 @@ bool acl_getroot_no_password(Security_context *sctx, char *user, char *host, */ for (i=0 ; i < acl_users.elements ; i++) { - acl_user= dynamic_element(&acl_users,i,ACL_USER*); - if ((!acl_user->user && !user[0]) || - (acl_user->user && strcmp(user, acl_user->user) == 0)) + ACL_USER *acl_user_tmp= dynamic_element(&acl_users,i,ACL_USER*); + if ((!acl_user_tmp->user && !user[0]) || + (acl_user_tmp->user && strcmp(user, acl_user_tmp->user) == 0)) { - if (compare_hostname(&acl_user->host, host, ip)) + if (compare_hostname(&acl_user_tmp->host, host, ip)) { - res= 0; - break; + acl_user= acl_user_tmp; + res= 0; + break; } } } diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 7c1ba3856e8..26b7098e27c 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -837,9 +837,12 @@ static int check_connection(THD *thd) password both send '\0'. This strlen() can't be easily deleted without changing protocol. + + Cast *passwd to an unsigned char, so that it doesn't extend the sign for + *passwd > 127 and become 2**32-127+ after casting to uint. */ uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ? - *passwd++ : strlen(passwd); + (uchar)(*passwd++) : strlen(passwd); db= thd->client_capabilities & CLIENT_CONNECT_WITH_DB ? db + passwd_len + 1 : 0; /* strlen() can't be easily deleted without changing protocol */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 411c26ea3c4..132fc5b0b4f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -259,7 +259,6 @@ bool is_update_query(enum enum_sql_command command) return (sql_command_flags[command] & CF_CHANGES_DATA) != 0; } - void execute_init_command(THD *thd, sys_var_str *init_command_var, rw_lock_t *var_mutex) { @@ -785,12 +784,15 @@ bool dispatch_command(enum enum_server_command command, THD *thd, Old clients send null-terminated string ('\0' for empty string) for password. New clients send the size (1 byte) + string (not null terminated, so also '\0' for empty string). + + Cast *passwd to an unsigned char, so that it doesn't extend the sign + for *passwd > 127 and become 2**32-127 after casting to uint. */ char db_buff[NAME_LEN+1]; // buffer to store db in utf8 char *db= passwd; char *save_db; uint passwd_len= (thd->client_capabilities & CLIENT_SECURE_CONNECTION ? - *passwd++ : strlen(passwd)); + (uchar)(*passwd++) : strlen(passwd)); uint dummy_errors, save_db_length, db_length; int res; Security_context save_security_ctx= *thd->security_ctx; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8372053b094..dc5e33518d2 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9415,7 +9415,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, bool using_unique_constraint= 0; bool use_packed_rows= 0; bool not_all_columns= !(select_options & TMP_TABLE_ALL_COLUMNS); - char *tmpname,path[FN_REFLEN]; + char *tmpname, *tmppath, path[FN_REFLEN], table_name[NAME_LEN+1]; uchar *pos, *group_buff, *bitmaps; uchar *null_flags; Field **reg_field, **from_field, **default_field; @@ -9439,12 +9439,12 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, temp_pool_slot = bitmap_lock_set_next(&temp_pool); if (temp_pool_slot != MY_BIT_NONE) // we got a slot - sprintf(path, "%s_%lx_%i", tmp_file_prefix, - current_pid, temp_pool_slot); + sprintf(table_name, "%s_%lx_%i", tmp_file_prefix, + current_pid, temp_pool_slot); else { /* if we run out of slots or we are not using tempool */ - sprintf(path,"%s%lx_%lx_%x", tmp_file_prefix,current_pid, + sprintf(table_name, "%s%lx_%lx_%x", tmp_file_prefix,current_pid, thd->thread_id, thd->tmp_table++); } @@ -9452,7 +9452,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, No need to change table name to lower case as we are only creating MyISAM or HEAP tables here */ - fn_format(path, path, mysql_tmpdir, "", MY_REPLACE_EXT|MY_UNPACK_FILENAME); + fn_format(path, table_name, mysql_tmpdir, "", + MY_REPLACE_EXT|MY_UNPACK_FILENAME); if (group) { @@ -9498,7 +9499,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, sizeof(*key_part_info)*(param->group_parts+1), ¶m->start_recinfo, sizeof(*param->recinfo)*(field_count*2+4), - &tmpname, (uint) strlen(path)+1, + &tmppath, (uint) strlen(path)+1, + &tmpname, (uint) strlen(table_name)+1, &group_buff, (group && ! using_unique_constraint ? param->group_length : 0), &bitmaps, bitmap_buffer_size(field_count)*2, @@ -9517,7 +9519,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, DBUG_RETURN(NULL); /* purecov: inspected */ } param->items_to_copy= copy_func; - strmov(tmpname,path); + strmov(tmppath, path); + strmov(tmpname, table_name); /* make table according to fields */ bzero((char*) table,sizeof(*table)); @@ -9542,7 +9545,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, table->keys_in_use_for_query.init(); table->s= share; - init_tmp_table_share(share, "", 0, tmpname, tmpname); + init_tmp_table_share(share, "", 0, tmpname, tmppath); share->blob_field= blob_field; share->blob_ptr_size= mi_portable_sizeof_char_ptr; share->db_low_byte_first=1; // True for HEAP and MyISAM |