summaryrefslogtreecommitdiff
path: root/sql/handler.h
diff options
context:
space:
mode:
authordlenev@mockturtle.local <>2007-05-23 15:22:13 +0400
committerdlenev@mockturtle.local <>2007-05-23 15:22:13 +0400
commitc07b3670d714db6429dc45486f7a71b230ae152d (patch)
tree03812138feda644bf3f4473b2cb4c51f59b88027 /sql/handler.h
parent1016aa36ec5335e1b56a3cbf7701afc355ada6a6 (diff)
downloadmariadb-git-c07b3670d714db6429dc45486f7a71b230ae152d.tar.gz
5.0 version of fix for:
Bug #23667 "CREATE TABLE LIKE is not isolated from alteration by other connections" Bug #18950 "CREATE TABLE LIKE does not obtain LOCK_open" As well as: Bug #25578 "CREATE TABLE LIKE does not require any privileges on source table". The first and the second bugs resulted in various errors and wrong binary log order when one tried to execute concurrently CREATE TABLE LIKE statement and DDL statements on source table or DML/DDL statements on its target table. The problem was caused by incomplete protection/table-locking against concurrent statements implemented in mysql_create_like_table() routine. We solve it by simply implementing such protection in proper way (see comment for sql_table.cc for details). The third bug allowed user who didn't have any privileges on table create its copy and therefore circumvent privilege check for SHOW CREATE TABLE. This patch solves this problem by adding privilege check, which was missing. Finally it also removes some duplicated code from mysql_create_like_table(). Note that, altough tests covering concurrency-related aspects of CREATE TABLE LIKE behaviour will only be introduced in 5.1, they were run manually for this patch as well.
Diffstat (limited to 'sql/handler.h')
-rw-r--r--sql/handler.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/handler.h b/sql/handler.h
index 9863d541b5f..a59b7a09740 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -162,6 +162,7 @@
#define HA_LEX_CREATE_TMP_TABLE 1
#define HA_LEX_CREATE_IF_NOT_EXISTS 2
+#define HA_LEX_CREATE_TABLE_LIKE 4
#define HA_OPTION_NO_CHECKSUM (1L << 17)
#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18)
#define HA_MAX_REC_LENGTH 65535