diff options
author | unknown <bell@sanja.is.com.ua> | 2004-05-05 22:30:01 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-05-05 22:30:01 +0300 |
commit | b52317df7105c7b556c030069ff27b134e9a8e26 (patch) | |
tree | e967558b190a889ad77f62e0f69da4f76c0774f6 /mysql-test | |
parent | 2c95f97c2beea7b88378623d9655fcf2ad88a9a9 (diff) | |
parent | 19d3f588f2165ed5025fe0b88c856474b913d6b8 (diff) | |
download | mariadb-git-b52317df7105c7b556c030069ff27b134e9a8e26.tar.gz |
merge
mysql-test/r/subselect.result:
Auto merged
sql/sql_union.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'mysql-test')
31 files changed, 307 insertions, 27 deletions
diff --git a/mysql-test/r/alias.result b/mysql-test/r/alias.result index 7f606367f39..587c21e9129 100644 --- a/mysql-test/r/alias.result +++ b/mysql-test/r/alias.result @@ -63,7 +63,7 @@ CREATE TABLE t1 ( AUFNR varchar(12) NOT NULL default '', PLNFL varchar(6) NOT NULL default '', VORNR varchar(4) NOT NULL default '', -xstatus_vor smallint(5) unsigned NOT NULL default '0', +xstatus_vor smallint(5) unsigned NOT NULL default '0' ); INSERT INTO t1 VALUES ('40004712','000001','0010',9); INSERT INTO t1 VALUES ('40004712','000001','0020',0); diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index ce72c353d20..b5f7da30bb3 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -274,6 +274,12 @@ create database `db1 `; ERROR 42000: Incorrect database name 'db1 ' create table t1(`a ` int); ERROR 42000: Incorrect column name 'a ' +create table t1 (a int,); +ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 +create table t1 (a int,,b int); +ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1 +create table t1 (,b int); +ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1 create table t1 (a int, key(a)); create table t2 (b int, foreign key(b) references t1(a), key(b)); drop table if exists t1,t2; diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index f5754bb3332..81e2cd03d1a 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -251,7 +251,7 @@ id select_type table type possible_keys key key_len ref rows Extra drop table t1; CREATE TABLE `t1` ( `N` int(11) unsigned NOT NULL default '0', -`M` tinyint(1) default '0', +`M` tinyint(1) default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `t1` (N, M) VALUES (1, 0),(1, 0),(1, 0),(2, 0),(2, 0),(3, 0); UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2; diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index bdba9e4c3e4..9904242b3e0 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -84,9 +84,9 @@ bbbb bb bbbbbbbb aaaa bbbb select replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') ; replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') this is a REAL test -select soundex(''),soundex('he'),soundex('hello all folks'); -soundex('') soundex('he') soundex('hello all folks') - H000 H4142 +select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb'); +soundex('') soundex('he') soundex('hello all folks') soundex('#3556 in bugdb') + H000 H4142 I51231 select 'mood' sounds like 'mud'; 'mood' sounds like 'mud' 1 @@ -281,7 +281,7 @@ CREATE TABLE t1 ( wid int(10) unsigned NOT NULL auto_increment, data_podp date default NULL, status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy', -PRIMARY KEY(wid), +PRIMARY KEY(wid) ); INSERT INTO t1 VALUES (8,NULL,'real'); INSERT INTO t1 VALUES (9,NULL,'nowy'); diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index d2ea3c4a87c..b37df0aef2c 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -352,6 +352,36 @@ extract(SECOND FROM "1999-01-02 10:11:12") select extract(MONTH FROM "2001-02-00"); extract(MONTH FROM "2001-02-00") 2 +SELECT "1900-01-01 00:00:00" + INTERVAL 2147483648 SECOND; +"1900-01-01 00:00:00" + INTERVAL 2147483648 SECOND +1968-01-20 03:14:08 +SELECT "1900-01-01 00:00:00" + INTERVAL "1:2147483647" MINUTE_SECOND; +"1900-01-01 00:00:00" + INTERVAL "1:2147483647" MINUTE_SECOND +1968-01-20 03:15:07 +SELECT "1900-01-01 00:00:00" + INTERVAL "100000000:214748364700" MINUTE_SECOND; +"1900-01-01 00:00:00" + INTERVAL "100000000:214748364700" MINUTE_SECOND +8895-03-27 22:11:40 +SELECT "1900-01-01 00:00:00" + INTERVAL 1<<37 SECOND; +"1900-01-01 00:00:00" + INTERVAL 1<<37 SECOND +6255-04-08 15:04:32 +SELECT "1900-01-01 00:00:00" + INTERVAL 1<<31 MINUTE; +"1900-01-01 00:00:00" + INTERVAL 1<<31 MINUTE +5983-01-24 02:08:00 +SELECT "1900-01-01 00:00:00" + INTERVAL 1<<20 HOUR; +"1900-01-01 00:00:00" + INTERVAL 1<<20 HOUR +2019-08-15 16:00:00 +SELECT "1900-01-01 00:00:00" + INTERVAL 1<<38 SECOND; +"1900-01-01 00:00:00" + INTERVAL 1<<38 SECOND +NULL +SELECT "1900-01-01 00:00:00" + INTERVAL 1<<33 MINUTE; +"1900-01-01 00:00:00" + INTERVAL 1<<33 MINUTE +NULL +SELECT "1900-01-01 00:00:00" + INTERVAL 1<<30 HOUR; +"1900-01-01 00:00:00" + INTERVAL 1<<30 HOUR +NULL +SELECT "1900-01-01 00:00:00" + INTERVAL "1000000000:214748364700" MINUTE_SECOND; +"1900-01-01 00:00:00" + INTERVAL "1000000000:214748364700" MINUTE_SECOND +NULL create table t1 (ctime varchar(20)); insert into t1 values ('2001-01-12 12:23:40'); select ctime, hour(ctime) from t1; diff --git a/mysql-test/r/innodb-lock.result b/mysql-test/r/innodb-lock.result new file mode 100644 index 00000000000..cf00adb30ae --- /dev/null +++ b/mysql-test/r/innodb-lock.result @@ -0,0 +1,22 @@ +drop table if exists t1; +create table t1 (id integer, x integer) engine=INNODB; +insert into t1 values(0, 0); +set autocommit=0; +SELECT * from t1 where id = 0 FOR UPDATE; +id x +0 0 +set autocommit=0; +lock table t1 write; +update t1 set x=1 where id = 0; +select * from t1; +id x +0 1 +commit; +update t1 set x=2 where id = 0; +commit; +unlock tables; +select * from t1; +id x +0 2 +commit; +drop table t1; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 5e513061821..3c36571a8c2 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -467,7 +467,7 @@ ERROR 23000: Duplicate entry 'test2' for key 2 select * from t1; id ggid email passwd 1 this will work -3 test2 this will work +4 test2 this will work select * from t1 where id=1; id ggid email passwd 1 this will work diff --git a/mysql-test/r/raid.result b/mysql-test/r/raid.result index 690ef24d809..05013cc0d5d 100644 --- a/mysql-test/r/raid.result +++ b/mysql-test/r/raid.result @@ -4,6 +4,14 @@ create database test_$1; create table test_$1.r1 (i int) raid_type=1; create table test_$1.r2 (i int) raid_type=1 raid_chunks=32; drop database test_$1; +create database test_$1; +create table test_$1.r2 (i int) raid_type=1 raid_chunks=257; +show create table test_$1.r2; +Table Create Table +r2 CREATE TABLE `r2` ( + `i` int(11) default NULL +) TYPE=MyISAM RAID_TYPE=striped RAID_CHUNKS=255 RAID_CHUNKSIZE=256 +drop database test_$1; CREATE TABLE t1 ( id int unsigned not null auto_increment primary key, c char(255) not null diff --git a/mysql-test/r/rpl_multi_delete2.result b/mysql-test/r/rpl_multi_delete2.result new file mode 100644 index 00000000000..c6c088111fc --- /dev/null +++ b/mysql-test/r/rpl_multi_delete2.result @@ -0,0 +1,21 @@ +stop slave; +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; +start slave; +create table t1 (a int); +create table t2 (a int); +insert into t1 values (1); +insert into t2 values (1); +delete t1.* from t1, t2 where t1.a = t2.a; +select * from t1; +a +select * from t2; +a +1 +select * from t1; +ERROR 42S02: Table 'test.t1' doesn't exist +select * from t2; +ERROR 42S02: Table 'test.t2' doesn't exist +drop table t1,t2; diff --git a/mysql-test/r/rpl_multi_update.result b/mysql-test/r/rpl_multi_update.result index 65587d25f63..34f99746c7d 100644 --- a/mysql-test/r/rpl_multi_update.result +++ b/mysql-test/r/rpl_multi_update.result @@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, -b int unsigned, +b int unsigned ) ENGINE=MyISAM; CREATE TABLE t2 ( a int unsigned not null auto_increment primary key, diff --git a/mysql-test/r/rpl_server_id1.result b/mysql-test/r/rpl_server_id1.result new file mode 100644 index 00000000000..8c383802de4 --- /dev/null +++ b/mysql-test/r/rpl_server_id1.result @@ -0,0 +1,22 @@ +stop slave; +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; +start slave; +create table t1 (n int); +reset master; +stop slave; +change master to master_port=SLAVE_PORT; +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master + 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 4 None 0 No NULL +start slave; +insert into t1 values (1); +show status like "slave_running"; +Variable_name Value +Slave_running ON +select * from t1; +n +1 +drop table t1; diff --git a/mysql-test/r/rpl_server_id2.result b/mysql-test/r/rpl_server_id2.result new file mode 100644 index 00000000000..5f4ec9df4c4 --- /dev/null +++ b/mysql-test/r/rpl_server_id2.result @@ -0,0 +1,21 @@ +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 (n int); +reset master; +stop slave; +change master to master_port=SLAVE_PORT; +show slave status; +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space +127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.001 4 No No 0 0 0 # +start slave; +insert into t1 values (1); +select * from t1; +n +1 +1 +drop table t1; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index c462a88ac1b..86a90d553da 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -90,8 +90,8 @@ test_set set( 'val1', 'val2', 'val3' ) not null default '', name char(20) default 'O''Brien' comment 'O''Brien as default', c int not null comment 'int column', `c-b` int comment 'name with a minus', -`space 2` int comment 'name with a space', -) comment = 'it\'s a table' ; +`space 2` int comment 'name with a space' + ) comment = 'it\'s a table' ; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 25ecb1786e5..a2210fde222 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1151,7 +1151,7 @@ CREATE TABLE `t1` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `pseudo` varchar(35) character set latin1 NOT NULL default '', PRIMARY KEY (`id`), -UNIQUE KEY `pseudo` (`pseudo`), +UNIQUE KEY `pseudo` (`pseudo`) ) ENGINE=MyISAM PACK_KEYS=1 ROW_FORMAT=DYNAMIC; INSERT INTO t1 (pseudo) VALUES ('test'); SELECT 0 IN (SELECT 1 FROM t1 a); @@ -1256,7 +1256,7 @@ CREATE TABLE `t1` ( `email` varchar(60) NOT NULL default '', PRIMARY KEY (`id`), UNIQUE KEY `email` (`email`), -UNIQUE KEY `pseudo` (`pseudo`), +UNIQUE KEY `pseudo` (`pseudo`) ) ENGINE=MyISAM CHARSET=latin1 PACK_KEYS=1 ROW_FORMAT=DYNAMIC; INSERT INTO t1 (id,pseudo,email) VALUES (1,'test','test'),(2,'test1','test1'); SELECT pseudo as a, pseudo as b FROM t1 GROUP BY (SELECT a) ORDER BY (SELECT id*1); diff --git a/mysql-test/t/alias.test b/mysql-test/t/alias.test index 852b78dd04e..986af339456 100644 --- a/mysql-test/t/alias.test +++ b/mysql-test/t/alias.test @@ -74,8 +74,7 @@ CREATE TABLE t1 ( AUFNR varchar(12) NOT NULL default '', PLNFL varchar(6) NOT NULL default '', VORNR varchar(4) NOT NULL default '', - xstatus_vor smallint(5) unsigned NOT NULL default '0', - + xstatus_vor smallint(5) unsigned NOT NULL default '0' ); INSERT INTO t1 VALUES ('40004712','000001','0010',9); diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 4bd92994530..30441fb9aae 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -242,6 +242,18 @@ create database `db1 `; create table t1(`a ` int); # +# Test for Bug #3481 +# "Parser permits multiple commas without syntax error" +# + +--error 1064 +create table t1 (a int,); +--error 1064 +create table t1 (a int,,b int); +--error 1064 +create table t1 (,b int); + +# # Test create with foreign keys # diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index f0d5a253bf4..fbfd3ccdef1 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -146,7 +146,7 @@ drop table t1; # CREATE TABLE `t1` ( `N` int(11) unsigned NOT NULL default '0', - `M` tinyint(1) default '0', + `M` tinyint(1) default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `t1` (N, M) VALUES (1, 0),(1, 0),(1, 0),(2, 0),(2, 0),(3, 0); UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 7efcac030af..24753c28073 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -39,7 +39,7 @@ SELECT CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),r select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c'); select replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') ; -select soundex(''),soundex('he'),soundex('hello all folks'); +select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb'); select 'mood' sounds like 'mud'; select 'Glazgo' sounds like 'Liverpool'; select null sounds like 'null'; @@ -146,7 +146,7 @@ CREATE TABLE t1 ( wid int(10) unsigned NOT NULL auto_increment, data_podp date default NULL, status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy', - PRIMARY KEY(wid), + PRIMARY KEY(wid) ); INSERT INTO t1 VALUES (8,NULL,'real'); diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 4b8c26a00d8..a85f9d563e9 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -139,10 +139,27 @@ select extract(MINUTE_SECOND FROM "10:11:12"); select extract(SECOND FROM "1999-01-02 10:11:12"); select extract(MONTH FROM "2001-02-00"); +# +# Test big intervals (Bug #3498) +# +SELECT "1900-01-01 00:00:00" + INTERVAL 2147483648 SECOND; +SELECT "1900-01-01 00:00:00" + INTERVAL "1:2147483647" MINUTE_SECOND; +SELECT "1900-01-01 00:00:00" + INTERVAL "100000000:214748364700" MINUTE_SECOND;SELECT "1900-01-01 00:00:00" + INTERVAL 1<<37 SECOND; +SELECT "1900-01-01 00:00:00" + INTERVAL 1<<31 MINUTE; +SELECT "1900-01-01 00:00:00" + INTERVAL 1<<20 HOUR; + +SELECT "1900-01-01 00:00:00" + INTERVAL 1<<38 SECOND; +SELECT "1900-01-01 00:00:00" + INTERVAL 1<<33 MINUTE; +SELECT "1900-01-01 00:00:00" + INTERVAL 1<<30 HOUR; +SELECT "1900-01-01 00:00:00" + INTERVAL "1000000000:214748364700" MINUTE_SECOND; + +# +# Bug #614 (multiple extracts in where) +# + create table t1 (ctime varchar(20)); insert into t1 values ('2001-01-12 12:23:40'); select ctime, hour(ctime) from t1; -# test bug 614 (multiple extracts in where) select ctime from t1 where extract(MONTH FROM ctime) = 1 AND extract(YEAR FROM ctime) = 2001; drop table t1; diff --git a/mysql-test/t/innodb-lock.test b/mysql-test/t/innodb-lock.test new file mode 100644 index 00000000000..33baec32549 --- /dev/null +++ b/mysql-test/t/innodb-lock.test @@ -0,0 +1,43 @@ +-- source include/have_innodb.inc + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# Testing of explicit table locks +# + +connection con1; +create table t1 (id integer, x integer) engine=INNODB; +insert into t1 values(0, 0); +set autocommit=0; +SELECT * from t1 where id = 0 FOR UPDATE; + +connection con2; +set autocommit=0; + +# The following statement should hang because con1 is locking the page +--send +lock table t1 write; +--sleep 2; + +connection con1; +update t1 set x=1 where id = 0; +select * from t1; +commit; + +connection con2; +reap; +update t1 set x=2 where id = 0; +commit; +unlock tables; + +connection con1; +select * from t1; +commit; + +drop table t1; diff --git a/mysql-test/t/raid.test b/mysql-test/t/raid.test index 457262a8d75..14a55db0c34 100644 --- a/mysql-test/t/raid.test +++ b/mysql-test/t/raid.test @@ -21,6 +21,18 @@ create table test_$1.r1 (i int) raid_type=1; create table test_$1.r2 (i int) raid_type=1 raid_chunks=32; drop database test_$1; +# +# Bug #3182: Test using more than 257 raid chunks +# +create database test_$1; +create table test_$1.r2 (i int) raid_type=1 raid_chunks=257; +show create table test_$1.r2; +drop database test_$1; + +# +# Test that data is spread over different raid directories +# + CREATE TABLE t1 ( id int unsigned not null auto_increment primary key, c char(255) not null diff --git a/mysql-test/t/rpl_error_ignored_table.test b/mysql-test/t/rpl_error_ignored_table.test index f2ddaa273ed..4e4e79adf67 100644 --- a/mysql-test/t/rpl_error_ignored_table.test +++ b/mysql-test/t/rpl_error_ignored_table.test @@ -40,7 +40,7 @@ insert into t3 values(connection_id()); send update t2 set a = a + 1 + get_lock('crash_lock%20C', 10); connection master1; -sleep 2; +real_sleep 2; select (@id := id) - id from t3; kill @id; drop table t2,t3; diff --git a/mysql-test/t/rpl_multi_delete2-slave.opt b/mysql-test/t/rpl_multi_delete2-slave.opt new file mode 100644 index 00000000000..b828d03fafb --- /dev/null +++ b/mysql-test/t/rpl_multi_delete2-slave.opt @@ -0,0 +1 @@ +--replicate-wild-ignore-table=test.% diff --git a/mysql-test/t/rpl_multi_delete2.test b/mysql-test/t/rpl_multi_delete2.test new file mode 100644 index 00000000000..c5128833843 --- /dev/null +++ b/mysql-test/t/rpl_multi_delete2.test @@ -0,0 +1,23 @@ +source include/master-slave.inc; +create table t1 (a int); +create table t2 (a int); + +insert into t1 values (1); +insert into t2 values (1); + +delete t1.* from t1, t2 where t1.a = t2.a; + +save_master_pos; +select * from t1; +select * from t2; + +connection slave; +# BUG#3461 would cause sync to fail +sync_with_master; +error 1146; +select * from t1; +error 1146; +select * from t2; + +connection master; +drop table t1,t2; diff --git a/mysql-test/t/rpl_multi_update.test b/mysql-test/t/rpl_multi_update.test index 98a199ae412..88994aa66bd 100644 --- a/mysql-test/t/rpl_multi_update.test +++ b/mysql-test/t/rpl_multi_update.test @@ -2,7 +2,7 @@ source include/master-slave.inc; CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, - b int unsigned, + b int unsigned ) ENGINE=MyISAM; CREATE TABLE t2 ( diff --git a/mysql-test/t/rpl_server_id1.test b/mysql-test/t/rpl_server_id1.test new file mode 100644 index 00000000000..aefcb81c930 --- /dev/null +++ b/mysql-test/t/rpl_server_id1.test @@ -0,0 +1,22 @@ +# This test checks that a slave does not execute queries originating +# from itself, by default. + +source include/master-slave.inc; +connection slave; +create table t1 (n int); +reset master; +# replicate ourselves +stop slave; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval change master to master_port=$SLAVE_MYPORT; +--replace_result $SLAVE_MYPORT SLAVE_PORT +--replace_column 18 # +show slave status; +start slave; +insert into t1 values (1); +# can't MASTER_POS_WAIT(), it does not work in this weird setup +# (when slave is its own master without --replicate-same-server-id) +sleep 2; # enough time for the event to be replicated (it should not) +show status like "slave_running"; +select * from t1; +drop table t1; diff --git a/mysql-test/t/rpl_server_id2-slave.opt b/mysql-test/t/rpl_server_id2-slave.opt new file mode 100644 index 00000000000..302889525dd --- /dev/null +++ b/mysql-test/t/rpl_server_id2-slave.opt @@ -0,0 +1 @@ +--disable-log-slave-updates --replicate-same-server-id diff --git a/mysql-test/t/rpl_server_id2.test b/mysql-test/t/rpl_server_id2.test new file mode 100644 index 00000000000..f022ab13188 --- /dev/null +++ b/mysql-test/t/rpl_server_id2.test @@ -0,0 +1,21 @@ +# This test checks that a slave DOES execute queries originating +# from itself, if running with --replicate-same-server-id. + +source include/master-slave.inc; +connection slave; +drop table if exists t1; +create table t1 (n int); +reset master; +# replicate ourselves +stop slave; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval change master to master_port=$SLAVE_MYPORT; +--replace_result $SLAVE_MYPORT SLAVE_PORT +--replace_column 18 # +show slave status; +start slave; +insert into t1 values (1); +save_master_pos; +sync_with_master; +select * from t1; # check that indeed 2 were inserted +drop table t1; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index b0307af19bb..deb95af9168 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -55,7 +55,7 @@ create table t1 ( name char(20) default 'O''Brien' comment 'O''Brien as default', c int not null comment 'int column', `c-b` int comment 'name with a minus', - `space 2` int comment 'name with a space', + `space 2` int comment 'name with a space' ) comment = 'it\'s a table' ; show create table t1; set sql_quote_show_create=0; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index bf7a8a6292d..1b5bb807b97 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -673,7 +673,7 @@ CREATE TABLE `t1` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `pseudo` varchar(35) character set latin1 NOT NULL default '', PRIMARY KEY (`id`), - UNIQUE KEY `pseudo` (`pseudo`), + UNIQUE KEY `pseudo` (`pseudo`) ) ENGINE=MyISAM PACK_KEYS=1 ROW_FORMAT=DYNAMIC; INSERT INTO t1 (pseudo) VALUES ('test'); SELECT 0 IN (SELECT 1 FROM t1 a); @@ -776,7 +776,7 @@ CREATE TABLE `t1` ( `email` varchar(60) NOT NULL default '', PRIMARY KEY (`id`), UNIQUE KEY `email` (`email`), - UNIQUE KEY `pseudo` (`pseudo`), + UNIQUE KEY `pseudo` (`pseudo`) ) ENGINE=MyISAM CHARSET=latin1 PACK_KEYS=1 ROW_FORMAT=DYNAMIC; INSERT INTO t1 (id,pseudo,email) VALUES (1,'test','test'),(2,'test1','test1'); SELECT pseudo as a, pseudo as b FROM t1 GROUP BY (SELECT a) ORDER BY (SELECT id*1); diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 21619534f49..d9e19571f81 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -469,12 +469,13 @@ show status like 'Slow_queries'; drop table t1; # -# bug #2508 +# Column 'name' cannot be null (error with union and left join) (bug #2508) # create table t1 ( RID int(11) not null default '0', IID int(11) not null default '0', nada varchar(50) not null,NAME varchar(50) not null,PHONE varchar(50) not null) engine=MyISAM; insert into t1 ( RID,IID,nada,NAME,PHONE) values (1, 1, 'main', 'a', '111'), (2, 1, 'main', 'b', '222'), (3, 1, 'main', 'c', '333'), (4, 1, 'main', 'd', '444'), (5, 1, 'main', 'e', '555'), (6, 2, 'main', 'c', '333'), (7, 2, 'main', 'd', '454'), (8, 2, 'main', 'e', '555'), (9, 2, 'main', 'f', '666'), (10, 2, 'main', 'g', '777'); select A.NAME, A.PHONE, B.NAME, B.PHONE from t1 A left join t1 B on A.NAME = B.NAME and B.IID = 2 where A.IID = 1 and (A.PHONE <> B.PHONE or B.NAME is null) union select A.NAME, A.PHONE, B.NAME, B.PHONE from t1 B left join t1 A on B.NAME = A.NAME and A.IID = 1 where B.IID = 2 and (A.PHONE <> B.PHONE or A.NAME is null); drop table t1; + # # Bug #2809 (UNION fails on MyIsam tables when index on second column from # same table) @@ -487,10 +488,8 @@ select col1 n from t1 union select col2 n from t1 order by n; drop table t1; # -# Bug #1428, incorrect handling of UNION ALL -# NOTE: The current result is wrong, needs to be fixed! +# Incorrect handling of UNION ALL (Bug #1428) # - create table t1 (i int); insert into t1 values (1); select * from t1 UNION select * from t1; |