diff options
author | unknown <gluh@mysql.com/mgluh.(none)> | 2008-02-22 12:30:17 +0400 |
---|---|---|
committer | unknown <gluh@mysql.com/mgluh.(none)> | 2008-02-22 12:30:17 +0400 |
commit | 1a8be8bccb198959c35794bc9055da093b0a4fc9 (patch) | |
tree | 58153526cb62fa6d5252b0b0132435409adfa806 /sql | |
parent | 18f885ed4c26c58d1dcb0691ee45f3adaea74dbb (diff) | |
download | mariadb-git-1a8be8bccb198959c35794bc9055da093b0a4fc9.tar.gz |
Bug#23588 SHOW COLUMNS on a temporary table causes locking issues
skip lock_type update for temporary tables
mysql-test/r/tablelock.result:
test result
mysql-test/t/tablelock.test:
test case
sql/sql_base.cc:
skip lock_type update for temporary tables
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_base.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 8190b3eeacd..c9f20b3d71b 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2852,8 +2852,12 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags) } if (tables->lock_type != TL_UNLOCK && ! thd->locked_tables) - tables->table->reginfo.lock_type= tables->lock_type == TL_WRITE_DEFAULT ? - thd->update_lock_default : tables->lock_type; + { + if (tables->lock_type == TL_WRITE_DEFAULT) + tables->table->reginfo.lock_type= thd->update_lock_default; + else if (tables->table->s->tmp_table == NO_TMP_TABLE) + tables->table->reginfo.lock_type= tables->lock_type; + } tables->table->grant= tables->grant; process_view_routines: |