summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsasha@mysql.sashanet.com <>2001-11-27 18:21:39 -0700
committersasha@mysql.sashanet.com <>2001-11-27 18:21:39 -0700
commit41afc03a85b92ac9d3bfe81a633631f17832b461 (patch)
tree82486bd3d1d0ded60ebe235a1ac877c7d2d6ad83
parente4bdf26066324b76942b1e92d2118a70591f447d (diff)
parent5d2f2c836931e277bfe83416c6a325e2e7e878b7 (diff)
downloadmariadb-git-41afc03a85b92ac9d3bfe81a633631f17832b461.tar.gz
Merge work:/home/bk/mysql into mysql.sashanet.com:/reiser-data/mysql
-rw-r--r--mysql-test/r/rpl000016.result2
-rw-r--r--mysql-test/t/rpl000013.test2
-rw-r--r--mysql-test/t/rpl000016.test5
-rw-r--r--sql/slave.cc7
-rw-r--r--sql/sql_base.cc4
5 files changed, 13 insertions, 7 deletions
diff --git a/mysql-test/r/rpl000016.result b/mysql-test/r/rpl000016.result
index abe4275a124..1390291f1e8 100644
--- a/mysql-test/r/rpl000016.result
+++ b/mysql-test/r/rpl000016.result
@@ -10,7 +10,7 @@ master-bin.003
Log_name
master-bin.003
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
-127.0.0.1 root 9999 60 master-bin.003 184 Yes 0 0
+127.0.0.1 root 9999 60 master-bin.003 206 Yes 0 0
m
34
65
diff --git a/mysql-test/t/rpl000013.test b/mysql-test/t/rpl000013.test
index af693a720d4..a190d5324ae 100644
--- a/mysql-test/t/rpl000013.test
+++ b/mysql-test/t/rpl000013.test
@@ -12,7 +12,7 @@ insert into t2 select * from t1;
connection master1;
create temporary table t1 (n int);
insert into t1 values (4),(5);
-insert into t2 select * from t1;
+insert into t2 select * from t1 as t10;
save_master_pos;
disconnect master;
connection slave;
diff --git a/mysql-test/t/rpl000016.test b/mysql-test/t/rpl000016.test
index 7b46bc75498..c9b6ccabcd2 100644
--- a/mysql-test/t/rpl000016.test
+++ b/mysql-test/t/rpl000016.test
@@ -28,7 +28,7 @@ select * from t1;
connection master;
flush logs;
drop table if exists t2;
-create table t2(m int not null primary key);
+create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123);
save_master_pos;
flush logs;
@@ -44,7 +44,8 @@ insert into t2 values(1234);
#same value on the master
connection master;
save_master_pos;
-insert into t2 values(1234);
+set insert_id=1234;
+insert into t2 values(NULL);
connection slave;
sync_with_master;
diff --git a/sql/slave.cc b/sql/slave.cc
index 958ea0f1e18..5fdbab7c7c6 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -885,7 +885,12 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
mi->inc_pos(event_len);
flush_master_info(mi);
- if(slave_skip_counter)
+ if(slave_skip_counter && /* protect against common user error of
+ setting the counter to 1 instead of 2
+ while recovering from an failed
+ auto-increment insert */
+ !(type_code == INTVAR_EVENT &&
+ slave_skip_counter == 1))
--slave_skip_counter;
delete ev;
return 0; // avoid infinite update loops
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 70dc2ed058d..656758623bc 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -527,10 +527,10 @@ void close_temporary_tables(THD *thd)
if (query) // we might be out of memory, but this is not fatal
{
// skip temporary tables not created directly by the user
- if (table->table_name[0] != '#')
+ if (table->real_name[0] != '#')
{
end = strxmov(end,table->table_cache_key,".",
- table->table_name,",", NullS);
+ table->real_name,",", NullS);
// here we assume table_cache_key always starts
// with \0 terminated db name
found_user_tables = 1;