summaryrefslogtreecommitdiff
path: root/sql/unireg.h
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2003-10-29 14:23:35 +0100
committerunknown <guilhem@mysql.com>2003-10-29 14:23:35 +0100
commit03dbf8ccbb649825d7aafd9f00234bee35111de9 (patch)
treefce8da3a99c175419b43436ce7e5ca6b3d7c8618 /sql/unireg.h
parente0fd80f72a9583581bcce0755e179f44dfe580a9 (diff)
downloadmariadb-git-03dbf8ccbb649825d7aafd9f00234bee35111de9.tar.gz
Fix for BUG#1686
"If 2 master threads with same-name temp table, slave makes bad binlog" and (two birds with one stone) for BUG#1240 "slave of slave breaks when STOP SLAVE was issud on parent slave and temp tables". Here is the design change: in a slave running with --log-slave-updates, events are now logged with the thread id they had on the master. So no more id conflicts between master threads, but introduces id conflicts between one master thread and one normal client thread connected to the slave. This is solved by storing the server id in the temp table's name. New test which requires mysql-test-run to be run with --manager, otherwise it will be skipped. Undoing a Monty's change (hum, a chill runs down my spine ;) which was "Cleanup temporary tables when slave ends" in ChangeSet 1.1572.1.1. mysql-test/mysql-test-run.sh: One new test which needs more than one slave so must be hardcoded in mysql-test-run.sh. sql/log_event.cc: The event needs to carry a slave_proxy_id (which is set at event's creation and used at event's logging). This is used for events created by ::exec_event() in the slave SQL thread: now we want to log these events with the thread id they had on the master. This is so that several same-name temp tables simultaneously created on the master end up with not the same thread id in the slave's binlog. sql/log_event.h: Query and Load need to carry a slave_proxy_id, like they carried a thread_id (to replicate temp tables well). sql/slave.cc: Do not free temp tables in the slave SQL thread. Or they will be lost when one does STOP SLAVE / START SLAVE. We even save them in rli->save_temporary_tables and set thd->temporary_tables=0 to prevent them to be freed. sql/sql_base.cc: Put the server id in the table cache key name for temp tables (we already put the slave_proxy_id, but we also need the server id in case normal clients (not slave threads) are using temp tables on the slave). sql/unireg.h: 4 more bytes, to store the server id.
Diffstat (limited to 'sql/unireg.h')
-rw-r--r--sql/unireg.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/unireg.h b/sql/unireg.h
index f2cace51fa7..37157311e15 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -43,7 +43,7 @@
#define ERRMAPP 1 /* Errormap f|r my_error */
#define LIBLEN FN_REFLEN-FN_LEN /* Max l{ngd p} dev */
-#define MAX_DBKEY_LENGTH (FN_LEN*2+6) /* extra 4 bytes for slave tmp
+#define MAX_DBKEY_LENGTH (FN_LEN*2+1+1+4+4) /* extra 4+4 bytes for slave tmp
* tables */
#define MAX_FIELD_NAME 34 /* Max colum name length +2 */
#define MAX_SYS_VAR_LENGTH 32