diff options
author | unknown <kroki/tomash@moonlight.home> | 2007-03-09 13:17:46 +0300 |
---|---|---|
committer | unknown <kroki/tomash@moonlight.home> | 2007-03-09 13:17:46 +0300 |
commit | b311d870523b6c1bae7e3a49e9d04d2c30bef5b2 (patch) | |
tree | 6197d95ef12f5c0b810b541f1b32c7955b0b1d7b /storage/myisam | |
parent | 1b198eeb6893b4095c70df224eafb2c823f8970f (diff) | |
parent | 0ea47f3ed46011263d696f9852190c6a2edf4772 (diff) | |
download | mariadb-git-b311d870523b6c1bae7e3a49e9d04d2c30bef5b2.tar.gz |
Merge moonlight.home:/home/tomash/src/mysql_ab/mysql-5.1
into moonlight.home:/home/tomash/src/mysql_ab/mysql-5.1-bug9953
mysql-test/r/sp-error.result:
Auto merged
mysql-test/r/view.result:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_help.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/table.cc:
Auto merged
sql/tztime.cc:
Auto merged
storage/myisam/ha_myisam.cc:
Auto merged
sql/sql_yacc.yy:
SCCS merged
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/ha_myisam.cc | 13 | ||||
-rw-r--r-- | storage/myisam/ha_myisam.h | 3 |
2 files changed, 10 insertions, 6 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 06ec5c4b44e..cc6d2e9ae70 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -565,7 +565,8 @@ err: bool ha_myisam::check_if_locking_is_allowed(uint sql_command, ulong type, TABLE *table, - uint count, + uint count, uint current, + uint *system_count, bool called_by_privileged_thread) { /* @@ -574,11 +575,13 @@ bool ha_myisam::check_if_locking_is_allowed(uint sql_command, we have to disallow write-locking of these tables with any other tables. */ if (table->s->system_table && - table->reginfo.lock_type >= TL_WRITE_ALLOW_WRITE && - count != 1) + table->reginfo.lock_type >= TL_WRITE_ALLOW_WRITE) + (*system_count)++; + + /* 'current' is an index, that's why '<=' below. */ + if (*system_count > 0 && *system_count <= current) { - my_error(ER_WRONG_LOCK_OF_SYSTEM_TABLE, MYF(0), table->s->db.str, - table->s->table_name.str); + my_error(ER_WRONG_LOCK_OF_SYSTEM_TABLE, MYF(0)); return FALSE; } diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index 882900bd35f..175a61bd97c 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -62,7 +62,8 @@ class ha_myisam: public handler virtual bool check_if_locking_is_allowed(uint sql_command, ulong type, TABLE *table, - uint count, + uint count, uint current, + uint *system_count, bool called_by_logger_thread); int open(const char *name, int mode, uint test_if_locked); int close(void); |