diff options
32 files changed, 57 insertions, 34 deletions
diff --git a/include/mysqld_error.h b/include/mysqld_error.h index cbdf0efb122..dabd1b869c8 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -214,4 +214,5 @@ #define ER_NO_PERMISSON_TO_CREATE_USER 1211 #define ER_UNION_TABLES_IN_DIFFERENT_DIR 1212 #define ER_LOCK_DEADLOCK 1213 -#define ER_ERROR_MESSAGES 214 +#define ER_TABLE_CANT_HANDLE_FULLTEXT 1214 +#define ER_ERROR_MESSAGES 215 diff --git a/libmysql/violite.c b/libmysql/violite.c index 721e6c8d81c..932861b10c2 100644 --- a/libmysql/violite.c +++ b/libmysql/violite.c @@ -39,7 +39,7 @@ #include <sys/ioctl.h> #endif -#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) +#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__FreeBSD__) #include <netinet/ip.h> #if !defined(alpha_linux_port) #include <netinet/tcp.h> diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h index cc193aba485..561e06229fa 100644 --- a/sql/ha_berkeley.h +++ b/sql/ha_berkeley.h @@ -90,7 +90,7 @@ class ha_berkeley: public handler HA_REC_NOT_IN_SEQ | HA_KEYPOS_TO_RNDPOS | HA_READ_ORDER | HA_LASTKEY_ORDER | HA_LONGLONG_KEYS | HA_NULL_KEY | HA_HAVE_KEY_READ_ONLY | - HA_BLOB_KEY | HA_NOT_EXACT_COUNT | + HA_BLOB_KEY | HA_NOT_EXACT_COUNT | HA_NO_FULLTEXT_KEY | HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE | HA_AUTO_PART_KEY), changed_rows(0),last_dup_key((uint) -1),version(0),using_ignore(0) diff --git a/sql/ha_heap.h b/sql/ha_heap.h index 1a6e8d9393c..6b7e9c6c626 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -33,9 +33,9 @@ class ha_heap: public handler const char *table_type() const { return "HEAP"; } const char **bas_ext() const; ulong option_flag() const - { return (HA_READ_RND_SAME | HA_NO_INDEX | HA_ONLY_WHOLE_INDEX | + { return (HA_READ_RND_SAME | HA_NO_INDEX | HA_ONLY_WHOLE_INDEX | HA_WRONG_ASCII_ORDER | HA_KEYPOS_TO_RNDPOS | HA_NO_BLOBS | - HA_REC_NOT_IN_SEQ); } + HA_REC_NOT_IN_SEQ | HA_NO_FULLTEXT_KEY); } uint max_record_length() const { return HA_MAX_REC_LENGTH; } uint max_keys() const { return MAX_KEY; } uint max_key_parts() const { return MAX_REF_PARTS; } diff --git a/sql/ha_innobase.h b/sql/ha_innobase.h index daa987dd757..923968aec93 100644 --- a/sql/ha_innobase.h +++ b/sql/ha_innobase.h @@ -79,7 +79,7 @@ class ha_innobase: public handler HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER | HA_HAVE_KEY_READ_ONLY | HA_READ_NOT_EXACT_KEY | HA_LONGLONG_KEYS | HA_NULL_KEY | - HA_NOT_EXACT_COUNT | + HA_NOT_EXACT_COUNT | HA_NO_FULLTEXT_KEY | HA_NO_WRITE_DELAYED | HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE | diff --git a/sql/ha_isam.h b/sql/ha_isam.h index b255e8ba87f..5e01edcf889 100644 --- a/sql/ha_isam.h +++ b/sql/ha_isam.h @@ -30,11 +30,11 @@ class ha_isam: public handler public: ha_isam(TABLE *table): handler(table), file(0), - int_option_flag(HA_READ_NEXT+HA_READ_PREV+HA_READ_RND_SAME+ - HA_KEYPOS_TO_RNDPOS+ HA_READ_ORDER+ HA_LASTKEY_ORDER+ - HA_HAVE_KEY_READ_ONLY+HA_READ_NOT_EXACT_KEY+ - HA_LONGLONG_KEYS+HA_KEY_READ_WRONG_STR + HA_DUPP_POS + - HA_NOT_DELETE_WITH_CACHE) + int_option_flag(HA_READ_NEXT | HA_READ_PREV | HA_READ_RND_SAME | + HA_KEYPOS_TO_RNDPOS | HA_READ_ORDER | HA_LASTKEY_ORDER | + HA_HAVE_KEY_READ_ONLY | HA_READ_NOT_EXACT_KEY | + HA_LONGLONG_KEYS | HA_KEY_READ_WRONG_STR | HA_DUPP_POS | + HA_NOT_DELETE_WITH_CACHE | HA_NO_FULLTEXT_KEY) {} ~ha_isam() {} const char *table_type() const { return "ISAM"; } diff --git a/sql/ha_isammrg.h b/sql/ha_isammrg.h index edced83d85d..c8eb7dd9f69 100644 --- a/sql/ha_isammrg.h +++ b/sql/ha_isammrg.h @@ -32,7 +32,8 @@ class ha_isammrg: public handler ~ha_isammrg() {} const char *table_type() const { return "MRG_ISAM"; } const char **bas_ext() const; - ulong option_flag() const { return HA_READ_RND_SAME+HA_KEYPOS_TO_RNDPOS+HA_REC_NOT_IN_SEQ;} + ulong option_flag() const { return HA_READ_RND_SAME | HA_KEYPOS_TO_RNDPOS + | HA_REC_NOT_IN_SEQ | HA_NO_FULLTEXT_KEY;} uint max_record_length() const { return HA_MAX_REC_LENGTH; } uint max_keys() const { return 0; } uint max_key_parts() const { return 0; } diff --git a/sql/ha_myisammrg.h b/sql/ha_myisammrg.h index 089d9ca5107..b97baa0703c 100644 --- a/sql/ha_myisammrg.h +++ b/sql/ha_myisammrg.h @@ -33,11 +33,11 @@ class ha_myisammrg: public handler const char *table_type() const { return "MRG_MyISAM"; } const char **bas_ext() const; ulong option_flag() const - { return (HA_REC_NOT_IN_SEQ | HA_READ_NEXT | - HA_READ_PREV | HA_READ_RND_SAME | - HA_HAVE_KEY_READ_ONLY | - HA_KEYPOS_TO_RNDPOS | HA_READ_ORDER | - HA_LASTKEY_ORDER | HA_READ_NOT_EXACT_KEY | + { return (HA_REC_NOT_IN_SEQ | HA_READ_NEXT | + HA_READ_PREV | HA_READ_RND_SAME | + HA_HAVE_KEY_READ_ONLY | HA_NO_FULLTEXT_KEY | + HA_KEYPOS_TO_RNDPOS | HA_READ_ORDER | + HA_LASTKEY_ORDER | HA_READ_NOT_EXACT_KEY | HA_LONGLONG_KEYS | HA_NULL_KEY | HA_BLOB_KEY); } uint max_record_length() const { return HA_MAX_REC_LENGTH; } uint max_keys() const { return MI_MAX_KEY; } diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 9d514d26fce..200eea5f0c4 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -224,3 +224,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 4247feb7ed4..4a92507320f 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -218,3 +218,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index ff8c729f445..a9d6f3f7e60 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -219,3 +219,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index faded099c2d..dbf0e70d5f9 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -215,3 +215,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index ee229cec589..59bde38bc01 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -219,3 +219,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index a5719da6d30..e84ee4e6f46 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -215,3 +215,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index 6181ece9e33..47c3b6541c6 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -218,3 +218,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index a81608ab1d8..7bd3d57d573 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -215,3 +215,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index e6ffe66ca8e..fd8294d6f18 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -217,3 +217,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index 9c31c70a733..31f5423c596 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -215,3 +215,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index fbf92c0837a..b559f7a715e 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -217,3 +217,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index c83aaad8235..99ac9735ff9 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -215,3 +215,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index a4f45dcb12a..342bb61a347 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -217,3 +217,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index a4ef04c0b1a..808a241a60c 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -217,3 +217,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index 81a574fdf49..3a22aad3bc3 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -219,3 +219,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index 46b72025f1e..d869a36c2a1 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -215,3 +215,4 @@ "Não é permitido a %-.32s@%-.64s criar novos usuários", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 0b2b172811e..379de97401c 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -219,3 +219,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index 3ab9c76aa6f..037e63a6c32 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -218,3 +218,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"ôÁÂÌÉÃÁ ÄÁÎÎÏÇÏ ÔÉÐÁ ÎÅ ÍÏÖÅÔ ÉÍÅÔØ FULLTEXT ÉÎÄÅËÓÁ", diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index d700398c2dc..a1da3d3189d 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -223,3 +223,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index c786ccb9ece..c61c3a80ee1 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -216,3 +216,4 @@ "%-.32s@%-.64s is not allowed to create new users", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index 9286aba66e4..b0f5471764d 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -215,3 +215,4 @@ "%-.32s@%-.64s har inte rättigheter att skapa nya användare", "Felaktig tabell definition: Alla tabeller i en MERGE tabell måste vara i samma databas", "Fick 'DEADLOCK' vid låsförsök av block/rad; Försök att starta om transaktionen", +"The used table type doesn't support FULLTEXT indexes", diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index 000f3114cda..1a2eb0b0d4b 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -220,3 +220,4 @@ "ëÏÒÉÓÔÕ×ÁÞÕ %-.32s@%-.64s ÎÅ ÄÏÚ×ÏÌÅÎÏ ÓÔ×ÏÒÀ×ÁÔÉ ÎÏ×ÉÈ ËÏÒÉÓÔÕ×ÁÞ¦×", "Incorrect table definition; All MERGE tables must be in the same database", "Deadlock found when trying to get lock; Try restarting transaction", +"÷ÉËÏÒÉÓÔÁÎÉÊ ÔÉÐ ÔÁÂÌÉæ ΊЦÄÔÒÉÍÕ¤ FULLTEXT ¦ÎÄÅËÓ¦×", diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 4735e8a08ec..237a1f63e44 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -413,6 +413,15 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, key_info->key_parts=(uint8) key->columns.elements; key_info->key_part=key_part_info; + if (key->type == Key::FULLTEXT) + { + if (file->option_flag() & HA_NO_FULLTEXT_KEY) + { + my_error(ER_TABLE_CANT_HANDLE_FULLTEXT, MYF(0)); + DBUG_RETURN(-1); + } + } + List_iterator<key_part_spec> cols(key->columns); for (uint column_nr=0 ; (column=cols++) ; column_nr++) { @@ -428,13 +437,8 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, column->field_name); DBUG_RETURN(-1); } - if (key->type == Key::FULLTEXT && - (file->option_flag() & HA_NO_FULLTEXT_KEY)) - { - my_printf_error(ER_WRONG_KEY_COLUMN, ER(ER_WRONG_KEY_COLUMN), MYF(0), - column->field_name); - DBUG_RETURN(-1); - } + if (key->type == Key::FULLTEXT) + column->length=1; /* ft-code ignores it anyway :-) */ if (f_is_blob(sql_field->pack_flag)) { if (!(file->option_flag() & HA_BLOB_KEY)) @@ -445,15 +449,10 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, } if (!column->length) { - if (key->type == Key::FULLTEXT) - column->length=1; /* ft-code ignores it anyway :-) */ - else - { - my_printf_error(ER_BLOB_KEY_WITHOUT_LENGTH, - ER(ER_BLOB_KEY_WITHOUT_LENGTH),MYF(0), - column->field_name); - DBUG_RETURN(-1); - } + my_printf_error(ER_BLOB_KEY_WITHOUT_LENGTH, + ER(ER_BLOB_KEY_WITHOUT_LENGTH),MYF(0), + column->field_name); + DBUG_RETURN(-1); } } if (!(sql_field->flags & NOT_NULL_FLAG)) diff --git a/sql/violite.c b/sql/violite.c index 721e6c8d81c..932861b10c2 100644 --- a/sql/violite.c +++ b/sql/violite.c @@ -39,7 +39,7 @@ #include <sys/ioctl.h> #endif -#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) +#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__FreeBSD__) #include <netinet/ip.h> #if !defined(alpha_linux_port) #include <netinet/tcp.h> |