mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge
sql/mysql_priv.h: Auto merged sql/set_var.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/subselect.result: SCCS merged mysql-test/t/subselect.test: SCCS merged
This commit is contained in:
@ -15,6 +15,8 @@ select * from t1;
|
||||
b
|
||||
|
||||
|
||||
drop table t1;
|
||||
create table t1 (a int not null auto_increment,primary key (a)) type=heap;
|
||||
drop table t1;
|
||||
create table t2 type=heap select * from t1;
|
||||
ERROR 42S02: Table 'test.t1' doesn't exist
|
||||
@ -26,10 +28,11 @@ Note 1051 Unknown table 't1'
|
||||
Note 1051 Unknown table 't2'
|
||||
create table t1 (b char(0) not null, index(b));
|
||||
ERROR 42000: The used storage engine can't index column 'b'
|
||||
create table t1 (a int not null auto_increment,primary key (a)) type=heap;
|
||||
create table t1 (a int not null,b text) type=heap;
|
||||
ERROR 42000: The used table type doesn't support BLOB/TEXT columns
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=heap;
|
||||
ERROR 42000: Incorrect table definition; There can only be one auto column and it must be defined as a key
|
||||
create table not_existing_database.test (a int);
|
||||
@ -66,9 +69,8 @@ drop table if exists ``;
|
||||
ERROR 42000: Incorrect table name ''
|
||||
create table t1 (`` int);
|
||||
ERROR 42000: Incorrect column name ''
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
create table t1 (i int, index `` (i));
|
||||
ERROR 42000: Incorrect index name ''
|
||||
create table t1 (a int auto_increment not null primary key, B CHAR(20));
|
||||
insert into t1 (b) values ("hello"),("my"),("world");
|
||||
create table t2 (key (b)) select * from t1;
|
||||
@ -220,6 +222,46 @@ ERROR 23000: Column 'k1' cannot be null
|
||||
insert into t1 values (NULL, NULL);
|
||||
ERROR 23000: Column 'k1' cannot be null
|
||||
drop table t1;
|
||||
create table t1 select x'4132';
|
||||
drop table t1;
|
||||
create table t1 select 1,2,3;
|
||||
create table if not exists t1 select 1,2;
|
||||
create table if not exists t1 select 1,2,3,4;
|
||||
ERROR 21S01: Column count doesn't match value count at row 1
|
||||
create table if not exists t1 select 1;
|
||||
select * from t1;
|
||||
1 2 3
|
||||
1 2 3
|
||||
0 1 2
|
||||
0 0 1
|
||||
drop table t1;
|
||||
create table t1 select 1,2,3;
|
||||
create table if not exists t1 select 1,2;
|
||||
create table if not exists t1 select 1,2,3,4;
|
||||
ERROR 21S01: Column count doesn't match value count at row 1
|
||||
create table if not exists t1 select 1;
|
||||
select * from t1;
|
||||
1 2 3
|
||||
1 2 3
|
||||
0 1 2
|
||||
0 0 1
|
||||
drop table t1;
|
||||
create table t1 (a int not null, b int, primary key (a));
|
||||
insert into t1 values (1,1);
|
||||
create table if not exists t1 select 2;
|
||||
select * from t1;
|
||||
a b
|
||||
1 1
|
||||
0 2
|
||||
create table if not exists t1 select 3 as 'a',4 as 'b';
|
||||
create table if not exists t1 select 3 as 'a',3 as 'b';
|
||||
ERROR 23000: Duplicate entry '3' for key 1
|
||||
select * from t1;
|
||||
a b
|
||||
1 1
|
||||
0 2
|
||||
3 4
|
||||
drop table t1;
|
||||
create table t1 (a int, key(a));
|
||||
create table t2 (b int, foreign key(b) references t1(a), key(b));
|
||||
drop table if exists t1,t2;
|
||||
@ -320,8 +362,6 @@ t1 CREATE TABLE `t1` (
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
SET SESSION table_type=default;
|
||||
drop table t1;
|
||||
create table t1 select x'4132';
|
||||
drop table t1;
|
||||
create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob);
|
||||
insert into t1(a)values(1);
|
||||
insert into t1(a,b,c,d,e,f,g,h)
|
||||
|
@ -1,3 +1,4 @@
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1 SELECT _utf8'test' as c1, _utf8'тест' as c2;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
@ -15,6 +16,10 @@ t1 CREATE TABLE `t1` (
|
||||
`c3` char(4) character set utf8 default NULL
|
||||
) TYPE=MyISAM CHARSET=latin1
|
||||
INSERT INTO t1 VALUES ('aaaabbbbccccdddd','aaaabbbbccccdddd','aaaabbbbccccdddd');
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'c1' at row 1
|
||||
Warning 1264 Data truncated for column 'c2' at row 1
|
||||
Warning 1264 Data truncated for column 'c3' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1 c2 c3
|
||||
aaaabbbbcccc aaaabbbbcccc aaaabbbbcccc
|
||||
|
157
mysql-test/r/date_formats.result
Normal file
157
mysql-test/r/date_formats.result
Normal file
@ -0,0 +1,157 @@
|
||||
SHOW GLOBAL VARIABLES LIKE "%_format%";
|
||||
Variable_name Value
|
||||
date_format %d.%m.%Y
|
||||
datetime_format %Y/%d/%m-%H:%i:%s
|
||||
default_week_format 0
|
||||
time_format %H.%i.%s
|
||||
SHOW SESSION VARIABLES LIKE "%_format%";
|
||||
Variable_name Value
|
||||
date_format %d.%m.%Y
|
||||
datetime_format %Y/%d/%m-%H:%i:%s
|
||||
default_week_format 0
|
||||
time_format %H.%i.%s
|
||||
SET date_format="%d.%m.%Y";
|
||||
select CAST("01.01.2001" as DATE) as a;
|
||||
a
|
||||
01.01.2001
|
||||
SET datetime_format="%d.%m.%Y %H.%i.%s";
|
||||
select CAST("01.01.2001 05.12.06" as DATETIME) as a;
|
||||
a
|
||||
01.01.2001 05.12.06
|
||||
SET time_format="%H.%i.%s";
|
||||
select CAST("05.12.06" as TIME) as a;
|
||||
a
|
||||
05.12.06
|
||||
SET datetime_format="%d.%m.%Y %h:%i:%s %p";
|
||||
select CAST("01.01.2001 05:12:06AM" as DATETIME) as a;
|
||||
a
|
||||
01.01.2001 05:12:06 AM
|
||||
select CAST("01.01.2001 05:12:06 PM" as DATETIME) as a;
|
||||
a
|
||||
01.01.2001 05:12:06 PM
|
||||
SET time_format="%h:%i:%s %p";
|
||||
select CAST("05:12:06 AM" as TIME) as a;
|
||||
a
|
||||
05:12:06 AM
|
||||
select CAST("05:12:06.1234PM" as TIME) as a;
|
||||
a
|
||||
05:12:06.001234 PM
|
||||
SET time_format="%h.%i.%s %p";
|
||||
SET date_format='%d.%m.%y';
|
||||
SET datetime_format="%d.%m.%y %h.%i.%s %p";
|
||||
select CAST("12-12-06" as DATE) as a;
|
||||
a
|
||||
12.12.06
|
||||
select adddate("01.01.97 11.59.59.000001 PM", 10);
|
||||
adddate("01.01.97 11.59.59.000001 PM", 10)
|
||||
11.01.97 11.59.59.000001 PM
|
||||
select datediff("31.12.97 11.59:59.000001 PM","01.01.98");
|
||||
datediff("31.12.97 11.59:59.000001 PM","01.01.98")
|
||||
-1
|
||||
select weekofyear("31.11.97 11:59:59.000001 PM");
|
||||
weekofyear("31.11.97 11:59:59.000001 PM")
|
||||
49
|
||||
select makedate(1997,1);
|
||||
makedate(1997,1)
|
||||
01.01.97
|
||||
select addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002");
|
||||
addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")
|
||||
02.01.98 01.01.01.000001 AM
|
||||
select maketime(23,11,12);
|
||||
maketime(23,11,12)
|
||||
11.11.12 PM
|
||||
select timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM");
|
||||
timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")
|
||||
8795.59.59.999999 PM
|
||||
SET time_format="%H%i%s";
|
||||
SET time_format="%h%i%s";
|
||||
ERROR HY000: Unknown error
|
||||
SET date_format='%d.%m.%d';
|
||||
ERROR HY000: Unknown error
|
||||
SET datetime_format="%d.%m.%y %h.%i.%s";
|
||||
ERROR HY000: Unknown error
|
||||
SET GLOBAL date_format=default;
|
||||
SHOW GLOBAL VARIABLES LIKE "date_format%";
|
||||
Variable_name Value
|
||||
date_format %d.%m.%Y
|
||||
SET GLOBAL time_format=default;
|
||||
SHOW GLOBAL VARIABLES LIKE "time_format%";
|
||||
Variable_name Value
|
||||
time_format %H.%i.%s
|
||||
SET GLOBAL datetime_format=default;
|
||||
SHOW GLOBAL VARIABLES LIKE "datetime_format%";
|
||||
Variable_name Value
|
||||
datetime_format %Y/%d/%m-%H:%i:%s
|
||||
SET date_format=default;
|
||||
SHOW SESSION VARIABLES LIKE "date_format%";
|
||||
Variable_name Value
|
||||
date_format %d.%m.%Y
|
||||
SET time_format=default;
|
||||
SHOW SESSION VARIABLES LIKE "time_format%";
|
||||
Variable_name Value
|
||||
time_format %H.%i.%s
|
||||
SET datetime_format=default;
|
||||
SHOW SESSION VARIABLES LIKE "datetime_format%";
|
||||
Variable_name Value
|
||||
datetime_format %Y/%d/%m-%H:%i:%s
|
||||
SET time_format='%i:%s:%H';
|
||||
select cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME);
|
||||
cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)
|
||||
59:59:12
|
||||
SET GLOBAL date_format='%Y-%m-%d';
|
||||
SET GLOBAL time_format='%H:%i:%s';
|
||||
SET GLOBAL datetime_format='%Y-%m-%d %H:%i:%s';
|
||||
SET date_format='%Y-%m-%d';
|
||||
SET time_format='%H:%i:%s';
|
||||
SET datetime_format='%Y-%m-%d %H:%i:%s';
|
||||
select str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S");
|
||||
str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S")
|
||||
2001-01-15 12:59:59
|
||||
select str_to_date("15 September 2001", "%d %M %Y");
|
||||
str_to_date("15 September 2001", "%d %M %Y")
|
||||
2001-09-15 00:00:00
|
||||
select str_to_date("15 Septembeb 2001", "%d %M %Y");
|
||||
str_to_date("15 Septembeb 2001", "%d %M %Y")
|
||||
NULL
|
||||
select str_to_date("15 MAY 2001", "%d %b %Y");
|
||||
str_to_date("15 MAY 2001", "%d %b %Y")
|
||||
2001-05-15 00:00:00
|
||||
select str_to_date("Sunday 15 MAY 2001", "%W %d %b %Y");
|
||||
str_to_date("Sunday 15 MAY 2001", "%W %d %b %Y")
|
||||
2001-05-15 00:00:00
|
||||
select str_to_date("Sundai 15 MAY 2001", "%W %d %b %Y");
|
||||
str_to_date("Sundai 15 MAY 2001", "%W %d %b %Y")
|
||||
NULL
|
||||
select str_to_date("Sundai 15 MA", "%W %d %b %Y");
|
||||
str_to_date("Sundai 15 MA", "%W %d %b %Y")
|
||||
NULL
|
||||
select str_to_date("Tuesday 52 2001", "%W %V %X");
|
||||
str_to_date("Tuesday 52 2001", "%W %V %X")
|
||||
NULL
|
||||
select str_to_date("Sunday 01 2001", "%W %V %X");
|
||||
str_to_date("Sunday 01 2001", "%W %V %X")
|
||||
NULL
|
||||
select str_to_date("Tuesday 00 2002", "%W %U %Y");
|
||||
str_to_date("Tuesday 00 2002", "%W %U %Y")
|
||||
2002-01-01 00:00:00
|
||||
select str_to_date("Thursday 53 1998", "%W %u %Y");
|
||||
str_to_date("Thursday 53 1998", "%W %u %Y")
|
||||
1998-12-31 00:00:00
|
||||
select str_to_date("15-01-2001", "%d-%m-%Y %H:%i:%S");
|
||||
str_to_date("15-01-2001", "%d-%m-%Y %H:%i:%S")
|
||||
2001-01-15 00:00:00
|
||||
select str_to_date("15-01-20", "%d-%m-%Y");
|
||||
str_to_date("15-01-20", "%d-%m-%Y")
|
||||
NULL
|
||||
select str_to_date("15-2001-1", "%d-%Y-%c");
|
||||
str_to_date("15-2001-1", "%d-%Y-%c")
|
||||
2001-01-15 00:00:00
|
||||
select get_format(DATE, 'USA') as a;
|
||||
a
|
||||
%m.%d.%Y
|
||||
select get_format(TIME, 'internal') as a;
|
||||
a
|
||||
%H%i%s
|
||||
select get_format(DATETIME, 'eur') as a;
|
||||
a
|
||||
%Y-%m-%d-%H.%i.%s
|
@ -215,3 +215,18 @@ ERROR 42000: You have an error in your SQL syntax. Check the manual that corres
|
||||
insert into (select * from t1) values (5);
|
||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1) values (5)' at line 1
|
||||
drop table t1;
|
||||
create table t1 (E1 INTEGER UNSIGNED NOT NULL, E2 INTEGER UNSIGNED NOT NULL, E3 INTEGER UNSIGNED NOT NULL, PRIMARY KEY(E1)
|
||||
);
|
||||
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;
|
||||
count(*)
|
||||
2
|
||||
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;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
|
||||
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 THEMAX.E2 1 Using where
|
||||
2 DERIVED t1 ALL NULL NULL NULL NULL 2 Using where
|
||||
3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where
|
||||
Warnings:
|
||||
Note 1275 Field or reference 'A.E2' of SELECT #3 was resolved in SELECT #2
|
||||
drop table t1;
|
||||
|
@ -40,9 +40,21 @@ uncompress(compress(""))
|
||||
select uncompressed_length("");
|
||||
uncompressed_length("")
|
||||
0
|
||||
select compress(NULL);
|
||||
compress(NULL)
|
||||
create table t1 (a text);
|
||||
insert t1 values (compress(null)), ('A\0\0\0BBBBBBBB'), (compress(space(50000))), (space(50000));
|
||||
select length(a) from t1;
|
||||
length(a)
|
||||
NULL
|
||||
select uncompress(NULL);
|
||||
uncompress(NULL)
|
||||
12
|
||||
76
|
||||
50000
|
||||
select length(uncompress(a)) from t1;
|
||||
length(uncompress(a))
|
||||
NULL
|
||||
NULL
|
||||
50000
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1258 Z_DATA_ERROR: Input data was corrupted for zlib
|
||||
Error 1255 Too big size of uncompressed data. The maximum size is 1048576. (probably, length of uncompressed data was corrupted)
|
||||
drop table t1;
|
||||
|
@ -196,3 +196,14 @@ insert into t1 values('test'),('test2');
|
||||
select * from t1 having group_concat(bar)='';
|
||||
bar
|
||||
drop table t1;
|
||||
create table t1 (a int, a1 varchar(10));
|
||||
create table t2 (a0 int);
|
||||
insert into t1 values (0,"a"),(0,"b"),(1,"c");
|
||||
insert into t2 values (1),(2),(3);
|
||||
select group_concat(a1 order by (t1.a IN (select a0 from t2))) from t1;
|
||||
group_concat(a1 order by (t1.a IN (select a0 from t2)))
|
||||
b,a,c
|
||||
select group_concat(a1 order by (t1.a)) from t1;
|
||||
group_concat(a1 order by (t1.a))
|
||||
b,a,c
|
||||
drop table t1, t2;
|
||||
|
@ -4,8 +4,6 @@ INSERT INTO t1 VALUES (1), (2);
|
||||
<?xml version="1.0"?>
|
||||
<mysqldump>
|
||||
<database name="test">
|
||||
DROP TABLE IF EXISTS t1;
|
||||
LOCK TABLES t1 WRITE;
|
||||
<table name="t1">
|
||||
<row>
|
||||
<field name="a">1</field>
|
||||
@ -14,7 +12,6 @@ LOCK TABLES t1 WRITE;
|
||||
<field name="a">2</field>
|
||||
</row>
|
||||
</table>
|
||||
UNLOCK TABLES;
|
||||
</database>
|
||||
</mysqldump>
|
||||
DROP TABLE t1;
|
||||
|
@ -75,6 +75,8 @@ NULL this is null
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a varchar(16) NOT NULL, b smallint(6) NOT NULL, c datetime NOT NULL, d smallint(6) NOT NULL);
|
||||
INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'd' at row 1
|
||||
UPDATE t1 SET d=1/NULL;
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'd' at row 1
|
||||
|
@ -8,16 +8,16 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_retry Master_Log_File
|
||||
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
|
||||
127.0.0.1 test MASTER_PORT 7 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No #
|
||||
# 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
|
||||
127.0.0.1 root MASTER_PORT 7 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No #
|
||||
# 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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);
|
||||
insert into t1 values (10),(45),(90);
|
||||
|
@ -9,7 +9,7 @@ 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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)
|
||||
drop table t1;
|
||||
|
@ -14,4 +14,4 @@ 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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 #
|
||||
|
@ -33,7 +33,7 @@ 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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;
|
||||
set sql_log_bin=1;
|
||||
@ -43,7 +43,7 @@ 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 #
|
||||
# 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 #
|
||||
set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
set sql_log_bin=0;
|
||||
@ -54,7 +54,7 @@ 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
|
||||
127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No #
|
||||
# 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),
|
||||
unique(day));
|
||||
|
@ -96,6 +96,6 @@ 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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
|
||||
|
@ -9,7 +9,7 @@ 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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;
|
||||
start slave;
|
||||
@ -17,17 +17,17 @@ 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
|
||||
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 #
|
||||
# 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
|
||||
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 #
|
||||
# 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
|
||||
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 #
|
||||
# 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
|
||||
master-bin.000001 79
|
||||
|
@ -16,7 +16,7 @@ select @@global.max_relay_log_size;
|
||||
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
|
||||
Waiting for master to send event 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 #
|
||||
# 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;
|
||||
set global max_relay_log_size=(5*4096);
|
||||
@ -26,7 +26,7 @@ select @@global.max_relay_log_size;
|
||||
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
|
||||
Waiting for master to send event 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 #
|
||||
# 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;
|
||||
set global max_relay_log_size=0;
|
||||
@ -36,25 +36,25 @@ select @@global.max_relay_log_size;
|
||||
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
|
||||
Waiting for master to send event 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 #
|
||||
# 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
|
||||
127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No #
|
||||
# 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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
|
||||
|
@ -19,12 +19,12 @@ select * from t1;
|
||||
t
|
||||
1
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db 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
|
||||
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
|
||||
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;
|
||||
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
|
||||
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
|
||||
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 #
|
||||
|
@ -28,4 +28,4 @@ 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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 #
|
||||
|
@ -6,17 +6,17 @@ 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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
|
||||
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 #
|
||||
# 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
|
||||
127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No #
|
||||
# 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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 #
|
||||
|
@ -16,7 +16,7 @@ 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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
|
||||
Could not break slave
|
||||
@ -57,7 +57,7 @@ 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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
|
||||
34
|
||||
@ -81,7 +81,7 @@ 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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;
|
||||
count(*)
|
||||
|
@ -10,5 +10,5 @@ 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
|
||||
Waiting for master to send event 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 #
|
||||
# 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 #
|
||||
reset master;
|
||||
|
@ -31,7 +31,7 @@ n
|
||||
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
|
||||
Waiting for master to send event 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 #
|
||||
# 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;
|
||||
n
|
||||
@ -41,7 +41,7 @@ n
|
||||
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
|
||||
Waiting for master to send event 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 #
|
||||
# 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 #
|
||||
start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=537;
|
||||
select * from t2;
|
||||
n
|
||||
@ -49,13 +49,13 @@ n
|
||||
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
|
||||
Waiting for master to send event 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 #
|
||||
# 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 #
|
||||
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
|
||||
Waiting for master to send event 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 #
|
||||
# 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 #
|
||||
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;
|
||||
|
@ -136,7 +136,7 @@ email104
|
||||
email105
|
||||
email106
|
||||
email107
|
||||
INSERT INTO `t1` (`id`, `kid`) VALUES ('', '150');
|
||||
INSERT INTO `t1` (`id`, `kid`) VALUES ('0', '150');
|
||||
SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
|
||||
email
|
||||
email1
|
||||
|
@ -71,10 +71,10 @@ t1 CREATE TABLE `t1` (
|
||||
PRIMARY KEY (`a`),
|
||||
UNIQUE KEY `email` (`email`)
|
||||
) TYPE=HEAP ROW_FORMAT=DYNAMIC
|
||||
set sql_mode="postgresql,oracle,mssql,db2,sapdb";
|
||||
set sql_mode="postgresql,oracle,mssql,db2,maxdb";
|
||||
select @@sql_mode;
|
||||
@@sql_mode
|
||||
PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,POSTGRESQL,ORACLE,MSSQL,DB2,SAPDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS
|
||||
PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE "t1" (
|
||||
|
@ -1456,7 +1456,7 @@ explain select * from t3 where a > all (select max(b) from t2 group by a);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
|
||||
2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
|
||||
drop table if exists t2, t3;
|
||||
drop table t2, t3;
|
||||
create table t1 (s1 int);
|
||||
insert into t1 values (1);
|
||||
insert into t1 values (2);
|
||||
|
@ -70,6 +70,12 @@ select min(a) from t1;
|
||||
min(a)
|
||||
-0.010
|
||||
drop table t1;
|
||||
create table t1 (a float);
|
||||
insert into t1 values (1);
|
||||
select max(a),min(a),avg(a) from t1;
|
||||
max(a) min(a) avg(a)
|
||||
1 1 1
|
||||
drop table t1;
|
||||
create table t1 (f float, f2 float(24), f3 float(6,2), d double, d2 float(53), d3 double(10,3), de decimal, de2 decimal(6), de3 decimal(5,2), n numeric, n2 numeric(8), n3 numeric(5,6));
|
||||
show full columns from t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
|
@ -163,6 +163,38 @@ set @@rand_seed1=10000000,@@rand_seed2=1000000;
|
||||
select ROUND(RAND(),5);
|
||||
ROUND(RAND(),5)
|
||||
0.02887
|
||||
show variables like '%alloc%';
|
||||
Variable_name Value
|
||||
query_alloc_block_size 8192
|
||||
query_prealloc_size 8192
|
||||
range_alloc_block_size 2048
|
||||
transaction_alloc_block_size 8192
|
||||
transaction_prealloc_size 4096
|
||||
set @@range_alloc_block_size=1024*16;
|
||||
set @@query_alloc_block_size=1024*17+2;
|
||||
set @@query_prealloc_size=1024*18;
|
||||
set @@transaction_alloc_block_size=1024*20-1;
|
||||
set @@transaction_prealloc_size=1024*21-1;
|
||||
select @@query_alloc_block_size;
|
||||
@@query_alloc_block_size
|
||||
17408
|
||||
show variables like '%alloc%';
|
||||
Variable_name Value
|
||||
query_alloc_block_size 17408
|
||||
query_prealloc_size 18432
|
||||
range_alloc_block_size 16384
|
||||
transaction_alloc_block_size 19456
|
||||
transaction_prealloc_size 20480
|
||||
set @@range_alloc_block_size=default;
|
||||
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
|
||||
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
|
||||
show variables like '%alloc%';
|
||||
Variable_name Value
|
||||
query_alloc_block_size 8192
|
||||
query_prealloc_size 8192
|
||||
range_alloc_block_size 2048
|
||||
transaction_alloc_block_size 8192
|
||||
transaction_prealloc_size 4096
|
||||
set big_tables=OFFF;
|
||||
ERROR 42000: Variable 'big_tables' can't be set to the value of 'OFFF'
|
||||
set big_tables="OFFF";
|
||||
@ -202,6 +234,8 @@ set myisam_max_sort_file_size=100;
|
||||
ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
|
||||
set myisam_max_extra_sort_file_size=100;
|
||||
ERROR HY000: Variable 'myisam_max_extra_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
|
||||
set @@SQL_WARNINGS=NULL;
|
||||
ERROR 42000: Variable 'sql_warnings' can't be set to the value of 'NULL'
|
||||
set autocommit=1;
|
||||
set big_tables=1;
|
||||
select @@autocommit, @@big_tables;
|
||||
|
@ -92,6 +92,8 @@ Warning 1264 Data truncated for column 'b' at row 3
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'a' at row 4
|
||||
Warning 1264 Data truncated for column 'b' at row 4
|
||||
insert into t2(b) values('mysqlab');
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'b' at row 1
|
||||
set sql_warnings=1;
|
||||
insert into t2(b) values('mysqlab');
|
||||
Warnings:
|
||||
|
@ -17,25 +17,35 @@ insert into t1 values (""),(null);
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a int not null auto_increment,primary key (a)) type=heap;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test of some CREATE TABLE'S that should fail
|
||||
#
|
||||
|
||||
!$1146 create table t2 type=heap select * from t1;
|
||||
!$1146 create table t2 select auto+1 from t1;
|
||||
--error 1146
|
||||
create table t2 type=heap select * from t1;
|
||||
--error 1146
|
||||
create table t2 select auto+1 from t1;
|
||||
drop table if exists t1,t2;
|
||||
!$1167 create table t1 (b char(0) not null, index(b));
|
||||
create table t1 (a int not null auto_increment,primary key (a)) type=heap;
|
||||
!$1163 create table t1 (a int not null,b text) type=heap;
|
||||
--error 1167
|
||||
create table t1 (b char(0) not null, index(b));
|
||||
--error 1163
|
||||
create table t1 (a int not null,b text) type=heap;
|
||||
drop table if exists t1;
|
||||
|
||||
!$1075 create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=heap;
|
||||
--error 1075
|
||||
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=heap;
|
||||
|
||||
-- error 1044,1
|
||||
create table not_existing_database.test (a int);
|
||||
!$1103 create table `a/a` (a int);
|
||||
!$1103 create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int);
|
||||
!$1059 create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int);
|
||||
--error 1103
|
||||
create table `a/a` (a int);
|
||||
--error 1103
|
||||
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int);
|
||||
--error 1059
|
||||
create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int);
|
||||
|
||||
#
|
||||
# test of dummy table names
|
||||
@ -62,7 +72,8 @@ create table `` (a int);
|
||||
drop table if exists ``;
|
||||
--error 1166
|
||||
create table t1 (`` int);
|
||||
drop table if exists t1;
|
||||
--error 1279
|
||||
create table t1 (i int, index `` (i));
|
||||
|
||||
#
|
||||
# Test of CREATE ... SELECT with indexes
|
||||
@ -166,6 +177,46 @@ insert into t1 values (NULL, 3);
|
||||
insert into t1 values (NULL, NULL);
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug # 801
|
||||
#
|
||||
|
||||
create table t1 select x'4132';
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# bug #1434
|
||||
#
|
||||
|
||||
create table t1 select 1,2,3;
|
||||
create table if not exists t1 select 1,2;
|
||||
--error 1136
|
||||
create table if not exists t1 select 1,2,3,4;
|
||||
create table if not exists t1 select 1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
create table t1 select 1,2,3;
|
||||
create table if not exists t1 select 1,2;
|
||||
--error 1136
|
||||
create table if not exists t1 select 1,2,3,4;
|
||||
create table if not exists t1 select 1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test create table if not exists with duplicate key error
|
||||
#
|
||||
|
||||
create table t1 (a int not null, b int, primary key (a));
|
||||
insert into t1 values (1,1);
|
||||
create table if not exists t1 select 2;
|
||||
select * from t1;
|
||||
create table if not exists t1 select 3 as 'a',4 as 'b';
|
||||
--error 1062
|
||||
create table if not exists t1 select 3 as 'a',3 as 'b';
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test create with foreign keys
|
||||
#
|
||||
@ -229,12 +280,6 @@ show create table t1;
|
||||
SET SESSION table_type=default;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug # 801
|
||||
#
|
||||
create table t1 select x'4132';
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test types of data for create select with functions
|
||||
#
|
||||
|
@ -1,3 +1,10 @@
|
||||
#
|
||||
# Test of alter table
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 SELECT _utf8'test' as c1, _utf8'тест' as c2;
|
||||
SHOW CREATE TABLE t1;
|
||||
DELETE FROM t1;
|
||||
|
1
mysql-test/t/date_formats-master.opt
Normal file
1
mysql-test/t/date_formats-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--date_format=%d.%m.%Y --time_format=%H.%i.%s --datetime_format=%Y/%d/%m-%H:%i:%s
|
82
mysql-test/t/date_formats.test
Normal file
82
mysql-test/t/date_formats.test
Normal file
@ -0,0 +1,82 @@
|
||||
SHOW GLOBAL VARIABLES LIKE "%_format%";
|
||||
SHOW SESSION VARIABLES LIKE "%_format%";
|
||||
|
||||
SET date_format="%d.%m.%Y";
|
||||
select CAST("01.01.2001" as DATE) as a;
|
||||
SET datetime_format="%d.%m.%Y %H.%i.%s";
|
||||
select CAST("01.01.2001 05.12.06" as DATETIME) as a;
|
||||
SET time_format="%H.%i.%s";
|
||||
select CAST("05.12.06" as TIME) as a;
|
||||
|
||||
SET datetime_format="%d.%m.%Y %h:%i:%s %p";
|
||||
select CAST("01.01.2001 05:12:06AM" as DATETIME) as a;
|
||||
select CAST("01.01.2001 05:12:06 PM" as DATETIME) as a;
|
||||
|
||||
SET time_format="%h:%i:%s %p";
|
||||
select CAST("05:12:06 AM" as TIME) as a;
|
||||
select CAST("05:12:06.1234PM" as TIME) as a;
|
||||
|
||||
SET time_format="%h.%i.%s %p";
|
||||
SET date_format='%d.%m.%y';
|
||||
SET datetime_format="%d.%m.%y %h.%i.%s %p";
|
||||
select CAST("12-12-06" as DATE) as a;
|
||||
|
||||
select adddate("01.01.97 11.59.59.000001 PM", 10);
|
||||
select datediff("31.12.97 11.59:59.000001 PM","01.01.98");
|
||||
select weekofyear("31.11.97 11:59:59.000001 PM");
|
||||
select makedate(1997,1);
|
||||
select addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002");
|
||||
select maketime(23,11,12);
|
||||
select timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM");
|
||||
|
||||
SET time_format="%H%i%s";
|
||||
--error 1105
|
||||
SET time_format="%h%i%s";
|
||||
--error 1105
|
||||
SET date_format='%d.%m.%d';
|
||||
--error 1105
|
||||
SET datetime_format="%d.%m.%y %h.%i.%s";
|
||||
|
||||
SET GLOBAL date_format=default;
|
||||
SHOW GLOBAL VARIABLES LIKE "date_format%";
|
||||
SET GLOBAL time_format=default;
|
||||
SHOW GLOBAL VARIABLES LIKE "time_format%";
|
||||
SET GLOBAL datetime_format=default;
|
||||
SHOW GLOBAL VARIABLES LIKE "datetime_format%";
|
||||
|
||||
SET date_format=default;
|
||||
SHOW SESSION VARIABLES LIKE "date_format%";
|
||||
SET time_format=default;
|
||||
SHOW SESSION VARIABLES LIKE "time_format%";
|
||||
SET datetime_format=default;
|
||||
SHOW SESSION VARIABLES LIKE "datetime_format%";
|
||||
|
||||
SET time_format='%i:%s:%H';
|
||||
select cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME);
|
||||
|
||||
SET GLOBAL date_format='%Y-%m-%d';
|
||||
SET GLOBAL time_format='%H:%i:%s';
|
||||
SET GLOBAL datetime_format='%Y-%m-%d %H:%i:%s';
|
||||
SET date_format='%Y-%m-%d';
|
||||
SET time_format='%H:%i:%s';
|
||||
SET datetime_format='%Y-%m-%d %H:%i:%s';
|
||||
|
||||
select str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S");
|
||||
select str_to_date("15 September 2001", "%d %M %Y");
|
||||
select str_to_date("15 Septembeb 2001", "%d %M %Y");
|
||||
select str_to_date("15 MAY 2001", "%d %b %Y");
|
||||
select str_to_date("Sunday 15 MAY 2001", "%W %d %b %Y");
|
||||
select str_to_date("Sundai 15 MAY 2001", "%W %d %b %Y");
|
||||
select str_to_date("Sundai 15 MA", "%W %d %b %Y");
|
||||
select str_to_date("Tuesday 52 2001", "%W %V %X");
|
||||
select str_to_date("Sunday 01 2001", "%W %V %X");
|
||||
select str_to_date("Tuesday 00 2002", "%W %U %Y");
|
||||
select str_to_date("Thursday 53 1998", "%W %u %Y");
|
||||
select str_to_date("15-01-2001", "%d-%m-%Y %H:%i:%S");
|
||||
select str_to_date("15-01-20", "%d-%m-%Y");
|
||||
select str_to_date("15-2001-1", "%d-%Y-%c");
|
||||
|
||||
select get_format(DATE, 'USA') as a;
|
||||
select get_format(TIME, 'internal') as a;
|
||||
select get_format(DATETIME, 'eur') as a;
|
||||
|
@ -122,3 +122,13 @@ delete from (select * from t1);
|
||||
-- error 1064
|
||||
insert into (select * from t1) values (5);
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# deived tables with subquery inside all by one table
|
||||
#
|
||||
create table t1 (E1 INTEGER UNSIGNED NOT NULL, E2 INTEGER UNSIGNED NOT NULL, E3 INTEGER UNSIGNED NOT NULL, PRIMARY KEY(E1)
|
||||
);
|
||||
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;
|
||||
|
@ -24,8 +24,12 @@ select uncompress(compress(""));
|
||||
select uncompressed_length("");
|
||||
|
||||
#
|
||||
# NULL (Bug #1333)
|
||||
# errors
|
||||
#
|
||||
|
||||
select compress(NULL);
|
||||
select uncompress(NULL);
|
||||
create table t1 (a text);
|
||||
insert t1 values (compress(null)), ('A\0\0\0BBBBBBBB'), (compress(space(50000))), (space(50000));
|
||||
select length(a) from t1;
|
||||
select length(uncompress(a)) from t1;
|
||||
drop table t1;
|
||||
|
||||
|
@ -119,4 +119,11 @@ insert into t1 values('test'),('test2');
|
||||
select * from t1 having group_concat(bar)='';
|
||||
drop table t1;
|
||||
|
||||
|
||||
# ORDER BY fix_fields()
|
||||
create table t1 (a int, a1 varchar(10));
|
||||
create table t2 (a0 int);
|
||||
insert into t1 values (0,"a"),(0,"b"),(1,"c");
|
||||
insert into t2 values (1),(2),(3);
|
||||
select group_concat(a1 order by (t1.a IN (select a0 from t2))) from t1;
|
||||
select group_concat(a1 order by (t1.a)) from t1;
|
||||
drop table t1, t2;
|
@ -34,6 +34,7 @@ create table t1 (a tinyint not null auto_increment, b blob not null, primary key
|
||||
|
||||
let $1=100;
|
||||
disable_query_log;
|
||||
--disable_warnings
|
||||
SET SQL_WARNINGS=0;
|
||||
while ($1)
|
||||
{
|
||||
@ -41,6 +42,7 @@ while ($1)
|
||||
dec $1;
|
||||
}
|
||||
SET SQL_WARNINGS=1;
|
||||
--enable_warnings
|
||||
enable_query_log;
|
||||
check table t1;
|
||||
repair table t1;
|
||||
|
@ -39,28 +39,28 @@ select "--- Local --" as "";
|
||||
#
|
||||
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ $MYSQL_TEST_DIR/var/log/master-bin.000001
|
||||
|
||||
# this should not fail but shouldn't produce any working statements
|
||||
--disable_query_log
|
||||
select "--- Broken LOAD DATA --" as "";
|
||||
--enable_query_log
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000002
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ $MYSQL_TEST_DIR/var/log/master-bin.000002
|
||||
|
||||
# this should show almost nothing
|
||||
--disable_query_log
|
||||
select "--- --database --" as "";
|
||||
--enable_query_log
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--exec $MYSQL_BINLOG --short-form --database=nottest $MYSQL_TEST_DIR/var/log/master-bin.000001
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --database=nottest $MYSQL_TEST_DIR/var/log/master-bin.000001
|
||||
|
||||
# this test for position option
|
||||
--disable_query_log
|
||||
select "--- --position --" as "";
|
||||
--enable_query_log
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--exec $MYSQL_BINLOG --short-form --position=27 $MYSQL_TEST_DIR/var/log/master-bin.000002
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --position=27 $MYSQL_TEST_DIR/var/log/master-bin.000002
|
||||
|
||||
# These are tests for remote binlog.
|
||||
# They should return the same as previous test.
|
||||
@ -76,28 +76,28 @@ select "--- Remote --" as "";
|
||||
# This is broken now
|
||||
# By the way it seems that remote version fetches all events with name >= master-bin.000001
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
|
||||
# This is broken too
|
||||
--disable_query_log
|
||||
select "--- Broken LOAD DATA --" as "";
|
||||
--enable_query_log
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
|
||||
|
||||
# And this too ! (altough it is documented)
|
||||
--disable_query_log
|
||||
select "--- --database --" as "";
|
||||
--enable_query_log
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001
|
||||
|
||||
# Strangely but this works
|
||||
--disable_query_log
|
||||
select "--- --position --" as "";
|
||||
--enable_query_log
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--exec $MYSQL_BINLOG --short-form --read-from-remote-server --position=27 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
|
||||
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --position=27 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
|
||||
|
||||
# clean up
|
||||
drop table t1;
|
||||
|
@ -7,24 +7,24 @@ save_master_pos;
|
||||
connection slave;
|
||||
reset slave;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
change master to master_host='127.0.0.1';
|
||||
# The following needs to be cleaned up when change master is fixed
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
eval change master to master_host='127.0.0.1',master_user='root',
|
||||
master_password='',master_port=$MASTER_MYPORT;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
connection master;
|
||||
--disable_warnings
|
||||
|
@ -1,6 +1,6 @@
|
||||
source include/master-slave.inc;
|
||||
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
#
|
||||
|
@ -15,7 +15,7 @@ sync_with_master;
|
||||
# The port number is different when doing the release build with
|
||||
# Do-compile, hence we have to replace the port number here accordingly
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
# check that the table has been ignored, because otherwise the test is nonsense
|
||||
show tables like 't1';
|
||||
|
@ -18,5 +18,5 @@ sleep 5;
|
||||
flush logs;
|
||||
sleep 5;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
@ -72,7 +72,7 @@ set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
# Trigger error again to test CHANGE MASTER
|
||||
@ -92,7 +92,7 @@ stop slave;
|
||||
change master to master_user='test';
|
||||
change master to master_user='root';
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
# Trigger error again to test RESET SLAVE
|
||||
@ -114,7 +114,7 @@ wait_for_slave_to_stop;
|
||||
stop slave;
|
||||
reset slave;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
|
||||
|
@ -94,7 +94,7 @@ show binlog events in 'slave-bin.000001' from 4;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION
|
||||
show binlog events in 'slave-bin.000002' from 4;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
# Need to recode the following
|
||||
|
@ -5,7 +5,7 @@ source include/master-slave.inc;
|
||||
show master status;
|
||||
sync_slave_with_master;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
stop slave;
|
||||
change master to master_log_pos=73;
|
||||
@ -15,12 +15,12 @@ stop slave;
|
||||
|
||||
change master to master_log_pos=73;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
start slave;
|
||||
sleep 5;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
stop slave;
|
||||
change master to master_log_pos=173;
|
||||
@ -28,7 +28,7 @@ change master to master_log_pos=173;
|
||||
start slave;
|
||||
sleep 2;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
connection master;
|
||||
show master status;
|
||||
|
@ -29,7 +29,7 @@ select @@global.max_relay_log_size;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
stop slave;
|
||||
reset slave;
|
||||
@ -38,7 +38,7 @@ select @@global.max_relay_log_size;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
stop slave;
|
||||
reset slave;
|
||||
@ -47,7 +47,7 @@ select @@global.max_relay_log_size;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
# Tests below are mainly to ensure that we have not coded with wrong assumptions
|
||||
@ -58,7 +58,7 @@ reset slave;
|
||||
# (to make sure it does not crash).
|
||||
flush logs;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
reset slave;
|
||||
@ -74,7 +74,7 @@ save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
# one more rotation, to be sure Relay_log_space is correctly updated
|
||||
flush logs;
|
||||
@ -84,7 +84,7 @@ save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
connection master;
|
||||
|
@ -45,7 +45,7 @@ select * from t1;
|
||||
|
||||
#checking show slave status
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
#checking if replication works without ssl also performing clean up
|
||||
@ -58,5 +58,5 @@ save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
@ -12,7 +12,7 @@ sync_with_master;
|
||||
#discover slaves
|
||||
connection master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
SHOW SLAVE STATUS;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
SHOW SLAVE HOSTS;
|
||||
|
@ -33,6 +33,6 @@ connection slave;
|
||||
sync_with_master;
|
||||
# show slave status, just to see of it prints replicate-do-table
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
|
@ -9,22 +9,22 @@ save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
stop slave;
|
||||
change master to master_user='test';
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
reset slave;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
start slave;
|
||||
sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
@ -55,7 +55,7 @@ create table t1 (s text);
|
||||
insert into t1 values('Could not break slave'),('Tried hard');
|
||||
sync_slave_with_master;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
select * from t1;
|
||||
connection master;
|
||||
@ -107,7 +107,7 @@ show binary logs;
|
||||
insert into t2 values (65);
|
||||
sync_slave_with_master;
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
select * from t2;
|
||||
|
||||
@ -138,7 +138,7 @@ sync_with_master;
|
||||
select * from t4;
|
||||
|
||||
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
# because of concurrent insert, the table may not be up to date
|
||||
# if we do not lock
|
||||
|
@ -21,7 +21,7 @@ start slave;
|
||||
# can't sync_with_master so we must sleep
|
||||
sleep 3;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
connection master;
|
||||
reset master;
|
||||
|
@ -29,7 +29,7 @@ sleep 2;
|
||||
# here table should be still not deleted
|
||||
select * from t1;
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
--replace_column 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
# this should fail right after start
|
||||
@ -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 33 #
|
||||
--replace_column 1 # 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 33 #
|
||||
--replace_column 1 # 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 33 #
|
||||
--replace_column 1 # 33 #
|
||||
show slave status;
|
||||
|
||||
#testing various error conditions
|
||||
|
@ -64,7 +64,7 @@ SELECT FOUND_ROWS();
|
||||
|
||||
SELECT DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
|
||||
SELECT DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL ORDER BY email LIMIT 10;
|
||||
INSERT INTO `t1` (`id`, `kid`) VALUES ('', '150');
|
||||
INSERT INTO `t1` (`id`, `kid`) VALUES ('0', '150');
|
||||
|
||||
SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
|
||||
SELECT FOUND_ROWS();
|
||||
|
@ -24,7 +24,7 @@ show create table t1;
|
||||
set @@sql_mode="no_field_options,mysql323,mysql40";
|
||||
show variables like 'sql_mode';
|
||||
show create table t1;
|
||||
set sql_mode="postgresql,oracle,mssql,db2,sapdb";
|
||||
set sql_mode="postgresql,oracle,mssql,db2,maxdb";
|
||||
select @@sql_mode;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
@ -971,7 +971,7 @@ explain select * from t3 where a >= all (select b from t2);
|
||||
insert into t2 values (2,2), (2,1), (3,3), (3,1);
|
||||
select * from t3 where a > all (select max(b) from t2 group by a);
|
||||
explain select * from t3 where a > all (select max(b) from t2 group by a);
|
||||
drop table if exists t2, t3;
|
||||
drop table t2, t3;
|
||||
|
||||
#
|
||||
# DO and SET with errors
|
||||
|
@ -31,6 +31,15 @@ select a from t1 order by a;
|
||||
select min(a) from t1;
|
||||
drop table t1;
|
||||
|
||||
# Bug #1022: When a table contains a 'float' field,
|
||||
# and one of the functions MAX, MIN, or AVG is used on that field,
|
||||
# the system crashes.
|
||||
|
||||
create table t1 (a float);
|
||||
insert into t1 values (1);
|
||||
select max(a),min(a),avg(a) from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# FLOAT/DOUBLE/DECIMAL handling
|
||||
#
|
||||
|
@ -98,6 +98,18 @@ select @@timestamp>0;
|
||||
set @@rand_seed1=10000000,@@rand_seed2=1000000;
|
||||
select ROUND(RAND(),5);
|
||||
|
||||
show variables like '%alloc%';
|
||||
set @@range_alloc_block_size=1024*16;
|
||||
set @@query_alloc_block_size=1024*17+2;
|
||||
set @@query_prealloc_size=1024*18;
|
||||
set @@transaction_alloc_block_size=1024*20-1;
|
||||
set @@transaction_prealloc_size=1024*21-1;
|
||||
select @@query_alloc_block_size;
|
||||
show variables like '%alloc%';
|
||||
set @@range_alloc_block_size=default;
|
||||
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
|
||||
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
|
||||
show variables like '%alloc%';
|
||||
|
||||
# The following should give errors
|
||||
|
||||
@ -138,6 +150,8 @@ select @@global.sql_auto_is_null;
|
||||
set myisam_max_sort_file_size=100;
|
||||
--error 1229
|
||||
set myisam_max_extra_sort_file_size=100;
|
||||
--error 1231
|
||||
set @@SQL_WARNINGS=NULL;
|
||||
|
||||
# Test setting all variables
|
||||
|
||||
|
Reference in New Issue
Block a user