Commit 87bb4f95 authored by lars@mysql.com's avatar lars@mysql.com

Merge mysql.com:/users/lthalmann/bkroot/tmp_5.0_merge

into  mysql.com:/users/lthalmann/bk/mysql-5.1-new
parents 8d1499a6 a29504cb
...@@ -189,4 +189,5 @@ HEX(f) ...@@ -189,4 +189,5 @@ HEX(f)
select HEX(f) from t4; select HEX(f) from t4;
HEX(f) HEX(f)
835C 835C
flush logs;
drop table t1, t2, t03, t04, t3, t4; drop table t1, t2, t03, t04, t3, t4;
...@@ -19,9 +19,40 @@ n ...@@ -19,9 +19,40 @@ n
2 2
3 3
4 4
show slave status; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 # No 0 0 323 # Master master-bin.000001 323 No # Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 776
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
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 319
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-bin.000001
Until_Log_Pos 319
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
select * from t1; select * from t1;
n n
...@@ -29,23 +60,116 @@ n ...@@ -29,23 +60,116 @@ n
2 2
3 3
4 4
show slave status; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 # No 0 0 323 # Master master-no-such-bin.000001 291 No # Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 776
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
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 319
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-no-such-bin.000001
Until_Log_Pos 291
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746; start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
select * from t2; select * from t2;
n n
1 1
2 2
show slave status; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 # No 0 0 612 # Relay slave-relay-bin.000004 746 No # Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 776
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
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 608
Relay_Log_Space #
Until_Condition Relay
Until_Log_File slave-relay-bin.000004
Until_Log_Pos 746
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
start slave; start slave;
stop slave; stop slave;
start slave until master_log_file='master-bin.000001', master_log_pos=776; start slave until master_log_file='master-bin.000001', master_log_pos=776;
show slave status; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 780 # Master master-bin.000001 776 No # Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 776
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
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 776
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-bin.000001
Until_Log_Pos 776
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
start slave until master_log_file='master-bin', master_log_pos=561; start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect 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; start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
......
...@@ -88,15 +88,24 @@ f ...@@ -88,15 +88,24 @@ f
1 1
drop temporary table t4; drop temporary table t4;
drop table t5; drop table t5;
set @session.pseudo_thread_id=100; set @@session.pseudo_thread_id=100;
create temporary table t101 (id int); create temporary table t101 (id int);
create temporary table t102 (id int); create temporary table t102 (id int);
set @session.pseudo_thread_id=200; set @@session.pseudo_thread_id=200;
create temporary table t201 (id int); create temporary table t201 (id int);
create temporary table `#not_user_table_prefixed_with_hash_sign_no_harm` (id int); create temporary table `t``201` (id int);
create temporary table `#sql_not_user_table202` (id int);
set @@session.pseudo_thread_id=300;
create temporary table t301 (id int);
create temporary table t302 (id int);
create temporary table `#sql_not_user_table303` (id int);
create table t1(f int); create table t1(f int);
insert into t1 values (1); insert into t1 values (1);
select * from t1 /* must be 1 */; select * from t1 /* must be 1 */;
f f
1 1
drop table t1; drop table t1;
select * from t1;
a
1
drop table t1;
...@@ -124,9 +124,22 @@ select HEX(f) from t3; ...@@ -124,9 +124,22 @@ select HEX(f) from t3;
select HEX(f) from t04; select HEX(f) from t04;
select HEX(f) from t4; select HEX(f) from t4;
#
# BUG#14157: utf8 encoding in binlog without set character_set_client
#
# BUG:
# This test only works on the MySQL-internal rpl machines.
# Needs to be fixed. Problem is that koi8r is not installed
# on many machines.
#
flush logs;
# --exec $MYSQL --character-sets-dir=../sql/share/charsets/ --default-character-set=koi8r test -e 'create table if not exists t5 (a int); set names koi8r; create temporary table `` (a int); insert into `` values (1); insert into t5 select * from ``'
# resulted log is client charset insensitive (latin1 not koi8r) as it must be
# --exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000006 | $MYSQL --default-character-set=latin1
#select * from t5 /* must be (1),(1) */;
# clean up # clean up
drop table t1, t2, t03, t04, t3, t4; drop table t1, t2, t03, t04, t3, t4;
# End of 4.1 tests # End of 5.0 tests
...@@ -32,7 +32,7 @@ wait_for_slave_to_stop; ...@@ -32,7 +32,7 @@ wait_for_slave_to_stop;
select * from t1; select * from t1;
--replace_result $MASTER_MYPORT MASTER_MYPORT --replace_result $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 9 # 11 # 23 # 33 # --replace_column 1 # 9 # 11 # 23 # 33 #
show slave status; --query_vertical SHOW SLAVE STATUS
# this should fail right after start # this should fail right after start
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
...@@ -42,7 +42,7 @@ sleep 2; ...@@ -42,7 +42,7 @@ sleep 2;
wait_for_slave_to_stop; wait_for_slave_to_stop;
--replace_result $MASTER_MYPORT MASTER_MYPORT --replace_result $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 9 # 11 # 23 # 33 # --replace_column 1 # 9 # 11 # 23 # 33 #
show slave status; --query_vertical SHOW SLAVE STATUS
# try replicate all up to and not including the second insert to t2; # try replicate all up to and not including the second insert to t2;
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746; start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
...@@ -51,7 +51,7 @@ wait_for_slave_to_stop; ...@@ -51,7 +51,7 @@ wait_for_slave_to_stop;
select * from t2; select * from t2;
--replace_result $MASTER_MYPORT MASTER_MYPORT --replace_result $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 9 # 11 # 23 # 33 # --replace_column 1 # 9 # 11 # 23 # 33 #
show slave status; --query_vertical SHOW SLAVE STATUS
# clean up # clean up
start slave; start slave;
...@@ -68,7 +68,7 @@ wait_for_slave_to_stop; ...@@ -68,7 +68,7 @@ wait_for_slave_to_stop;
# here the sql slave thread should be stopped # here the sql slave thread should be stopped
--replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004 --replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
--replace_column 1 # 9 # 23 # 33 # --replace_column 1 # 9 # 23 # 33 #
show slave status; --query_vertical SHOW SLAVE STATUS
#testing various error conditions #testing various error conditions
--error 1277 --error 1277
......
...@@ -165,24 +165,19 @@ drop table t5; ...@@ -165,24 +165,19 @@ drop table t5;
# value was set up at the moment of temp table creation # value was set up at the moment of temp table creation
# #
connection con1; connection con1;
set @session.pseudo_thread_id=100; set @@session.pseudo_thread_id=100;
create temporary table t101 (id int); create temporary table t101 (id int);
create temporary table t102 (id int); create temporary table t102 (id int);
set @session.pseudo_thread_id=200; set @@session.pseudo_thread_id=200;
create temporary table t201 (id int); create temporary table t201 (id int);
create temporary table `#not_user_table_prefixed_with_hash_sign_no_harm` (id int); create temporary table `t``201` (id int);
# emulate internal temp table not to come to binlog
# create temporary table `#sql_not_user_table202` (id int);
# Don't kill our own connection to the server as set @@session.pseudo_thread_id=300;
# the result code differs depending on platform. create temporary table t301 (id int);
# create temporary table t302 (id int);
# Select the id to kill into a variable of mysqltest create temporary table `#sql_not_user_table303` (id int);
let $con1_id= `select connection_id()`; disconnect con1;
# Switch connection to avoid killing our own connection
connection master;
--disable_query_log
eval kill $con1_id;
--enable_query_log
#now do something to show that slave is ok after DROP temp tables #now do something to show that slave is ok after DROP temp tables
connection master; connection master;
...@@ -195,4 +190,17 @@ select * from t1 /* must be 1 */; ...@@ -195,4 +190,17 @@ select * from t1 /* must be 1 */;
connection master; connection master;
drop table t1; drop table t1;
# End of 5.1 tests
#
#14157: utf8 encoding in binlog without set character_set_client
#
--exec $MYSQL --character-sets-dir=../sql/share/charsets/ --default-character-set=koi8r test -e 'create table t1 (a int); set names koi8r; create temporary table `ÑÝÉË` (a int); insert into `ÑÝÉË` values (1); insert into t1 select * from `ÑÝÉË`'
sync_slave_with_master;
#connection slave;
select * from t1;
connection master;
drop table t1;
# End of 5.0 tests
...@@ -1936,6 +1936,16 @@ inline int hexchar_to_int(char c) ...@@ -1936,6 +1936,16 @@ inline int hexchar_to_int(char c)
return -1; return -1;
} }
/*
is_user_table()
return true if the table was created explicitly
*/
inline bool is_user_table(TABLE * table)
{
const char *name= table->s->table_name;
return strncmp(name, tmp_file_prefix, tmp_file_prefix_length);
}
/* /*
Some functions that are different in the embedded library and the normal Some functions that are different in the embedded library and the normal
......
...@@ -1183,13 +1183,7 @@ static inline uint tmpkeyval(THD *thd, TABLE *table) ...@@ -1183,13 +1183,7 @@ static inline uint tmpkeyval(THD *thd, TABLE *table)
void close_temporary_tables(THD *thd) void close_temporary_tables(THD *thd)
{ {
TABLE *next, TABLE *table;
*prev_table /* prev link is not maintained in TABLE's double-linked list */,
*table;
char *query= (gptr) 0, *end;
uint query_buf_size, max_names_len;
bool found_user_tables;
if (!thd->temporary_tables) if (!thd->temporary_tables)
return; return;
......
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