diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log.cc | 2 | ||||
-rw-r--r-- | sql/share/czech/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/danish/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/dutch/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/estonian/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/french/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/german/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/greek/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/hungarian/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/italian/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/japanese/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/korean/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/norwegian-ny/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/norwegian/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/polish/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/portuguese/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/romanian/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/russian/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/slovak/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/spanish/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/share/swedish/errmsg.txt | 10 | ||||
-rw-r--r-- | sql/slave.cc | 2 | ||||
-rw-r--r-- | sql/sql_db.cc | 46 |
23 files changed, 92 insertions, 44 deletions
diff --git a/sql/log.cc b/sql/log.cc index 5ee3120a991..f1cb1b4d50c 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -688,6 +688,8 @@ bool MYSQL_LOG::write(Query_log_event* event_info) { Intvar_log_event e((uchar)LAST_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; } diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 68d717bc1fa..6d35e913ffd 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -218,5 +218,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 2b054724222..d1e0ea71175 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -212,5 +212,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index 48f5e9e3dc4..7ae6c564283 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -209,5 +209,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index 858618285b2..1418295b417 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -213,5 +213,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 26c114022c6..0da5cf94ed8 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -209,5 +209,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index d38651314f2..9abbb3a8a2f 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -212,5 +212,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index 778c4483bd1..8f81fcfda31 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -209,5 +209,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index b1bb76cd6c7..84d8c56cd04 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -211,5 +211,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index 3b9a6b1604b..ab31fa279c4 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -209,5 +209,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index 6368ee5bae3..49e58079588 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -211,5 +211,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index a0e73ff9772..2e278dbd129 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -209,5 +209,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index 10c28232a5d..df9efbd28a4 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -211,5 +211,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index e32d66f5eab..c95669aa016 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -211,5 +211,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index 9d9c88e2ed6..d708bc6fffb 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -213,5 +213,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index bb9e06c69b8..b1cab63c0a0 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -209,5 +209,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 421b43a781f..8069f9907bb 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -213,5 +213,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index 55d5a6ad360..6bc845d5599 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -212,5 +212,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index 814bcccfc8e..8631ee6bdeb 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -217,5 +217,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index 4b075a4d3f6..ea97a282c83 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -210,5 +210,5 @@ "Lock wait timeout exceeded", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", -"Error connecting to master: %-.128s", -"Error running query on master: %-.128s", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index 227a02ac873..7f43afd04b6 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -206,8 +206,8 @@ "Kunde inte starta en tråd för replikering", "Användare '%-.64s' har redan 'max_user_connections' aktiva inloggningar", "Du kan endast använda konstant-uttryck med SET", -"Tiden att få ett lås var för lång", -"Antal lås är större än vad som ryms i lock tabellen", -"Du kan inte låsa tabeller/poster under READ UNCOMMITTED", -"Fick fel vid inloggning till master: %-.128s", -"Fick fel vid exekvering av fråga på master: %-.128s", +"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", diff --git a/sql/slave.cc b/sql/slave.cc index 20c1abc416a..d7a0287fb85 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1440,7 +1440,7 @@ the slave thread with \"mysqladmin start-slave\". We stopped at log \ { // show a little mercy, allow slave to read one more event // before cutting him off - otherwise he gets stuck - // on Invar events, since they do not advance the offset + // on Intvar events, since they do not advance the offset // immediately if (++stuck_count > 2) events_till_disconnect++; diff --git a/sql/sql_db.cc b/sql/sql_db.cc index f3fda058113..85d3f0a344c 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -39,6 +39,32 @@ int mysql_create_db(THD *thd, char *db, uint create_options) DBUG_ENTER("mysql_create_db"); VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); + VOID(pthread_mutex_lock(&LOCK_open)); + + // do not create database if another thread is holding read lock + if (global_read_lock) + { + if (thd->global_read_lock) + { + net_printf(&thd->net, ER_CREATE_DB_WITH_READ_LOCK); + VOID(pthread_mutex_unlock(&LOCK_open)); + goto exit; + } + while (global_read_lock && ! thd->killed) + { + (void) pthread_cond_wait(&COND_refresh,&LOCK_open); + } + + if (thd->killed) + { + net_printf(&thd->net, ER_SERVER_SHUTDOWN); + VOID(pthread_mutex_unlock(&LOCK_open)); + goto exit; + } + + } + + VOID(pthread_mutex_unlock(&LOCK_open)); /* Check directory */ (void)sprintf(path,"%s/%s", mysql_data_home, db); @@ -117,6 +143,26 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists) VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); VOID(pthread_mutex_lock(&LOCK_open)); + // do not drop database if another thread is holding read lock + if (global_read_lock) + { + if (thd->global_read_lock) + { + net_printf(&thd->net, ER_DROP_DB_WITH_READ_LOCK); + goto exit; + } + while (global_read_lock && ! thd->killed) + { + (void) pthread_cond_wait(&COND_refresh,&LOCK_open); + } + + if (thd->killed) + { + net_printf(&thd->net, ER_SERVER_SHUTDOWN); + goto exit; + } + } + (void) sprintf(path,"%s/%s",mysql_data_home,db); unpack_dirname(path,path); // Convert if not unix /* See if the directory exists */ |