Commit 2bfeecca authored by unknown's avatar unknown

Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0-rpl

into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge


sql/ha_ndbcluster.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
parents fcd21bd4 9de027bd
This diff is collapsed.
This diff is collapsed.
#
# Setup
#
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;
use test;
drop table if exists t1, t2, t3;
#
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
#
# We also check how the foreign_key_check variable is replicated
#
create table t1(a int auto_increment, key(a));
create table t2(b int auto_increment, c int, key(b));
insert into t1 values (1),(2),(3);
......@@ -38,6 +49,9 @@ select * from t2;
b c
5 0
6 11
#
# check if INSERT SELECT in auto_increment is well replicated (bug #490)
#
drop table t2;
drop table t1;
create table t1(a int auto_increment, key(a));
......@@ -68,12 +82,19 @@ b c
9 13
drop table t1;
drop table t2;
#
# Bug#8412: Error codes reported in binary log for CHARACTER SET,
# FOREIGN_KEY_CHECKS
#
SET TIMESTAMP=1000000000;
CREATE TABLE t1 ( a INT UNIQUE );
SET FOREIGN_KEY_CHECKS=0;
INSERT INTO t1 VALUES (1),(1);
ERROR 23000: Duplicate entry '1' for key 1
drop table t1;
#
# Bug#14553: NULL in WHERE resets LAST_INSERT_ID
#
create table t1(a int auto_increment, key(a));
create table t2(a int);
insert into t1 (a) values (null);
......@@ -87,6 +108,9 @@ a
1
drop table t1;
drop table t2;
#
# End of 4.1 tests
#
drop function if exists bug15728;
drop function if exists bug15728_insert;
drop table if exists t1, t2;
......@@ -210,3 +234,6 @@ n b
2 100
3 350
drop table t1;
# End of 5.0 tests
......@@ -5,9 +5,15 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
#
# Generate a big enough master's binlog to cause relay log rotations
#
create table t1 (a int);
drop table t1;
reset slave;
#
# Test 1
#
set global max_binlog_size=8192;
set global max_relay_log_size=8192-1;
select @@global.max_relay_log_size;
......@@ -15,47 +21,251 @@ 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
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72952 # # master-bin.000001 Yes Yes 0 0 72952 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 72952
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 72952
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 2
#
stop slave;
reset slave;
set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
@@global.max_relay_log_size
20480
@@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
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72952 # # master-bin.000001 Yes Yes 0 0 72952 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 72952
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 72952
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 3: max_relay_log_size = 0
#
stop slave;
reset slave;
set global max_relay_log_size=0;
select @@global.max_relay_log_size;
@@global.max_relay_log_size
0
@@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
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72952 # # master-bin.000001 Yes Yes 0 0 72952 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 72952
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 72952
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
#
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 # # No No 0 0 0 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File
Read_Master_Log_Pos 4
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File
Slave_IO_Running No
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 0
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 5
#
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
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73038 # # master-bin.000001 Yes Yes 0 0 73038 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 73038
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 73038
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
#
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
#
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
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73114 # # master-bin.000001 Yes Yes 0 0 73114 # None 0 No #
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 73114
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 73114
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 98
File master-bin.000002
Position 98
Binlog_Do_DB
Binlog_Ignore_DB
#
# End of 4.1 tests
#
......@@ -91,3 +91,19 @@ c
---> Cleaning up...
DROP VIEW v1;
DROP TABLE t1;
create table t1(a int, b int);
insert into t1 values (1, 1), (1, 2), (1, 3);
create view v1(a, b) as select a, sum(b) from t1 group by a;
explain v1;
Field Type Null Key Default Extra
a int(11) YES NULL
b decimal(32,0) YES NULL
show create table v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,sum(`t1`.`b`) AS `b` from `t1` group by `t1`.`a`
select * from v1;
a b
1 6
drop table t1;
drop view v1;
End of 5.0 tests
This diff is collapsed.
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
# We also check how the foreign_key_check variable is replicated
--echo #
--echo # Setup
--echo #
source include/master-slave.inc;
source include/have_innodb.inc;
use test;
--disable_warnings
drop table if exists t1, t2, t3;
--enable_warnings
--echo #
--echo # See if queries that use both auto_increment and LAST_INSERT_ID()
--echo # are replicated well
--echo #
--echo # We also check how the foreign_key_check variable is replicated
--echo #
connection master;
create table t1(a int auto_increment, key(a));
create table t2(b int auto_increment, c int, key(b));
......@@ -39,7 +50,9 @@ select * from t1;
select * from t2;
connection master;
# check if INSERT SELECT in auto_increment is well replicated (bug #490)
--echo #
--echo # check if INSERT SELECT in auto_increment is well replicated (bug #490)
--echo #
drop table t2;
drop table t1;
......@@ -62,10 +75,11 @@ save_master_pos;
connection slave;
sync_with_master;
#
# Bug#8412: Error codes reported in binary log for CHARACTER SET,
# FOREIGN_KEY_CHECKS
#
--echo #
--echo # Bug#8412: Error codes reported in binary log for CHARACTER SET,
--echo # FOREIGN_KEY_CHECKS
--echo #
connection master;
SET TIMESTAMP=1000000000;
CREATE TABLE t1 ( a INT UNIQUE );
......@@ -78,9 +92,10 @@ connection master;
drop table t1;
sync_slave_with_master;
#
# Bug#14553: NULL in WHERE resets LAST_INSERT_ID
#
--echo #
--echo # Bug#14553: NULL in WHERE resets LAST_INSERT_ID
--echo #
connection master;
create table t1(a int auto_increment, key(a));
create table t2(a int);
......@@ -95,8 +110,10 @@ connection master;
drop table t1;
drop table t2;
sync_slave_with_master;
# End of 4.1 tests
--echo #
--echo # End of 4.1 tests
--echo #
#
# BUG#15728: LAST_INSERT_ID function inside a stored function returns 0
......@@ -227,7 +244,10 @@ select * from t1 order by n;
connection master;
drop table t1;
sync_slave_with_master;
--echo
--echo # End of 5.0 tests
--echo
# End of 5.0 tests
sync_slave_with_master;
......@@ -7,7 +7,11 @@ source include/master-slave.inc;
connection slave;
stop slave;
connection master;
# Generate a big enough master's binlog to cause relay log rotations
--echo #
--echo # Generate a big enough master's binlog to cause relay log rotations
--echo #
create table t1 (a int);
let $1=800;
disable_query_log;
......@@ -23,6 +27,11 @@ drop table t1;
save_master_pos;
connection slave;
reset slave;
--echo #
--echo # Test 1
--echo #
set global max_binlog_size=8192;
set global max_relay_log_size=8192-1; # mapped to 4096
select @@global.max_relay_log_size;
......@@ -30,7 +39,13 @@ start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
show slave status;
--echo #
--echo # Test 2
--echo #
stop slave;
reset slave;
set global max_relay_log_size=(5*4096);
......@@ -39,7 +54,13 @@ start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
show slave status;
--echo #
--echo # Test 3: max_relay_log_size = 0
--echo #
stop slave;
reset slave;
set global max_relay_log_size=0;
......@@ -48,9 +69,12 @@ start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
show slave status;
# Tests below are mainly to ensure that we have not coded with wrong assumptions
--echo #
--echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
--echo #
stop slave;
reset slave;
......@@ -59,8 +83,13 @@ reset slave;
flush logs;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
show slave status;
--echo #
--echo # Test 5
--echo #
reset slave;
start slave;
sync_with_master;
......@@ -75,8 +104,13 @@ connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
show slave status;
# one more rotation, to be sure Relay_Log_Space is correctly updated
--echo #
--echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
--echo #
flush logs;
connection master;
drop table t1;
......@@ -85,6 +119,7 @@ connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
show slave status;
connection master;
......@@ -92,5 +127,6 @@ connection master;
flush logs;
show master status;
# End of 4.1 tests
#
--echo #
--echo # End of 4.1 tests
--echo #
......@@ -129,3 +129,24 @@ DROP TABLE t1;
--sync_with_master
--connection master
#
# BUG#19419: "VIEW: View that the column name is different
# by master and slave is made".
#
connection master;
create table t1(a int, b int);
insert into t1 values (1, 1), (1, 2), (1, 3);
create view v1(a, b) as select a, sum(b) from t1 group by a;
sync_slave_with_master;
explain v1;
show create table v1;
select * from v1;
connection master;
drop table t1;
drop view v1;
sync_slave_with_master;
--echo End of 5.0 tests
......@@ -4765,6 +4765,19 @@ end_with_restore_list:
}
append_identifier(thd, &buff, first_table->table_name,
first_table->table_name_length);
if (lex->view_list.elements)
{
List_iterator_fast<LEX_STRING> names(lex->view_list);
LEX_STRING *name;
int i;
for (i= 0; name= names++; i++)
{
buff.append(i ? ", " : "(");
append_identifier(thd, &buff, name->str, name->length);
}
buff.append(')');
}
buff.append(STRING_WITH_LEN(" AS "));
buff.append(first_table->source.str, first_table->source.length);
......
......@@ -6921,6 +6921,9 @@ load: LOAD DATA_SYM
YYABORT;
}
lex->sql_command = SQLCOM_LOAD_MASTER_TABLE;
WARN_DEPRECATED("LOAD TABLE FROM MASTER",
"mysqldump or future "
"BACKUP/RESTORE DATABASE facility");
if (!Select->add_table_to_list(YYTHD, $3, NULL, TL_OPTION_UPDATING))
YYABORT;
};
......@@ -6959,6 +6962,9 @@ load_data:
FROM MASTER_SYM
{
Lex->sql_command = SQLCOM_LOAD_MASTER_DATA;
WARN_DEPRECATED("LOAD DATA FROM MASTER",
"mysqldump or future "
"BACKUP/RESTORE DATABASE facility");
};
opt_local:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment