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/t | |
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/t')
-rw-r--r-- | mysql-test/t/backup.test | 2 | ||||
-rw-r--r-- | mysql-test/t/bigint.test | 12 | ||||
-rw-r--r-- | mysql-test/t/binary.test | 11 | ||||
-rw-r--r-- | mysql-test/t/count_distinct.test | 1 | ||||
-rw-r--r-- | mysql-test/t/func_crypt.test | 2 | ||||
-rw-r--r-- | mysql-test/t/func_group.test | 27 | ||||
-rw-r--r-- | mysql-test/t/grant.test | 3 | ||||
-rw-r--r-- | mysql-test/t/grant_cache.test | 17 | ||||
-rw-r--r-- | mysql-test/t/group_by.test | 43 | ||||
-rw-r--r-- | mysql-test/t/handler.test | 21 | ||||
-rw-r--r-- | mysql-test/t/query_cache.test | 14 | ||||
-rw-r--r-- | mysql-test/t/rpl000009.test | 6 | ||||
-rw-r--r-- | mysql-test/t/rpl000015.test | 4 | ||||
-rw-r--r-- | mysql-test/t/rpl000017.test | 4 | ||||
-rw-r--r-- | mysql-test/t/rpl_insert_id.test | 39 | ||||
-rw-r--r-- | mysql-test/t/rpl_master_pos_wait.test | 9 | ||||
-rw-r--r-- | mysql-test/t/rpl_rotate_logs.test | 4 |
17 files changed, 198 insertions, 21 deletions
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; |