mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 4.1 to 5.0
BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union configure.in: Auto merged client/mysql.cc: Auto merged client/mysqltest.c: Auto merged include/my_global.h: Auto merged include/my_pthread.h: Auto merged include/mysql_com.h: Auto merged libmysql/libmysql.c: Auto merged myisam/mi_check.c: Auto merged myisam/myisamchk.c: Auto merged myisam/myisamdef.h: Auto merged myisam/sort.c: Auto merged mysql-test/install_test_db.sh: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/symlink.result: Auto merged mysql-test/t/subselect.test: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisam.cc: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/protocol.cc: Auto merged sql/protocol.h: Auto merged sql/protocol_cursor.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_db.cc: Auto merged sql/sql_derived.cc: Auto merged sql/sql_error.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_list.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_select.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_test.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged
This commit is contained in:
@ -12,11 +12,13 @@ if [ x$1 = x"-bin" ]; then
|
||||
BINARY_DIST=1
|
||||
fix_bin=mysql-test
|
||||
scriptdir=../bin
|
||||
libexecdir=../libexec
|
||||
else
|
||||
execdir=../sql
|
||||
bindir=../client
|
||||
fix_bin=.
|
||||
scriptdir=../scripts
|
||||
libexecdir=../libexec
|
||||
fi
|
||||
|
||||
vardir=var
|
||||
@ -36,8 +38,13 @@ EXTRA_ARG=""
|
||||
|
||||
if test ! -x $execdir/mysqld
|
||||
then
|
||||
echo "mysqld is missing - looked in $execdir"
|
||||
exit 1
|
||||
if test ! -x $libexecdir/mysqld
|
||||
then
|
||||
echo "mysqld is missing - looked in $execdir and in $libexecdir"
|
||||
exit 1
|
||||
else
|
||||
execdir=$libexecdir
|
||||
fi
|
||||
fi
|
||||
|
||||
# On IRIX hostname is in /usr/bsd so add this to the path
|
||||
|
@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
#!/bin/sh
|
||||
# mysql-test-run - originally written by Matt Wagner <matt@mysql.com>
|
||||
# modified by Sasha Pachev <sasha@mysql.com>
|
||||
# Sligtly updated by Monty
|
||||
# Slightly updated by Monty
|
||||
# Cleaned up again by Matt
|
||||
# Fixed by Sergei
|
||||
# :-)
|
||||
@ -1172,7 +1172,7 @@ run_testcase ()
|
||||
slave_master_info_file=$TESTDIR/$tname.slave-mi
|
||||
echo $tname > $CURRENT_TEST
|
||||
SKIP_SLAVE=`$EXPR \( $tname : rpl \) = 0`
|
||||
if [ $USE_MANAGER = 1 ] ; then
|
||||
if [ "$USE_MANAGER" = 1 ] ; then
|
||||
many_slaves=`$EXPR \( \( $tname : rpl_failsafe \) != 0 \) \| \( \( $tname : rpl_chain_temp_table \) != 0 \)`
|
||||
fi
|
||||
|
||||
|
@ -18,9 +18,11 @@ select -(0-3),round(-(0-3)), round(9999999999999999999);
|
||||
-(0-3) round(-(0-3)) round(9999999999999999999)
|
||||
3 3 10000000000000000000
|
||||
create table t1 (a bigint unsigned not null, primary key(a));
|
||||
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
|
||||
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
|
||||
select * from t1;
|
||||
a
|
||||
18446744073709551612
|
||||
18446744073709551613
|
||||
18446744073709551614
|
||||
18446744073709551615
|
||||
select * from t1 where a=18446744073709551615;
|
||||
@ -29,6 +31,8 @@ a
|
||||
delete from t1 where a=18446744073709551615;
|
||||
select * from t1;
|
||||
a
|
||||
18446744073709551612
|
||||
18446744073709551613
|
||||
18446744073709551614
|
||||
drop table t1;
|
||||
create table t1 ( a int not null default 1, big bigint );
|
||||
@ -70,3 +74,13 @@ select * from t1 limit 9999999999;
|
||||
id a
|
||||
9999999999 1
|
||||
drop table t1;
|
||||
CREATE TABLE t1 ( quantity decimal(60,0));
|
||||
insert into t1 values (10000000000000000000);
|
||||
insert into t1 values (10000000000000000000.0);
|
||||
insert into t1 values ('10000000000000000000');
|
||||
select * from t1;
|
||||
quantity
|
||||
-8446744073709551616
|
||||
10000000000000000000
|
||||
10000000000000000000
|
||||
drop table t1;
|
||||
|
@ -90,19 +90,21 @@ CASE WHEN 1 THEN 1 ELSE 'a' END AS c4,
|
||||
CASE WHEN 1 THEN 'a' ELSE 1.0 END AS c5,
|
||||
CASE WHEN 1 THEN 1.0 ELSE 'a' END AS c6,
|
||||
CASE WHEN 1 THEN 1 ELSE 1.0 END AS c7,
|
||||
CASE WHEN 1 THEN 1.0 ELSE 1 END AS c8
|
||||
CASE WHEN 1 THEN 1.0 ELSE 1 END AS c8,
|
||||
CASE WHEN 1 THEN 1.0 END AS c9
|
||||
;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` char(1) character set latin1 collate latin1_danish_ci default NULL,
|
||||
`c2` char(1) character set latin1 collate latin1_danish_ci default NULL,
|
||||
`c3` char(1) default NULL,
|
||||
`c4` char(1) default NULL,
|
||||
`c5` char(3) default NULL,
|
||||
`c6` char(3) default NULL,
|
||||
`c7` double(3,1) default NULL,
|
||||
`c8` double(3,1) default NULL
|
||||
`c1` char(1) character set latin1 collate latin1_danish_ci NOT NULL default '',
|
||||
`c2` char(1) character set latin1 collate latin1_danish_ci NOT NULL default '',
|
||||
`c3` char(1) NOT NULL default '',
|
||||
`c4` char(1) NOT NULL default '',
|
||||
`c5` char(3) NOT NULL default '',
|
||||
`c6` char(3) NOT NULL default '',
|
||||
`c7` double(3,1) NOT NULL default '0.0',
|
||||
`c8` double(3,1) NOT NULL default '0.0',
|
||||
`c9` double(3,1) default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
SELECT CASE
|
||||
|
@ -5,3 +5,4 @@ COUNT(*)
|
||||
4181000
|
||||
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
|
||||
DROP TABLE t1;
|
||||
set @@read_buffer_size=default;
|
||||
|
@ -1,4 +1,5 @@
|
||||
drop table if exists t1,t2,t3;
|
||||
drop database if exists test_$1;
|
||||
create table t1 (b char(0));
|
||||
insert into t1 values (""),(null);
|
||||
select * from t1;
|
||||
@ -302,9 +303,6 @@ t3 CREATE TABLE `t3` (
|
||||
select * from t3;
|
||||
id name
|
||||
drop table t2, t3;
|
||||
drop database if exists test_$1;
|
||||
Warnings:
|
||||
Note 1008 Can't drop database 'test_$1'; database doesn't exist
|
||||
create database test_$1;
|
||||
create table test_$1.t3 like t1;
|
||||
create temporary table t3 like test_$1.t3;
|
||||
@ -404,14 +402,13 @@ d date 0000-00-00
|
||||
e char(1)
|
||||
f datetime 0000-00-00 00:00:00
|
||||
g time 00:00:00
|
||||
h mediumblob
|
||||
h longblob
|
||||
dd time 00:00:00
|
||||
select * from t2;
|
||||
a b c d e f g h dd
|
||||
1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00
|
||||
2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data 02:00:00
|
||||
drop table t1, t2;
|
||||
drop database if exists test_$1;
|
||||
create database test_$1;
|
||||
use test_$1;
|
||||
select database();
|
||||
|
@ -120,7 +120,7 @@ date format str_to_date
|
||||
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.000044
|
||||
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
|
||||
15 September 2001 %d %M %Y 2001-09-15 00:00:00
|
||||
15 SEPTEMB 2001 %d %M %Y 2001-01-15 00:00:00
|
||||
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
|
||||
15 MAY 2001 %d %b %Y 2001-05-15 00:00:00
|
||||
Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
|
||||
Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
|
||||
@ -144,7 +144,7 @@ date format con
|
||||
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.000044
|
||||
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
|
||||
15 September 2001 %d %M %Y 2001-09-15 00:00:00
|
||||
15 SEPTEMB 2001 %d %M %Y 2001-01-15 00:00:00
|
||||
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
|
||||
15 MAY 2001 %d %b %Y 2001-05-15 00:00:00
|
||||
Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
|
||||
Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
|
||||
@ -168,7 +168,7 @@ date format datetime
|
||||
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.000044
|
||||
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
|
||||
15 September 2001 %d %M %Y 2001-09-15 00:00:00
|
||||
15 SEPTEMB 2001 %d %M %Y 2001-01-15 00:00:00
|
||||
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
|
||||
15 MAY 2001 %d %b %Y 2001-05-15 00:00:00
|
||||
Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
|
||||
Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
|
||||
@ -192,7 +192,7 @@ date format date2
|
||||
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00
|
||||
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15
|
||||
15 September 2001 %d %M %Y 2001-09-15
|
||||
15 SEPTEMB 2001 %d %M %Y 2001-01-15
|
||||
15 SEPTEMB 2001 %d %M %Y 2001-09-15
|
||||
15 MAY 2001 %d %b %Y 2001-05-15
|
||||
Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15
|
||||
Sund 15 MAY 2001 %W %d %b %Y 2001-05-15
|
||||
@ -330,3 +330,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority makedate(1997,1) AS `makedate(1997,1)`,addtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff(_latin1'01.01.97 11:59:59.000001 PM',_latin1'31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date(_latin1'15-01-2001 12:59:59',_latin1'%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond(_latin1'1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")`
|
||||
create table t1 (d date);
|
||||
insert into t1 values ('2004-07-14'),('2005-07-14');
|
||||
select date_format(d,"%d") from t1 order by 1;
|
||||
date_format(d,"%d")
|
||||
14
|
||||
14
|
||||
drop table t1;
|
||||
|
@ -228,3 +228,20 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
2 DERIVED t1 ALL NULL NULL NULL NULL 2 Using where
|
||||
3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2);
|
||||
select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
|
||||
a a
|
||||
1 1
|
||||
2 1
|
||||
1 2
|
||||
2 2
|
||||
explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
|
||||
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 2
|
||||
4 DERIVED t1 ALL NULL NULL NULL NULL 2
|
||||
5 UNION t1 ALL NULL NULL NULL NULL 2
|
||||
2 DERIVED t1 ALL NULL NULL NULL NULL 2
|
||||
3 UNION t1 ALL NULL NULL NULL NULL 2
|
||||
drop table t1;
|
||||
|
@ -161,6 +161,23 @@ Only MyISAM tables support collections
|
||||
Function MATCH ... AGAINST() is used to do a search
|
||||
some test foobar implements vector space model
|
||||
drop table t1;
|
||||
create table t1 (a varchar(200) not null, fulltext (a));
|
||||
insert t1 values ("aaa10 bbb20"), ("aaa20 bbb15"), ("aaa30 bbb10");
|
||||
select * from t1 where match a against ("+aaa* +bbb*" in boolean mode);
|
||||
a
|
||||
aaa10 bbb20
|
||||
aaa20 bbb15
|
||||
aaa30 bbb10
|
||||
select * from t1 where match a against ("+aaa* +bbb1*" in boolean mode);
|
||||
a
|
||||
aaa20 bbb15
|
||||
aaa30 bbb10
|
||||
select * from t1 where match a against ("+aaa* +ccc*" in boolean mode);
|
||||
a
|
||||
select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode);
|
||||
a
|
||||
aaa10 bbb20
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
id int(11),
|
||||
ticket int(11),
|
||||
|
@ -41,4 +41,12 @@ venue_id venue_text dt name entity_id
|
||||
select * from t1 left join t2 on venue_id = entity_id where match(name) against('aberdeen') and dt = '2003-05-23 19:30:00';
|
||||
venue_id venue_text dt name entity_id
|
||||
1 a1 2003-05-23 19:30:00 aberdeen town hall 1
|
||||
select * from t1 left join t2 on (venue_id = entity_id and match(name) against('aberdeen' in boolean mode)) where dt = '2003-05-23 19:30:00';
|
||||
venue_id venue_text dt name entity_id
|
||||
1 a1 2003-05-23 19:30:00 aberdeen town hall 1
|
||||
NULL a2 2003-05-23 19:30:00 NULL NULL
|
||||
select * from t1 left join t2 on (venue_id = entity_id and match(name) against('aberdeen')) where dt = '2003-05-23 19:30:00';
|
||||
venue_id venue_text dt name entity_id
|
||||
1 a1 2003-05-23 19:30:00 aberdeen town hall 1
|
||||
NULL a2 2003-05-23 19:30:00 NULL NULL
|
||||
drop table t1,t2;
|
||||
|
@ -580,3 +580,7 @@ FieldKey LongVal StringVal
|
||||
3 2 1
|
||||
3 3 3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
SET @id=0;
|
||||
UPDATE t1 SET a=0 ORDER BY (a=@id), b;
|
||||
DROP TABLE t1;
|
||||
|
@ -1,7 +1,8 @@
|
||||
create database test_raid;
|
||||
create table test_raid.r1 (i int) raid_type=1;
|
||||
drop database test_raid;
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
DROP DATABASE IF EXISTS test_$1;
|
||||
create database test_$1;
|
||||
create table test_$1.r1 (i int) raid_type=1;
|
||||
drop database test_$1;
|
||||
CREATE TABLE t1 (
|
||||
id int unsigned not null auto_increment primary key,
|
||||
c char(255) not null
|
||||
@ -99,7 +100,6 @@ count(*)
|
||||
450
|
||||
DROP TABLE t2;
|
||||
/* variable rows */
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1 (
|
||||
id int unsigned not null auto_increment primary key,
|
||||
c varchar(255) not null
|
||||
|
@ -279,6 +279,16 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
SELECT * FROM t1 WHERE a IN(1,2) AND b=5;
|
||||
a b
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int, b int, c int, INDEX (c,a,b));
|
||||
INSERT INTO t1 VALUES (1,0,0),(1,0,0),(1,0,0);
|
||||
INSERT INTO t1 VALUES (0,1,0),(0,1,0),(0,1,0);
|
||||
SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1);
|
||||
COUNT(*)
|
||||
6
|
||||
SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
|
||||
COUNT(*)
|
||||
6
|
||||
DROP TABLE t1;
|
||||
create table t1 (id int(10) primary key);
|
||||
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
select id from t1 where id in (2,5,9) ;
|
||||
|
@ -1,22 +1,22 @@
|
||||
reset master;
|
||||
show master status;
|
||||
File Position Binlog_do_db Binlog_ignore_db
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 79
|
||||
reset slave;
|
||||
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
|
||||
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
|
||||
change master to master_host='127.0.0.1';
|
||||
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
|
||||
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 test MASTER_PORT 7 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No #
|
||||
change master to master_host='127.0.0.1',master_user='root',
|
||||
master_password='',master_port=MASTER_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
|
||||
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 MASTER_PORT 7 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No #
|
||||
start slave;
|
||||
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
|
||||
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 MASTER_PORT 7 master-bin.000001 79 slave-relay-bin.000001 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No #
|
||||
drop table if exists t1;
|
||||
create table t1 (n int);
|
||||
|
32
mysql-test/r/rpl_change_master.result
Normal file
32
mysql-test/r/rpl_change_master.result
Normal file
@ -0,0 +1,32 @@
|
||||
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;
|
||||
select get_lock("a",5);
|
||||
get_lock("a",5)
|
||||
1
|
||||
create table t1(n int);
|
||||
insert into t1 values(1+get_lock("a",15)*0);
|
||||
insert into t1 values(2);
|
||||
stop slave;
|
||||
select * from t1;
|
||||
n
|
||||
1
|
||||
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 MASTER_MYPORT 1 master-bin.000001 273 slave-relay-bin.000002 258 master-bin.000001 No No 0 0 214 317 None 0 No #
|
||||
change master to master_user='root';
|
||||
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 MASTER_MYPORT 1 master-bin.000001 214 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 214 4 None 0 No #
|
||||
select release_lock("a");
|
||||
release_lock("a")
|
||||
1
|
||||
start slave;
|
||||
select * from t1;
|
||||
n
|
||||
1
|
||||
2
|
||||
drop table t1;
|
@ -5,7 +5,7 @@ reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
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
|
||||
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
|
||||
load table t1 from master;
|
||||
ERROR 08S01: Error connecting to master: Master is not configured
|
||||
load table t1 from master;
|
||||
|
@ -8,7 +8,7 @@ create table t1 (a int primary key);
|
||||
insert into t1 values (1),(1);
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 213 slave-relay-bin.000002 257 master-bin.000001 Yes Yes test.t1 0 0 213 257 None 0 No #
|
||||
show tables like 't1';
|
||||
Tables_in_test (t1)
|
||||
|
@ -13,5 +13,5 @@ master_password='',master_port=SLAVE_PORT;
|
||||
start slave;
|
||||
flush logs;
|
||||
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
|
||||
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 60 slave-bin.000001 79 relay-log.000002 4 slave-bin.000001 Yes Yes 0 0 79 4 None 0 No #
|
||||
|
@ -21,7 +21,7 @@ day id category name
|
||||
2003-03-22 2161 c asdf
|
||||
2003-03-22 2416 a bbbbb
|
||||
show master status;
|
||||
File Position Binlog_do_db Binlog_ignore_db
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
slave-bin.000001 964
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
@ -32,7 +32,7 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 1311 slave-relay-bin.000002 1355 master-bin.000001 Yes Yes 0 0 1311 1355 None 0 No #
|
||||
set sql_log_bin=0;
|
||||
delete from t1;
|
||||
@ -42,8 +42,8 @@ stop slave;
|
||||
change master to master_user='test';
|
||||
change master to master_user='root';
|
||||
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 MASTER_PORT 1 master-bin.000001 1442 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 1442 4 None 0 No #
|
||||
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 MASTER_PORT 1 master-bin.000001 1419 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 1419 4 None 0 No #
|
||||
set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
set sql_log_bin=0;
|
||||
@ -53,7 +53,7 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
stop slave;
|
||||
reset slave;
|
||||
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
|
||||
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 MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No #
|
||||
reset master;
|
||||
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
|
||||
@ -63,6 +63,6 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
|
||||
'\n##\n' starting by '>' ignore 1 lines;
|
||||
ERROR 23000: Duplicate entry '2003-03-22' for key 1
|
||||
show master status;
|
||||
File Position Binlog_do_db Binlog_ignore_db
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 491
|
||||
drop table t2;
|
||||
|
@ -5,7 +5,7 @@ reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
drop database if exists mysqltest;
|
||||
reset master;
|
||||
stop slave;
|
||||
create database mysqltest;
|
||||
create table t1(a int, b int, unique(b));
|
||||
use mysqltest;
|
||||
|
@ -95,7 +95,7 @@ slave-bin.000002 4 Query 1 4 use `test`; create table t1 (n int)
|
||||
slave-bin.000002 62 Query 1 62 use `test`; insert into t1 values (1)
|
||||
slave-bin.000002 122 Query 1 122 use `test`; drop table t1
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000002 276 slave-relay-bin.000003 214 master-bin.000002 Yes Yes 0 0 276 214 None 0 No #
|
||||
show binlog events in 'slave-bin.000005' from 4;
|
||||
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
|
||||
|
@ -5,10 +5,10 @@ reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
show master status;
|
||||
File Position Binlog_do_db Binlog_ignore_db
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 79
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No #
|
||||
stop slave;
|
||||
change master to master_log_pos=73;
|
||||
@ -16,20 +16,20 @@ start slave;
|
||||
stop slave;
|
||||
change master to master_log_pos=73;
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 73 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 73 4 None 0 No #
|
||||
start slave;
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 73 slave-relay-bin.000001 48 master-bin.000001 No Yes 0 0 73 48 None 0 No #
|
||||
stop slave;
|
||||
change master to master_log_pos=173;
|
||||
start slave;
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 173 slave-relay-bin.000001 4 master-bin.000001 No Yes 0 0 173 4 None 0 No #
|
||||
show master status;
|
||||
File Position Binlog_do_db Binlog_ignore_db
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 79
|
||||
create table if not exists t1 (n int);
|
||||
drop table if exists t1;
|
||||
|
@ -15,7 +15,7 @@ select @@global.max_relay_log_size;
|
||||
4096
|
||||
start slave;
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 50477 slave-relay-bin.000014 1221 master-bin.000001 Yes Yes 0 0 50477 1221 None 0 No #
|
||||
stop slave;
|
||||
reset slave;
|
||||
@ -25,7 +25,7 @@ select @@global.max_relay_log_size;
|
||||
20480
|
||||
start slave;
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 50477 slave-relay-bin.000004 9457 master-bin.000001 Yes Yes 0 0 50477 9457 None 0 No #
|
||||
stop slave;
|
||||
reset slave;
|
||||
@ -35,27 +35,27 @@ select @@global.max_relay_log_size;
|
||||
0
|
||||
start slave;
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 50477 slave-relay-bin.000008 1283 master-bin.000001 Yes Yes 0 0 50477 1283 None 0 No #
|
||||
stop slave;
|
||||
reset slave;
|
||||
flush logs;
|
||||
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
|
||||
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 MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No #
|
||||
reset slave;
|
||||
start slave;
|
||||
flush logs;
|
||||
create table t1 (a int);
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 50535 slave-relay-bin.000009 62 master-bin.000001 Yes Yes 0 0 50535 62 None 0 No #
|
||||
flush logs;
|
||||
drop table t1;
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 50583 slave-relay-bin.000010 52 master-bin.000001 Yes Yes 0 0 50583 52 None 0 No #
|
||||
flush logs;
|
||||
show master status;
|
||||
File Position Binlog_do_db Binlog_ignore_db
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000002 4
|
||||
|
@ -19,12 +19,12 @@ select * from t1;
|
||||
t
|
||||
1
|
||||
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
|
||||
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 replssl MASTER_MYPORT 1 master-bin.000001 289 slave-relay-bin.000001 108 master-bin.000001 Yes Yes 0 0 289 108 None 0 Yes MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem #
|
||||
stop slave;
|
||||
change master to master_user='root',master_password='', master_ssl=0;
|
||||
start slave;
|
||||
drop table t1;
|
||||
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
|
||||
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 MASTER_MYPORT 1 master-bin.000001 337 slave-relay-bin.000001 96 master-bin.000001 Yes Yes 0 0 337 96 None 0 No MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem #
|
||||
|
@ -5,7 +5,7 @@ reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
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
|
||||
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
|
||||
SHOW SLAVE HOSTS;
|
||||
Server_id Host Port Rpl_recovery_rank Master_id
|
||||
2 127.0.0.1 SLAVE_PORT 2 1
|
||||
|
@ -27,5 +27,5 @@ select * from t11;
|
||||
ERROR 42S02: Table 'test.t11' doesn't exist
|
||||
drop table if exists t1,t2,t11;
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 1281 slave-relay-bin.000002 1325 master-bin.000001 Yes Yes test.t1 0 0 1281 1325 None 0 No #
|
||||
|
@ -5,20 +5,20 @@ reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No #
|
||||
stop slave;
|
||||
change master to master_user='test';
|
||||
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
|
||||
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 test MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 79 4 None 0 No #
|
||||
reset slave;
|
||||
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
|
||||
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 MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No #
|
||||
start slave;
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No #
|
||||
stop slave;
|
||||
reset slave;
|
||||
|
@ -15,7 +15,7 @@ insert into temp_table values ("testing temporary tables");
|
||||
create table t1 (s text);
|
||||
insert into t1 values('Could not break slave'),('Tried hard');
|
||||
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
|
||||
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 MASTER_PORT 60 master-bin.000001 417 slave-relay-bin.000001 461 master-bin.000001 Yes Yes 0 0 417 461 None 0 No #
|
||||
select * from t1;
|
||||
s
|
||||
@ -56,7 +56,7 @@ Log_name
|
||||
master-bin.000003
|
||||
insert into t2 values (65);
|
||||
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
|
||||
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 MASTER_PORT 60 master-bin.000003 290 slave-relay-bin.000001 1088 master-bin.000003 Yes Yes 0 0 290 1088 None 0 No #
|
||||
select * from t2;
|
||||
m
|
||||
@ -74,13 +74,13 @@ Log_name
|
||||
master-bin.000003
|
||||
master-bin.000004
|
||||
show master status;
|
||||
File Position Binlog_do_db Binlog_ignore_db
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000004 2886
|
||||
select * from t4;
|
||||
a
|
||||
testing temporary tables part 2
|
||||
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
|
||||
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 MASTER_PORT 60 master-bin.000004 2886 slave-relay-bin.000001 7891 master-bin.000004 Yes Yes 0 0 2886 7891 None 0 No #
|
||||
lock tables t3 read;
|
||||
select count(*) from t3 where n >= 4;
|
||||
|
@ -9,5 +9,5 @@ flush logs;
|
||||
reset slave;
|
||||
start slave;
|
||||
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
|
||||
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 MASTER_PORT 1 master-bin.000002 4 slave-relay-bin.000002 123 master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. Probably cause is that the master died while writing the transaction to it's binary log. 0 79 326 None 0 No #
|
||||
|
@ -30,7 +30,7 @@ n
|
||||
3
|
||||
4
|
||||
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
|
||||
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 MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 332 master-bin.000001 Yes No 0 0 244 649 Master master-bin.000001 244 No #
|
||||
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
|
||||
select * from t1;
|
||||
@ -40,22 +40,22 @@ n
|
||||
3
|
||||
4
|
||||
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 MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 332 master-bin.000001 Yes No 0 0 244 649 Master master-no-such-bin.000001 291 No #
|
||||
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 MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 # master-bin.000001 Yes No 0 0 244 # Master master-no-such-bin.000001 291 No #
|
||||
start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=537;
|
||||
select * from t2;
|
||||
n
|
||||
1
|
||||
2
|
||||
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 MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 537 master-bin.000001 Yes No 0 0 449 649 Relay slave-relay-bin.000002 537 No #
|
||||
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 MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 # master-bin.000001 Yes No 0 0 449 # Relay slave-relay-bin.000002 537 No #
|
||||
start slave;
|
||||
stop slave;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=561;
|
||||
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 MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 649 master-bin.000001 Yes No 0 0 561 693 Master master-bin.000001 561 No #
|
||||
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 MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 # master-bin.000001 Yes No 0 0 561 # Master master-bin.000001 561 No #
|
||||
start slave until master_log_file='master-bin', master_log_pos=561;
|
||||
ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
|
||||
|
@ -149,10 +149,10 @@ select (select a from t1 where t1.a=t2.b), a from t2;
|
||||
(select a from t1 where t1.a=t2.b) a
|
||||
NULL 1
|
||||
NULL 2
|
||||
select (select a from t1), a from t2;
|
||||
(select a from t1) a
|
||||
2 1
|
||||
2 2
|
||||
select (select a from t1), a, (select 1 union select 2 limit 1) from t2;
|
||||
(select a from t1) a (select 1 union select 2 limit 1)
|
||||
2 1 1
|
||||
2 2 1
|
||||
select (select a from t3), a from t2;
|
||||
(select a from t3) a
|
||||
NULL 1
|
||||
|
@ -40,7 +40,7 @@ t9 CREATE TABLE `t9` (
|
||||
`b` char(16) NOT NULL default '',
|
||||
`c` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`a`)
|
||||
) TYPE=MyISAM CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
|
||||
alter table t9 rename t8, add column d int not null;
|
||||
alter table t8 rename t7;
|
||||
rename table t7 to t9;
|
||||
@ -62,5 +62,5 @@ t9 CREATE TABLE `t9` (
|
||||
`c` int(11) NOT NULL default '0',
|
||||
`d` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`a`)
|
||||
) TYPE=MyISAM CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
|
||||
drop database mysqltest;
|
||||
|
@ -508,5 +508,5 @@ drop table t1;
|
||||
create table t1 select load_file('../../std_data/words.dat');
|
||||
show full fields from t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
load_file('../../std_data/words.dat') mediumblob NULL YES NULL select,insert,update,references
|
||||
load_file('../../std_data/words.dat') longblob NULL YES NULL select,insert,update,references
|
||||
drop table t1;
|
||||
|
@ -271,8 +271,8 @@ Field Type Collation Null Key Default Extra Privileges Comment
|
||||
auto bigint(17) unsigned NULL PRI 0 select,insert,update,references
|
||||
t1 bigint(1) NULL 0 select,insert,update,references
|
||||
t2 char(1) latin1_swedish_ci select,insert,update,references
|
||||
t3 mediumtext latin1_swedish_ci select,insert,update,references
|
||||
t4 mediumtext latin1_bin select,insert,update,references
|
||||
t3 longtext latin1_swedish_ci select,insert,update,references
|
||||
t4 longtext latin1_bin select,insert,update,references
|
||||
select * from t2;
|
||||
auto t1 t2 t3 t4
|
||||
11 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||||
|
@ -53,7 +53,7 @@ select 0,'#' union select a,b from t1 union all select a,b from t2 union select
|
||||
4 d
|
||||
5 f
|
||||
6 e
|
||||
7 g
|
||||
7 gg
|
||||
select a,b from t1 union select a,b from t1;
|
||||
a b
|
||||
1 a
|
||||
@ -449,10 +449,10 @@ INSERT INTO t2 (id, id_master, text1, text2) VALUES("4", "1",
|
||||
SELECT 1 AS id_master, 1 AS id, NULL AS text1, 'ABCDE' AS text2 UNION SELECT id_master, t2.id, text1, text2 FROM t1 LEFT JOIN t2 ON t1.id = t2.id_master;
|
||||
id_master id text1 text2
|
||||
1 1 NULL ABCDE
|
||||
1 1 bar1
|
||||
1 2 bar2
|
||||
1 1 foo1 bar1
|
||||
1 2 foo2 bar2
|
||||
1 3 NULL bar3
|
||||
1 4 bar4
|
||||
1 4 foo4 bar4
|
||||
SELECT 1 AS id_master, 1 AS id, 'ABCDE' AS text1, 'ABCDE' AS text2 UNION SELECT id_master, t2.id, text1, text2 FROM t1 LEFT JOIN t2 ON t1.id = t2.id_master;
|
||||
id_master id text1 text2
|
||||
1 1 ABCDE ABCDE
|
||||
@ -523,3 +523,303 @@ pla_id matintnum
|
||||
105 c
|
||||
0 0
|
||||
drop table t1, t2;
|
||||
create table t1 SELECT "a" as a UNION select "aa" as a;
|
||||
select * from t1;
|
||||
a
|
||||
a
|
||||
aa
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(2) NOT NULL default ''
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT 12 as a UNION select "aa" as a;
|
||||
select * from t1;
|
||||
a
|
||||
12
|
||||
aa
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(2) NOT NULL default ''
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT 12 as a UNION select 12.2 as a;
|
||||
select * from t1;
|
||||
a
|
||||
12.0
|
||||
12.2
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` double(4,1) NOT NULL default '0.0'
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t2 (it1 tinyint, it2 tinyint not null, i int not null, ib bigint, f float, d double, y year, da date, dt datetime, sc char(10), sv varchar(10), b blob, tx text);
|
||||
insert into t2 values (NULL, 1, 3, 4, 1.5, 2.5, 1972, '1972-10-22', '1972-10-22 11:50', 'testc', 'testv', 'tetetetetest', 'teeeeeeeeeeeest');
|
||||
create table t1 SELECT it2 from t2 UNION select it1 from t2;
|
||||
select * from t1;
|
||||
it2
|
||||
1
|
||||
NULL
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`it2` tinyint(4) default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT it2 from t2 UNION select i from t2;
|
||||
select * from t1;
|
||||
it2
|
||||
1
|
||||
3
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`it2` int(11) NOT NULL default '0'
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT i from t2 UNION select f from t2;
|
||||
select * from t1;
|
||||
i
|
||||
3
|
||||
1.5
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`i` double default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT f from t2 UNION select d from t2;
|
||||
select * from t1;
|
||||
f
|
||||
1.5
|
||||
2.5
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f` double default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT ib from t2 UNION select f from t2;
|
||||
select * from t1;
|
||||
ib
|
||||
4
|
||||
1.5
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`ib` double default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT ib from t2 UNION select d from t2;
|
||||
select * from t1;
|
||||
ib
|
||||
4
|
||||
2.5
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`ib` double default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT f from t2 UNION select y from t2;
|
||||
select * from t1;
|
||||
f
|
||||
1.5
|
||||
1972
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f` float default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT f from t2 UNION select da from t2;
|
||||
select * from t1;
|
||||
f
|
||||
1.5
|
||||
1972-10-22
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f` char(12) binary default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT y from t2 UNION select da from t2;
|
||||
select * from t1;
|
||||
y
|
||||
1972
|
||||
1972-10-22
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`y` char(10) binary default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT y from t2 UNION select dt from t2;
|
||||
select * from t1;
|
||||
y
|
||||
1972
|
||||
1972-10-22 11:50:00
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`y` char(19) binary default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT da from t2 UNION select dt from t2;
|
||||
select * from t1;
|
||||
da
|
||||
1972-10-22 00:00:00
|
||||
1972-10-22 11:50:00
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`da` datetime default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT dt from t2 UNION select sc from t2;
|
||||
select * from t1;
|
||||
dt
|
||||
1972-10-22 11:50:00
|
||||
testc
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`dt` char(19) default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT dt from t2 UNION select sv from t2;
|
||||
select * from t1;
|
||||
dt
|
||||
1972-10-22 11:50:00
|
||||
testv
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`dt` char(19) default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT sc from t2 UNION select sv from t2;
|
||||
select * from t1;
|
||||
sc
|
||||
testc
|
||||
testv
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`sc` varchar(10) default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT dt from t2 UNION select b from t2;
|
||||
select * from t1;
|
||||
dt
|
||||
1972-10-22 11:50:00
|
||||
tetetetetest
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`dt` longblob
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT sv from t2 UNION select b from t2;
|
||||
select * from t1;
|
||||
sv
|
||||
testv
|
||||
tetetetetest
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`sv` longblob
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT i from t2 UNION select d from t2 UNION select b from t2;
|
||||
select * from t1;
|
||||
i
|
||||
3
|
||||
2.5
|
||||
tetetetetest
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`i` blob
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT sv from t2 UNION select tx from t2;
|
||||
select * from t1;
|
||||
sv
|
||||
testv
|
||||
teeeeeeeeeeeest
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`sv` text
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 SELECT b from t2 UNION select tx from t2;
|
||||
select * from t1;
|
||||
b
|
||||
tetetetetest
|
||||
teeeeeeeeeeeest
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`b` longblob
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1,t2;
|
||||
create table t1 (d decimal(10,1));
|
||||
create table t2 (d decimal(10,9));
|
||||
insert into t1 values ("100000000.0");
|
||||
insert into t2 values ("1.23456780");
|
||||
create table t3 select * from t2 union select * from t1;
|
||||
select * from t3;
|
||||
d
|
||||
1.234567800
|
||||
100000000.0
|
||||
show create table t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`d` decimal(10,9) default NULL
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1,t2,t3;
|
||||
create table t1 select 1 union select -1;
|
||||
select * from t1;
|
||||
1
|
||||
1
|
||||
-1
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`1` bigint(1) NOT NULL default '0'
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 select _latin1"test" union select _latin2"testt" ;
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'UNION'
|
||||
create table t1 select _latin2"test" union select _latin2"testt" ;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`test` char(5) character set latin2 NOT NULL default ''
|
||||
) TYPE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (s char(200));
|
||||
insert into t1 values (repeat("1",200));
|
||||
create table t2 select * from t1;
|
||||
insert into t2 select * from t1;
|
||||
insert into t1 select * from t2;
|
||||
insert into t2 select * from t1;
|
||||
insert into t1 select * from t2;
|
||||
insert into t2 select * from t1;
|
||||
set local tmp_table_size=1024;
|
||||
select count(*) from (select * from t1 union all select * from t2 order by 1) b;
|
||||
count(*)
|
||||
21
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
8
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
13
|
||||
drop table t1,t2;
|
||||
set local tmp_table_size=default;
|
||||
|
@ -101,3 +101,22 @@ drop table t1;
|
||||
select @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b, @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b;
|
||||
@a:=10 @b:=2 @a>@b @a:="10" @b:="2" @a>@b @a:=10 @b:=2 @a>@b @a:="10" @b:="2" @a>@b
|
||||
10 2 1 10 2 1 10 2 1 10 2 1
|
||||
create table t1 (i int not null);
|
||||
insert t1 values (1),(2),(2),(3),(3),(3);
|
||||
select @a:=0;
|
||||
@a:=0
|
||||
0
|
||||
select @a, @a:=@a+count(*), count(*), @a from t1 group by i;
|
||||
@a @a:=@a+count(*) count(*) @a
|
||||
0 1 1 0
|
||||
0 2 2 0
|
||||
0 3 3 0
|
||||
select @a:=0;
|
||||
@a:=0
|
||||
0
|
||||
select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
|
||||
@a+0 @a:=@a+0+count(*) count(*) @a+0
|
||||
0 1 1 0
|
||||
1 3 2 0
|
||||
3 6 3 0
|
||||
drop table t1;
|
||||
|
@ -22,7 +22,7 @@ select -(0-3),round(-(0-3)), round(9999999999999999999);
|
||||
#
|
||||
|
||||
create table t1 (a bigint unsigned not null, primary key(a));
|
||||
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
|
||||
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
|
||||
select * from t1;
|
||||
select * from t1 where a=18446744073709551615;
|
||||
# select * from t1 where a='18446744073709551615';
|
||||
@ -54,3 +54,17 @@ insert into t1 values (null,1);
|
||||
select * from t1;
|
||||
select * from t1 limit 9999999999;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Item_uint::save_to_field()
|
||||
# BUG#1845
|
||||
# This can't be fixed in MySQL 4.0 without loosing precisions for bigints
|
||||
#
|
||||
|
||||
CREATE TABLE t1 ( quantity decimal(60,0));
|
||||
insert into t1 values (10000000000000000000);
|
||||
insert into t1 values (10000000000000000000.0);
|
||||
insert into t1 values ('10000000000000000000');
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
|
@ -57,7 +57,8 @@ CREATE TABLE t1 SELECT
|
||||
CASE WHEN 1 THEN 'a' ELSE 1.0 END AS c5,
|
||||
CASE WHEN 1 THEN 1.0 ELSE 'a' END AS c6,
|
||||
CASE WHEN 1 THEN 1 ELSE 1.0 END AS c7,
|
||||
CASE WHEN 1 THEN 1.0 ELSE 1 END AS c8
|
||||
CASE WHEN 1 THEN 1.0 ELSE 1 END AS c8,
|
||||
CASE WHEN 1 THEN 1.0 END AS c9
|
||||
;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
@ -21,6 +21,7 @@ while ($1)
|
||||
INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev);
|
||||
dec $1;
|
||||
}
|
||||
set @@read_buffer_size=2*1024*1024;
|
||||
CREATE TABLE t2 SELECT * FROM t1;
|
||||
INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
|
||||
INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
|
||||
@ -53,3 +54,5 @@ SELECT COUNT(*) FROM t1;
|
||||
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
|
||||
--enable_result_log
|
||||
DROP TABLE t1;
|
||||
|
||||
set @@read_buffer_size=default;
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3;
|
||||
drop database if exists test_$1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (b char(0));
|
||||
@ -57,6 +58,7 @@ select 1ea10.1a20,1e+ 1e+10 from 1ea10;
|
||||
drop table 1ea10;
|
||||
create table t1 (t1.index int);
|
||||
drop table t1;
|
||||
# Test that we get warning for this
|
||||
drop database if exists test_$1;
|
||||
create database test_$1;
|
||||
create table test_$1.$test1 (a$1 int, $b int, c$ int);
|
||||
@ -245,7 +247,6 @@ drop table t3;
|
||||
show create table t3;
|
||||
select * from t3;
|
||||
drop table t2, t3;
|
||||
drop database if exists test_$1;
|
||||
create database test_$1;
|
||||
create table test_$1.t3 like t1;
|
||||
create temporary table t3 like test_$1.t3;
|
||||
@ -326,9 +327,6 @@ drop table t1, t2;
|
||||
# Bug #1209
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop database if exists test_$1;
|
||||
--enable_warnings
|
||||
create database test_$1;
|
||||
use test_$1;
|
||||
select database();
|
||||
|
@ -200,3 +200,12 @@ select get_format(DATE, 'TEST') as a;
|
||||
select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA'));
|
||||
|
||||
explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001");
|
||||
|
||||
#
|
||||
# Test of date_format()
|
||||
#
|
||||
|
||||
create table t1 (d date);
|
||||
insert into t1 values ('2004-07-14'),('2005-07-14');
|
||||
select date_format(d,"%d") from t1 order by 1;
|
||||
drop table t1;
|
||||
|
@ -132,3 +132,9 @@ insert into t1 VALUES(1,1,1), (2,2,1);
|
||||
select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
|
||||
explain select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2);
|
||||
select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
|
||||
explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
|
||||
drop table t1;
|
||||
|
@ -80,6 +80,17 @@ delete from t1 where MATCH(a,b) AGAINST ("indexes");
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# why to scan strings for trunc*
|
||||
#
|
||||
create table t1 (a varchar(200) not null, fulltext (a));
|
||||
insert t1 values ("aaa10 bbb20"), ("aaa20 bbb15"), ("aaa30 bbb10");
|
||||
select * from t1 where match a against ("+aaa* +bbb*" in boolean mode);
|
||||
select * from t1 where match a against ("+aaa* +bbb1*" in boolean mode);
|
||||
select * from t1 where match a against ("+aaa* +ccc*" in boolean mode);
|
||||
select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode);
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Check bug reported by Matthias Urlichs
|
||||
#
|
||||
|
@ -41,5 +41,7 @@ create table t2 (name varchar(255) not null default '', entity_id int(11) not nu
|
||||
insert into t2 (name, entity_id) values ('aberdeen town hall', 1), ('glasgow royal concert hall', 2), ('queen\'s hall, edinburgh', 3);
|
||||
select * from t1 left join t2 on venue_id = entity_id where match(name) against('aberdeen' in boolean mode) and dt = '2003-05-23 19:30:00';
|
||||
select * from t1 left join t2 on venue_id = entity_id where match(name) against('aberdeen') and dt = '2003-05-23 19:30:00';
|
||||
select * from t1 left join t2 on (venue_id = entity_id and match(name) against('aberdeen' in boolean mode)) where dt = '2003-05-23 19:30:00';
|
||||
select * from t1 left join t2 on (venue_id = entity_id and match(name) against('aberdeen')) where dt = '2003-05-23 19:30:00';
|
||||
drop table t1,t2;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
# It would be nice to make this a replication test, but in 4.0 the
|
||||
# slave is always with --skip-innodb in the testsuite. I (Guilhem) however
|
||||
# did some tests manually on a slave; tables are replicated fine and
|
||||
# Exec_master_log_pos advances as expected.
|
||||
# Exec_Master_Log_Pos advances as expected.
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
|
@ -365,3 +365,11 @@ SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
|
||||
EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
|
||||
SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #1945 - Crashing bug with bad User Variables in UPDATE ... ORDER BY ...
|
||||
#
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
SET @id=0;
|
||||
UPDATE t1 SET a=0 ORDER BY (a=@id), b;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
@ -9,6 +9,7 @@ enable_query_log;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
DROP DATABASE IF EXISTS test_$1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
@ -111,8 +112,8 @@ ALTER TABLE t1 DROP COLUMN x;
|
||||
ALTER TABLE t1 RENAME t2;
|
||||
select count(*) from t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
/* variable rows */
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1 (
|
||||
id int unsigned not null auto_increment primary key,
|
||||
c varchar(255) not null
|
||||
|
@ -226,7 +226,18 @@ INSERT INTO t1 VALUES
|
||||
# we expect that optimizer will choose index on A
|
||||
EXPLAIN SELECT * FROM t1 WHERE a IN(1,2) AND b=5;
|
||||
SELECT * FROM t1 WHERE a IN(1,2) AND b=5;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Test error with
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a int, b int, c int, INDEX (c,a,b));
|
||||
INSERT INTO t1 VALUES (1,0,0),(1,0,0),(1,0,0);
|
||||
INSERT INTO t1 VALUES (0,1,0),(0,1,0),(0,1,0);
|
||||
# -- First reports 3; second reports 6
|
||||
SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1);
|
||||
SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
|
||||
DROP TABLE t1;
|
||||
|
||||
# test for a bug with in() and unique key
|
||||
|
30
mysql-test/t/rpl_change_master.test
Normal file
30
mysql-test/t/rpl_change_master.test
Normal file
@ -0,0 +1,30 @@
|
||||
source include/master-slave.inc;
|
||||
|
||||
connection slave;
|
||||
select get_lock("a",5);
|
||||
connection master;
|
||||
create table t1(n int);
|
||||
insert into t1 values(1+get_lock("a",15)*0);
|
||||
insert into t1 values(2);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
--real_sleep 3; # can't sync_with_master as we should be blocked
|
||||
stop slave;
|
||||
select * from t1;
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
change master to master_user='root';
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
# Will restart from after the values(2), which is bug
|
||||
select release_lock("a");
|
||||
start slave;
|
||||
sync_with_master;
|
||||
select * from t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
@ -9,7 +9,7 @@ drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
connection slave;
|
||||
reset master;
|
||||
stop slave; # don't need slave for this test
|
||||
|
||||
# Test logging on master
|
||||
|
||||
|
@ -76,7 +76,7 @@ sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
# one more rotation, to be sure Relay_log_space is correctly updated
|
||||
# one more rotation, to be sure Relay_Log_Space is correctly updated
|
||||
flush logs;
|
||||
connection master;
|
||||
drop table t1;
|
||||
|
@ -101,7 +101,8 @@ show master logs;
|
||||
# we just tests if synonyms are accepted
|
||||
purge binary logs to 'master-bin.000002';
|
||||
show binary logs;
|
||||
--sleep 1;
|
||||
# sleeping 10 seconds or more would make the slave believe connection is down
|
||||
--real_sleep 1;
|
||||
purge master logs before now();
|
||||
show binary logs;
|
||||
insert into t2 values (65);
|
||||
|
@ -38,7 +38,7 @@ start slave until master_log_file='master-no-such-bin.000001', master_log_pos=29
|
||||
select * from t1;
|
||||
sleep 2;
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
--replace_column 1 # 33 #
|
||||
--replace_column 1 # 9 # 23 # 33 #
|
||||
show slave status;
|
||||
|
||||
# try replicate all until second insert to t2;
|
||||
@ -46,7 +46,7 @@ start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=537;
|
||||
sleep 2;
|
||||
select * from t2;
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
--replace_column 1 # 33 #
|
||||
--replace_column 1 # 9 # 23 # 33 #
|
||||
show slave status;
|
||||
|
||||
# clean up
|
||||
@ -62,7 +62,7 @@ start slave until master_log_file='master-bin.000001', master_log_pos=561;
|
||||
sleep 2;
|
||||
# here the sql slave thread should be stopped
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
--replace_column 1 # 33 #
|
||||
--replace_column 1 # 9 # 23 # 33 #
|
||||
show slave status;
|
||||
|
||||
#testing various error conditions
|
||||
|
@ -67,7 +67,7 @@ insert into t4 values (4,8),(3,8),(5,9);
|
||||
select (select a from t1 where t1.a = a1) as a2, (select b from t2 where t2.b=a2) as a1;
|
||||
select (select a from t1 where t1.a=t2.a), a from t2;
|
||||
select (select a from t1 where t1.a=t2.b), a from t2;
|
||||
select (select a from t1), a from t2;
|
||||
select (select a from t1), a, (select 1 union select 2 limit 1) from t2;
|
||||
select (select a from t3), a from t2;
|
||||
select * from t2 where t2.a=(select a from t1);
|
||||
insert into t3 values (6),(7),(3);
|
||||
|
@ -65,7 +65,7 @@ drop table t1;
|
||||
#
|
||||
|
||||
disable_query_log;
|
||||
--error 1279,1279
|
||||
--error 1103,1103
|
||||
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam data directory="tmp";
|
||||
|
||||
# Check that we cannot link over a table from another database.
|
||||
@ -75,7 +75,7 @@ create database mysqltest;
|
||||
--error 1,1
|
||||
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam index directory="/this-dir-does-not-exist";
|
||||
|
||||
--error 1279,1279
|
||||
--error 1103,1103
|
||||
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam index directory="not-hard-path";
|
||||
|
||||
--error 1,1
|
||||
|
@ -302,3 +302,137 @@ insert into t1 values (NULL, 'a', 1), (NULL, 'b', 2), (NULL, 'c', 3), (NULL, 'd'
|
||||
insert into t2 values (1, 100), (1, 101), (1, 102), (2, 100), (2, 103), (2, 104), (3, 101), (3, 102), (3, 105);
|
||||
SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id union SELECT 0, 0;
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# types conversions
|
||||
#
|
||||
create table t1 SELECT "a" as a UNION select "aa" as a;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT 12 as a UNION select "aa" as a;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT 12 as a UNION select 12.2 as a;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
create table t2 (it1 tinyint, it2 tinyint not null, i int not null, ib bigint, f float, d double, y year, da date, dt datetime, sc char(10), sv varchar(10), b blob, tx text);
|
||||
insert into t2 values (NULL, 1, 3, 4, 1.5, 2.5, 1972, '1972-10-22', '1972-10-22 11:50', 'testc', 'testv', 'tetetetetest', 'teeeeeeeeeeeest');
|
||||
|
||||
create table t1 SELECT it2 from t2 UNION select it1 from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT it2 from t2 UNION select i from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT i from t2 UNION select f from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT f from t2 UNION select d from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT ib from t2 UNION select f from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT ib from t2 UNION select d from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT f from t2 UNION select y from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT f from t2 UNION select da from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT y from t2 UNION select da from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT y from t2 UNION select dt from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT da from t2 UNION select dt from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT dt from t2 UNION select sc from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT dt from t2 UNION select sv from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT sc from t2 UNION select sv from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT dt from t2 UNION select b from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT sv from t2 UNION select b from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT i from t2 UNION select d from t2 UNION select b from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT sv from t2 UNION select tx from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1 SELECT b from t2 UNION select tx from t2;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1,t2;
|
||||
create table t1 (d decimal(10,1));
|
||||
create table t2 (d decimal(10,9));
|
||||
insert into t1 values ("100000000.0");
|
||||
insert into t2 values ("1.23456780");
|
||||
create table t3 select * from t2 union select * from t1;
|
||||
select * from t3;
|
||||
show create table t3;
|
||||
drop table t1,t2,t3;
|
||||
create table t1 select 1 union select -1;
|
||||
select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
-- error 1266
|
||||
create table t1 select _latin1"test" union select _latin2"testt" ;
|
||||
create table t1 select _latin2"test" union select _latin2"testt" ;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# conversion memory->disk table
|
||||
#
|
||||
#
|
||||
# conversion memory->disk table
|
||||
#
|
||||
create table t1 (s char(200));
|
||||
insert into t1 values (repeat("1",200));
|
||||
create table t2 select * from t1;
|
||||
insert into t2 select * from t1;
|
||||
insert into t1 select * from t2;
|
||||
insert into t2 select * from t1;
|
||||
insert into t1 select * from t2;
|
||||
insert into t2 select * from t1;
|
||||
set local tmp_table_size=1024;
|
||||
select count(*) from (select * from t1 union all select * from t2 order by 1) b;
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
drop table t1,t2;
|
||||
set local tmp_table_size=default;
|
||||
|
@ -60,3 +60,14 @@ drop table t1;
|
||||
|
||||
# just for fun :)
|
||||
select @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b, @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b;
|
||||
|
||||
#
|
||||
# bug#1739
|
||||
# Item_func_set_user_var sets update_query_id, Item_func_get_user_var checks it
|
||||
#
|
||||
create table t1 (i int not null);
|
||||
insert t1 values (1),(2),(2),(3),(3),(3);
|
||||
select @a:=0; select @a, @a:=@a+count(*), count(*), @a from t1 group by i;
|
||||
select @a:=0; select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
|
||||
drop table t1;
|
||||
|
||||
|
Reference in New Issue
Block a user