Below is the list of changes that have just been pushed into main
3.23. repository. For information on how to access the repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
>>>>>>> BitKeeper/tmp/post-commit_sasha@stripped
ChangeSet@stripped, 2001-06-22 08:35:18-06:00, sasha@stripped
merged new 3.23 errors
fixed bugs in log seq - now starting to look good
fixes for SHOW BINLOG EVENTS
will push this one
mysql-test/r/drop.result
1.4 01/06/22 08:35:17 sasha@stripped +7 -0
updated test
mysql-test/r/rpl_log.result
1.2 01/06/22 08:35:17 sasha@stripped +13 -15
updated test
mysql-test/t/drop.test
1.4 01/06/22 08:35:17 sasha@stripped +15 -0
updated test
mysql-test/t/rpl_log.test
1.2 01/06/22 08:35:17 sasha@stripped +5 -0
fixed bugs in test case
sql/item_sum.h
1.10 01/06/22 08:35:17 sasha@stripped +1 -1
remove compiler warning about re-ordered initialization
sql/log.cc
1.60 01/06/22 08:35:17 sasha@stripped +7 -17
fixed a bunch of loq_seq bugs
sql/log_event.cc
1.42 01/06/22 08:35:17 sasha@stripped +17 -4
fixed log seq bugs, added info for Slave event in SHOW BINLOG EVENTS
sql/share/czech/errmsg.txt
1.26 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/danish/errmsg.txt
1.25 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/dutch/errmsg.txt
1.26 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/english/errmsg.txt
1.30 01/06/22 08:35:17 sasha@stripped +2 -1
merged errors from 3.23
sql/share/estonian/errmsg.txt
1.27 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/french/errmsg.txt
1.25 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/german/errmsg.txt
1.27 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/greek/errmsg.txt
1.26 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/hungarian/errmsg.txt
1.27 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/italian/errmsg.txt
1.30 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/japanese/errmsg.txt
1.25 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/korean/errmsg.txt
1.25 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/norwegian-ny/errmsg.txt
1.25 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/norwegian/errmsg.txt
1.25 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/polish/errmsg.txt
1.25 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/portuguese/errmsg.txt
1.27 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/romanian/errmsg.txt
1.24 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/russian/errmsg.txt
1.26 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/slovak/errmsg.txt
1.26 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/spanish/errmsg.txt
1.26 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/share/swedish/errmsg.txt
1.26 01/06/22 08:35:17 sasha@stripped +3 -0
merged errors from 3.23
sql/slave.cc
1.111 01/06/22 08:35:17 sasha@stripped +36 -9
fixed log_seq bugs
include/mysqld_error.h
1.27 01/06/22 08:35:16 sasha@stripped +6 -4
merged errors from 3.23
mysql-test/mysql-test-run.sh
1.80 01/06/22 08:35:16 sasha@stripped +1 -1
wrong quotes in --skip-test
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: sasha
# Host: mysql.sashanet.com
# Root: /home/sasha/src/bk/mysql-4.0
--- 1.26/include/mysqld_error.h Thu Jun 21 16:14:59 2001
+++ 1.27/include/mysqld_error.h Fri Jun 22 08:35:16 2001
@@ -208,7 +208,9 @@
#define ER_LOCK_WAIT_TIMEOUT 1205
#define ER_LOCK_TABLE_FULL 1206
#define ER_READ_ONLY_TRANSACTION 1207
-#define ER_CONNECT_TO_MASTER 1208
-#define ER_QUERY_ON_MASTER 1209
-#define ER_SHOW_BINLOG_EVENTS 1210
-#define ER_ERROR_MESSAGES 211
+#define ER_DROP_DB_WITH_READ_LOCK 1208
+#define ER_CREATE_DB_WITH_READ_LOCK 1209
+#define ER_CONNECT_TO_MASTER 1210
+#define ER_QUERY_ON_MASTER 1211
+#define ER_SHOW_BINLOG_EVENTS 1212
+#define ER_ERROR_MESSAGES 213
--- 1.79/mysql-test/mysql-test-run.sh Thu Jun 21 13:19:23 2001
+++ 1.80/mysql-test/mysql-test-run.sh Fri Jun 22 08:35:16 2001
@@ -659,7 +659,7 @@
slave_master_info_file=$TESTDIR/$tname-slave-master-info.opt
SKIP_SLAVE=`$EXPR \( $tname : rpl \) = 0`
if [ -n $SKIP_TEST ] ; then
- SKIP_THIS_TEST=`$EXPR \( $tname : '$SKIP_TEST' \) != 0`
+ SKIP_THIS_TEST=`$EXPR \( $tname : "$SKIP_TEST" \) != 0`
if [ x$SKIP_THIS_TEST = x1 ] ;
then
return;
--- 1.9/sql/item_sum.h Thu Jun 21 03:03:53 2001
+++ 1.10/sql/item_sum.h Fri Jun 22 08:35:17 2001
@@ -173,7 +173,7 @@
public:
Item_sum_count_distinct(List<Item> &list)
:Item_sum_int(list),table(0),used_table_cache(~(table_map) 0),
- tmp_table_param(0),always_null(0),use_tree(0)
+ tmp_table_param(0),use_tree(0),always_null(0)
{ quick_group=0; }
~Item_sum_count_distinct();
table_map used_tables() const { return used_table_cache; }
--- 1.59/sql/log.cc Thu Jun 21 16:14:59 2001
+++ 1.60/sql/log.cc Fri Jun 22 08:35:17 2001
@@ -236,20 +236,6 @@
bool error;
s.set_log_seq(0, this);
s.write(&log_file);
- // if we have a master, record current master info in a slave
- // event
- if (glob_mi.inited)
- {
- THD* thd = current_thd;
- Slave_log_event s(thd, &glob_mi);
-
- if(s.master_host)
- {
- s.set_log_seq(thd, this);
- s.write(&log_file);
- }
- }
-
flush_io_cache(&log_file);
pthread_mutex_lock(&LOCK_index);
error=(my_write(index_file, (byte*) log_file_name, strlen(log_file_name),
@@ -548,7 +534,7 @@
to change base names at some point.
*/
Rotate_log_event r(new_name+dirname_length(new_name));
- r.set_log_seq(current_thd, this);
+ r.set_log_seq(0, this);
r.write(&log_file);
VOID(pthread_cond_broadcast(&COND_binlog_update));
}
@@ -650,8 +636,10 @@
if (!inited) // Can't use mutex if not init
return 0;
VOID(pthread_mutex_lock(&LOCK_log));
- event_info->set_log_seq(current_thd, this);
+ if(!event_info->log_seq)
+ event_info->set_log_seq(current_thd, this);
error = event_info->write(&log_file);
+ flush_io_cache(&log_file);
VOID(pthread_mutex_unlock(&LOCK_log));
return error;
}
@@ -688,7 +676,7 @@
{
Intvar_log_event e((uchar)LAST_INSERT_ID_EVENT, thd->last_insert_id);
e.set_log_seq(thd, this);
- if(thd->server_id)
+ if (thd->server_id)
e.server_id = thd->server_id;
if (e.write(file))
goto err;
@@ -697,6 +685,8 @@
{
Intvar_log_event e((uchar)INSERT_ID_EVENT, thd->last_insert_id);
e.set_log_seq(thd, this);
+ if (thd->server_id)
+ e.server_id = thd->server_id;
if (e.write(file))
goto err;
}
--- 1.41/sql/log_event.cc Thu Jun 21 13:19:23 2001
+++ 1.42/sql/log_event.cc Fri Jun 22 08:35:17 2001
@@ -204,7 +204,17 @@
void Slave_log_event::pack_info(String* packet)
{
- net_store_data(packet, "", 0);
+ String tmp;
+ char buf[22];
+ tmp.append("host=");
+ tmp.append(master_host);
+ tmp.append(",port=");
+ tmp.append(llstr(master_port,buf));
+ tmp.append(",log=");
+ tmp.append(master_log);
+ tmp.append(",pos=");
+ tmp.append(llstr(master_pos,buf));
+ net_store_data(packet, tmp.ptr(), tmp.length());
}
@@ -889,8 +899,8 @@
master_host = mem_pool + SL_MASTER_HOST_OFFSET;
master_host_len = strlen(master_host);
// safety
- master_log = master_host + master_host_len;
- if(master_log >= mem_pool + data_size)
+ master_log = master_host + master_host_len + 1;
+ if(master_log > mem_pool + data_size)
{
master_host = 0;
return;
@@ -902,9 +912,12 @@
Slave_log_event::Slave_log_event(const char* buf, int event_len):
Log_event(buf),mem_pool(0),master_host(0)
{
+ event_len -= LOG_EVENT_HEADER_LEN;
+ if(event_len < 0)
+ return;
if(!(mem_pool = (char*)my_malloc(event_len + 1, MYF(MY_WME))))
return;
- memcpy(mem_pool, buf, event_len);
+ memcpy(mem_pool, buf + LOG_EVENT_HEADER_LEN, event_len);
mem_pool[event_len] = 0;
init_from_mem_pool(event_len);
}
--- 1.25/sql/share/czech/errmsg.txt Thu Jun 21 16:14:59 2001
+++ 1.26/sql/share/czech/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -220,3 +220,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.24/sql/share/danish/errmsg.txt Thu Jun 21 16:14:59 2001
+++ 1.25/sql/share/danish/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -214,3 +214,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.25/sql/share/dutch/errmsg.txt Thu Jun 21 16:14:59 2001
+++ 1.26/sql/share/dutch/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -211,3 +211,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.29/sql/share/english/errmsg.txt Thu Jun 21 16:14:59 2001
+++ 1.30/sql/share/english/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -209,7 +209,8 @@
"Lock wait timeout exceeded",
"The total number of locks exceeds the lock table size",
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
+"DROP DATABASE not allowed while thread is holding global read lock",
+"CREATE DATABASE not allowed while thread is holding global read lock",
"Error connecting to master: %-.128s",
"Error running query on master: %-.128s",
"Error in SHOW BINLOG EVENTS: %-.128s",
-
--- 1.26/sql/share/estonian/errmsg.txt Thu Jun 21 16:14:59 2001
+++ 1.27/sql/share/estonian/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -215,3 +215,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.24/sql/share/french/errmsg.txt Thu Jun 21 16:14:59 2001
+++ 1.25/sql/share/french/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -211,3 +211,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.26/sql/share/german/errmsg.txt Thu Jun 21 16:14:59 2001
+++ 1.27/sql/share/german/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -214,3 +214,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.25/sql/share/greek/errmsg.txt Thu Jun 21 16:14:59 2001
+++ 1.26/sql/share/greek/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -211,3 +211,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.26/sql/share/hungarian/errmsg.txt Thu Jun 21 16:14:59 2001
+++ 1.27/sql/share/hungarian/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -213,3 +213,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.29/sql/share/italian/errmsg.txt Thu Jun 21 16:15:00 2001
+++ 1.30/sql/share/italian/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -211,3 +211,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.24/sql/share/japanese/errmsg.txt Thu Jun 21 16:15:00 2001
+++ 1.25/sql/share/japanese/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -213,3 +213,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.24/sql/share/korean/errmsg.txt Thu Jun 21 16:15:00 2001
+++ 1.25/sql/share/korean/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -211,3 +211,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.24/sql/share/norwegian-ny/errmsg.txt Thu Jun 21 16:15:00 2001
+++ 1.25/sql/share/norwegian-ny/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -213,3 +213,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.24/sql/share/norwegian/errmsg.txt Thu Jun 21 16:15:00 2001
+++ 1.25/sql/share/norwegian/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -213,3 +213,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.24/sql/share/polish/errmsg.txt Thu Jun 21 16:15:00 2001
+++ 1.25/sql/share/polish/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -215,3 +215,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.26/sql/share/portuguese/errmsg.txt Thu Jun 21 16:15:00 2001
+++ 1.27/sql/share/portuguese/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -211,3 +211,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.23/sql/share/romanian/errmsg.txt Thu Jun 21 16:15:00 2001
+++ 1.24/sql/share/romanian/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -215,3 +215,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.25/sql/share/russian/errmsg.txt Thu Jun 21 16:15:00 2001
+++ 1.26/sql/share/russian/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -214,3 +214,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.25/sql/share/slovak/errmsg.txt Thu Jun 21 16:15:00 2001
+++ 1.26/sql/share/slovak/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -219,3 +219,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.25/sql/share/spanish/errmsg.txt Thu Jun 21 16:15:00 2001
+++ 1.26/sql/share/spanish/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -212,3 +212,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.25/sql/share/swedish/errmsg.txt Thu Jun 21 16:15:00 2001
+++ 1.26/sql/share/swedish/errmsg.txt Fri Jun 22 08:35:17 2001
@@ -211,3 +211,6 @@
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
"DROP DATABASE not allowed while thread is holding global read lock",
"CREATE DATABASE not allowed while thread is holding global read lock",
+"Error connecting to master: %-.128s",
+"Error running query on master: %-.128s",
+"Error in SHOW BINLOG EVENTS: %-.128s",
--- 1.110/sql/slave.cc Thu Jun 21 16:01:09 2001
+++ 1.111/sql/slave.cc Fri Jun 22 08:35:17 2001
@@ -928,7 +928,10 @@
thd->server_id = ev->server_id; // use the original server id for logging
thd->set_time(); // time the query
- if(!ev->when)
+ if(!thd->log_seq)
+ thd->log_seq = ev->log_seq;
+
+ if (!ev->when)
ev->when = time(NULL);
switch(type_code) {
@@ -1009,6 +1012,7 @@
}
free_root(&thd->mem_root,0);
delete ev;
+ thd->log_seq = 0;
mi->inc_pos(event_len);
flush_master_info(mi);
@@ -1024,6 +1028,7 @@
}
delete ev;
+ thd->log_seq = 0;
break;
}
@@ -1135,6 +1140,7 @@
}
delete ev;
+ thd->log_seq = 0;
free_root(&thd->mem_root,0);
if(thd->fatal_error)
@@ -1154,6 +1160,7 @@
mi->inc_pos(event_len);
flush_master_info(mi);
delete ev;
+ thd->log_seq = 0;
break;
case STOP_EVENT:
@@ -1164,30 +1171,49 @@
flush_master_info(mi);
}
delete ev;
+ thd->log_seq = 0;
break;
case ROTATE_EVENT:
{
Rotate_log_event* rev = (Rotate_log_event*)ev;
int ident_len = rev->ident_len;
+ bool rotate_binlog = 0, write_slave_event = 0;
+ char* log_name = mi->log_file_name;
pthread_mutex_lock(&mi->lock);
- memcpy(mi->log_file_name, rev->new_log_ident,ident_len );
- mi->log_file_name[ident_len] = 0;
+
+ // rotate local binlog only if the name of remote has changed
+ if (!*log_name || !(log_name[ident_len] == 0 &&
+ !memcmp(log_name, rev->new_log_ident, ident_len)))
+ {
+ write_slave_event = mysql_bin_log.is_open();
+ rotate_binlog = (*log_name && write_slave_event );
+ memcpy(log_name, rev->new_log_ident,ident_len );
+ log_name[ident_len] = 0;
+ }
mi->pos = 4; // skip magic number
pthread_cond_broadcast(&mi->cond);
pthread_mutex_unlock(&mi->lock);
flush_master_info(mi);
#ifndef DBUG_OFF
- if(abort_slave_event_count)
+ if (abort_slave_event_count)
++events_till_abort;
#endif
- if(mysql_bin_log.is_open())
- {
+ if (rotate_binlog)
mysql_bin_log.new_file();
- Slave_log_event sev(slave_thd, mi);
- if(sev.master_host)
- mysql_bin_log.write(&sev);
+
+ if (write_slave_event)
+ {
+ Slave_log_event s(thd, mi);
+ if (s.master_host)
+ {
+ s.set_log_seq(0, &mysql_bin_log);
+ s.server_id = ::server_id;
+ mysql_bin_log.write(&s);
+ }
}
+
delete ev;
+ thd->log_seq = 0;
break;
}
@@ -1207,6 +1233,7 @@
}
mi->inc_pending(event_len);
delete ev;
+ // do not reset log_seq
break;
}
}
--- 1.3/mysql-test/r/drop.result Thu Jun 21 16:14:59 2001
+++ 1.4/mysql-test/r/drop.result Fri Jun 22 08:35:17 2001
@@ -2,3 +2,10 @@
1
n
4
+Database
+foo
+mysql
+test
+Database
+mysql
+test
--- 1.1/mysql-test/r/rpl_log.result Thu Jun 21 13:19:23 2001
+++ 1.2/mysql-test/r/rpl_log.result Fri Jun 22 08:35:17 2001
@@ -28,24 +28,22 @@
Log_name Pos Event_type Server_id Log_seq Info
master-bin.002 4 Start 1 1 Server ver: 4.0.0-debug-log, Binlog ver: 2
Log_name
+master-bin.001
+master-bin.002
+Log_name
slave-bin.001
slave-bin.002
-slave-bin.003
-slave-bin.004
Log_name Pos Event_type Server_id Log_seq Info
slave-bin.001 4 Start 2 1 Server ver: 4.0.0-debug-log, Binlog ver: 2
-slave-bin.001 79 Slave 2 2
-slave-bin.001 118 Rotate 2 3 slave-bin.002
-slave-bin.001 150 Stop 2 4
+slave-bin.001 79 Slave 2 2 host=127.0.0.1,port=9306,log=master-bin.001,pos=4
+slave-bin.001 132 Query 1 2 use test; create table t1(n int not null auto_increment primary key)
+slave-bin.001 225 Intvar 1 3 INSERT_ID=1
+slave-bin.001 253 Query 1 4 use test; insert into t1 values (NULL)
+slave-bin.001 316 Query 1 5 use test; drop table t1
+slave-bin.001 364 Query 1 6 use test; create table t1 (word char(20) not null)
+slave-bin.001 439 Query 1 8 use test; drop table t1
+slave-bin.001 487 Rotate 2 3 slave-bin.002
+slave-bin.001 519 Stop 2 4
Log_name Pos Event_type Server_id Log_seq Info
slave-bin.002 4 Start 2 1 Server ver: 4.0.0-debug-log, Binlog ver: 2
-slave-bin.002 79 Slave 1 2
-slave-bin.002 132 Slave 1 3
-slave-bin.002 185 Query 1 4 use test; create table t1(n int not null auto_increment primary key)
-slave-bin.002 278 Intvar 2 5 INSERT_ID=1
-slave-bin.002 306 Query 1 6 use test; insert into t1 values (NULL)
-slave-bin.002 369 Query 1 7 use test; drop table t1
-slave-bin.002 417 Query 1 8 use test; create table t1 (word char(20) not null)
-slave-bin.002 492 Query 1 9 use test; drop table t1
-slave-bin.002 540 Rotate 2 10 slave-bin.003
-slave-bin.002 572 Stop 2 11
+slave-bin.002 79 Slave 2 2 host=127.0.0.1,port=9306,log=master-bin.002,pos=4
--- 1.3/mysql-test/t/drop.test Thu Jun 21 16:14:59 2001
+++ 1.4/mysql-test/t/drop.test Fri Jun 22 08:35:17 2001
@@ -24,3 +24,18 @@
drop database if exists foo;
create database foo;
drop database foo;
+
+# test drop/create database and FLUSH TABLES WITH READ LOCK
+drop database if exists foo;
+flush tables with read lock;
+--error 1209
+create database foo;
+unlock tables;
+create database foo;
+show databases;
+flush tables with read lock;
+--error 1208
+drop database foo;
+unlock tables;
+drop database foo;
+show databases;
--- 1.1/mysql-test/t/rpl_log.test Thu Jun 21 13:19:23 2001
+++ 1.2/mysql-test/t/rpl_log.test Fri Jun 22 08:35:17 2001
@@ -2,9 +2,12 @@
#clean up slave binlogs
connection slave;
+slave stop;
reset master;
+reset slave;
connection master;
+reset master;
drop table if exists t1;
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL);
@@ -19,8 +22,10 @@
flush logs;
show binlog events;
show binlog events in 'master-bin.002';
+show master logs;
save_master_pos;
connection slave;
+slave start;
sync_with_master;
show master logs;
show binlog events in 'slave-bin.001' from 4;
| Thread |
|---|
| • bk commit into 3.23 tree | sasha | 22 Jun |