From 82281dff1a6008f0d89e5d60e240e2c8fbf037f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Feb 2003 18:50:12 +0200 Subject: A fix for new conditions being defined and upper condition not updated mysql-test/r/type_datetime.result: result for datetime fix mysql-test/t/type_datetime.test: test for datetime fix sql/sql_select.cc: Fix for a bug caused implicitely by MySQL having to comply with ODBC standard on datetime comparisons. This failed to update used_tables() for OR condition, which is why query returned all rows on query as in .test above, while none of types contains NULL nor 0 datetime (last one from ODBC) --- mysql-test/r/type_datetime.result | 1 + mysql-test/t/type_datetime.test | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index dd34bc1cf86..6c461b10930 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -40,3 +40,4 @@ date numfacture expedition 0000-00-00 00:00:00 1212 0001-00-00 00:00:00 table type possible_keys key key_len ref rows Extra t1 ref expedition expedition 8 const 1 where used +a b diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 626dedad547..eed3f831383 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -50,3 +50,8 @@ INSERT INTO t1 (numfacture,expedition) VALUES ('1212','0001-00-00 00:00:00'); SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; drop table t1; +create table t1 (a datetime not null, b datetime not null); +insert into t1 values (now(), now()); +insert into t1 values (now(), now()); +select * from t1 where a is null or b is null; +drop table t1; -- cgit v1.2.1 From b276b60e033744a25b034d3107e7a3f1122e04c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Feb 2003 22:24:00 +0200 Subject: LOAD DATA INFILE is not replicated if replicate_*_table is set LOAD DATA LOCAL INFILE was not replicated correctly VC++Files/bdb/bdb.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/Berkeley_DB.dsw: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_archive.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_buildall.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_checkpoint.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_deadlock.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_dll.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_dump.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_java.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_load.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_printlog.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_recover.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_stat.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_static.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_static1.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_tcl.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_test.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_upgrade.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/db_verify.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/ex_access.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/ex_btrec.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/ex_env.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/ex_lock.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/ex_mpool.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/ex_tpcb.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/excxx_access.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/excxx_btrec.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/excxx_env.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/excxx_lock.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/excxx_mpool.dsp: Updated VC++ files +end space removed VC++Files/bdb/build_win32/excxx_tpcb.dsp: Updated VC++ files +end space removed VC++Files/client/mysql.dsp: Updated VC++ files +end space removed VC++Files/client/mysqladmin.dsp: Updated VC++ files +end space removed VC++Files/client/mysqlcheck.dsp: Updated VC++ files +end space removed VC++Files/client/mysqlclient.dsp: Updated VC++ files +end space removed VC++Files/client/mysqlclient.dsw: Updated VC++ files +end space removed VC++Files/client/mysqldump.dsp: Updated VC++ files +end space removed VC++Files/client/mysqlimport.dsp: Updated VC++ files +end space removed VC++Files/client/mysqlshow.dsp: Updated VC++ files +end space removed VC++Files/comp_err/comp_err.dsp: Updated VC++ files +end space removed VC++Files/contrib/asm386/zlibvc.dsp: Updated VC++ files +end space removed VC++Files/contrib/asm386/zlibvc.dsw: Updated VC++ files +end space removed VC++Files/contrib/minizip/zlibvc.dsp: Updated VC++ files +end space removed VC++Files/contrib/minizip/zlibvc.dsw: Updated VC++ files +end space removed VC++Files/dbug/dbug.dsp: Updated VC++ files +end space removed VC++Files/dbug/dbug.dsw: Updated VC++ files +end space removed VC++Files/heap/heap.dsp: Updated VC++ files +end space removed VC++Files/innobase/innobase.dsp: Updated VC++ files +end space removed VC++Files/isam/isam.dsp: Updated VC++ files +end space removed VC++Files/isam/isam.dsw: Updated VC++ files +end space removed VC++Files/isamchk/isamchk.dsp: Updated VC++ files +end space removed VC++Files/libmysql/libmysql.dsp: Updated VC++ files +end space removed VC++Files/libmysql/libmysql.dsw: Updated VC++ files +end space removed VC++Files/libmysqld/examples/test_libmysqld.dsp: Updated VC++ files +end space removed VC++Files/libmysqld/libmysqld.dsp: Updated VC++ files +end space removed VC++Files/libmysqltest/myTest.dsp: Updated VC++ files +end space removed VC++Files/libmysqltest/mytest.dsw: Updated VC++ files +end space removed VC++Files/merge/merge.dsp: Updated VC++ files +end space removed VC++Files/merge/merge.dsw: Updated VC++ files +end space removed VC++Files/my_print_defaults/my_print_defaults.dsp: Updated VC++ files +end space removed VC++Files/myisam/myisam.dsp: Updated VC++ files +end space removed VC++Files/myisamchk/myisamchk.dsp: Updated VC++ files +end space removed VC++Files/myisamlog/myisamlog.dsp: Updated VC++ files +end space removed VC++Files/myisammrg/myisammrg.dsp: Updated VC++ files +end space removed VC++Files/myisampack/myisampack.dsp: Updated VC++ files +end space removed VC++Files/mysql.dsp: Updated VC++ files +end space removed VC++Files/mysql.dsw: Updated VC++ files +end space removed VC++Files/mysqlbinlog/mysqlbinlog.dsp: Updated VC++ files +end space removed VC++Files/mysqlcheck/mysqlcheck.dsp: Updated VC++ files +end space removed VC++Files/mysqldemb/mysqldemb.dsp: Updated VC++ files +end space removed VC++Files/mysqlmanager/MySqlManager.dsp: Updated VC++ files +end space removed VC++Files/mysqlmanager/mysqlmanager.dsw: Updated VC++ files +end space removed VC++Files/mysqlserver/mysqlserver.dsp: Updated VC++ files +end space removed VC++Files/mysqlshutdown/myshutdown.dsp: Updated VC++ files +end space removed VC++Files/mysqlshutdown/mysqlshutdown.dsp: Updated VC++ files +end space removed VC++Files/mysqlwatch/mysqlwatch.dsp: Updated VC++ files +end space removed VC++Files/mysys/mysys.dsp: Updated VC++ files +end space removed VC++Files/mysys/mysys.dsw: Updated VC++ files +end space removed VC++Files/pack_isam/pack_isam.dsp: Updated VC++ files +end space removed VC++Files/perror/perror.dsp: Updated VC++ files +end space removed VC++Files/regex/regex.dsp: Updated VC++ files +end space removed VC++Files/regex/regex.dsw: Updated VC++ files +end space removed VC++Files/replace/replace.dsp: Updated VC++ files +end space removed VC++Files/sql/mysqld.dsp: Updated VC++ files +end space removed VC++Files/sql/mysqld.dsw: Updated VC++ files +end space removed VC++Files/sql/mysqldmax.dsp: Updated VC++ files +end space removed VC++Files/sql/old/mysqld.dsw: Updated VC++ files +end space removed VC++Files/strings/MASM6x/strings.dsp: Updated VC++ files +end space removed VC++Files/strings/MASM6x/strings.dsw: Updated VC++ files +end space removed VC++Files/strings/backup/strings.dsp: Updated VC++ files +end space removed VC++Files/strings/backup/strings.dsw: Updated VC++ files +end space removed VC++Files/strings/noMASM/strings.dsp: Updated VC++ files +end space removed VC++Files/strings/noMASM/strings.dsw: Updated VC++ files +end space removed VC++Files/strings/strings.dsp: Updated VC++ files +end space removed VC++Files/strings/strings.dsw: Updated VC++ files +end space removed VC++Files/test1/test1.dsp: Updated VC++ files +end space removed VC++Files/thr_insert_test/thr_insert_test.dsp: Updated VC++ files +end space removed VC++Files/thr_test/thr_test.dsp: Updated VC++ files +end space removed VC++Files/vio/vio.dsp: Updated VC++ files +end space removed VC++Files/zlib/zlib.dsp: Updated VC++ files +end space removed include/my_global.h: Always include errno.h sql/log_event.cc: LOAD DATA INFILE is not replicated if replicate_*_table is set sql/mf_iocache.cc: LOAD DATA LOCAL INFILE was not replicated correctly --- mysql-test/r/rpl_loaddatalocal.result | 0 mysql-test/t/rpl_loaddatalocal.test | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 mysql-test/r/rpl_loaddatalocal.result create mode 100644 mysql-test/t/rpl_loaddatalocal.test (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_loaddatalocal.result b/mysql-test/r/rpl_loaddatalocal.result new file mode 100644 index 00000000000..e69de29bb2d diff --git a/mysql-test/t/rpl_loaddatalocal.test b/mysql-test/t/rpl_loaddatalocal.test new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.1 From 6a933b2e08037a4fb17ea98abf00d0990cef22ae Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 2 Mar 2003 01:48:57 +0100 Subject: fix auto-increment in sub-key and insert ... select --- mysql-test/r/auto_increment.result | 10 ++++++++++ mysql-test/t/auto_increment.test | 8 ++++++++ 2 files changed, 18 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 66efd2ba567..e79e6aab56b 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -84,6 +84,16 @@ ordid ord 3 sdj 1 zzz drop table t1; +create table t1 (sid char(5), id int(2) NOT NULL auto_increment, key(sid, id)); +create table t2 (sid char(20), id int(2)); +insert into t2 values ('skr',NULL),('skr',NULL),('test',NULL); +insert into t1 select * from t2; +select * from t1; +sid id +skr 1 +skr 2 +test 1 +drop table t1,t2; create table t1 (a int not null primary key auto_increment); insert into t1 values (0); update t1 set a=0; diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index d86466572d8..5fba4bb9234 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -52,6 +52,13 @@ insert into t1 values (NULL,'sdj'),(NULL,'sdj'),(NULL,"abc"),(NULL,'abc'),(NULL, select * from t1; drop table t1; +create table t1 (sid char(5), id int(2) NOT NULL auto_increment, key(sid, id)); +create table t2 (sid char(20), id int(2)); +insert into t2 values ('skr',NULL),('skr',NULL),('test',NULL); +insert into t1 select * from t2; +select * from t1; +drop table t1,t2; + # # Test of auto_increment columns when they are set to 0 # @@ -62,3 +69,4 @@ update t1 set a=0; select * from t1; check table t1; drop table t1; + -- cgit v1.2.1 From c5cd20fe8f37b4ff693bdb9cb24e8cf7d1b59194 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 2 Mar 2003 14:07:32 +0100 Subject: optimizer should check for "field LIKE const" not "field like STRING" BitKeeper/etc/ignore: Added configure.lineno innobase/configure.lineno to the ignore list --- mysql-test/r/func_like.result | 10 ++++++++++ mysql-test/t/func_like.test | 11 +++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result index c2085ba12da..f923c16b2ac 100644 --- a/mysql-test/r/func_like.result +++ b/mysql-test/r/func_like.result @@ -1,10 +1,20 @@ drop table if exists t1; create table t1 (a varchar(10), key(a)); insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); +explain select * from t1 where a like 'abc%'; +table type possible_keys key key_len ref rows Extra +t1 range a a 11 NULL 1 Using where; Using index +explain select * from t1 where a like concat('abc','%'); +table type possible_keys key key_len ref rows Extra +t1 range a a 11 NULL 1 Using where; Using index select * from t1 where a like "abc%"; a abc abcd +select * from t1 where a like concat("abc","%"); +a +abc +abcd select * from t1 where a like "ABC%"; a abc diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test index 09746fcc817..a5d1193fd74 100644 --- a/mysql-test/t/func_like.test +++ b/mysql-test/t/func_like.test @@ -5,10 +5,13 @@ drop table if exists t1; create table t1 (a varchar(10), key(a)); insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); -select * from t1 where a like "abc%"; -select * from t1 where a like "ABC%"; -select * from t1 where a like "test%"; -select * from t1 where a like "te_t"; +explain select * from t1 where a like 'abc%'; +explain select * from t1 where a like concat('abc','%'); +select * from t1 where a like "abc%"; +select * from t1 where a like concat("abc","%"); +select * from t1 where a like "ABC%"; +select * from t1 where a like "test%"; +select * from t1 where a like "te_t"; # # The following will test the Turbo Boyer-Moore code -- cgit v1.2.1 From b331fe928c38666a7119aa62f7a8e3acbb4e330a Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 2 Mar 2003 18:20:32 +0100 Subject: ChangeSet 1.1625 was faulty as regards sql/mf_iocache.cc and LOAD DATA LOCAL replication tests mysql-test/r/rpl_loaddatalocal.result: ChangeSet 1.1625 was faulty as regards this file (LOAD DATA LOCAL bug) mysql-test/t/rpl_loaddatalocal.test: ChangeSet 1.1625 was faulty as regards this file (LOAD DATA LOCAL bug) sql/mf_iocache.cc: ChangeSet 1.1625 was faulty as regards this file (LOAD DATA LOCAL bug) --- mysql-test/r/rpl_loaddatalocal.result | 14 ++++++++++++++ mysql-test/t/rpl_loaddatalocal.test | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_loaddatalocal.result b/mysql-test/r/rpl_loaddatalocal.result index e69de29bb2d..dc98b1b5bfb 100644 --- a/mysql-test/r/rpl_loaddatalocal.result +++ b/mysql-test/r/rpl_loaddatalocal.result @@ -0,0 +1,14 @@ +slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +slave start; +create table t1(a int); +select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1; +truncate table t1; +load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1; +select a,count(*) from t1 group by a; +a count(*) +1 10000 +drop table t1; diff --git a/mysql-test/t/rpl_loaddatalocal.test b/mysql-test/t/rpl_loaddatalocal.test index e69de29bb2d..70f4ab96b6a 100644 --- a/mysql-test/t/rpl_loaddatalocal.test +++ b/mysql-test/t/rpl_loaddatalocal.test @@ -0,0 +1,36 @@ +# See if "LOAD DATA LOCAL INFILE" is well replicated +# (LOAD DATA LOCAL INFILE is not written to the binlog +# the same way as LOAD DATA INFILE : Append_blocks are smaller). +# In MySQL 4.0 <4.0.12 there were 2 bugs with LOAD DATA LOCAL INFILE : +# - the loaded file was not written entirely to the master's binlog, +# only the first 4KB, 8KB or 16KB usually. +# - the loaded file's first line was not written entirely to the +# master's binlog (1st char was absent) +source include/master-slave.inc; + +create table t1(a int); +let $1=10000; +disable_query_log; +set SQL_LOG_BIN=0; +while ($1) +{ +#eval means expand $ expressions + eval insert into t1 values(1); + dec $1; +} +set SQL_LOG_BIN=1; +enable_query_log; +select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1; +#This will generate a 20KB file, now test LOAD DATA LOCAL +truncate table t1; +load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1; +system rm ./var/master-data/rpl_loaddatalocal.select_outfile ; +save_master_pos; +connection slave; +sync_with_master; +select a,count(*) from t1 group by a; +connection master; +drop table t1; +save_master_pos; +connection slave; +sync_with_master; -- cgit v1.2.1 From 285541505844c01546c37a46fcad92685e99cd3c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Mar 2003 14:57:02 +0100 Subject: Replication: small bug fixes in mysql-test-run.sh and in replication code (more reinitializations) + fix for #70 + test result fix for LOAD DATA LOCAL bug #82 client/mysqltest.c: Removed wrong comment and useless sleep mysql-test/mysql-test-run.sh: Fix $slave_datadir variable because this if [ -n "$1" ] ; slave_datadir="var/$slave_ident-data/" else slave_datadir=$SLAVE_MYDDIR was not coherent and led to problems of master.info not being deleted. Delete relay-log.info too. mysql-test/r/rpl000001.result: SUM is 1022 (1021 was when we had the LOAD DATA LOCAL bug #82). It's logical to have an even number as we load the same file twice. sql/slave.cc: When we RESET SLAVE, clear rli->master_log_* to give a good display in SHOW SLAVE STATUS ; seeing the old values may confuse the user. When we START SLAVE, clear rli->master_log_name, not only rli->master_log_pos. sql/sql_repl.cc: When we RESET SLAVE, clear mi->master_log_* to give a good display in SHOW SLAVE STATUS (bug #70) --- mysql-test/mysql-test-run.sh | 8 ++++---- mysql-test/r/rpl000001.result | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 48bb94ea0e4..ae5b47fbc04 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -810,8 +810,8 @@ start_master() $RM -f $MASTER_MYDDIR/log.* # Remove stale binary logs $RM -f $MYSQL_TEST_DIR/var/log/master-bin.* - # Remove old master.info files - $RM -f $MYSQL_TEST_DIR/var/master-data/master.info + # Remove old master.info and relay-log.info files + $RM -f $MYSQL_TEST_DIR/var/master-data/master.info $MYSQL_TEST_DIR/var/master-data/relay-log.info #run master initialization shell script if one exists @@ -915,7 +915,7 @@ start_slave() slave_port=`expr $SLAVE_MYPORT + $1` slave_log="$SLAVE_MYLOG.$1" slave_err="$SLAVE_MYERR.$1" - slave_datadir="var/$slave_ident-data/" + slave_datadir="$SLAVE_MYDDIR/../$slave_ident-data/" slave_pid="$MYRUN_DIR/mysqld-$slave_ident.pid" slave_sock="$SLAVE_MYSOCK-$1" else @@ -930,7 +930,7 @@ start_slave() fi # Remove stale binary logs and old master.info files $RM -f $MYSQL_TEST_DIR/var/log/$slave_ident-*bin.* - $RM -f $MYSQL_TEST_DIR/$slave_datadir/master.info + $RM -f $slave_datadir/master.info $slave_datadir/relay-log.info #run slave initialization shell script if one exists if [ -f "$slave_init_script" ] ; diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result index 2d277571296..f3b52b43b19 100644 --- a/mysql-test/r/rpl000001.result +++ b/mysql-test/r/rpl000001.result @@ -32,7 +32,7 @@ n 2 select sum(length(word)) from t1; sum(length(word)) -1021 +1022 drop table t1,t3; reset master; slave stop; -- cgit v1.2.1 From 3446199d8e421da02a5546f439ee76b368594700 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Mar 2003 12:22:35 +0200 Subject: Fixed bug in LOCK TABLE + DROP TABLE when other thread was waiting for a table that was locked bug not droped client/mysqltest.c: Fixed bug that comments did a ping include/thr_lock.h: Added function to abort a lock for a specific thread mysql-test/mysql-test-run.sh: Fixed where mysqltest traces are put mysql-test/r/lock_multi.result: Test for LOCK TABLE + DROP TABLE bug mysql-test/t/lock_multi.test: Test for LOCK TABLE + DROP TABLE bug mysys/thr_lock.c: Added function to abort a lock for a specific thread sql/handler.cc: Indentation cleanup sql/lock.cc: Added function to abort a lock for a specific thread sql/mysql_priv.h: Added function to abort a lock for a specific thread sql/mysqld.cc: Use automatic recover even with --safe --- mysql-test/mysql-test-run.sh | 3 ++- mysql-test/r/lock_multi.result | 9 ++++++++- mysql-test/t/lock_multi.test | 24 ++++++++++++++++++++++-- 3 files changed, 32 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 48bb94ea0e4..b12ed2b3739 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -349,7 +349,8 @@ while test $# -gt 0; do --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/master.trace" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \ --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/slave.trace" - EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT --debug" + EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT \ + --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqltest.trace" ;; --fast) FAST_START=1 diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result index 20bc9b9572f..b808fca0acf 100644 --- a/mysql-test/r/lock_multi.result +++ b/mysql-test/r/lock_multi.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1,t2; create table t1(n int); insert into t1 values (1); lock tables t1 write; @@ -17,3 +17,10 @@ unlock tables; n 1 drop table t1; +create table t1 (a int); +create table t2 (a int); +lock table t1 write, t2 write; + insert t1 select * from t2; +drop table t2; +Table 'test.t2' doesn't exist +drop table t1; diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test index 792ae956e2a..0295fca29e7 100644 --- a/mysql-test/t/lock_multi.test +++ b/mysql-test/t/lock_multi.test @@ -6,8 +6,9 @@ # -- source include/not_embedded.inc -drop table if exists t1; -#test to see if select will get the lock ahead of low priority update +drop table if exists t1,t2; + +# test to see if select will get the lock ahead of low priority update connect (locker,localhost,root,,); connect (reader,localhost,root,,); @@ -48,3 +49,22 @@ reap; connection reader; reap; drop table t1; + +# +# Test problem when using locks on many tables and droping a table that +# is to-be-locked by another thread +# + +connection locker; +create table t1 (a int); +create table t2 (a int); +lock table t1 write, t2 write; +connection reader; +send insert t1 select * from t2; +connection locker; +drop table t2; +connection reader; +--error 1146 +reap; +connection locker; +drop table t1; -- cgit v1.2.1 From 8529b744b7dbddb0be58c7c2a62ab1131a35ccad Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Mar 2003 18:02:56 +0100 Subject: fixed Field::eq() to work with CHAR(0) fields BitKeeper/etc/ignore: Added configure.lineno innobase/configure.lineno to the ignore list --- mysql-test/r/delete.result | 4 ++++ mysql-test/t/delete.test | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 mysql-test/r/delete.result (limited to 'mysql-test') diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result new file mode 100644 index 00000000000..169232b72d8 --- /dev/null +++ b/mysql-test/r/delete.result @@ -0,0 +1,4 @@ +bool not_null misc +NULL c 6 +NULL d 7 +bool not_null misc diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index 953e22cdd55..13fa617b3cf 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -35,3 +35,23 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); delete from t1 where a=27; drop table t1; + +# +# CHAR(0) bug - not actually DELETE bug, but anyway... +# + +CREATE TABLE t1 ( + bool char(0) default NULL, + not_null varchar(20) binary NOT NULL default '', + misc integer not null, + PRIMARY KEY (not_null) +) TYPE=MyISAM; + +INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7); + +select * from t1 where misc > 5 and bool is null; +delete from t1 where misc > 5 and bool is null; +select * from t1 where misc > 5 and bool is null; + +drop table t1; + -- cgit v1.2.1 From 37d1dd03d8100ea8a963b1fcc80f07d3f7536be6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Mar 2003 18:18:05 +0100 Subject: - added missing file mysql-test/std_data/des_key_file to source and binary distribution to fix a test failure in test "func_encrypt" --- mysql-test/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 06897852f17..66f931133e3 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -31,6 +31,7 @@ dist-hook: $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.001 $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data install-data-local: $(mkinstalldirs) \ @@ -47,6 +48,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(DESTDIR)$(testdir)/std_data SUFFIXES = .sh -- cgit v1.2.1 From e5382ef74f5887d3befb0916c8dc17c277898c3d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Mar 2003 18:43:56 +0100 Subject: --new option and local variable to optionally turn on "very new functions" - for now 4.1-compatible TIMESTAMT format --- mysql-test/r/type_timestamp.result | 20 ++++++++++++++++++++ mysql-test/t/type_timestamp.test | 14 ++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 088f3b205b9..85e5c2c194f 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -84,3 +84,23 @@ date date_time time_stamp 2005-01-01 2005-01-01 00:00:00 20050101000000 2030-01-01 2030-01-01 00:00:00 20300101000000 drop table t1; +show variables like 'new'; +Variable_name Value +new OFF +create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6), +t8 timestamp(8), t10 timestamp(10), t12 timestamp(12), +t14 timestamp(14)); +insert t1 values (0,0,0,0,0,0,0), +("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", +"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", +"1997-12-31 23:47:59"); +select * from t1; +t2 t4 t6 t8 t10 t12 t14 +00 0000 000000 00000000 0000000000 000000000000 00000000000000 +97 9712 971231 19971231 9712312347 971231234759 19971231234759 +set new=1; +select * from t1; +t2 t4 t6 t8 t10 t12 t14 +00 00-00 00-00-00 0000-00-00 00-00-00 00:00 00-00-00 00:00:00 0000-00-00 00:00:00 +97 97-12 97-12-31 1997-12-31 97-12-31 23:47 97-12-31 23:47:59 1997-12-31 23:47:59 +drop table t1; diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 2929184df93..eb0def74a17 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -55,3 +55,17 @@ INSERT INTO t1 VALUES ("2030-01-01","2030-01-01 00:00:00",20300101000000); #INSERT INTO t1 VALUES ("2050-01-01","2050-01-01 00:00:00",20500101000000); SELECT * FROM t1; drop table t1; + +show variables like 'new'; +create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6), + t8 timestamp(8), t10 timestamp(10), t12 timestamp(12), + t14 timestamp(14)); +insert t1 values (0,0,0,0,0,0,0), +("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", +"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", +"1997-12-31 23:47:59"); +select * from t1; +set new=1; +select * from t1; +drop table t1; + -- cgit v1.2.1 From 62ada91165198a4c8c3828514dab0ab989f05ac1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Mar 2003 10:54:27 +0100 Subject: disable partial timestamps in --new mode --- mysql-test/r/type_timestamp.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 85e5c2c194f..3d5d74709c1 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -101,6 +101,6 @@ t2 t4 t6 t8 t10 t12 t14 set new=1; select * from t1; t2 t4 t6 t8 t10 t12 t14 -00 00-00 00-00-00 0000-00-00 00-00-00 00:00 00-00-00 00:00:00 0000-00-00 00:00:00 -97 97-12 97-12-31 1997-12-31 97-12-31 23:47 97-12-31 23:47:59 1997-12-31 23:47:59 +0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 +1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 drop table t1; -- cgit v1.2.1 From efadca644132c76beb4b06b5db4b6f3533a95e29 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Mar 2003 12:36:52 +0200 Subject: Fixed AUTO_INCREMENT handling in MyISAM (last auto_increment patch broke things) Some after merge fixes mysql-test/r/ctype_latin1_de.result: Changed test to have more relevant results mysql-test/r/delete.result: Updated results after merge mysql-test/r/select.result: Remove explicit database usage mysql-test/r/type_datetime.result: Updated results after merge mysql-test/t/ctype_latin1_de.test: Changed test to have more relevant results mysql-test/t/select.test: Remove explicit database usage sql/ha_myisam.cc: Fixed AUTO_INCREMENT handling in MyISAM (last auto_increment patch broke things) --- mysql-test/r/ctype_latin1_de.result | 210 ++++++++++++++++++------------------ mysql-test/r/delete.result | 15 +++ mysql-test/r/select.result | 1 - mysql-test/r/type_datetime.result | 15 --- mysql-test/t/ctype_latin1_de.test | 4 +- mysql-test/t/select.test | 2 - 6 files changed, 124 insertions(+), 123 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result index e5ae6f249ee..b79bc67138c 100644 --- a/mysql-test/r/ctype_latin1_de.result +++ b/mysql-test/r/ctype_latin1_de.result @@ -1,93 +1,95 @@ drop table if exists t1; -create table t1 (a char (20) not null, b int not null auto_increment, index (a,b),index(b)); +create table t1 (a char (20) not null, b int not null auto_increment, index (a,b)); insert into t1 (a) values ('ä'),('ac'),('ae'),('ad'),('Äc'),('aeb'); insert into t1 (a) values ('üc'),('uc'),('ue'),('ud'),('Ü'),('ueb'),('uf'); insert into t1 (a) values ('ö'),('oc'),('Öa'),('oe'),('od'),('Öc'),('oeb'); insert into t1 (a) values ('s'),('ss'),('ß'),('ßb'),('ssa'),('ssc'),('ßa'); insert into t1 (a) values ('eä'),('uü'),('öo'),('ää'),('ääa'),('aeae'); -insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'); +insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'),('a'); select a,b from t1 order by a,b; a b -a 35 -ac 2 -ad 4 +a 1 +a 2 +ac 1 +ad 1 ä 1 -ae 3 -ää 31 -aeae 33 -ääa 32 -aeb 6 -Äc 5 -é 38 -É 39 -eä 28 -o 37 -oc 15 -od 18 -ö 14 -oe 17 -Öa 16 -oeb 20 -Öc 19 -öo 30 -q 34 -s 21 -ss 22 -ß 23 -ssa 25 -ßa 27 -ßb 24 -ssc 26 -u 36 -uc 8 -ud 10 -ue 9 -Ü 11 -ueb 12 -üc 7 -uf 13 -uü 29 +ae 2 +ää 1 +aeae 2 +ääa 1 +aeb 1 +Äc 1 +é 1 +É 2 +eä 1 +o 1 +oc 1 +od 1 +ö 1 +oe 2 +Öa 1 +oeb 1 +Öc 1 +öo 1 +q 1 +s 1 +ss 1 +ß 2 +ssa 1 +ßa 2 +ßb 1 +ssc 1 +u 1 +uc 1 +ud 1 +ue 1 +Ü 2 +ueb 1 +üc 1 +uf 1 +uü 1 select a,b from t1 order by upper(a),b; a b -a 35 -ac 2 -ad 4 +a 1 +a 2 +ac 1 +ad 1 ä 1 -ae 3 -ää 31 -aeae 33 -ääa 32 -aeb 6 -Äc 5 -é 38 -É 39 -eä 28 -o 37 -oc 15 -od 18 -ö 14 -oe 17 -Öa 16 -oeb 20 -Öc 19 -öo 30 -q 34 -s 21 -ss 22 -ß 23 -ssa 25 -ßa 27 -ßb 24 -ssc 26 -u 36 -uc 8 -ud 10 -ue 9 -Ü 11 -ueb 12 -üc 7 -uf 13 -uü 29 +ae 2 +ää 1 +aeae 2 +ääa 1 +aeb 1 +Äc 1 +é 1 +É 2 +eä 1 +o 1 +oc 1 +od 1 +ö 1 +oe 2 +Öa 1 +oeb 1 +Öc 1 +öo 1 +q 1 +s 1 +ss 1 +ß 2 +ssa 1 +ßa 2 +ßb 1 +ssc 1 +u 1 +uc 1 +ud 1 +ue 1 +Ü 2 +ueb 1 +üc 1 +uf 1 +uü 1 select a from t1 order by a desc; a uü @@ -129,44 +131,46 @@ ae ad ac a +a check table t1; Table Op Msg_type Msg_text test.t1 check status OK select * from t1 where a like "ö%"; a b -ö 14 -Öa 16 -Öc 19 -öo 30 +ö 1 +Öa 1 +Öc 1 +öo 1 select * from t1 where a like binary "%É%"; a b -É 39 +É 2 select * from t1 where a like "%Á%"; a b -a 35 -ac 2 -ad 4 -ae 3 -aeae 33 -ääa 32 -aeb 6 -Öa 16 -ssa 25 -ßa 27 +a 1 +a 2 +ac 1 +ad 1 +ae 2 +aeae 2 +ääa 1 +aeb 1 +Öa 1 +ssa 1 +ßa 2 select * from t1 where a like "%U%"; a b -u 36 -uc 8 -ud 10 -ue 9 -ueb 12 -uf 13 -uü 29 +u 1 +uc 1 +ud 1 +ue 1 +ueb 1 +uf 1 +uü 1 select * from t1 where a like "%ss%"; a b -ss 22 -ssa 25 -ssc 26 +ss 1 +ssa 1 +ssc 1 drop table t1; select strcmp('ä','ae'),strcmp('ae','ä'),strcmp('aeq','äq'),strcmp('äq','aeq'); strcmp('ä','ae') strcmp('ae','ä') strcmp('aeq','äq') strcmp('äq','aeq') diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index c2230722aa6..582ab894233 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -24,3 +24,18 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); delete from t1 where a=27; drop table t1; +CREATE TABLE t1 ( +bool char(0) default NULL, +not_null varchar(20) binary NOT NULL default '', +misc integer not null, +PRIMARY KEY (not_null) +) TYPE=MyISAM; +INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7); +select * from t1 where misc > 5 and bool is null; +bool not_null misc +NULL c 6 +NULL d 7 +delete from t1 where misc > 5 and bool is null; +select * from t1 where misc > 5 and bool is null; +bool not_null misc +drop table t1; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index a921d75f20a..b71c6ada03f 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -1,4 +1,3 @@ -use test; drop table if exists t1,t2,t3,t4; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index b71884f8563..4785f790069 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -78,21 +78,6 @@ EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; table type possible_keys key key_len ref rows Extra t1 ref expedition expedition 8 const 1 Using where drop table t1; -CREATE TABLE `t1` ( - `date` datetime NOT NULL default '0000-00-00 00:00:00', - `numfacture` int(6) unsigned NOT NULL default '0', - `expedition` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`numfacture`), - KEY `date` (`date`), - KEY `expedition` (`expedition`) -) TYPE=MyISAM; - -INSERT INTO t1 (expedition) VALUES ('0001-00-00 00:00:00'); -SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; -INSERT INTO t1 (numfacture,expedition) VALUES ('1212','0001-00-00 00:00:00'); -SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; -EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; -drop table t1; create table t1 (a datetime not null, b datetime not null); insert into t1 values (now(), now()); insert into t1 values (now(), now()); diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test index e829005a229..4b96f5f5867 100644 --- a/mysql-test/t/ctype_latin1_de.test +++ b/mysql-test/t/ctype_latin1_de.test @@ -2,13 +2,13 @@ # Test latin_de character set # drop table if exists t1; -create table t1 (a char (20) not null, b int not null auto_increment, index (a,b),index(b)); +create table t1 (a char (20) not null, b int not null auto_increment, index (a,b)); insert into t1 (a) values ('ä'),('ac'),('ae'),('ad'),('Äc'),('aeb'); insert into t1 (a) values ('üc'),('uc'),('ue'),('ud'),('Ü'),('ueb'),('uf'); insert into t1 (a) values ('ö'),('oc'),('Öa'),('oe'),('od'),('Öc'),('oeb'); insert into t1 (a) values ('s'),('ss'),('ß'),('ßb'),('ssa'),('ssc'),('ßa'); insert into t1 (a) values ('eä'),('uü'),('öo'),('ää'),('ääa'),('aeae'); -insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'); +insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'),('a'); select a,b from t1 order by a,b; select a,b from t1 order by upper(a),b; select a from t1 order by a desc; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index d9b75fca362..89cc2a57b30 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -6,8 +6,6 @@ # Simple select test # -use test; - drop table if exists t1,t2,t3,t4; CREATE TABLE t1 ( -- cgit v1.2.1 From 157b36675eccce990a816532153bb2eb61aa139c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Mar 2003 14:40:37 +0200 Subject: Fixed an unlikely optimizer bug that casued a core dump in pt_range.cc::sel_cmp() mysql-test/r/join.result: Test of range optimizer bug mysql-test/t/join.test: Test of range optimizer bug sql/sql_rename.cc: Added missing DEBUG_PRINT() --- mysql-test/r/join.result | 4 ++++ mysql-test/t/join.test | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 39331fc68e4..0c575d7505e 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -37,3 +37,7 @@ COUNT(t1.Title) t1_id t2_id type cost_unit min_value max_value t3_id item_id id name 22 1 Percent Cost 100 -1 6 291 1 s1 23 1 Percent Cost 100 -1 21 291 1 s1 +rate_code base_rate +cust 20 +rate_code base_rate +cust 20 diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index d31db5c4837..6a022e690f2 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -219,3 +219,27 @@ CREATE TABLE t2 ( INSERT INTO t2 VALUES (1,'s1'),(2,'s2'),(3,'s3'),(4,'s4'),(5,'s5'); select t1.*, t2.* from t1, t2 where t2.id=t1.t2_id limit 2; drop table t1,t2; + +# +# Bug in range optimiser with MAYBE_KEY +# + +CREATE TABLE t1 ( + siteid varchar(25) NOT NULL default '', + emp_id varchar(30) NOT NULL default '', + rate_code varchar(10) default NULL, + UNIQUE KEY site_emp (siteid,emp_id), + KEY siteid (siteid) +) TYPE=MyISAM; +INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust'); +CREATE TABLE t2 ( + siteid varchar(25) NOT NULL default '', + rate_code varchar(10) NOT NULL default '', + base_rate float NOT NULL default '0', + PRIMARY KEY (siteid,rate_code), + FULLTEXT KEY rate_code (rate_code) +) TYPE=MyISAM; +INSERT INTO t2 VALUES ('rivercats','cust',20); +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats'; +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE lr.siteid = 'rivercats' AND emp.emp_id = 'psmith'; +drop table t1,t2; -- cgit v1.2.1 From fd5182cb743edcb20122ca004a26ee6079958ff8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 9 Mar 2003 17:13:37 +0200 Subject: Changed --debug to append to test instead of creating new trace files. (This patch is already in 4.0) mysql-test/mysql-test-run.sh: Changed --debug to append to test instead of creating new trace files --- mysql-test/mysql-test-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 8b1c8ff1b44..faa49969a23 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -220,9 +220,9 @@ while test $# -gt 0; do ;; --debug) EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT \ - --debug=d:t:i:O,$MYSQL_TEST_DIR/var/log/master.trace" + --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/master.trace" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \ - --debug=d:t:i:O,$MYSQL_TEST_DIR/var/log/slave.trace" + --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/slave.trace" EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT --debug" ;; -- ) shift; break ;; -- cgit v1.2.1 From 68ae365395c78eba74b4db66fb0989e76d221d0d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Mar 2003 11:22:37 +0200 Subject: Don't allow BACKUP TABLE to overwrite files Fixed memory leak when replication restarts in debug mode include/my_sys.h: Added option to not overwrite files to my_copy() mysql-test/mysql-test-run.sh: Fixed --ddd option Fixed that mysqld is restarted if there is a testname-master.sh file mysql-test/r/backup.result: Update for security fix in BACKUP TABLE mysql-test/t/backup.test: Update for security fix in BACKUP TABLE mysys/my_copy.c: Added option to not overwrite files to my_copy() sql/ha_myisam.cc: Don't allow BACKUP TABLE to overwrite files sql/slave.cc: Fixed problem with --debug output from 'handle_slave' Fixed memory leak when replication restarts in debug mode --- mysql-test/mysql-test-run.sh | 4 ++-- mysql-test/r/backup.result | 14 ++++++++------ mysql-test/t/backup-master.sh | 5 +++++ mysql-test/t/backup.test | 39 +++++++++++++++++++++------------------ 4 files changed, 36 insertions(+), 26 deletions(-) create mode 100755 mysql-test/t/backup-master.sh (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 8b1c8ff1b44..e6a52ba8756 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -604,7 +604,7 @@ start_slave() $EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT" if [ x$DO_DDD = x1 ] then - $ECHO "set args $master_args" > $GDB_SLAVE_INIT + $ECHO "set args $slave_args" > $GDB_SLAVE_INIT ddd --debugger "gdb -x $GDB_SLAVE_INIT" $SLAVE_MYSQLD & prompt_user "Hit enter to continue after you've started the slave" elif [ x$DO_GDB = x1 ] @@ -746,7 +746,7 @@ run_testcase () stop_master start_master else - if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] ; + if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] || [ -f $master_init_script ] then EXTRA_MASTER_OPT="" stop_master diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result index 2bbe15954dc..0d34cd7eae8 100644 --- a/mysql-test/r/backup.result +++ b/mysql-test/r/backup.result @@ -1,10 +1,13 @@ Table Op Msg_type Msg_text -test.t1 backup error Failed copying .frm file: errno = X -test.t1 backup status Operation failed +test.t4 backup error Failed copying .frm file (errno: X) +test.t4 backup status Operation failed Table Op Msg_type Msg_text -test.t1 backup status OK +test.t4 backup status OK Table Op Msg_type Msg_text -test.t1 restore status OK +test.t4 backup error Failed copying .frm file (errno: X) +test.t4 backup status Operation failed +Table Op Msg_type Msg_text +test.t4 restore status OK count(*) 0 Table Op Msg_type Msg_text @@ -18,7 +21,6 @@ n 45 67 Table Op Msg_type Msg_text -test.t1 backup status OK test.t2 backup status OK test.t3 backup status OK Table Op Msg_type Msg_text @@ -40,4 +42,4 @@ k Table Op Msg_type Msg_text test.t1 restore status OK Table Op Msg_type Msg_text -test.t1 backup status OK +test.t5 backup status OK diff --git a/mysql-test/t/backup-master.sh b/mysql-test/t/backup-master.sh new file mode 100755 index 00000000000..99da5857afe --- /dev/null +++ b/mysql-test/t/backup-master.sh @@ -0,0 +1,5 @@ +#!/bin/sh +if [ "$MYSQL_TEST_DIR" ] +then + rm -f $MYSQL_TEST_DIR/var/tmp/*.frm $MYSQL_TEST_DIR/var/tmp/*.MY? +fi diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index 71343783d69..e4d5be00445 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -1,15 +1,23 @@ +# +# This test is a bit tricky as we can't use backup table to overwrite an old +# table +# connect (con1,localhost,root,,); connect (con2,localhost,root,,); connection con1; set SQL_LOG_BIN=0; -drop table if exists t1; +drop table if exists t1,t2,t3,t4; +create table t4(n int); +--replace_result "errno: 2" "errno: X" "errno: 22" "errno: X" "errno: 23" "errno: X" +backup table t4 to '../bogus'; +backup table t4 to '../tmp'; +--replace_result "errno: 17" "errno: X" +backup table t4 to '../tmp'; +drop table t4; +restore table t4 from '../tmp'; +select count(*) from t4; + create table t1(n int); ---replace_result "errno = 2" "errno = X" "errno = 22" "errno = X" "errno = 23" "errno = X" -backup table t1 to '../bogus'; -backup table t1 to '../tmp'; -drop table t1; -restore table t1 from '../tmp'; -select count(*) from t1; insert into t1 values (23),(45),(67); backup table t1 to '../tmp'; drop table t1; @@ -20,29 +28,24 @@ create table t2(m int not null primary key); create table t3(k int not null primary key); insert into t2 values (123),(145),(167); insert into t3 values (223),(245),(267); -backup table t1,t2,t3 to '../tmp'; +backup table t2,t3 to '../tmp'; drop table t1,t2,t3; restore table t1,t2,t3 from '../tmp'; select n from t1; select m from t2; select k from t3; -drop table t1,t2,t3; +drop table t1,t2,t3,t4; restore table t1 from '../tmp'; connection con2; +rename table t1 to t5; --send -lock tables t1 write; +lock tables t5 write; connection con1; --send -backup table t1 to '../tmp'; +backup table t5 to '../tmp'; connection con2; reap; unlock tables; connection con1; reap; -drop table t1; - - - - - - +drop table t5; -- cgit v1.2.1 From 5c100a6975cb50a6e20e6a0380bfb616e54eab70 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Mar 2003 13:54:20 +0200 Subject: after merge fixes --- mysql-test/r/backup.result | 40 +++++++++++++++++++++------------------ mysql-test/r/delete.result | 15 +++++++++++++++ mysql-test/r/join.result | 19 +++++++++++++++++++ mysql-test/r/type_datetime.result | 6 ++++++ 4 files changed, 62 insertions(+), 18 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result index 43d57d2d4f7..0e0a87172f2 100644 --- a/mysql-test/r/backup.result +++ b/mysql-test/r/backup.result @@ -1,20 +1,24 @@ set SQL_LOG_BIN=0; -drop table if exists t1; -create table t1(n int); -backup table t1 to '../bogus'; +create table t4(n int); +backup table t4 to '../bogus'; Table Op Msg_type Msg_text -test.t1 backup error Failed copying .frm file: errno = X -test.t1 backup status Operation failed -backup table t1 to '../tmp'; +test.t4 backup error Failed copying .frm file (errno: X) +test.t4 backup status Operation failed +backup table t4 to '../tmp'; Table Op Msg_type Msg_text -test.t1 backup status OK -drop table t1; -restore table t1 from '../tmp'; +test.t4 backup status OK +backup table t4 to '../tmp'; Table Op Msg_type Msg_text -test.t1 restore status OK -select count(*) from t1; +test.t4 backup error Failed copying .frm file (errno: X) +test.t4 backup status Operation failed +drop table t4; +restore table t4 from '../tmp'; +Table Op Msg_type Msg_text +test.t4 restore status OK +select count(*) from t4; count(*) 0 +create table t1(n int); insert into t1 values (23),(45),(67); backup table t1 to '../tmp'; Table Op Msg_type Msg_text @@ -35,9 +39,8 @@ create table t2(m int not null primary key); create table t3(k int not null primary key); insert into t2 values (123),(145),(167); insert into t3 values (223),(245),(267); -backup table t1,t2,t3 to '../tmp'; +backup table t2,t3 to '../tmp'; Table Op Msg_type Msg_text -test.t1 backup status OK test.t2 backup status OK test.t3 backup status OK drop table t1,t2,t3; @@ -61,13 +64,14 @@ k 223 245 267 -drop table t1,t2,t3; +drop table t1,t2,t3,t4; restore table t1 from '../tmp'; Table Op Msg_type Msg_text test.t1 restore status OK -lock tables t1 write; -backup table t1 to '../tmp'; +rename table t1 to t5; +lock tables t5 write; +backup table t5 to '../tmp'; unlock tables; Table Op Msg_type Msg_text -test.t1 backup status OK -drop table t1; +test.t5 backup status OK +drop table t5; diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index c2230722aa6..582ab894233 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -24,3 +24,18 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); delete from t1 where a=27; drop table t1; +CREATE TABLE t1 ( +bool char(0) default NULL, +not_null varchar(20) binary NOT NULL default '', +misc integer not null, +PRIMARY KEY (not_null) +) TYPE=MyISAM; +INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7); +select * from t1 where misc > 5 and bool is null; +bool not_null misc +NULL c 6 +NULL d 7 +delete from t1 where misc > 5 and bool is null; +select * from t1 where misc > 5 and bool is null; +bool not_null misc +drop table t1; diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index d8c45ca09ce..9f6a8762325 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -251,7 +251,26 @@ t1_id t2_id type cost_unit min_value max_value t3_id item_id id name 22 1 Percent Cost 100 -1 6 291 1 s1 23 1 Percent Cost 100 -1 21 291 1 s1 drop table t1,t2; +CREATE TABLE t1 ( +siteid varchar(25) NOT NULL default '', +emp_id varchar(30) NOT NULL default '', +rate_code varchar(10) default NULL, +UNIQUE KEY site_emp (siteid,emp_id), +KEY siteid (siteid) +) TYPE=MyISAM; +INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust'); +CREATE TABLE t2 ( +siteid varchar(25) NOT NULL default '', +rate_code varchar(10) NOT NULL default '', +base_rate float NOT NULL default '0', +PRIMARY KEY (siteid,rate_code), +FULLTEXT KEY rate_code (rate_code) +) TYPE=MyISAM; +INSERT INTO t2 VALUES ('rivercats','cust',20); +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats'; rate_code base_rate cust 20 +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE lr.siteid = 'rivercats' AND emp.emp_id = 'psmith'; rate_code base_rate cust 20 +drop table t1,t2; diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 38b264b96b9..4785f790069 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -78,3 +78,9 @@ EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; table type possible_keys key key_len ref rows Extra t1 ref expedition expedition 8 const 1 Using where drop table t1; +create table t1 (a datetime not null, b datetime not null); +insert into t1 values (now(), now()); +insert into t1 values (now(), now()); +select * from t1 where a is null or b is null; +a b +drop table t1; -- cgit v1.2.1 From 3ab655681c4dc87226f3048a60d4ad3abf310f72 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Mar 2003 13:41:53 +0400 Subject: Openssl test client/mysqltest.c: For openssl test BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- mysql-test/include/have_openssl_1.inc | 2 +- mysql-test/mysql-test-run.sh | 8 +++++-- mysql-test/r/have_openssl_1.require | 2 +- mysql-test/r/openssl_1.result | 34 ++++++++++++++++++++++++-- mysql-test/t/openssl_1.test | 45 +++++++++++++++++++++++++++++++---- 5 files changed, 81 insertions(+), 10 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/have_openssl_1.inc b/mysql-test/include/have_openssl_1.inc index 4d3646abdc2..887309c7e23 100644 --- a/mysql-test/include/have_openssl_1.inc +++ b/mysql-test/include/have_openssl_1.inc @@ -1,4 +1,4 @@ -- require r/have_openssl_1.require disable_query_log; -show variables like "have_openssl"; +SHOW STATUS LIKE 'Ssl_cipher'; enable_query_log; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 48bb94ea0e4..689614c1740 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -207,6 +207,7 @@ CHARACTER_SET=latin1 DBUSER="" START_WAIT_TIMEOUT=10 STOP_WAIT_TIMEOUT=10 +MYSQL_TEST_SSL_OPTS="" while test $# -gt 0; do case "$1" in @@ -237,7 +238,10 @@ while test $# -gt 0; do EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \ --ssl-ca=$BASEDIR/SSL/cacert.pem \ --ssl-cert=$BASEDIR/SSL/server-cert.pem \ - --ssl-key=$BASEDIR/SSL/server-key.pem" ;; + --ssl-key=$BASEDIR/SSL/server-key.pem" + MYSQL_TEST_SSL_OPTS="--ssl-ca=$BASEDIR/SSL/cacert.pem \ + --ssl-cert=$BASEDIR/SSL/client-cert.pem \ + --ssl-key=$BASEDIR/SSL/client-key.pem" ;; --no-manager | --skip-manager) USE_MANAGER=0 ;; --manager) USE_MANAGER=1 @@ -489,7 +493,7 @@ fi MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ - --tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT" + --tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT $MYSQL_TEST_SSL_OPTS" MYSQL_TEST_BIN=$MYSQL_TEST MYSQL_TEST="$MYSQL_TEST $MYSQL_TEST_ARGS" GDB_CLIENT_INIT=$MYSQL_TMP_DIR/gdbinit.client diff --git a/mysql-test/r/have_openssl_1.require b/mysql-test/r/have_openssl_1.require index dae48a472b5..032b60d544a 100644 --- a/mysql-test/r/have_openssl_1.require +++ b/mysql-test/r/have_openssl_1.require @@ -1,2 +1,2 @@ Variable_name Value -have_openssl YES +Ssl_cipher EDH-RSA-DES-CBC3-SHA diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index b5c67dfbcb0..65b882c0a9b 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -1,2 +1,32 @@ -SHOW STATUS LIKE 'SSL%'; -Variable_name Value +drop table if exists t1; +create table t1(f1 int); +insert into t1 values (5); +grant select on test.* to ssl_user1@localhost require SSL; +grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; +grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com"; +grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com" ISSUER "/C=RU/ST=Some-State/L=Orenburg/O=MySQL AB/CN=Walrus/Email=walrus@mysql.com"; +flush privileges; +select * from t1; +f1 +5 +delete from t1; +Access denied for user: 'ssl_user1@localhost' to database 'test' +select * from t1; +f1 +5 +delete from t1; +Access denied for user: 'ssl_user2@localhost' to database 'test' +select * from t1; +f1 +5 +delete from t1; +Access denied for user: 'ssl_user3@localhost' to database 'test' +select * from t1; +f1 +5 +delete from t1; +Access denied for user: 'ssl_user4@localhost' to database 'test' +delete from mysql.user where user='ssl_user%'; +delete from mysql.db where user='ssl_user%'; +flush privileges; +drop table t1; diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 8dfd0d8c2f9..3af7406cef3 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -1,6 +1,43 @@ -# We test openssl. Result set is optimized to be compiled with --with-openssl but -# SSL is swithced off in some reason --- source include/have_openssl_2.inc +# We test openssl. Result set is optimized to be compiled with --with-openssl. +# Use mysql-test-run with --with-openssl option. +-- source include/have_openssl_1.inc -SHOW STATUS LIKE 'SSL%'; +drop table if exists t1; +create table t1(f1 int); +insert into t1 values (5); +grant select on test.* to ssl_user1@localhost require SSL; +grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; +grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com"; +grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com" ISSUER "/C=RU/ST=Some-State/L=Orenburg/O=MySQL AB/CN=Walrus/Email=walrus@mysql.com"; +flush privileges; +connect (con1,localhost,ssl_user1,,); +connect (con2,localhost,ssl_user2,,); +connect (con3,localhost,ssl_user3,,); +connect (con4,localhost,ssl_user4,,); + +connection con1; +select * from t1; +--error 1044; +delete from t1; + +connection con2; +select * from t1; +--error 1044; +delete from t1; + +connection con3; +select * from t1; +--error 1044; +delete from t1; + +connection con4; +select * from t1; +--error 1044; +delete from t1; + +connection default; +delete from mysql.user where user='ssl_user%'; +delete from mysql.db where user='ssl_user%'; +flush privileges; +drop table t1; -- cgit v1.2.1 From 8162aec6b9155d0e97d58a0b9c43716ce7adb320 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Mar 2003 18:34:00 +0200 Subject: fixed bug of unchecked random part of WHERE clause (bug #142) mysql-test/r/select.result: test of random WHERE clause mysql-test/t/select.test: test of random WHERE clause sql/sql_select.cc: fixed bug of unchecked random part of WHERE clause --- mysql-test/r/select.result | 1 + mysql-test/t/select.test | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 5ac5de05f97..dcb796b8e00 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -1793,3 +1793,4 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par t2 0 PRIMARY 1 auto A 1199 NULL NULL t2 0 fld1 1 fld1 A 1199 NULL NULL t2 1 fld3 1 fld3 A NULL NULL NULL +1 diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index cdb6ee57e0f..2caadd99dbb 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1712,8 +1712,23 @@ show full columns from t2 from test like 'f%'; show full columns from t2 from test like 's%'; show keys from t2; +# +# random in WHERE clause +# + +drop table t1; +CREATE TABLE t1 ( + id mediumint(8) unsigned NOT NULL auto_increment, + pseudo varchar(35) NOT NULL default '', + PRIMARY KEY (id), + UNIQUE KEY pseudo (pseudo) +); +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 from t1 where rand() > 2; + # # Drop the test tables # -drop table t4, t3,t2, t1; +drop table t4, t3, t2, t1; -- cgit v1.2.1 From fd59fb1031bfcf0d0154f192fe8d8895a2f69b5a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Mar 2003 19:40:49 +0200 Subject: A bug fix for multi-table updates with InnoDB storage engine --- mysql-test/r/innodb.result | 17 +++++++++++++++++ mysql-test/t/innodb.test | 11 +++++++++++ 2 files changed, 28 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index d65e90a6cc0..e577ddb9ecd 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1074,3 +1074,20 @@ id select * from t2; id t1_id drop table t1,t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; +CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) TYPE=INNODB; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, 1); +SELECT * from t1; +id +1 +UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; +SELECT * from t1; +id +2 +UPDATE t1,t2 SET t1.id=t1.id+1; +SELECT * from t1; +id +3 +DROP TABLE IF EXISTS t1,t2; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 7d13258ede1..bd44038b446 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -715,3 +715,14 @@ delete t1,t2 from t1,t2 where t1.id=t2.t1_id; select * from t1; select * from t2; drop table t1,t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; +CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) TYPE=INNODB; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, 1); +SELECT * from t1; +UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; +SELECT * from t1; +UPDATE t1,t2 SET t1.id=t1.id+1; +SELECT * from t1; +DROP TABLE IF EXISTS t1,t2; -- cgit v1.2.1 From dccac5839636906822aa4e07fb7da79fb2668ab6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Mar 2003 21:20:53 +0100 Subject: fixed an obscure bug in group by + having + Item_ref::get_date --- mysql-test/r/group_by.result | 1 + mysql-test/t/group_by.test | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 113f8325685..0073827056d 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -128,3 +128,4 @@ a MAX(b) ELT(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f') a MAX(b) MAKE_SET(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') 1 4 c 10 43 a,b,d,f +a c count(distinct rand()) diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 6e256d7896f..20e11713d31 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -346,3 +346,11 @@ select a, MAX(b), CONCAT_WS(MAX(b), '43', '4', '5') from t1 group by a; select a, MAX(b), ELT(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f') from t1 group by a; select a, MAX(b), MAKE_SET(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') from t1 group by a; drop table t1; + +# not purely group_by bug, but group_by is involved... + +create table t1 (a date default null, b date default null); +insert t1 values ('1999-10-01','2000-01-10'), ('1997-01-01','1998-10-01'); +select a,min(b) c,count(distinct rand()) from t1 group by a having c Date: Wed, 12 Mar 2003 01:40:06 +0200 Subject: Simple fixes (nothing notable) dbug/dbug.c: Remove duplicate va_end() call mysql-test/mysql-test-run.sh: Longer stack trace from valgrind mysys/my_lib.c: Fixed wrong dbug printf sql/slave.cc: Simple optimization sql/sql_class.cc: Added DBUG info --- mysql-test/mysql-test-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index e0e9af2432a..978fcdfd2b3 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -326,7 +326,7 @@ while test $# -gt 0; do USE_RUNNING_SERVER="" ;; --valgrind) - VALGRIND="valgrind --alignment=8 --leak-check=yes" + VALGRIND="valgrind --alignment=8 --leak-check=yes --num-callers=16" EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc" SLEEP_TIME_AFTER_RESTART=10 -- cgit v1.2.1 From cbbe5e8e2b45d20fbf06c3110e86d3faa5ba5542 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Mar 2003 14:34:07 +0200 Subject: A little bit improved test case --- mysql-test/r/innodb.result | 2 +- mysql-test/t/innodb.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index e577ddb9ecd..66e748579de 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1086,7 +1086,7 @@ UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; SELECT * from t1; id 2 -UPDATE t1,t2 SET t1.id=t1.id+1; +UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id; SELECT * from t1; id 3 diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index bd44038b446..6a6bb850902 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -723,6 +723,6 @@ INSERT INTO t2 VALUES(1, 1); SELECT * from t1; UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; SELECT * from t1; -UPDATE t1,t2 SET t1.id=t1.id+1; +UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id; SELECT * from t1; DROP TABLE IF EXISTS t1,t2; -- cgit v1.2.1 From 72f44dafe6ed6580a1b5775a1d0c11ff84722445 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Mar 2003 16:43:01 +0200 Subject: NEWDATE -> DATE in anylyse() output Changed that analyse(#) also affects strings mysql-test/r/analyse.result: Better analyse test mysql-test/t/analyse.test: Better analyse test sql/sql_analyse.cc: NEWDATE -> DATE in anylyse() output Changed that analyse(#) also affects strings Fixed that number of elements in ENUM is limited by # not by #+1 --- mysql-test/r/analyse.result | 12 ++++++++++++ mysql-test/t/analyse.test | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index f6b8cc2fcbf..e69a7e99992 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -1,6 +1,18 @@ Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL +t1.empty_string 0 0 4 0 0.0000 NULL ENUM('') NOT NULL +t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +t1.d 2002-03-04 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +t1.i 1 7 1 1 0 0 4.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL +t1.j 2 8 1 1 0 0 5.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL +t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL +t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +t1.d 2002-03-04 10 10 0 0 10.0000 NULL DATE NOT NULL Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL +t1.empty_string 0 0 4 0 0.0000 NULL ENUM('') NOT NULL +t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +t1.d 2002-03-04 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test index 1b5022f6e4c..a937318aa6c 100644 --- a/mysql-test/t/analyse.test +++ b/mysql-test/t/analyse.test @@ -2,9 +2,10 @@ # Test of procedure analyse # -create table t1 (i int, j int); -insert into t1 values (1,2), (3,4), (5,6), (7,8); +create table t1 (i int, j int, empty_string char(10), bool char(1), d date); +insert into t1 values (1,2,"","Y","2002-03-03"), (3,4,"","N","2002-03-04"), (5,6,"","Y","2002-03-04"), (7,8,"","N","2002-03-05"); select * from t1 procedure analyse(); +select * from t1 procedure analyse(2); create table t2 select * from t1 procedure analyse(); select * from t2; drop table t1,t2; -- cgit v1.2.1 From da9d94997cd63c746cb1201e8ccf44a437cb1dde Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Mar 2003 20:33:41 +0200 Subject: making sure that test works. --- mysql-test/r/innodb.result | 2 +- mysql-test/t/innodb.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 66e748579de..caf3e10be80 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1090,4 +1090,4 @@ UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id; SELECT * from t1; id 3 -DROP TABLE IF EXISTS t1,t2; +DROP TABLE t1,t2; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 6a6bb850902..556822ab51d 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -725,4 +725,4 @@ UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; SELECT * from t1; UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id; SELECT * from t1; -DROP TABLE IF EXISTS t1,t2; +DROP TABLE t1,t2; -- cgit v1.2.1 From 012c8f9175c826b8b154fd9d1ef64ce560ff718d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Mar 2003 14:34:07 +0100 Subject: test result updated after merge --- mysql-test/r/analyse.result | 17 +++++++++++++++-- mysql-test/r/group_by.result | 5 +++++ mysql-test/r/select.result | 13 +++++++++++-- 3 files changed, 31 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index c183530df48..5e859bb0b7a 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -1,13 +1,26 @@ drop table if exists t1,t2; -create table t1 (i int, j int); -insert into t1 values (1,2), (3,4), (5,6), (7,8); +create table t1 (i int, j int, empty_string char(10), bool char(1), d date); +insert into t1 values (1,2,"","Y","2002-03-03"), (3,4,"","N","2002-03-04"), (5,6,"","Y","2002-03-04"), (7,8,"","N","2002-03-05"); select * from t1 procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL +t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL +t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL +select * from t1 procedure analyse(2); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +t1.i 1 7 1 1 0 0 4.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL +t1.j 2 8 1 1 0 0 5.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL +t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL +t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL create table t2 select * from t1 procedure analyse(); select * from t2; Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL +t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL +t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL drop table t1,t2; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 6627890f86c..91f33e0cd9f 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -303,6 +303,11 @@ score count(*) 2 1 1 2 drop table t1; +create table t1 (a date default null, b date default null); +insert t1 values ('1999-10-01','2000-01-10'), ('1997-01-01','1998-10-01'); +select a,min(b) c,count(distinct rand()) from t1 group by a having c 2; +DROP TABLE t1; CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp(14) NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) TYPE=MyISAM; INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) TYPE=MyISAM; @@ -3467,7 +3477,6 @@ a a a 2 2 2 3 3 3 drop table t1; -drop table if exists t1,t2; CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) TYPE=MyISAM; INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=MyISAM; @@ -3479,4 +3488,4 @@ aa id t2_id id 4 8302 2519 2519 5 8303 2520 2520 6 8304 2521 2521 -drop table if exists t1,t2; +drop table t1,t2; -- cgit v1.2.1 From e97a000a654d25877f2ab23e2fb3114efa94fa08 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Mar 2003 14:40:13 +0100 Subject: make test result more obvious --- mysql-test/r/select.result | 3 ++- mysql-test/t/select.test | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index bc86ed84edb..1ad3043b4b2 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3251,7 +3251,8 @@ UNIQUE KEY pseudo (pseudo) ); INSERT INTO t1 (pseudo) VALUES ('test'); INSERT INTO t1 (pseudo) VALUES ('test1'); -SELECT 1 from t1 where rand() > 2; +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 DROP TABLE t1; CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp(14) NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) TYPE=MyISAM; INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 85783e30a82..de90eeec2e8 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1739,7 +1739,7 @@ CREATE TABLE t1 ( ); INSERT INTO t1 (pseudo) VALUES ('test'); INSERT INTO t1 (pseudo) VALUES ('test1'); -SELECT 1 from t1 where rand() > 2; +SELECT 1 as rnd1 from t1 where rand() > 2; DROP TABLE t1; # -- cgit v1.2.1 From 03b0df9481c6f83ab67c1c79d8c6cc2db0ca9223 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Mar 2003 17:08:42 +0200 Subject: Check for empty table/column names mysql-test/t/create.test: Test for empty table/column name tests/grant.pl: More tests tests/grant.res: More tests --- mysql-test/t/create.test | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 1a829eec6a3..b11c07e5b8d 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -59,6 +59,14 @@ create table test_$1.test2$ (a int); drop table test_$1.test2$; drop database test_$1; +--error 1103 +create table `` (a int); +--error 1103 +drop table if exists ``; +--error 1166 +create table t1 (`` int); +drop table if exists t1; + # # Test of CREATE ... SELECT with indexes # -- cgit v1.2.1 From 9681f4a8cd242e3828f211e0bed5235e70ee5f4e Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 16 Mar 2003 16:28:30 +0200 Subject: Write binlog before commit when doing INSERT ... SELECT mysql-test/r/create.result: After merge fix sql/sql_insert.cc: Write binlog before commit sql/sql_update.cc: Added comment --- mysql-test/r/create.result | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index c3083dbfb03..0cc98c38d49 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -58,6 +58,13 @@ a$1 $b c$ create table test_$1.test2$ (a int); drop table test_$1.test2$; drop database test_$1; +create table `` (a int); +Incorrect table name '' +drop table if exists ``; +Incorrect table name '' +create table t1 (`` int); +Incorrect column name '' +drop table if exists t1; create table t1 (a int auto_increment not null primary key, B CHAR(20)); insert into t1 (b) values ("hello"),("my"),("world"); create table t2 (key (b)) select * from t1; -- cgit v1.2.1