diff options
author | unknown <monty@mashka.mysql.fi> | 2003-02-04 21:52:14 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-02-04 21:52:14 +0200 |
commit | 2ff82a7b152181a49814f5ea125ca8dc6551fbdd (patch) | |
tree | bad5f8dd7f020cc76a4c5e0f19bd130e3fb4a735 /mysql-test | |
parent | 5a7189cf8c238c991e2b590ee3bb968d13fed63c (diff) | |
parent | dfbd628cd7ec0d3dbe86ee8e4f820d78f10b8ad0 (diff) | |
download | mariadb-git-2ff82a7b152181a49814f5ea125ca8dc6551fbdd.tar.gz |
Merge with 4.0.11
BitKeeper/etc/gone:
auto-union
BitKeeper/etc/logging_ok:
auto-union
Makefile.am:
Auto merged
bdb/os/os_handle.c:
Auto merged
client/mysqladmin.c:
Auto merged
client/mysqlcheck.c:
Auto merged
client/mysqldump.c:
Auto merged
client/mysqltest.c:
Auto merged
extra/resolveip.c:
Auto merged
include/Makefile.am:
Auto merged
include/config-win.h:
Auto merged
include/my_base.h:
Auto merged
include/my_global.h:
Auto merged
include/my_pthread.h:
Auto merged
include/my_sys.h:
Auto merged
include/mysql.h:
Auto merged
innobase/btr/btr0cur.c:
Auto merged
innobase/os/os0file.c:
Auto merged
innobase/srv/srv0srv.c:
Auto merged
innobase/srv/srv0start.c:
Auto merged
libmysql/Makefile.am:
Auto merged
libmysql/Makefile.shared:
Auto merged
libmysql/manager.c:
Auto merged
libmysqld/libmysqld.c:
Auto merged
myisam/ft_static.c:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_open.c:
Auto merged
myisam/mi_test3.c:
Auto merged
myisam/myisamdef.h:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/func_group.result:
Auto merged
mysql-test/r/func_math.result:
Auto merged
mysql-test/r/handler.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/select_found.result:
Auto merged
mysql-test/r/union.result:
Auto merged
mysql-test/t/backup.test:
Auto merged
mysql-test/t/bigint.test:
Auto merged
mysql-test/t/binary.test:
Auto merged
mysql-test/t/count_distinct.test:
Auto merged
mysql-test/t/func_crypt.test:
Auto merged
mysql-test/t/func_group.test:
Auto merged
mysql-test/t/grant_cache.test:
Auto merged
mysql-test/t/handler.test:
Auto merged
mysql-test/t/query_cache.test:
Auto merged
mysql-test/t/rpl000015.test:
Auto merged
mysql-test/t/rpl000017.test:
Auto merged
mysys/default.c:
Auto merged
mysys/my_getwd.c:
Auto merged
mysys/my_init.c:
Auto merged
sql/Makefile.am:
Auto merged
sql/des_key_file.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/ha_myisammrg.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/hostname.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item_create.h:
Auto merged
sql/item_func.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_sum.h:
Auto merged
sql/lex.h:
Auto merged
sql/net_serv.cc:
Auto merged
sql/opt_sum.cc:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/slave.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_repl.cc:
Auto merged
sql/sql_select.h:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_udf.cc:
Auto merged
sql-bench/crash-me.sh:
Auto merged
sql-bench/server-cfg.sh:
Auto merged
sql-bench/test-insert.sh:
Auto merged
sql/share/english/errmsg.txt:
Auto merged
sql/table.cc:
Auto merged
Docs/manual.texi:
Use remote version
client/mysql.cc:
Merge
configure.in:
Merge
libmysql/libmysql.c:
Merge
libmysqld/lib_sql.cc:
Merge
myisam/ft_stopwords.c:
Merge
myisam/myisamchk.c:
Merge
mysql-test/r/bigint.result:
Merge
mysql-test/r/group_by.result:
Merge
mysql-test/r/rpl000009.result:
Merge
mysql-test/t/group_by.test:
Merge
mysql-test/t/rpl000009.test:
Merge
mysql-test/t/rpl_rotate_logs.test:
Merge
mysys/Makefile.am:
Merge
mysys/charset.c:
Merge
sql/item.h:
Merge
sql/item_cmpfunc.cc:
Merge
sql/item_cmpfunc.h:
Merge
sql/item_create.cc:
Merge
sql/item_func.cc:
Merge
sql/item_strfunc.h:
Merge
sql/log.cc:
Merge
sql/mysql_priv.h:
Merge
sql/mysqld.cc:
Merge
sql/protocol.cc:
Merge
sql/slave.cc:
Merge
sql/sql_class.h:
Merge
sql/sql_db.cc:
Merge
sql/sql_handler.cc:
Merge
sql/sql_parse.cc:
Merge
sql/sql_select.cc:
Merge
sql/sql_yacc.yy:
Merge
Diffstat (limited to 'mysql-test')
35 files changed, 489 insertions, 34 deletions
diff --git a/mysql-test/include/have_crypt.inc b/mysql-test/include/have_crypt.inc new file mode 100644 index 00000000000..fe1f974bffd --- /dev/null +++ b/mysql-test/include/have_crypt.inc @@ -0,0 +1,4 @@ +-- require r/have_crypt.require +disable_query_log; +show variables like "have_crypt"; +enable_query_log; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 1d730e3f7c5..854a4b10b2f 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -106,6 +106,7 @@ TAIL=tail ECHO=echo # use internal echo if possible EXPR=expr # use internal if possible FIND=find +GREP=grep if test $? != 0; then exit 1; fi PRINTF=printf RM=rm @@ -609,6 +610,30 @@ report_stats () { $ECHO "If you want to report this error, please read first the documentation at" $ECHO "http://www.mysql.com/doc/M/y/MySQL_test_suite.html" fi + + # + # Report if there was any fatal warnings/errors in the log files + # + $RM -f $MY_LOG_DIR/warnings $MY_LOG_DIR/warnings.tmp + # Remove some non fatal warnings from the log files + $SED -e 's!Warning: Table:.* on delete!!g' \ + $MY_LOG_DIR/*.err > $MY_LOG_DIR/warnings.tmp + + found_error=0 + # Find errors + for i in "^Warning:" "^Error:" "^==.* at 0x" + do + if `$GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings` + then + found_error=1 + fi + done + $RM -f $MY_LOG_DIR/warnings.tmp + if [ $found_error = "1" ] + then + echo "WARNING: Got errors/warnings while running tests. Please examine" + echo "$MY_LOG_DIR/warnings for details." + fi } mysql_install_db () { diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index 8bc383c6f4c..2037085dfdb 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -8,6 +8,9 @@ select 9223372036854775807,-009223372036854775808; select +9999999999999999999,-9999999999999999999; +9999999999999999999 -9999999999999999999 10000000000000000000 -10000000000000000000 +select 9223372036854775808+1; +9223372036854775808+1 +9223372036854775808 create table t1 (a bigint unsigned not null, primary key(a)); insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE); select * from t1; @@ -52,3 +55,12 @@ select min(big),max(big),max(big)-1 from t1 group by a; min(big) max(big) max(big)-1 -1 9223372036854775807 9223372036854775806 drop table t1; +create table t1 (id bigint auto_increment primary key, a int) auto_increment=9999999999; +insert into t1 values (null,1); +select * from t1; +id a +9999999999 1 +select * from t1 limit 9999999999; +id a +9999999999 1 +drop table t1; diff --git a/mysql-test/r/binary.result b/mysql-test/r/binary.result index 325accf00e7..4d5eb62cc71 100644 --- a/mysql-test/r/binary.result +++ b/mysql-test/r/binary.result @@ -43,16 +43,31 @@ name select name from t2 where name between 'Ä' and 'Ö'; name drop table t1,t2; -create table t1 (a char(10) not null, b char(10) binary not null,index (a)); +create table t1 (a char(10) not null, b char(10) binary not null,key (a), key(b)); insert into t1 values ("hello ","hello "),("hello2 ","hello2 "); +select * from t1 where a="hello"; +a b +hello hello select * from t1 where a="hello "; a b hello hello -select * from t1 where b="hello "; +select * from t1 ignore index (a) where a="hello "; a b +hello hello select * from t1 where b="hello"; a b hello hello +select * from t1 where b="hello "; +a b +hello hello +select * from t1 ignore index (b) where b="hello "; +a b +alter table t1 modify b tinytext not null, drop key b, add key (b(100)); +select * from t1 where b="hello "; +a b +select * from t1 ignore index (b) where b="hello "; +a b +hello hello drop table t1; create table t1 (b char(8)); insert into t1 values(NULL); diff --git a/mysql-test/r/count_distinct.result b/mysql-test/r/count_distinct.result index 3bff6c6ad88..81976d268ef 100644 --- a/mysql-test/r/count_distinct.result +++ b/mysql-test/r/count_distinct.result @@ -36,6 +36,10 @@ select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join isbn city libname a 007 Berkeley Berkeley Public1 2 000 New York New York Public Libra 2 +select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct concat(t1.libname,'a')) > 1; +isbn city libname a +007 Berkeley Berkeley Public1 2 +000 New York New York Public Libra 2 drop table t1, t2, t3; create table t1 (f1 int); insert into t1 values (1); diff --git a/mysql-test/r/fulltext_var.result b/mysql-test/r/fulltext_var.result index eb71e87538d..dda8e332fba 100644 --- a/mysql-test/r/fulltext_var.result +++ b/mysql-test/r/fulltext_var.result @@ -1,6 +1,7 @@ show variables like "ft\_%"; Variable_name Value +ft_boolean_syntax + -><()~*:""&| ft_min_word_len 4 ft_max_word_len 254 ft_max_word_len_for_sort 20 -ft_boolean_syntax + -><()~*:""&| +ft_stopword_file (built-in) diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 409fd110ab9..b13dfa4de7a 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -151,3 +151,56 @@ sum(num) 45.63 51.80 drop table t1; +create table t1 (a1 int, a2 char(3), key k1(a1), key k2(a2)); +insert into t1 values(10,'aaa'), (10,null), (10,'bbb'), (20,'zzz'); +create table t2(a1 char(3), a2 int, a3 real, key k1(a1), key k2(a2, a1)); +select * from t1; +a1 a2 +10 aaa +10 NULL +10 bbb +20 zzz +select min(a2) from t1; +min(a2) +aaa +select max(t1.a1), max(t2.a2) from t1, t2; +max(t1.a1) max(t2.a2) +NULL NULL +select max(t1.a1) from t1, t2; +max(t1.a1) +NULL +select max(t2.a2), max(t1.a1) from t1, t2; +max(t2.a2) max(t1.a1) +NULL NULL +explain select min(a2) from t1; +Comment +Select tables optimized away +explain select max(t1.a1), max(t2.a2) from t1, t2; +Comment +No matching min/max row +insert into t2 values('AAA', 10, 0.5); +select max(t1.a1), max(t2.a1) from t1, t2 where t2.a2=9; +max(t1.a1) max(t2.a1) +NULL NULL +select max(t2.a1), max(t1.a1) from t1, t2 where t2.a2=9; +max(t2.a1) max(t1.a1) +NULL NULL +select t1.a1, t1.a2, t2.a1, t2.a2 from t1 left outer join t2 on t1.a1=10; +a1 a2 a1 a2 +10 aaa AAA 10 +10 NULL AAA 10 +10 bbb AAA 10 +20 zzz NULL NULL +select max(t1.a2) from t1 left outer join t2 on t1.a1=10; +max(t1.a2) +zzz +select max(t1.a2) from t1 left outer join t2 on t1.a1=10 where t1.a1=20; +max(t1.a2) +zzz +select max(t1.a2) from t1 left outer join t2 on t1.a1=10 where t1.a1=10; +max(t1.a2) +bbb +select max(t2.a1) from t1 left outer join t2 on t1.a2=t2.a1 and 1=0 where t2.a1='AAA'; +max(t2.a1) +NULL +drop table t1,t2; diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 811a16fff6c..d6596e51db4 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -36,7 +36,7 @@ select rand(999999),rand(); rand(999999) rand() 0.014231365187309 0.028870999839968 select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1); -PI() sin(pi()/2) cos(pi()/2) abs(tan(pi())) cot(1) asin(1) acos(0) atan(1) +pi() sin(pi()/2) cos(pi()/2) abs(tan(pi())) cot(1) asin(1) acos(0) atan(1) 3.141593 1.000000 0.000000 0.000000 0.64209262 1.570796 1.570796 0.785398 select degrees(pi()),radians(360); degrees(pi()) radians(360) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index a1a0c91a575..c1dcd5c29e9 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -22,6 +22,7 @@ GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' grant select on mysqltest.* to mysqltest_1@localhost require NONE; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' grant USAGE on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "testsubject" ISSUER "MySQL AB"; show grants for mysqltest_1@localhost; @@ -37,24 +38,34 @@ flush privileges; grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' flush privileges; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' revoke CREATE TEMPORARY TABLES on mysqltest.* from mysqltest_1@localhost; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' grant ALL PRIVILEGES on mysqltest.* to mysqltest_1@localhost with GRANT OPTION; flush privileges; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TEMPORARY TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION revoke all privileges on mysqltest.* from mysqltest_1@localhost; delete from mysql.user where user='mysqltest_1'; flush privileges; +grant usage on test.* to user@localhost with grant option; +show grants for user@localhost; +Grants for user@localhost +GRANT USAGE ON *.* TO 'user'@'localhost' +GRANT USAGE ON `test`.* TO 'user'@'localhost' WITH GRANT OPTION diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index a63054da88b..40e2c72ff32 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -34,6 +34,11 @@ userid MIN(t1.score) 1 1 2 2 3 3 +SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid ORDER BY NULL; +userid MIN(t1.score) +1 1 +2 2 +3 3 SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid; userid MIN(t1.score) 1 1 @@ -42,6 +47,10 @@ SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1 userid MIN(t1.score+0.0) 1 1.0 2 2.0 +SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid ORDER BY NULL; +userid MIN(t1.score+0.0) +1 1.0 +2 2.0 drop table t1,t2; CREATE TABLE t1 ( PID int(10) unsigned DEFAULT '0' NOT NULL auto_increment, @@ -88,6 +97,8 @@ INSERT INTO t2 VALUES (91,2); INSERT INTO t2 VALUES (92,2); SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid; cid CONCAT(firstname, ' ', surname) COUNT(call_id) +SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY NULL; +cid CONCAT(firstname, ' ', surname) COUNT(call_id) SELECT HIGH_PRIORITY cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY surname, firstname; cid CONCAT(firstname, ' ', surname) COUNT(call_id) drop table t1,t2; @@ -237,6 +248,9 @@ INSERT INTO t1 VALUES (1,1,1),(2,2,2),(2,1,1),(3,3,3),(4,3,3),(5,3,3); explain select userid,count(*) from t1 group by userid desc; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort +explain select userid,count(*) from t1 group by userid desc order by null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary select userid,count(*) from t1 group by userid desc; userid count(*) 3 3 @@ -252,6 +266,9 @@ userid count(*) explain select spid,count(*) from t1 where spid between 1 and 2 group by spid desc; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range spID spID 5 NULL 2 Using where; Using index +explain select spid,count(*) from t1 where spid between 1 and 2 group by spid order by null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range spID spID 5 NULL 2 Using where; Using index explain select spid,count(*) from t1 where spid between 1 and 2 group by spid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range spID spID 5 NULL 2 Using where; Using index @@ -266,6 +283,9 @@ spid count(*) explain select sql_big_result spid,sum(userid) from t1 group by spid desc; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort +explain select sql_big_result spid,sum(userid) from t1 group by spid desc order by null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 select sql_big_result spid,sum(userid) from t1 group by spid desc; spid sum(userid) 5 3 @@ -276,6 +296,9 @@ spid sum(userid) explain select sql_big_result score,count(*) from t1 group by score desc; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL score 3 NULL 6 Using index +explain select sql_big_result score,count(*) from t1 group by score desc order by null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL score 3 NULL 6 Using index select sql_big_result score,count(*) from t1 group by score desc; score count(*) 3 3 @@ -482,3 +505,63 @@ NULL 9 3 b 1 drop table t1; +create table t1 (a int not null, b int not null); +insert into t1 values (1,1),(1,2),(3,1),(3,2),(2,2),(2,1); +create table t2 (a int not null, b int not null, key(a)); +insert into t2 values (1,3),(3,1),(2,2),(1,1); +select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b; +a b +1 1 +1 3 +2 2 +3 1 +select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL; +a b +1 3 +3 1 +2 2 +1 1 +explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b; +table type possible_keys key key_len ref rows Extra +t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort +t2 ALL a NULL NULL NULL 4 Using where +explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL; +table type possible_keys key key_len ref rows Extra +t1 ALL NULL NULL NULL NULL 6 Using temporary +t2 ALL a NULL NULL NULL 4 Using where +drop table t1,t2; +create table t1 (a int, b int); +insert into t1 values (1, 4); +insert into t1 values (10, 40); +insert into t1 values (1, 4); +insert into t1 values (10, 43); +insert into t1 values (1, 4); +insert into t1 values (10, 41); +insert into t1 values (1, 4); +insert into t1 values (10, 43); +insert into t1 values (1, 4); +select a, MAX(b), INTERVAL (MAX(b), 1,3,10,30,39,40,50,60,100,1000) from t1 group by a; +a MAX(b) INTERVAL (MAX(b), 1,3,10,30,39,40,50,60,100,1000) +1 4 2 +10 43 6 +select a, MAX(b), CASE MAX(b) when 4 then 4 when 43 then 43 else 0 end from t1 group by a; +a MAX(b) CASE MAX(b) when 4 then 4 when 43 then 43 else 0 end +1 4 4 +10 43 43 +select a, MAX(b), FIELD(MAX(b), '43', '4', '5') from t1 group by a; +a MAX(b) FIELD(MAX(b), '43', '4', '5') +1 4 2 +10 43 1 +select a, MAX(b), CONCAT_WS(MAX(b), '43', '4', '5') from t1 group by a; +a MAX(b) CONCAT_WS(MAX(b), '43', '4', '5') +1 4 434445 +10 43 43434435 +select a, MAX(b), ELT(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f') from t1 group by a; +a MAX(b) ELT(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f') +1 4 d +10 43 NULL +select a, MAX(b), MAKE_SET(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') from t1 group by a; +a MAX(b) MAKE_SET(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') +1 4 c +10 43 a,b,d,f +drop table t1; diff --git a/mysql-test/r/handler.result b/mysql-test/r/handler.result index b47f97e167f..9d3383efd8f 100644 --- a/mysql-test/r/handler.result +++ b/mysql-test/r/handler.result @@ -138,4 +138,10 @@ a b handler t2 read last; You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 handler t2 close; -drop table if exists t1; +handler t1 open as t2; +drop table t1; +create table t1 (a int); +insert into t1 values (17); +handler t2 read first; +Unknown table 't2' in HANDLER +drop table t1; diff --git a/mysql-test/r/have_crypt.require b/mysql-test/r/have_crypt.require new file mode 100644 index 00000000000..739fbb738f0 --- /dev/null +++ b/mysql-test/r/have_crypt.require @@ -0,0 +1,2 @@ +Variable_name Value +have_crypt YES diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 17c9c8edbd2..7114c251e03 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -544,3 +544,14 @@ select * from mysql.db; show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 +create table t1(id int auto_increment primary key); +insert into t1 values (NULL), (NULL), (NULL); +select * from t1 where id=2; +id +2 +alter table t1 rename to t2; +select * from t1 where id=2; +Table 'test.t1' doesn't exist +drop table t2; +select * from t1 where id=2; +Table 'test.t1' doesn't exist diff --git a/mysql-test/r/rpl000009.result b/mysql-test/r/rpl000009.result index e67993b53f6..fef2b8c6179 100644 --- a/mysql-test/r/rpl000009.result +++ b/mysql-test/r/rpl000009.result @@ -8,6 +8,7 @@ drop database if exists mysqltest2; create database mysqltest2; drop database if exists mysqltest; create database mysqltest; +create database mysqltest2; create table mysqltest2.foo (n int); insert into mysqltest2.foo values(4); create table mysqltest2.foo (n int); diff --git a/mysql-test/r/rpl_insert_id.result b/mysql-test/r/rpl_insert_id.result new file mode 100644 index 00000000000..d524818985e --- /dev/null +++ b/mysql-test/r/rpl_insert_id.result @@ -0,0 +1,41 @@ +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; +drop table if exists t1; +create table t1(a int auto_increment, key(a)); +create table t2(b int auto_increment, c int, key(b)); +insert into t1 values (1),(2),(3); +insert into t1 values (null); +insert into t2 values (null,last_insert_id()); +select * from t1; +a +1 +2 +3 +4 +select * from t2; +b c +1 4 +drop table t1; +drop table t2; +create table t1(a int auto_increment, key(a)); +create table t2(b int auto_increment, c int, key(b)); +insert into t1 values (10); +insert into t1 values (null),(null),(null); +insert into t2 values (5,0); +insert into t2 values (null,last_insert_id()); +select * from t1; +a +10 +11 +12 +13 +select * from t2; +b c +5 0 +6 11 +drop table t1; +drop table t2; diff --git a/mysql-test/r/rpl_master_pos_wait.result b/mysql-test/r/rpl_master_pos_wait.result new file mode 100644 index 00000000000..22c7aef621c --- /dev/null +++ b/mysql-test/r/rpl_master_pos_wait.result @@ -0,0 +1,9 @@ +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; +select master_pos_wait('master-bin.999999',0,10); +master_pos_wait('master-bin.999999',0,10) +-1 diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result index 5b6c490b928..c8991696b5e 100644 --- a/mysql-test/r/select_found.result +++ b/mysql-test/r/select_found.result @@ -12,43 +12,43 @@ a b 7 7 8 9 select found_rows(); -FOUND_ROWS() +found_rows() 8 select SQL_CALC_FOUND_ROWS * from t1 limit 1; a b 1 2 select found_rows(); -FOUND_ROWS() +found_rows() 8 select SQL_BUFFER_RESULT SQL_CALC_FOUND_ROWS * from t1 limit 1; a b 1 2 select found_rows(); -FOUND_ROWS() +found_rows() 8 select SQL_CALC_FOUND_ROWS * from t1 order by b desc limit 1; a b 8 9 select found_rows(); -FOUND_ROWS() +found_rows() 8 select SQL_CALC_FOUND_ROWS distinct b from t1 limit 1; b 2 select found_rows(); -FOUND_ROWS() +found_rows() 6 select SQL_CALC_FOUND_ROWS b,count(*) as c from t1 group by b order by c desc limit 1; b c 5 3 select found_rows(); -FOUND_ROWS() +found_rows() 6 select SQL_CALC_FOUND_ROWS * from t1 left join t1 as t2 on (t1.b=t2.a) limit 2,1; a b a b 3 5 5 5 select found_rows(); -FOUND_ROWS() +found_rows() 8 drop table t1; create table t1 (a int not null primary key); diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index e546a8c8284..cb3a8029a87 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -91,7 +91,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 2 UNION t2 ALL NULL NULL NULL NULL 4 Using filesort select found_rows(); -FOUND_ROWS() +found_rows() 0 explain select a,b from t1 union all select a,b from t2; id select_type table type possible_keys key key_len ref rows Extra diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index 8939d281eda..02ef72ef66d 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -6,7 +6,7 @@ set SQL_LOG_BIN=0; drop table if exists t1, t2, t3; --enable_warnings create table t1(n int); ---replace_result "errno = 2" "errno = X" "errno = 22" "errno = X" "errno = 23" "errno = X" +--replace_result "errno = 1" "errno = X" "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; diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test index 3dde4b8a2c1..f627614c049 100644 --- a/mysql-test/t/bigint.test +++ b/mysql-test/t/bigint.test @@ -11,7 +11,7 @@ drop table if exists t1; select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296; select 9223372036854775807,-009223372036854775808; select +9999999999999999999,-9999999999999999999; - +select 9223372036854775808+1; # # In 3.23 we have to disable the test of column to bigint as # this fails on AIX powerpc (the resolution for double is not good enough) @@ -41,3 +41,13 @@ alter table t1 modify big bigint not null; select min(big),max(big),max(big)-1 from t1; select min(big),max(big),max(big)-1 from t1 group by a; drop table t1; + +# +# Test problem with big values fir auto_increment +# + +create table t1 (id bigint auto_increment primary key, a int) auto_increment=9999999999; +insert into t1 values (null,1); +select * from t1; +select * from t1 limit 9999999999; +drop table t1; diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test index 0a5dd71f98e..4f9ac7581d2 100644 --- a/mysql-test/t/binary.test +++ b/mysql-test/t/binary.test @@ -28,11 +28,18 @@ drop table t1,t2; # Test of binary and normal strings # -create table t1 (a char(10) not null, b char(10) binary not null,index (a)); +create table t1 (a char(10) not null, b char(10) binary not null,key (a), key(b)); insert into t1 values ("hello ","hello "),("hello2 ","hello2 "); +select * from t1 where a="hello"; select * from t1 where a="hello "; -select * from t1 where b="hello "; +select * from t1 ignore index (a) where a="hello "; select * from t1 where b="hello"; +select * from t1 where b="hello "; +select * from t1 ignore index (b) where b="hello "; +# blob test +alter table t1 modify b tinytext not null, drop key b, add key (b(100)); +select * from t1 where b="hello "; +select * from t1 ignore index (b) where b="hello "; drop table t1; # diff --git a/mysql-test/t/count_distinct.test b/mysql-test/t/count_distinct.test index c7740e73ee8..239edea2422 100644 --- a/mysql-test/t/count_distinct.test +++ b/mysql-test/t/count_distinct.test @@ -34,6 +34,7 @@ insert into t1 values ('Berkeley Public2','Berkeley'); insert into t1 values ('NYC Lib','New York'); select t2.isbn,city,t1.libname,count(t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city,t1.libname; select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct t1.libname) > 1; +select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct concat(t1.libname,'a')) > 1; drop table t1, t2, t3; # diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test index af0ef661d06..c72356bda1a 100644 --- a/mysql-test/t/func_crypt.test +++ b/mysql-test/t/func_crypt.test @@ -1,3 +1,5 @@ +-- source include/have_crypt.inc + select length(encrypt('foo', 'ff')) <> 0; --replace_result $1$aa$4OSUA5cjdx0RUQ08opV27/ aaqPiZY5xR5l. diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index b6511779f51..fe1cebaac17 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -102,3 +102,30 @@ insert into t1 values (5.2,'nem'),(8.64,'monty'),(11.12,'sinisa'); select sum(num) from t1; select sum(num) from t1 group by user; drop table t1; + +# +# Test problem with MIN() optimization in case of null values +# + +create table t1 (a1 int, a2 char(3), key k1(a1), key k2(a2)); +insert into t1 values(10,'aaa'), (10,null), (10,'bbb'), (20,'zzz'); +create table t2(a1 char(3), a2 int, a3 real, key k1(a1), key k2(a2, a1)); +select * from t1; +# The following returned NULL in 4.0.10 +select min(a2) from t1; +select max(t1.a1), max(t2.a2) from t1, t2; +select max(t1.a1) from t1, t2; +select max(t2.a2), max(t1.a1) from t1, t2; + +explain select min(a2) from t1; +explain select max(t1.a1), max(t2.a2) from t1, t2; + +insert into t2 values('AAA', 10, 0.5); +select max(t1.a1), max(t2.a1) from t1, t2 where t2.a2=9; +select max(t2.a1), max(t1.a1) from t1, t2 where t2.a2=9; +select t1.a1, t1.a2, t2.a1, t2.a2 from t1 left outer join t2 on t1.a1=10; +select max(t1.a2) from t1 left outer join t2 on t1.a1=10; +select max(t1.a2) from t1 left outer join t2 on t1.a1=10 where t1.a1=20; +select max(t1.a2) from t1 left outer join t2 on t1.a1=10 where t1.a1=10; +select max(t2.a1) from t1 left outer join t2 on t1.a2=t2.a1 and 1=0 where t2.a1='AAA'; +drop table t1,t2; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 7ee3b08cc3b..bd04b2e4c41 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -39,3 +39,6 @@ show grants for mysqltest_1@localhost; revoke all privileges on mysqltest.* from mysqltest_1@localhost; delete from mysql.user where user='mysqltest_1'; flush privileges; +grant usage on test.* to user@localhost with grant option; +show grants for user@localhost; + diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test index 84091d9b830..2d704a770aa 100644 --- a/mysql-test/t/grant_cache.test +++ b/mysql-test/t/grant_cache.test @@ -9,7 +9,7 @@ drop table if exists test.t1,mysqltest.t1,mysqltest.t2; reset query cache; flush status; -connect (root,localhost,root,,test,0,master.sock); +connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock); connection root; --disable_warnings create database if not exists mysqltest; @@ -22,7 +22,7 @@ insert into mysqltest.t2 values (3,3,3); create table test.t1 (a char (10)); insert into test.t1 values ("test.t1"); select * from t1; -connect (root2,localhost,root,,mysqltest,0,master.sock); +connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,master.sock); connection root2; # put queries in cache select * from t1; @@ -40,7 +40,7 @@ grant SELECT on test.t1 to mysqltest_2@localhost; grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost; # The following queries should be fetched from cache -connect (user1,localhost,mysqltest_1,,mysqltest,0,master.sock); +connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock); connection user1; select "user1"; select * from t1; @@ -52,13 +52,14 @@ show status like "Qcache_hits"; show status like "Qcache_not_cached"; # The following queries should be fetched from cache -connect (user2,localhost,mysqltest_2,,mysqltest,0,master.sock); +connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,master.sock); connection user2; select "user2"; select * from t1; select a from t1; select c from t1; select * from mysqltest.t1,test.t1; +--replace_result 127.0.0.1 localhost --error 1142 select * from t2; show status like "Qcache_queries_in_cache"; @@ -66,16 +67,20 @@ show status like "Qcache_hits"; show status like "Qcache_not_cached"; # The following queries should not be fetched from cache -connect (user3,localhost,mysqltest_3,,mysqltest,0,master.sock); +connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,master.sock); connection user3; select "user3"; +--replace_result 127.0.0.1 localhost --error 1143 select * from t1; select a from t1; +--replace_result 127.0.0.1 localhost --error 1143 select c from t1; +--replace_result 127.0.0.1 localhost --error 1142 select * from t2; +--replace_result 127.0.0.1 localhost --error 1143 select mysqltest.t1.c from test.t1,mysqltest.t1; show status like "Qcache_queries_in_cache"; @@ -83,7 +88,7 @@ show status like "Qcache_hits"; show status like "Qcache_not_cached"; # Connect without a database -connect (user4,localhost,mysqltest_1,,*NO-ONE*,0,master.sock); +connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,master.sock); connection user4; select "user4"; --error 1046 diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index bca86f1ef37..dfcf72eb2c3 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -46,8 +46,10 @@ INSERT INTO t2 VALUES (2,'name','pass','mail','Y','v','n','adr','1','1','1'); INSERT INTO t2 VALUES (3,'name','pass','mail','Y','v','n','adr','1','1','1'); SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid; +SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid ORDER BY NULL; SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid; SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid; +SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid ORDER BY NULL; drop table t1,t2; # @@ -110,6 +112,7 @@ INSERT INTO t2 VALUES (91,2); INSERT INTO t2 VALUES (92,2); SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid; +SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY NULL; SELECT HIGH_PRIORITY cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY surname, firstname; drop table t1,t2; @@ -244,16 +247,20 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES (1,1,1),(2,2,2),(2,1,1),(3,3,3),(4,3,3),(5,3,3); explain select userid,count(*) from t1 group by userid desc; +explain select userid,count(*) from t1 group by userid desc order by null; select userid,count(*) from t1 group by userid desc; select userid,count(*) from t1 group by userid desc having (count(*)+1) IN (4,3); select userid,count(*) from t1 group by userid desc having 3 IN (1,COUNT(*)); explain select spid,count(*) from t1 where spid between 1 and 2 group by spid desc; explain select spid,count(*) from t1 where spid between 1 and 2 group by spid; +explain select spid,count(*) from t1 where spid between 1 and 2 group by spid order by null; select spid,count(*) from t1 where spid between 1 and 2 group by spid; select spid,count(*) from t1 where spid between 1 and 2 group by spid desc; explain select sql_big_result spid,sum(userid) from t1 group by spid desc; +explain select sql_big_result spid,sum(userid) from t1 group by spid desc order by null; select sql_big_result spid,sum(userid) from t1 group by spid desc; explain select sql_big_result score,count(*) from t1 group by score desc; +explain select sql_big_result score,count(*) from t1 group by score desc order by null; select sql_big_result score,count(*) from t1 group by score desc; drop table t1; @@ -374,3 +381,39 @@ select a,count(*) from t1 group by a; set option sql_big_tables=1; select a,count(*) from t1 group by a; drop table t1; + +# +# Test of GROUP BY ... ORDER BY NULL optimization +# + +create table t1 (a int not null, b int not null); +insert into t1 values (1,1),(1,2),(3,1),(3,2),(2,2),(2,1); +create table t2 (a int not null, b int not null, key(a)); +insert into t2 values (1,3),(3,1),(2,2),(1,1); +select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b; +select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL; +explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b; +explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL; +drop table t1,t2; + +# +# group function arguments in some functions +# + +create table t1 (a int, b int); +insert into t1 values (1, 4); +insert into t1 values (10, 40); +insert into t1 values (1, 4); +insert into t1 values (10, 43); +insert into t1 values (1, 4); +insert into t1 values (10, 41); +insert into t1 values (1, 4); +insert into t1 values (10, 43); +insert into t1 values (1, 4); +select a, MAX(b), INTERVAL (MAX(b), 1,3,10,30,39,40,50,60,100,1000) from t1 group by a; +select a, MAX(b), CASE MAX(b) when 4 then 4 when 43 then 43 else 0 end from t1 group by a; +select a, MAX(b), FIELD(MAX(b), '43', '4', '5') from t1 group by a; +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; diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test index b72b739600e..657185f5e2d 100644 --- a/mysql-test/t/handler.test +++ b/mysql-test/t/handler.test @@ -33,13 +33,15 @@ handler t2 read a next; handler t2 read a=(15); handler t2 read a=(16); -!$1070 handler t2 read a=(19,"fff"); +--error 1070 +handler t2 read a=(19,"fff"); handler t2 read b=(19,"fff"); handler t2 read b=(19,"yyy"); handler t2 read b=(19); -!$1109 handler t1 read a last; +--error 1109 +handler t1 read a last; handler t2 read a=(11); handler t2 read a>=(11); @@ -65,8 +67,19 @@ handler t2 read first; handler t2 read next; alter table t1 type=MyISAM; handler t2 read next; -!$1064 handler t2 read last; +--error 1064 +handler t2 read last; handler t2 close; -drop table if exists t1; + +# +# DROP TABLE +# +handler t1 open as t2; +drop table t1; +create table t1 (a int); +insert into t1 values (17); +--error 1109 +handler t2 read first; +drop table t1; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index e1df5fa7b3b..5f2cf8b5f56 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -387,3 +387,17 @@ disable_result_log; select * from mysql.db; enable_result_log; show status like "Qcache_queries_in_cache"; + + +# +# simple rename test +# +create table t1(id int auto_increment primary key); +insert into t1 values (NULL), (NULL), (NULL); +select * from t1 where id=2; +alter table t1 rename to t2; +-- error 1146 +select * from t1 where id=2; +drop table t2; +-- error 1146 +select * from t1 where id=2; diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test index d5cb14350a6..1fbdd65e1fb 100644 --- a/mysql-test/t/rpl000009.test +++ b/mysql-test/t/rpl000009.test @@ -12,6 +12,7 @@ create database mysqltest; save_master_pos; connection slave; sync_with_master; +create database mysqltest; create table mysqltest2.foo (n int); insert into mysqltest2.foo values(4); connection master; @@ -25,10 +26,13 @@ sync_with_master; select mysqltest2.foo.n,mysqltest.bar.m from mysqltest2.foo,mysqltest.bar; connection master; drop database mysqltest; -drop database mysqltest2; +drop database if exists mysqltest2; save_master_pos; connection slave; sync_with_master; +--error 1008 +drop database mysqltest2; +drop database mysqltest; # Now let's test load data from master diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test index 9573dfd8fb3..b5234373355 100644 --- a/mysql-test/t/rpl000015.test +++ b/mysql-test/t/rpl000015.test @@ -1,5 +1,5 @@ -connect (master,localhost,root,,test,0,master.sock); -connect (slave,localhost,root,,test,0, slave.sock); +connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock); +connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); connection master; reset master; show master status; diff --git a/mysql-test/t/rpl000017.test b/mysql-test/t/rpl000017.test index f38e109cb19..cf808a2cbc0 100644 --- a/mysql-test/t/rpl000017.test +++ b/mysql-test/t/rpl000017.test @@ -1,5 +1,5 @@ -connect (master,localhost,root,,test,0,master.sock); -connect (slave,localhost,root,,test,0,slave.sock); +connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock); +connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); connection master; reset master; grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab'; diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/t/rpl_insert_id.test new file mode 100644 index 00000000000..3f3636d3082 --- /dev/null +++ b/mysql-test/t/rpl_insert_id.test @@ -0,0 +1,39 @@ +#see if queries that use both +#auto_increment and LAST_INSERT_ID() +#are replicated well +source include/master-slave.inc; +connection master; +drop table if exists t1; +create table t1(a int auto_increment, key(a)); +create table t2(b int auto_increment, c int, key(b)); +insert into t1 values (1),(2),(3); +insert into t1 values (null); +insert into t2 values (null,last_insert_id()); +save_master_pos; +connection slave; +sync_with_master; +select * from t1; +select * from t2; +connection master; +#check if multi-line inserts, +#which set last_insert_id to the first id inserted, +#are replicated the same way +drop table t1; +drop table t2; +create table t1(a int auto_increment, key(a)); +create table t2(b int auto_increment, c int, key(b)); +insert into t1 values (10); +insert into t1 values (null),(null),(null); +insert into t2 values (5,0); +insert into t2 values (null,last_insert_id()); +save_master_pos; +connection slave; +sync_with_master; +select * from t1; +select * from t2; +connection master; +drop table t1; +drop table t2; +save_master_pos; +connection slave; +sync_with_master; diff --git a/mysql-test/t/rpl_master_pos_wait.test b/mysql-test/t/rpl_master_pos_wait.test new file mode 100644 index 00000000000..a6aae222a89 --- /dev/null +++ b/mysql-test/t/rpl_master_pos_wait.test @@ -0,0 +1,9 @@ +# See if master_pos_wait(,,timeout) +# Terminates with "timeout expired" (-1) +source include/master-slave.inc; +save_master_pos; +connection slave; +sync_with_master; +# Ask for a master log that has certainly not been reached yet +# timeout= 10 seconds +select master_pos_wait('master-bin.999999',0,10); diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index 025e07382ba..52c7bc290bb 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -9,11 +9,11 @@ # changes # - Test creating a duplicate key error and recover from it -connect (master,localhost,root,,test,0,master.sock); +connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock); --disable_warnings drop table if exists t1, t2, t3, t4; --enable_warnings -connect (slave,localhost,root,,test,0,slave.sock); +connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); system cat /dev/null > var/slave-data/master.info; system chmod 000 var/slave-data/master.info; connection slave; |