From 4ec6fe10e56de0cf9b4dbc649b8552ae39c2c500 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 7 Apr 2013 14:00:16 +0200 Subject: remove ULL() and LL(), because they're totally unnecessary and sometimes harmful (used with expressions) --- sql/handler.h | 86 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index c38dec198b9..6241f1ee774 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -2,7 +2,7 @@ #define HANDLER_INCLUDED /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. - Copyright (c) 2009-2011 Monty Program Ab + Copyright (c) 2009, 2013, Monty Program Ab. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -59,9 +59,9 @@ /* Bits in table_flags() to show what database can do */ -#define HA_NO_TRANSACTIONS (1 << 0) /* Doesn't support transactions */ -#define HA_PARTIAL_COLUMN_READ (1 << 1) /* read may not return all columns */ -#define HA_TABLE_SCAN_ON_INDEX (1 << 2) /* No separate data/index file */ +#define HA_NO_TRANSACTIONS (1ULL << 0) /* Doesn't support transactions */ +#define HA_PARTIAL_COLUMN_READ (1ULL << 1) /* read may not return all columns */ +#define HA_TABLE_SCAN_ON_INDEX (1ULL << 2) /* No separate data/index file */ /* The following should be set if the following is not true when scanning a table with rnd_next() @@ -70,37 +70,37 @@ If this flag is not set, filesort will do a position() call for each matched row to be able to find the row later. */ -#define HA_REC_NOT_IN_SEQ (1 << 3) -#define HA_CAN_GEOMETRY (1 << 4) +#define HA_REC_NOT_IN_SEQ (1ULL << 3) +#define HA_CAN_GEOMETRY (1ULL << 4) /* Reading keys in random order is as fast as reading keys in sort order (Used in records.cc to decide if we should use a record cache and by filesort to decide if we should sort key + data or key + pointer-to-row */ -#define HA_FAST_KEY_READ (1 << 5) +#define HA_FAST_KEY_READ (1ULL << 5) /* Set the following flag if we on delete should force all key to be read and on update read all keys that changes */ -#define HA_REQUIRES_KEY_COLUMNS_FOR_DELETE (1 << 6) -#define HA_NULL_IN_KEY (1 << 7) /* One can have keys with NULL */ -#define HA_DUPLICATE_POS (1 << 8) /* ha_position() gives dup row */ -#define HA_NO_BLOBS (1 << 9) /* Doesn't support blobs */ -#define HA_CAN_INDEX_BLOBS (1 << 10) -#define HA_AUTO_PART_KEY (1 << 11) /* auto-increment in multi-part key */ -#define HA_REQUIRE_PRIMARY_KEY (1 << 12) /* .. and can't create a hidden one */ -#define HA_STATS_RECORDS_IS_EXACT (1 << 13) /* stats.records is exact */ +#define HA_REQUIRES_KEY_COLUMNS_FOR_DELETE (1ULL << 6) +#define HA_NULL_IN_KEY (1ULL << 7) /* One can have keys with NULL */ +#define HA_DUPLICATE_POS (1ULL << 8) /* ha_position() gives dup row */ +#define HA_NO_BLOBS (1ULL << 9) /* Doesn't support blobs */ +#define HA_CAN_INDEX_BLOBS (1ULL << 10) +#define HA_AUTO_PART_KEY (1ULL << 11) /* auto-increment in multi-part key */ +#define HA_REQUIRE_PRIMARY_KEY (1ULL << 12) /* .. and can't create a hidden one */ +#define HA_STATS_RECORDS_IS_EXACT (1ULL << 13) /* stats.records is exact */ /* INSERT_DELAYED only works with handlers that uses MySQL internal table level locks */ -#define HA_CAN_INSERT_DELAYED (1 << 14) +#define HA_CAN_INSERT_DELAYED (1ULL << 14) /* If we get the primary key columns for free when we do an index read It also implies that we have to retrive the primary key when using position() and rnd_pos(). */ -#define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15) +#define HA_PRIMARY_KEY_IN_READ_INDEX (1ULL << 15) /* If HA_PRIMARY_KEY_REQUIRED_FOR_POSITION is set, it means that to position() uses a primary key given by the record argument. @@ -108,36 +108,36 @@ If not set, the position is returned as the current rows position regardless of what argument is given. */ -#define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1 << 16) -#define HA_CAN_RTREEKEYS (1 << 17) -#define HA_NOT_DELETE_WITH_CACHE (1 << 18) +#define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1ULL << 16) +#define HA_CAN_RTREEKEYS (1ULL << 17) +#define HA_NOT_DELETE_WITH_CACHE (1ULL << 18) /* The following is we need to a primary key to delete (and update) a row. If there is no primary key, all columns needs to be read on update and delete */ -#define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1 << 19) -#define HA_NO_PREFIX_CHAR_KEYS (1 << 20) -#define HA_CAN_FULLTEXT (1 << 21) -#define HA_CAN_SQL_HANDLER (1 << 22) -#define HA_NO_AUTO_INCREMENT (1 << 23) +#define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1ULL << 19) +#define HA_NO_PREFIX_CHAR_KEYS (1ULL << 20) +#define HA_CAN_FULLTEXT (1ULL << 21) +#define HA_CAN_SQL_HANDLER (1ULL << 22) +#define HA_NO_AUTO_INCREMENT (1ULL << 23) /* Has automatic checksums and uses the old checksum format */ -#define HA_HAS_OLD_CHECKSUM (1 << 24) +#define HA_HAS_OLD_CHECKSUM (1ULL << 24) /* Table data are stored in separate files (for lower_case_table_names) */ -#define HA_FILE_BASED (1 << 26) -#define HA_NO_VARCHAR (1 << 27) -#define HA_CAN_BIT_FIELD (1 << 28) /* supports bit fields */ -#define HA_NEED_READ_RANGE_BUFFER (1 << 29) /* for read_multi_range */ -#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30) -#define HA_NO_COPY_ON_ALTER (LL(1) << 31) -#define HA_HAS_RECORDS (LL(1) << 32) /* records() gives exact count*/ +#define HA_FILE_BASED (1ULL << 26) +#define HA_NO_VARCHAR (1ULL << 27) +#define HA_CAN_BIT_FIELD (1ULL << 28) /* supports bit fields */ +#define HA_NEED_READ_RANGE_BUFFER (1ULL << 29) /* for read_multi_range */ +#define HA_ANY_INDEX_MAY_BE_UNIQUE (1ULL << 30) +#define HA_NO_COPY_ON_ALTER (1ULL << 31) +#define HA_HAS_RECORDS (1ULL << 32) /* records() gives exact count*/ /* Has it's own method of binlog logging */ -#define HA_HAS_OWN_BINLOGGING (LL(1) << 33) +#define HA_HAS_OWN_BINLOGGING (1ULL << 33) /* Engine is capable of row-format and statement-format logging, respectively */ -#define HA_BINLOG_ROW_CAPABLE (LL(1) << 34) -#define HA_BINLOG_STMT_CAPABLE (LL(1) << 35) +#define HA_BINLOG_ROW_CAPABLE (1ULL << 34) +#define HA_BINLOG_STMT_CAPABLE (1ULL << 35) /* When a multiple key conflict happens in a REPLACE command mysql expects the conflicts to be reported in the ascending order of @@ -160,20 +160,20 @@ This flag helps the underlying SE to inform the server that the keys are not ordered. */ -#define HA_DUPLICATE_KEY_NOT_IN_ORDER (LL(1) << 36) +#define HA_DUPLICATE_KEY_NOT_IN_ORDER (1ULL << 36) /* Engine supports REPAIR TABLE. Used by CHECK TABLE FOR UPGRADE if an incompatible table is detected. If this flag is set, CHECK TABLE FOR UPGRADE will report ER_TABLE_NEEDS_UPGRADE, otherwise ER_TABLE_NEED_REBUILD. */ -#define HA_CAN_REPAIR (LL(1) << 37) +#define HA_CAN_REPAIR (1ULL << 37) /* Has automatic checksums and uses the new checksum format */ -#define HA_HAS_NEW_CHECKSUM (LL(1) << 38) -#define HA_CAN_VIRTUAL_COLUMNS (LL(1) << 39) -#define HA_MRR_CANT_SORT (LL(1) << 40) -#define HA_RECORD_MUST_BE_CLEAN_ON_WRITE (LL(1) << 41) +#define HA_HAS_NEW_CHECKSUM (1ULL << 38) +#define HA_CAN_VIRTUAL_COLUMNS (1ULL << 39) +#define HA_MRR_CANT_SORT (1ULL << 40) +#define HA_RECORD_MUST_BE_CLEAN_ON_WRITE (1ULL << 41) /* Table condition pushdown must be performed regardless of @@ -186,7 +186,7 @@ then the "query=..." condition must be always pushed down into storage engine. */ -#define HA_MUST_USE_TABLE_CONDITION_PUSHDOWN (LL(1) << 42) +#define HA_MUST_USE_TABLE_CONDITION_PUSHDOWN (1ULL << 42) /* Set of all binlog flags. Currently only contain the capabilities -- cgit v1.2.1 From ccc9238335daaa1ca269b651bf25845afa7cf166 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 7 Apr 2013 15:35:39 +0200 Subject: s/st_ha_create_information/HA_CREATE_INFO/ --- sql/handler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 6241f1ee774..7c8cc98b37c 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1284,7 +1284,7 @@ struct st_partition_iter; enum ha_choice { HA_CHOICE_UNDEF, HA_CHOICE_NO, HA_CHOICE_YES }; -typedef struct st_ha_create_information +struct HA_CREATE_INFO { CHARSET_INFO *table_charset, *default_table_charset; LEX_STRING connect_string; @@ -1324,7 +1324,7 @@ typedef struct st_ha_create_information ha_table_option_struct *option_struct; ///< structure with parsed table options ha_field_option_struct **fields_option_struct; ///< array of field option structures ha_index_option_struct **indexes_option_struct; ///< array of index option structures -} HA_CREATE_INFO; +}; typedef struct st_key_create_information -- cgit v1.2.1 From 94753d8b946aa8b04cc713377fdcd50f952f3231 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 7 Apr 2013 15:44:19 +0200 Subject: small cleanup - remove prehistoric DB_TYPE_xxx values --- sql/handler.h | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 7c8cc98b37c..2acec83d3ca 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -336,25 +336,23 @@ enum legacy_db_type { - DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1, - DB_TYPE_HASH,DB_TYPE_MISAM,DB_TYPE_PISAM, - DB_TYPE_RMS_ISAM, DB_TYPE_HEAP, DB_TYPE_ISAM, - DB_TYPE_MRG_ISAM, DB_TYPE_MYISAM, DB_TYPE_MRG_MYISAM, - DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB, - DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER, - DB_TYPE_EXAMPLE_DB, DB_TYPE_ARCHIVE_DB, DB_TYPE_CSV_DB, - DB_TYPE_FEDERATED_DB, - DB_TYPE_BLACKHOLE_DB, - DB_TYPE_PARTITION_DB, - DB_TYPE_BINLOG, - DB_TYPE_SOLID, - DB_TYPE_PBXT, - DB_TYPE_TABLE_FUNCTION, - DB_TYPE_MEMCACHE, - DB_TYPE_FALCON, - DB_TYPE_MARIA, - /** Performance schema engine. */ - DB_TYPE_PERFORMANCE_SCHEMA, + /* note these numerical values are fixed and can *not* be changed */ + DB_TYPE_UNKNOWN=0, + DB_TYPE_HEAP=6, + DB_TYPE_MYISAM=9, + DB_TYPE_MRG_MYISAM=10, + DB_TYPE_INNODB=12, + DB_TYPE_NDBCLUSTER=14, + DB_TYPE_EXAMPLE_DB=15, + DB_TYPE_ARCHIVE_DB=16, + DB_TYPE_CSV_DB=17, + DB_TYPE_FEDERATED_DB=18, + DB_TYPE_BLACKHOLE_DB=19, + DB_TYPE_PARTITION_DB=20, + DB_TYPE_BINLOG=21, + DB_TYPE_PBXT=23, + DB_TYPE_MARIA=27, + DB_TYPE_PERFORMANCE_SCHEMA=28, DB_TYPE_FIRST_DYNAMIC=42, DB_TYPE_DEFAULT=127 // Must be last }; -- cgit v1.2.1 From 09ece94fac5fc160e11e6bd46208e6c0be86e7e6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 7 Apr 2013 15:57:38 +0200 Subject: remove handlerton::find_files (new implementation is coming), and handlerton::table_exists_in_engine (new implementation is coming), and handlerton::license (redundant) --- sql/handler.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 2acec83d3ca..f6a10a84646 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1079,14 +1079,6 @@ struct handlerton const char *name, uchar **frmblob, size_t *frmlen); - int (*find_files)(handlerton *hton, THD *thd, - const char *db, - const char *path, - const char *wild, bool dir, List *files); - int (*table_exists_in_engine)(handlerton *hton, THD* thd, const char *db, - const char *name); - - uint32 license; /* Flag for Engine License */ /* Optional clauses in the CREATE/ALTER TABLE */ @@ -3041,9 +3033,6 @@ bool ha_check_if_table_exists(THD* thd, const char *db, const char *name, bool *exists); int ha_discover(THD* thd, const char* dbname, const char* name, uchar** frmblob, size_t* frmlen); -int ha_find_files(THD *thd,const char *db,const char *path, - const char *wild, bool dir, List* files); -int ha_table_exists_in_engine(THD* thd, const char* db, const char* name); /* key cache */ extern "C" int ha_init_key_cache(const char *name, KEY_CACHE *key_cache, void *); -- cgit v1.2.1 From 58e62d701e9d1c0a5ebb88f8a8779011c59ee735 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 7 Apr 2013 17:08:49 +0200 Subject: * move bas_ext from the handler to the handlerton * provide a default bas_ext value of the empty list --- sql/handler.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index f6a10a84646..43c5246c156 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1086,6 +1086,7 @@ struct handlerton ha_create_table_option *field_options; // these are specified per field ha_create_table_option *index_options; // these are specified per index + const char **tablefile_extensions; }; @@ -2416,7 +2417,10 @@ public: element - data file extention. This order is assumed by prepare_for_repair() when REPAIR TABLE ... USE_FRM is issued. */ - virtual const char **bas_ext() const =0; + const char **bas_ext() const + { + return ht->tablefile_extensions; + } virtual int get_default_no_partitions(HA_CREATE_INFO *create_info) { return 1;} -- cgit v1.2.1 From 03dfb2c1210f75e234b5571a40a9aa92cb1afa45 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 15:31:29 +0200 Subject: file-based table discovery for discovering storage engines also: * move few tests from archive/archive.test to archive/discover.test * fix (unintentionally) bug#34104, updated result files --- sql/handler.h | 74 +++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 17 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 43c5246c156..93edfb2296e 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1086,11 +1086,60 @@ struct handlerton ha_create_table_option *field_options; // these are specified per field ha_create_table_option *index_options; // these are specified per index - const char **tablefile_extensions; + /** + The list of extensions of files created for a single table in the + database directory (datadir/db_name/). + + Used by open_table_error(), by the default rename_table and delete_table + handler methods, and by the default discovery implementation. + + For engines that have more than one file name extentions (separate + metadata, index, and/or data files), the order of elements is relevant. + First element of engine file name extentions array should be metadata + file extention. This is implied by the open_table_error() + and the default discovery implementation. + + Second element - data file extention. This is implied + assumed by REPAIR TABLE ... USE_FRM implementation. + */ + const char **tablefile_extensions; // by default - empty list + + /********************************************************************* + Table discovery API. + It allows the server to "discover" tables that exist in the storage + engine, without user issuing an explicit CREATE TABLE statement. + **********************************************************************/ + + /* + The discover_table_names method tells the server + about all tables in the specified database that the engine + knows about. Tables (or file names of tables) are added to + the provided discovered_list collector object using + add_table() or add_file() methods. + */ + class discovered_list + { + public: + virtual bool add_table(const char *tname, size_t tlen) = 0; + virtual bool add_file(const char *fname) = 0; + protected: virtual ~discovered_list() {} + }; + + /* + By default (if not implemented by the engine, but the discovery_table() is + implemented) it will perform a file-based discovery: + + - if tablefile_extensions[0] is not null, this will discovers all tables + with the tablefile_extensions[0] extension. + + Returns 0 on success and 1 on error. + */ + int (*discover_table_names)(handlerton *hton, LEX_STRING *db, MY_DIR *dir, + discovered_list *result); }; -inline LEX_STRING *hton_name(const handlerton *hton) +static inline LEX_STRING *hton_name(const handlerton *hton) { return &(hton2plugin[hton->slot]->name); } @@ -2406,21 +2455,7 @@ public: virtual void free_foreign_key_create_info(char* str) {} /** The following can be called without an open handler */ const char *table_type() const { return hton_name(ht)->str; } - /** - If frm_error() is called then we will use this to find out what file - extentions exist for the storage engine. This is also used by the default - rename_table and delete_table method in handler.cc. - - For engines that have two file name extentions (separate meta/index file - and data file), the order of elements is relevant. First element of engine - file name extentions array should be meta/index file extention. Second - element - data file extention. This order is assumed by - prepare_for_repair() when REPAIR TABLE ... USE_FRM is issued. - */ - const char **bas_ext() const - { - return ht->tablefile_extensions; - } + const char **bas_ext() const { return ht->tablefile_extensions; } virtual int get_default_no_partitions(HA_CREATE_INFO *create_info) { return 1;} @@ -3037,6 +3072,11 @@ bool ha_check_if_table_exists(THD* thd, const char *db, const char *name, bool *exists); int ha_discover(THD* thd, const char* dbname, const char* name, uchar** frmblob, size_t* frmlen); +int ha_discover_table_names(THD *thd, LEX_STRING *db, MY_DIR *dirp, + handlerton::discovered_list *result); +#ifdef MYSQL_SERVER +extern volatile int32 engines_with_discover_table_names; +#endif /* key cache */ extern "C" int ha_init_key_cache(const char *name, KEY_CACHE *key_cache, void *); -- cgit v1.2.1 From b0a5dd73fa7d9f239661cc1683422f14e69c53eb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 15:35:15 +0200 Subject: * remove ha_check_if_table_exists() and get_table_share_with_discover(). * rename check_if_table_exists() -> table_exists() and remove unneeded arguments --- sql/handler.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 93edfb2296e..79e757c5649 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -3068,8 +3068,6 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat); /* discovery */ int ha_create_table_from_engine(THD* thd, const char *db, const char *name); -bool ha_check_if_table_exists(THD* thd, const char *db, const char *name, - bool *exists); int ha_discover(THD* thd, const char* dbname, const char* name, uchar** frmblob, size_t* frmlen); int ha_discover_table_names(THD *thd, LEX_STRING *db, MY_DIR *dirp, -- cgit v1.2.1 From 6a839ff40d1be946b4391eb7a316b0404e1cd82b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 15:35:57 +0200 Subject: handlerton::discover_table_existence() method --- sql/handler.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 79e757c5649..ee1d54c3253 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1136,6 +1136,27 @@ struct handlerton */ int (*discover_table_names)(handlerton *hton, LEX_STRING *db, MY_DIR *dir, discovered_list *result); + + /* + This is a method that allows to server to check if a table exists without + an overhead of the complete discovery. + + By default (if not implemented by the engine, but the discovery_table() is + implemented) it will try to perform a file-based discovery: + + - if tablefile_extensions[0] is not null this will look for a file name + with the tablefile_extensions[0] extension. + + - if tablefile_extensions[0] is null, this will resort to discover_table(). + + Note that resorting to discover_table() is slow and the engine + should probably implement its own discover_table_existence() method, + if its tablefile_extensions[0] is null. + + Returns 1 if the table exists and 0 if it does not. + */ + int (*discover_table_existence)(handlerton *hton, const char *db, + const char *table_name); }; @@ -3072,6 +3093,8 @@ int ha_discover(THD* thd, const char* dbname, const char* name, uchar** frmblob, size_t* frmlen); int ha_discover_table_names(THD *thd, LEX_STRING *db, MY_DIR *dirp, handlerton::discovered_list *result); +bool ha_table_exists(THD *thd, const char *db, const char *table_name); + #ifdef MYSQL_SERVER extern volatile int32 engines_with_discover_table_names; #endif -- cgit v1.2.1 From f532653c2920490ac15ad70db0f2f1aaaacb92fe Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 15:41:57 +0200 Subject: remove ha_create_table_from_engine() replace enum read_frm_op with a bitmap flags. remove always-unused 'error' argument of get_table_share --- sql/handler.h | 1 - 1 file changed, 1 deletion(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index ee1d54c3253..2f899fdaa19 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -3088,7 +3088,6 @@ int ha_delete_table(THD *thd, handlerton *db_type, const char *path, bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat); /* discovery */ -int ha_create_table_from_engine(THD* thd, const char *db, const char *name); int ha_discover(THD* thd, const char* dbname, const char* name, uchar** frmblob, size_t* frmlen); int ha_discover_table_names(THD *thd, LEX_STRING *db, MY_DIR *dirp, -- cgit v1.2.1 From e5a323e107767ceb5106b85d077d4ac9d2d37778 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 15:45:31 +0200 Subject: single table discovery: handlerton::discover_table() method. fixes for need_full_discover_for_existence mode --- sql/handler.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 2f899fdaa19..2093a3d1605 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1075,10 +1075,6 @@ struct handlerton enum handler_create_iterator_result (*create_iterator)(handlerton *hton, enum handler_iterator_type type, struct handler_iterator *fill_this_in); - int (*discover)(handlerton *hton, THD* thd, const char *db, - const char *name, - uchar **frmblob, - size_t *frmlen); /* Optional clauses in the CREATE/ALTER TABLE */ @@ -1110,6 +1106,20 @@ struct handlerton engine, without user issuing an explicit CREATE TABLE statement. **********************************************************************/ + /* + This method is required for any engine that supports automatic table + discovery, there is no default implementation. + + Given a TABLE_SHARE discover_table() fills it in with a correct table + structure using one of the TABLE_SHARE::init_from_* methods. + + Returns HA_ERR_NO_SUCH_TABLE if the table did not exist in the engine, + zero if the table was discovered successfully, or any other + HA_ERR_* error code as appropriate if the table existed, but the + discovery failed. + */ + int (*discover_table)(handlerton *hton, THD* thd, TABLE_SHARE *share); + /* The discover_table_names method tells the server about all tables in the specified database that the engine @@ -1157,6 +1167,7 @@ struct handlerton */ int (*discover_table_existence)(handlerton *hton, const char *db, const char *table_name); + }; @@ -3088,8 +3099,7 @@ int ha_delete_table(THD *thd, handlerton *db_type, const char *path, bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat); /* discovery */ -int ha_discover(THD* thd, const char* dbname, const char* name, - uchar** frmblob, size_t* frmlen); +int ha_discover_table(THD *thd, TABLE_SHARE *share); int ha_discover_table_names(THD *thd, LEX_STRING *db, MY_DIR *dirp, handlerton::discovered_list *result); bool ha_table_exists(THD *thd, const char *db, const char *table_name); -- cgit v1.2.1 From a489ae89b9ffe427963745f13c44e1e4d67494f4 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 15:47:25 +0200 Subject: fix mysql_rm_table_no_locks() not to use dd_frm_type, because the frm file may not exist (the table exists only in the engine). --- sql/handler.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 2093a3d1605..02e273204e2 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -3073,6 +3073,8 @@ static inline bool ha_storage_engine_is_enabled(const handlerton *db_type) (db_type->state == SHOW_OPTION_YES) : FALSE; } +#define view_pseudo_hton ((handlerton *)1) + /* basic stuff */ int ha_init_errors(void); int ha_init(void); @@ -3102,7 +3104,8 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat); int ha_discover_table(THD *thd, TABLE_SHARE *share); int ha_discover_table_names(THD *thd, LEX_STRING *db, MY_DIR *dirp, handlerton::discovered_list *result); -bool ha_table_exists(THD *thd, const char *db, const char *table_name); +bool ha_table_exists(THD *thd, const char *db, const char *table_name, + handlerton **hton= 0); #ifdef MYSQL_SERVER extern volatile int32 engines_with_discover_table_names; -- cgit v1.2.1 From 5d364e53cb8545790e1b5f37489a2180b78a43cc Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 15:49:00 +0200 Subject: handlerton::discover_table_names() can not discover only "unknown" tables. Duplicates are possible - deal with them. --- sql/handler.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 02e273204e2..7b3be833b33 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -31,6 +31,7 @@ #include "thr_lock.h" /* thr_lock_type, THR_LOCK_DATA */ #include "sql_cache.h" #include "structs.h" /* SHOW_COMP_OPTION */ +#include "sql_array.h" /* Dynamic_array<> */ #include #include @@ -3101,14 +3102,30 @@ int ha_delete_table(THD *thd, handlerton *db_type, const char *path, bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat); /* discovery */ +#ifdef MYSQL_SERVER +class Discovered_table_list: public handlerton::discovered_list +{ + THD *thd; + const char *wild, *wend; +public: + Dynamic_array *tables; + + Discovered_table_list(THD *thd_arg, Dynamic_array *tables_arg, + const LEX_STRING *wild_arg); + ~Discovered_table_list() {} + + bool add_table(const char *tname, size_t tlen); + bool add_file(const char *fname); + + void sort(); + void remove_duplicates(); // assumes that the list is sorted +}; + int ha_discover_table(THD *thd, TABLE_SHARE *share); int ha_discover_table_names(THD *thd, LEX_STRING *db, MY_DIR *dirp, - handlerton::discovered_list *result); + Discovered_table_list *result); bool ha_table_exists(THD *thd, const char *db, const char *table_name, handlerton **hton= 0); - -#ifdef MYSQL_SERVER -extern volatile int32 engines_with_discover_table_names; #endif /* key cache */ -- cgit v1.2.1 From 07b252391811d20a6ddd49bac9492257048e8ed6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 15:49:13 +0200 Subject: rename a handler method to more precisely reflect what kind of a hack it does --- sql/handler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 7b3be833b33..ea928afa9ed 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -2063,7 +2063,7 @@ public: int ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info); - int ha_create_handler_files(const char *name, const char *old_name, + int ha_create_partitioning_metadata(const char *name, const char *old_name, int action_flag, HA_CREATE_INFO *info); int ha_change_partitions(HA_CREATE_INFO *create_info, @@ -3003,7 +3003,7 @@ private: virtual void drop_table(const char *name); virtual int create(const char *name, TABLE *form, HA_CREATE_INFO *info)=0; - virtual int create_handler_files(const char *name, const char *old_name, + virtual int create_partitioning_metadata(const char *name, const char *old_name, int action_flag, HA_CREATE_INFO *info) { return FALSE; } -- cgit v1.2.1 From 5f69c8a59480569eb275169630f91763fceacc0f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 15:49:39 +0200 Subject: ha_create_table: remove unused argument --- sql/handler.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index ea928afa9ed..11221fa3b10 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -3093,8 +3093,7 @@ void ha_checkpoint_state(bool disable); void ha_commit_checkpoint_request(void *cookie, void (*pre_hook)(void *)); int ha_create_table(THD *thd, const char *path, const char *db, const char *table_name, - HA_CREATE_INFO *create_info, - bool update_create_info); + HA_CREATE_INFO *create_info); int ha_delete_table(THD *thd, handlerton *db_type, const char *path, const char *db, const char *alias, bool generate_warning); -- cgit v1.2.1 From e06cb31719ce31fb1cd7944d1de86d4de9e3eca6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 15:57:09 +0200 Subject: CREATE TABLE and frm-less discovering engines. Now CREATE TABLE does not write the frm file on disk, if the engine can discover it --- sql/handler.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 11221fa3b10..8e4d59e7f7f 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1397,6 +1397,8 @@ struct HA_CREATE_INFO ha_table_option_struct *option_struct; ///< structure with parsed table options ha_field_option_struct **fields_option_struct; ///< array of field option structures ha_index_option_struct **indexes_option_struct; ///< array of index option structures + + bool tmp_table() { return options & HA_LEX_CREATE_TMP_TABLE; } }; @@ -3093,7 +3095,7 @@ void ha_checkpoint_state(bool disable); void ha_commit_checkpoint_request(void *cookie, void (*pre_hook)(void *)); int ha_create_table(THD *thd, const char *path, const char *db, const char *table_name, - HA_CREATE_INFO *create_info); + HA_CREATE_INFO *create_info, LEX_CUSTRING *frm); int ha_delete_table(THD *thd, handlerton *db_type, const char *path, const char *db, const char *alias, bool generate_warning); -- cgit v1.2.1 From 02c712aa546df8d6e9c285e6adc95309925673e3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 16:18:33 +0200 Subject: * frm extra2 segment. * persistent table versions in the extra2 * ha_archive::frm_compare using TABLE_SHARE::tabledef_version * distinguish between "important" and "optional" extra2 frm values * write engine-defined attributes (aka "table options") to extra2, not to extra, but still read from the old location, if they're found there. --- sql/handler.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 8e4d59e7f7f..edbff4b68e1 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1360,6 +1360,7 @@ enum ha_choice { HA_CHOICE_UNDEF, HA_CHOICE_NO, HA_CHOICE_YES }; struct HA_CREATE_INFO { CHARSET_INFO *table_charset, *default_table_charset; + LEX_CUSTRING tabledef_version; LEX_STRING connect_string; const char *password, *tablespace; LEX_STRING comment; @@ -1393,6 +1394,7 @@ struct HA_CREATE_INFO enum ha_storage_media storage_media; ///< DEFAULT, DISK or MEMORY enum ha_choice page_checksum; ///< If we have page_checksums engine_option_value *option_list; ///< list of table create options + /* the following three are only for ALTER TABLE, check_if_incompatible_data() */ ha_table_option_struct *option_struct; ///< structure with parsed table options ha_field_option_struct **fields_option_struct; ///< array of field option structures -- cgit v1.2.1 From a53200d4e7e1377784034d676c609d9b533e9fb7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 16:19:01 +0200 Subject: remove HA_CREATE_INFO::frm_only - it's internal server flag, not part of the SE API, and, again, mutually exclusive with C_ORDINARY_CREATE and C_CREATE_SELECT. --- sql/handler.h | 1 - 1 file changed, 1 deletion(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index edbff4b68e1..d2dbe169101 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1389,7 +1389,6 @@ struct HA_CREATE_INFO uint merge_insert_method; uint extra_size; /* length of extra data segment */ enum ha_choice transactional; - bool frm_only; ///< 1 if no ha_create_table() bool varchar; ///< 1 if table has a VARCHAR enum ha_storage_media storage_media; ///< DEFAULT, DISK or MEMORY enum ha_choice page_checksum; ///< If we have page_checksums -- cgit v1.2.1 From db7809e8172997a0e713a907f29072cc7ff750b4 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 16:19:05 +0200 Subject: dead code, remove unused argument --- sql/handler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index d2dbe169101..3424fa22edf 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -2067,7 +2067,7 @@ public: int ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info); int ha_create_partitioning_metadata(const char *name, const char *old_name, - int action_flag, HA_CREATE_INFO *info); + int action_flag); int ha_change_partitions(HA_CREATE_INFO *create_info, const char *path, @@ -3007,7 +3007,7 @@ private: virtual int create(const char *name, TABLE *form, HA_CREATE_INFO *info)=0; virtual int create_partitioning_metadata(const char *name, const char *old_name, - int action_flag, HA_CREATE_INFO *info) + int action_flag) { return FALSE; } virtual int change_partitions(HA_CREATE_INFO *create_info, -- cgit v1.2.1 From 32ee15d851f3099d401b28321a1ae46dd36ef8ef Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 16:19:14 +0200 Subject: Assisted discovery --- sql/handler.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 3424fa22edf..2290b8f37fd 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -634,6 +634,7 @@ enum enum_schema_tables }; struct TABLE_SHARE; +struct HA_CREATE_INFO; struct st_foreign_key_info; typedef struct st_foreign_key_info FOREIGN_KEY_INFO; typedef bool (stat_print_fn)(THD *thd, const char *type, uint type_len, @@ -1169,6 +1170,25 @@ struct handlerton int (*discover_table_existence)(handlerton *hton, const char *db, const char *table_name); + /* + This is the assisted table discovery method. Unlike the fully + automatic discovery as above, here a user is expected to issue an + explicit CREATE TABLE with the appropriate table attributes to + "assist" the discovery of a table. But this "discovering" CREATE TABLE + statement will not specify the table structure - the engine discovers + it using this method. For example, FederatedX uses it in + + CREATE TABLE t1 ENGINE=FEDERATED CONNECTION="mysql://foo/bar/t1"; + + Given a TABLE_SHARE discover_table_structure() fills it in with a correct + table structure using one of the TABLE_SHARE::init_from_* methods. + + Assisted discovery works independently from the automatic discover. + An engine is allowed to support only assisted discovery and not + support automatic one. Or vice versa. + */ + int (*discover_table_structure)(handlerton *hton, THD* thd, + TABLE_SHARE *share, HA_CREATE_INFO *info); }; -- cgit v1.2.1 From 5f293dd694f9b1b4a0bdf73bb6ae80cda70f21d4 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 23:27:24 +0200 Subject: MDEV-4022 table attributes with sysvar as a default value --- sql/handler.h | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 2290b8f37fd..12f6b8808b3 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -714,22 +714,26 @@ struct ha_index_option_struct; enum ha_option_type { HA_OPTION_TYPE_ULL, /* unsigned long long */ HA_OPTION_TYPE_STRING, /* char * */ HA_OPTION_TYPE_ENUM, /* uint */ - HA_OPTION_TYPE_BOOL}; /* bool */ + HA_OPTION_TYPE_BOOL, /* bool */ + HA_OPTION_TYPE_SYSVAR};/* type of the sysval */ #define HA_xOPTION_NUMBER(name, struc, field, def, min, max, blk_siz) \ { HA_OPTION_TYPE_ULL, name, sizeof(name)-1, \ - offsetof(struc, field), def, min, max, blk_siz, 0 } + offsetof(struc, field), def, min, max, blk_siz, 0, 0 } #define HA_xOPTION_STRING(name, struc, field) \ { HA_OPTION_TYPE_STRING, name, sizeof(name)-1, \ - offsetof(struc, field), 0, 0, 0, 0, 0 } + offsetof(struc, field), 0, 0, 0, 0, 0, 0} #define HA_xOPTION_ENUM(name, struc, field, values, def) \ { HA_OPTION_TYPE_ENUM, name, sizeof(name)-1, \ offsetof(struc, field), def, 0, \ - sizeof(values)-1, 0, values } + sizeof(values)-1, 0, values, 0 } #define HA_xOPTION_BOOL(name, struc, field, def) \ { HA_OPTION_TYPE_BOOL, name, sizeof(name)-1, \ - offsetof(struc, field), def, 0, 1, 0, 0 } -#define HA_xOPTION_END { HA_OPTION_TYPE_ULL, 0, 0, 0, 0, 0, 0, 0, 0 } + offsetof(struc, field), def, 0, 1, 0, 0, 0 } +#define HA_xOPTION_SYSVAR(name, struc, field, sysvar) \ + { HA_OPTION_TYPE_SYSVAR, name, sizeof(name)-1, \ + offsetof(struc, field), 0, 0, 0, 0, 0, MYSQL_SYSVAR(sysvar) } +#define HA_xOPTION_END { HA_OPTION_TYPE_ULL, 0, 0, 0, 0, 0, 0, 0, 0, 0 } #define HA_TOPTION_NUMBER(name, field, def, min, max, blk_siz) \ HA_xOPTION_NUMBER(name, ha_table_option_struct, field, def, min, max, blk_siz) @@ -739,6 +743,8 @@ enum ha_option_type { HA_OPTION_TYPE_ULL, /* unsigned long long */ HA_xOPTION_ENUM(name, ha_table_option_struct, field, values, def) #define HA_TOPTION_BOOL(name, field, def) \ HA_xOPTION_BOOL(name, ha_table_option_struct, field, def) +#define HA_TOPTION_SYSVAR(name, field, sysvar) \ + HA_xOPTION_SYSVAR(name, ha_table_option_struct, field, sysvar) #define HA_TOPTION_END HA_xOPTION_END #define HA_FOPTION_NUMBER(name, field, def, min, max, blk_siz) \ @@ -749,6 +755,8 @@ enum ha_option_type { HA_OPTION_TYPE_ULL, /* unsigned long long */ HA_xOPTION_ENUM(name, ha_field_option_struct, field, values, def) #define HA_FOPTION_BOOL(name, field, def) \ HA_xOPTION_BOOL(name, ha_field_option_struct, field, def) +#define HA_FOPTION_SYSVAR(name, field, sysvar) \ + HA_xOPTION_SYSVAR(name, ha_field_option_struct, field, sysvar) #define HA_FOPTION_END HA_xOPTION_END #define HA_IOPTION_NUMBER(name, field, def, min, max, blk_siz) \ @@ -759,6 +767,8 @@ enum ha_option_type { HA_OPTION_TYPE_ULL, /* unsigned long long */ HA_xOPTION_ENUM(name, ha_index_option_struct, field, values, def) #define HA_IOPTION_BOOL(name, field, values, def) \ HA_xOPTION_BOOL(name, ha_index_option_struct, field, values, def) +#define HA_IOPTION_SYSVAR(name, field, sysvar) \ + HA_xOPTION_SYSVAR(name, ha_index_option_struct, field, sysvar) #define HA_IOPTION_END HA_xOPTION_END typedef struct st_ha_create_table_option { @@ -769,6 +779,7 @@ typedef struct st_ha_create_table_option { ulonglong def_value; ulonglong min_value, max_value, block_size; const char *values; + struct st_mysql_sys_var *var; } ha_create_table_option; enum handler_iterator_type @@ -1197,6 +1208,11 @@ static inline LEX_STRING *hton_name(const handlerton *hton) return &(hton2plugin[hton->slot]->name); } +static inline sys_var *find_hton_sysvar(handlerton *hton, st_mysql_sys_var *var) +{ + return find_plugin_sysvar(hton2plugin[hton->slot], var); +} + /* Possible flags of a handlerton (there can be 32 of them) */ #define HTON_NO_FLAGS 0 -- cgit v1.2.1 From c7eead7a965b33fbad5099c927d2bb0723725bf3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 23:27:29 +0200 Subject: MDEV-3807 show plugins soname 'xxx' and INFORMATION_SCHEMA.ALL_PLUGINS table with condition pushdown for I_S.ALL_PLUGINS and a new status variable to cound successful dlopen's --- sql/handler.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 12f6b8808b3..18639b6a8a4 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -610,6 +610,7 @@ enum enum_schema_tables SCH_PARAMETERS, SCH_PARTITIONS, SCH_PLUGINS, + SCH_ALL_PLUGINS, SCH_PROCESSLIST, SCH_PROFILES, SCH_REFERENTIAL_CONSTRAINTS, -- cgit v1.2.1 From 821db3801d443f5b7640921da9a6d15496649803 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 15 Apr 2013 18:47:47 +0200 Subject: remove numerous #ifdef HAVE_PSI_TABLE_INTERFACE simplify ha_table_share_psi() --- sql/handler.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 44d86e5ec97..1b2ae21c05a 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -36,6 +36,7 @@ #include #include #include +#include #if MAX_KEY > 128 #error MAX_KEY is too large. Values up to 128 are supported. @@ -2907,34 +2908,29 @@ protected: /** Acquire the instrumented table information from a table share. - @param share a table share @return an instrumented table share, or NULL. */ - PSI_table_share *ha_table_share_psi(const TABLE_SHARE *share) const; + PSI_table_share *ha_table_share_psi() const; inline void psi_open() { DBUG_ASSERT(m_psi == NULL); DBUG_ASSERT(table_share != NULL); -#ifdef HAVE_PSI_INTERFACE if (PSI_server) { - PSI_table_share *share_psi= ha_table_share_psi(table_share); + PSI_table_share *share_psi= ha_table_share_psi(); if (share_psi) - m_psi= PSI_server->open_table(share_psi, this); + m_psi= PSI_CALL_open_table(share_psi, this); } -#endif } inline void psi_close() { -#ifdef HAVE_PSI_INTERFACE if (PSI_server && m_psi) { - PSI_server->close_table(m_psi); + PSI_CALL_close_table(m_psi); m_psi= NULL; /* instrumentation handle, invalid after close_table() */ } -#endif DBUG_ASSERT(m_psi == NULL); } -- cgit v1.2.1 From f398ced7f05e64b0f2bdb8e0a70de907aff9e1eb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 16 Apr 2013 18:25:36 +0200 Subject: don't compare table names to detect temporary tables (also fixes a bug with unaccounted table names like #sql-123, see drop and alter_table tests) --- sql/handler.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 1b2ae21c05a..397d273c60d 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -320,6 +320,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_CREATE_TMP_ALTER 8 #define HA_MAX_REC_LENGTH 65535 /* Table caching type */ @@ -1437,7 +1438,7 @@ struct HA_CREATE_INFO const char *alias; ulonglong max_rows,min_rows; ulonglong auto_increment_value; - ulong table_options; + ulong table_options; ///< HA_OPTION_ values ulong avg_row_length; ulong used_fields; ulong key_block_size; -- cgit v1.2.1