summaryrefslogtreecommitdiff
path: root/include/my_base.h
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2006-01-12 10:05:07 +0100
committerunknown <ingo@mysql.com>2006-01-12 10:05:07 +0100
commit085c97c19e65321955baf8b9c8481813b818709c (patch)
tree4131d01c9aab626adf6397d5022483456915872c /include/my_base.h
parent69f4b6a92b04f0de0c160e23173dec551f93be63 (diff)
downloadmariadb-git-085c97c19e65321955baf8b9c8481813b818709c.tar.gz
WL#1563 - Modify MySQL to support fast CREATE/DROP INDEX
NDB cluster is not fully supported. This will be added with WL 1892 (NDB Handler: Add support for CREATE/DROP INDEX). Some preparatory code for this is already present though. A change for the "duplicate key" error message is planned for another changeset. include/my_base.h: WL#1563 - Modify MySQL to support fast CREATE/DROP INDEX Defined a mask of flags which must be the same for two indexes if they should compare as compatible. Added an error number for a new drop index error message. mysql-test/r/key.result: WL#1563 - Modify MySQL to support fast CREATE/DROP INDEX The test result. mysql-test/t/key.test: WL#1563 - Modify MySQL to support fast CREATE/DROP INDEX The test case. sql/handler.cc: WL#1563 - Modify MySQL to support fast CREATE/DROP INDEX Prepared for a later change in an error message: Replace index number by index name for "duplicate key" error. Added handling for the new drop index error message. sql/handler.h: WL#1563 - Modify MySQL to support fast CREATE/DROP INDEX Added new flags and methods. Removed old flags and methods (from the last attempt). sql/share/errmsg.txt: WL#1563 - Modify MySQL to support fast CREATE/DROP INDEX Added a new error message for drop index. sql/sql_table.cc: WL#1563 - Modify MySQL to support fast CREATE/DROP INDEX Moved definitions to the top of the file. In mysql_prepare_table() allow an index to have the name "PRIMARY" if it has the key type "Key::PRIMARY". Added a parenthesis for readability. Removed old code from the last attempt. Some changes to compare_tables(): - Input parameter "List<Key> *key_list" is replaced by "KEY *key_info_buffer, uint key_count". - Output parameters added: "index_drop_buffer/index_drop_count" and "index_add_buffer/index_add_count". - Key comparison must now find matching keys in changed old and new key lists. - Key comparison of a key is easier now because both old and new keys are of type 'KEY'. Call mysql_prepare_table() before compare_tables(). The translated KEY structs are needed at some places now. Inserted a code segment for checking alter_table_flags(). Removed mysql_prepare_table() from the 'partition' branches (it is done above now). Removed a pair of unnecessary braces. Inserted a code segment for executing fast add/drop index. Made close of table dependent on whether it was opened. Prepared for NDB cluster support. Fixed commit to be called outside of LOCK_open.
Diffstat (limited to 'include/my_base.h')
-rw-r--r--include/my_base.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/my_base.h b/include/my_base.h
index 9b53ebffeb4..a9700639cb0 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -206,6 +206,11 @@ enum ha_base_keytype {
#define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */
#define HA_GENERATED_KEY 8192 /* Automaticly generated key */
+ /* The combination of the above can be used for key type comparison. */
+#define HA_KEYFLAG_MASK (HA_NOSAME | HA_PACK_KEY | HA_AUTO_KEY | \
+ HA_BINARY_PACK_KEY | HA_FULLTEXT | HA_UNIQUE_CHECK | \
+ HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY)
+
/* Automatic bits in key-flag */
#define HA_SPACE_PACK_USED 4 /* Test for if SPACE_PACK used */
@@ -349,8 +354,9 @@ enum ha_base_keytype {
#define HA_ERR_NO_PARTITION_FOUND 160 /* There's no partition in table for
given value */
#define HA_ERR_RBR_LOGGING_FAILED 161 /* Row-based binlogging of row failed */
+#define HA_ERR_DROP_INDEX_FK 162 /* Index needed in foreign key constr. */
-#define HA_ERR_LAST 161 /* Copy last error no */
+#define HA_ERR_LAST 162 /* Copy last error no */
/* Add error numbers before HA_ERR_LAST and change it accordingly. */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)