summaryrefslogtreecommitdiff
path: root/scripts/mysql_system_tables.sql
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2017-03-24 12:07:07 +0100
committerKristian Nielsen <knielsen@knielsen-hq.org>2017-04-21 10:30:16 +0200
commitfdf2d407707faf05b8b7d67662a70cc5537d15aa (patch)
tree63fa7fb276ffe1d247054bc1712a9b745f1b129d /scripts/mysql_system_tables.sql
parent3cc89b3e85605ecb09b4b2222c8b0b8222a29fde (diff)
downloadmariadb-git-fdf2d407707faf05b8b7d67662a70cc5537d15aa.tar.gz
MDEV-12179: Per-engine mysql.gtid_slave_pos table
Intermediate commit. Implement auto-creation of mysql.gtid_slave_pos* tables with needed engines, if listed in --gtid-pos-auto-engines. Uses an asynchronous approach to minimise locking overhead. The list of available tables is extended with a flag. Extra entries are added for --gtid-pos-auto-engines tables that do not exist yet, marked as not existing but ready for auto-creation. If record_gtid() needs a table marked for auto-creation, it sends a request to the slave background thread to create the table, and continues to use an existing table for the current and immediately coming transactions. As soon as the slave background thread has made the new table available, it will be used for all subsequent relevant transactions in record_gtid(). This asynchronous approach also avoids a lot of complex issues around trying to do DDL in the middle of an on-going transaction.
Diffstat (limited to 'scripts/mysql_system_tables.sql')
-rw-r--r--scripts/mysql_system_tables.sql2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index 7b614163f46..60c1ac97955 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -224,6 +224,8 @@ CREATE TABLE IF NOT EXISTS column_stats (db_name varchar(64) NOT NULL, table_nam
CREATE TABLE IF NOT EXISTS index_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, index_name varchar(64) NOT NULL, prefix_arity int(11) unsigned NOT NULL, avg_frequency decimal(12,4) DEFAULT NULL, PRIMARY KEY (db_name,table_name,index_name,prefix_arity) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Indexes';
+-- Note: This definition must be kept in sync with the one used in
+-- build_gtid_pos_create_query() in sql/slave.cc
SET @cmd= "CREATE TABLE IF NOT EXISTS gtid_slave_pos (
domain_id INT UNSIGNED NOT NULL,
sub_id BIGINT UNSIGNED NOT NULL,