summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2001-01-27 15:33:31 -0700
committerunknown <sasha@mysql.sashanet.com>2001-01-27 15:33:31 -0700
commitdbe03fb0bce93ae750db6c0cd346e87bc82201ab (patch)
treeb2d2f6b0dd73eec46bc4a16978de2f24b148927a /sql
parenteb5706d128539f1aa98690793e9344df280f98c8 (diff)
downloadmariadb-git-dbe03fb0bce93ae750db6c0cd346e87bc82201ab.tar.gz
fixed up lock counting code - Monty's suggestions
updated manual about table lock counter fixed coredump in DROP DATABASE with long bogus name by non-root user fixed bug in handling STOP immediately after ROTATE added test case for buffer overrun on DROP DATABASE by non-root user added test case for the STOP bug in replication Docs/manual.texi: updates for Table_locks_immediate and Table_locks_waited include/thr_lock.h: fixes suggested by Monty to lock counts mysql-test/r/status.result: clean up of result for changes in the test case mysql-test/t/status.test: make it produce the same results if the had been some activity on the server already mysys/thr_lock.c: fixes suggested by Monty sql/mysqld.cc: fixes suggested by Monty sql/slave.cc: fixed bug in processing STOP event after rotate sql/sql_base.cc: fixes suggested by Monty sql/sql_parse.cc: fixed coredump in drop database with long name by a non-root user sql/sql_repl.cc: better status message
Diffstat (limited to 'sql')
-rw-r--r--sql/mysqld.cc1
-rw-r--r--sql/slave.cc9
-rw-r--r--sql/sql_base.cc5
-rw-r--r--sql/sql_parse.cc7
-rw-r--r--sql/sql_repl.cc2
5 files changed, 16 insertions, 8 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 36fc5a49148..465a74c2ac5 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -260,7 +260,6 @@ ulong query_id=1L,long_query_count,long_query_time,aborted_threads,
delayed_queue_size,delayed_insert_threads,delayed_insert_writes,
delayed_rows_in_use,delayed_insert_errors,flush_time, thread_created;
ulong filesort_rows, filesort_range_count, filesort_scan_count;
-extern "C" ulong locks_immediate, locks_waited;
ulong filesort_merge_passes;
ulong select_range_check_count, select_range_count, select_scan_count;
ulong select_full_range_join_count,select_full_join_count;
diff --git a/sql/slave.cc b/sql/slave.cc
index 22d76c54ecd..5a110b6921b 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1055,9 +1055,12 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
break;
case STOP_EVENT:
- close_temporary_tables(thd);
- mi->inc_pos(event_len);
- flush_master_info(mi);
+ if(mi->pos > 4) // stop event should be ignored after rotate event
+ {
+ close_temporary_tables(thd);
+ mi->inc_pos(event_len);
+ flush_master_info(mi);
+ }
delete ev;
break;
case ROTATE_EVENT:
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index ed7a8027079..d69bc905c31 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -32,7 +32,6 @@
TABLE *unused_tables; /* Used by mysql_test */
HASH open_cache; /* Used by mysql_test */
-extern "C" ulong locks_waited, locks_immediate;
static int open_unireg_entry(THD *thd,TABLE *entry,const char *db,
const char *name, const char *alias, bool locked);
@@ -1167,8 +1166,8 @@ bool wait_for_tables(THD *thd)
{
/* Now we can open all tables without any interference */
thd->proc_info="Reopen tables";
- if(!(result=reopen_tables(thd,0,0)))
- ++locks_waited;
+ result=reopen_tables(thd,0,0);
+
}
pthread_mutex_unlock(&LOCK_open);
thd->proc_info=0;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 495b00217ef..2926f59547f 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1886,6 +1886,13 @@ check_access(THD *thd,uint want_access,const char *db, uint *save_priv,
if (db == any_db)
return FALSE; // Allow select on anything
+
+ if (strlen(db) > NAME_LEN || check_db_name(db))
+ {
+ net_printf(&thd->net,ER_WRONG_DB_NAME, db);
+ return TRUE;
+ }
+
if (db && (!thd->db || strcmp(db,thd->db)))
db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr,
thd->priv_user, db); /* purecov: inspected */
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 4f0112bac26..0598d906aa0 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -392,7 +392,7 @@ sweepstakes if you report the bug";
thd->mysys_var->current_mutex = log_lock;
thd->mysys_var->current_cond = &COND_binlog_update;
const char* proc_info = thd->proc_info;
- thd->proc_info = "Waiting for update";
+ thd->proc_info = "Slave connection: waiting for binlog update";
pthread_mutex_unlock(&thd->mysys_var->mutex);
bool read_packet = 0, fatal_error = 0;