diff options
author | monty@mysql.com <> | 2005-05-14 16:24:36 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2005-05-14 16:24:36 +0300 |
commit | beb5867dfb429a88dc2b732fb1d379560d29fc29 (patch) | |
tree | 438b1bf66c03f295f0c2546a80859345423c0539 | |
parent | b4e92e6360df30ab8d5e1baaf4d4d5d7cb8bc5f1 (diff) | |
download | mariadb-git-beb5867dfb429a88dc2b732fb1d379560d29fc29.tar.gz |
After merge fixes
-rw-r--r-- | libmysql/libmysql.c | 31 | ||||
-rw-r--r-- | mysql-test/r/alter_table.result | 225 | ||||
-rw-r--r-- | mysql-test/r/innodb.result | 2 | ||||
-rw-r--r-- | mysql-test/r/insert_update.result | 9 | ||||
-rw-r--r-- | mysql-test/r/outfile.result | bin | 683 -> 959 bytes | |||
-rw-r--r-- | mysql-test/r/outfile2.result | 10 | ||||
-rw-r--r-- | mysql-test/t/alter_table.test | 102 | ||||
-rw-r--r-- | mysql-test/t/insert_update.test | 6 | ||||
-rw-r--r-- | mysql-test/t/outfile.test | 1 | ||||
-rw-r--r-- | sql/item_func.cc | 2 | ||||
-rw-r--r-- | sql/sql_table.cc | 2 |
11 files changed, 200 insertions, 190 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 4c9f06df38e..ff90cfb6007 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1509,37 +1509,40 @@ const char * STDCALL mysql_character_set_name(MYSQL *mysql) return mysql->charset->csname; } + int STDCALL mysql_set_character_set(MYSQL *mysql, char *cs_name) { struct charset_info_st *cs; - const char *save_csdir = charsets_dir; + const char *save_csdir= charsets_dir; if (mysql->options.charset_dir) - charsets_dir = mysql->options.charset_dir; + charsets_dir= mysql->options.charset_dir; - if ( (cs = get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0))) ) + if ((cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0)))) { char buff[MY_CS_NAME_SIZE + 10]; - charsets_dir = save_csdir; + charsets_dir= save_csdir; sprintf(buff, "SET NAMES %s", cs_name); - if (!mysql_query(mysql, buff)) { - mysql->charset = cs; - } - } else { + if (!mysql_query(mysql, buff)) + { + mysql->charset= cs; + } + } + else + { char cs_dir_name[FN_REFLEN]; get_charsets_dir(cs_dir_name); - mysql->net.last_errno=CR_CANT_READ_CHARSET; + mysql->net.last_errno= CR_CANT_READ_CHARSET; strmov(mysql->net.sqlstate, unknown_sqlstate); - my_snprintf(mysql->net.last_error, sizeof(mysql->net.last_error)-1, - ER(mysql->net.last_errno), - cs_name, - cs_dir_name); + my_snprintf(mysql->net.last_error, sizeof(mysql->net.last_error) - 1, + ER(mysql->net.last_errno), cs_name, cs_dir_name); } - charsets_dir = save_csdir; + charsets_dir= save_csdir; return mysql->net.last_errno; } + uint STDCALL mysql_thread_safe(void) { #ifdef THREAD diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 6cada0d5fb2..b7d47a09bee 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -303,6 +303,120 @@ ALTER TABLE t1 DISABLE KEYS; INSERT DELAYED INTO t1 VALUES(1),(2),(3); ALTER TABLE t1 ENABLE KEYS; drop table t1; +CREATE TABLE t1 ( +Host varchar(16) binary NOT NULL default '', +User varchar(16) binary NOT NULL default '', +PRIMARY KEY (Host,User) +) ENGINE=MyISAM; +ALTER TABLE t1 DISABLE KEYS; +LOCK TABLES t1 WRITE; +INSERT INTO t1 VALUES ('localhost','root'),('localhost',''),('games','monty'); +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE +t1 0 PRIMARY 2 User A 3 NULL NULL BTREE +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; +CHECK TABLES t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +CREATE TABLE t1 ( +Host varchar(16) binary NOT NULL default '', +User varchar(16) binary NOT NULL default '', +PRIMARY KEY (Host,User), +KEY (Host) +) ENGINE=MyISAM; +ALTER TABLE t1 DISABLE KEYS; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE +t1 0 PRIMARY 2 User A 0 NULL NULL BTREE +t1 1 Host 1 Host A NULL NULL NULL BTREE disabled +LOCK TABLES t1 WRITE; +INSERT INTO t1 VALUES ('localhost','root'),('localhost',''); +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE +t1 0 PRIMARY 2 User A 2 NULL NULL BTREE +t1 1 Host 1 Host A NULL NULL NULL BTREE disabled +ALTER TABLE t1 ENABLE KEYS; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE +t1 0 PRIMARY 2 User A 2 NULL NULL BTREE +t1 1 Host 1 Host A 1 NULL NULL BTREE +UNLOCK TABLES; +CHECK TABLES t1; +Table Op Msg_type Msg_text +test.t1 check status OK +LOCK TABLES t1 WRITE; +ALTER TABLE t1 RENAME t2; +UNLOCK TABLES; +select * from t2; +Host User +localhost +localhost root +DROP TABLE t2; +CREATE TABLE t1 ( +Host varchar(16) binary NOT NULL default '', +User varchar(16) binary NOT NULL default '', +PRIMARY KEY (Host,User), +KEY (Host) +) ENGINE=MyISAM; +LOCK TABLES t1 WRITE; +ALTER TABLE t1 DISABLE KEYS; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE +t1 0 PRIMARY 2 User A 0 NULL NULL BTREE +t1 1 Host 1 Host A NULL NULL NULL BTREE disabled +DROP TABLE t1; +create table t1 (a int); +alter table t1 rename to `t1\\`; +ERROR 42000: Incorrect table name 't1\\' +rename table t1 to `t1\\`; +ERROR 42000: Incorrect table name 't1\\' +drop table t1; +drop table if exists t1, t2; +Warnings: +Note 1051 Unknown table 't1' +Note 1051 Unknown table 't2' +create table t1 ( a varchar(10) not null primary key ) engine=myisam; +create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1); +flush tables; +alter table t1 modify a varchar(10); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(10) NOT NULL default '', + PRIMARY KEY (`a`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`) +flush tables; +alter table t1 modify a varchar(10) not null; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(10) NOT NULL default '', + PRIMARY KEY (`a`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`) +drop table if exists t1, t2; +create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM; +insert into t1 (a) values(1); +show table status like 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 9 Fixed 1 37 X X X X X X X X latin1_swedish_ci NULL +alter table t1 modify a int; +show table status like 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 9 Fixed 1 37 X X X X X X X X latin1_swedish_ci NULL +drop table t1; +create table t1 (a int not null, b int not null, c int not null, d int not null, e int not null, f int not null, g int not null, h int not null,i int not null, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM; +insert into t1 (a) values(1); +show table status like 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 9 Fixed 1 37 X X X X X X X X latin1_swedish_ci NULL +drop table t1; set names koi8r; create table t1 (a char(10) character set koi8r); insert into t1 values ('ΤΕΣΤ'); @@ -382,75 +496,6 @@ t1 CREATE TABLE `t1` ( `mytext` longtext character set latin1 collate latin1_general_cs ) ENGINE=MyISAM DEFAULT CHARSET=latin2 drop table t1; -CREATE TABLE t1 ( -Host varchar(16) binary NOT NULL default '', -User varchar(16) binary NOT NULL default '', -PRIMARY KEY (Host,User) -) ENGINE=MyISAM; -ALTER TABLE t1 DISABLE KEYS; -LOCK TABLES t1 WRITE; -INSERT INTO t1 VALUES ('localhost','root'),('localhost',''),('games','monty'); -SHOW INDEX FROM t1; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE -t1 0 PRIMARY 2 User A 3 NULL NULL BTREE -ALTER TABLE t1 ENABLE KEYS; -UNLOCK TABLES; -CHECK TABLES t1; -Table Op Msg_type Msg_text -test.t1 check status OK -DROP TABLE t1; -CREATE TABLE t1 ( -Host varchar(16) binary NOT NULL default '', -User varchar(16) binary NOT NULL default '', -PRIMARY KEY (Host,User), -KEY (Host) -) ENGINE=MyISAM; -ALTER TABLE t1 DISABLE KEYS; -SHOW INDEX FROM t1; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE -t1 0 PRIMARY 2 User A 0 NULL NULL BTREE -t1 1 Host 1 Host A NULL NULL NULL BTREE disabled -LOCK TABLES t1 WRITE; -INSERT INTO t1 VALUES ('localhost','root'),('localhost',''); -SHOW INDEX FROM t1; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE -t1 0 PRIMARY 2 User A 2 NULL NULL BTREE -t1 1 Host 1 Host A NULL NULL NULL BTREE disabled -ALTER TABLE t1 ENABLE KEYS; -SHOW INDEX FROM t1; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE -t1 0 PRIMARY 2 User A 2 NULL NULL BTREE -t1 1 Host 1 Host A 1 NULL NULL BTREE -UNLOCK TABLES; -CHECK TABLES t1; -Table Op Msg_type Msg_text -test.t1 check status OK -LOCK TABLES t1 WRITE; -ALTER TABLE t1 RENAME t2; -UNLOCK TABLES; -select * from t2; -Host User -localhost -localhost root -DROP TABLE t2; -CREATE TABLE t1 ( -Host varchar(16) binary NOT NULL default '', -User varchar(16) binary NOT NULL default '', -PRIMARY KEY (Host,User), -KEY (Host) -) ENGINE=MyISAM; -LOCK TABLES t1 WRITE; -ALTER TABLE t1 DISABLE KEYS; -SHOW INDEX FROM t1; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE -t1 0 PRIMARY 2 User A 0 NULL NULL BTREE -t1 1 Host 1 Host A NULL NULL NULL BTREE disabled -DROP TABLE t1; CREATE TABLE t1 (a int PRIMARY KEY, b INT UNIQUE); ALTER TABLE t1 DROP PRIMARY KEY; SHOW CREATE TABLE t1; @@ -469,12 +514,6 @@ alter table t1 drop key no_such_key; ERROR 42000: Can't DROP 'no_such_key'; check that column/key exists alter table t1 drop key a; drop table t1; -create table t1 (a int); -alter table t1 rename to `t1\\`; -ERROR 42000: Incorrect table name 't1\\' -rename table t1 to `t1\\`; -ERROR 42000: Incorrect table name 't1\\' -drop table t1; create table t1 (a text) character set koi8r; insert into t1 values (_koi8r'ΤΕΣΤ'); select hex(a) from t1; @@ -489,39 +528,3 @@ create table t1 ( a timestamp ); alter table t1 add unique ( a(1) ); ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys drop table t1; -drop table if exists t1, t2; -create table t1 ( a varchar(10) not null primary key ) engine=myisam; -create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1); -flush tables; -alter table t1 modify a varchar(10); -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` varchar(10) NOT NULL default '', - PRIMARY KEY (`a`) -) TYPE=MRG_MyISAM UNION=(t1) -flush tables; -alter table t1 modify a varchar(10) not null; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` varchar(10) NOT NULL default '', - PRIMARY KEY (`a`) -) TYPE=MRG_MyISAM UNION=(t1) -drop table if exists t1, t2; -create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM; -insert into t1 (a) values(1); -show table status like 't1'; -Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Create_options Comment -t1 MyISAM Fixed 1 37 37 X X X X X X X X -alter table t1 modify a int; -show table status like 't1'; -Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Create_options Comment -t1 MyISAM Fixed 1 37 37 X X X X X X X X -drop table t1; -create table t1 (a int not null, b int not null, c int not null, d int not null, e int not null, f int not null, g int not null, h int not null,i int not null, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM; -insert into t1 (a) values(1); -show table status like 't1'; -Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Create_options Comment -t1 MyISAM Fixed 1 37 37 X X X X X X X X -drop table t1; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index def462fb521..4c983014d4b 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1645,5 +1645,5 @@ concat(a, b) drop table t1; CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); -The used table type doesn't support FULLTEXT indexes +ERROR HY000: The used table type doesn't support FULLTEXT indexes DROP TABLE t1; diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index f78372541f2..2143538469b 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -167,7 +167,7 @@ a b c VALUES(a) 2 1 11 NULL DROP TABLE t1; DROP TABLE t2; -create table t1 (a int not null unique); +create table t1 (a int not null unique) engine=myisam; insert into t1 values (1),(2); insert ignore into t1 select 1 on duplicate key update a=2; select * from t1; @@ -179,4 +179,11 @@ select * from t1; a 1 3 +insert into t1 select 1 on duplicate key update a=2; +select * from t1; +a +2 +3 +insert into t1 select a from t1 on duplicate key update a=a+1 ; +ERROR 23000: Duplicate entry '3' for key 1 drop table t1; diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result Binary files differindex a7871592241..5eb24a78ef0 100644 --- a/mysql-test/r/outfile.result +++ b/mysql-test/r/outfile.result diff --git a/mysql-test/r/outfile2.result b/mysql-test/r/outfile2.result deleted file mode 100644 index 4dc09f65b7c..00000000000 --- a/mysql-test/r/outfile2.result +++ /dev/null @@ -1,10 +0,0 @@ -drop table if exists t1; -CREATE TABLE t1 (a INT); -EXPLAIN -SELECT * -INTO OUTFILE '/tmp/t1.txt' - FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' - FROM t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found -DROP TABLE t1; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index d133403f42b..c3ba2c8a7a4 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -166,56 +166,6 @@ ALTER TABLE t1 ENABLE KEYS; drop table t1; # -# Test that data get converted when character set is changed -# Test that data doesn't get converted when src or dst is BINARY/BLOB -# -set names koi8r; -create table t1 (a char(10) character set koi8r); -insert into t1 values ('ΤΕΣΤ'); -select a,hex(a) from t1; -alter table t1 change a a char(10) character set cp1251; -select a,hex(a) from t1; -alter table t1 change a a binary(10); -select a,hex(a) from t1; -alter table t1 change a a char(10) character set cp1251; -select a,hex(a) from t1; -alter table t1 change a a char(10) character set koi8r; -select a,hex(a) from t1; -alter table t1 change a a varchar(10) character set cp1251; -select a,hex(a) from t1; -alter table t1 change a a char(10) character set koi8r; -select a,hex(a) from t1; -alter table t1 change a a text character set cp1251; -select a,hex(a) from t1; -alter table t1 change a a char(10) character set koi8r; -select a,hex(a) from t1; -delete from t1; - -# -# Test ALTER TABLE .. CHARACTER SET .. -# -show create table t1; -alter table t1 DEFAULT CHARACTER SET latin1; -show create table t1; -alter table t1 CONVERT TO CHARACTER SET latin1; -show create table t1; -alter table t1 DEFAULT CHARACTER SET cp1251; -show create table t1; - -drop table t1; - -# -# Bug#2821 -# Test that table CHARACTER SET does not affect blobs -# -create table t1 (myblob longblob,mytext longtext) -default charset latin1 collate latin1_general_cs; -show create table t1; -alter table t1 character set latin2; -show create table t1; -drop table t1; - -# # Test ALTER TABLE ENABLE/DISABLE keys when things are locked # @@ -317,6 +267,58 @@ insert into t1 (a) values(1); --replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X show table status like 't1'; drop table t1; + +# +# Test that data get converted when character set is changed +# Test that data doesn't get converted when src or dst is BINARY/BLOB +# +set names koi8r; +create table t1 (a char(10) character set koi8r); +insert into t1 values ('ΤΕΣΤ'); +select a,hex(a) from t1; +alter table t1 change a a char(10) character set cp1251; +select a,hex(a) from t1; +alter table t1 change a a binary(10); +select a,hex(a) from t1; +alter table t1 change a a char(10) character set cp1251; +select a,hex(a) from t1; +alter table t1 change a a char(10) character set koi8r; +select a,hex(a) from t1; +alter table t1 change a a varchar(10) character set cp1251; +select a,hex(a) from t1; +alter table t1 change a a char(10) character set koi8r; +select a,hex(a) from t1; +alter table t1 change a a text character set cp1251; +select a,hex(a) from t1; +alter table t1 change a a char(10) character set koi8r; +select a,hex(a) from t1; +delete from t1; + +# +# Test ALTER TABLE .. CHARACTER SET .. +# +show create table t1; +alter table t1 DEFAULT CHARACTER SET latin1; +show create table t1; +alter table t1 CONVERT TO CHARACTER SET latin1; +show create table t1; +alter table t1 DEFAULT CHARACTER SET cp1251; +show create table t1; + +drop table t1; + +# +# Bug#2821 +# Test that table CHARACTER SET does not affect blobs +# +create table t1 (myblob longblob,mytext longtext) +default charset latin1 collate latin1_general_cs; +show create table t1; +alter table t1 character set latin2; +show create table t1; +drop table t1; + +# # Bug 2361 (Don't drop UNIQUE with DROP PRIMARY KEY) # diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index 0fa366586b3..f5857840588 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -85,10 +85,14 @@ DROP TABLE t2; # Bug#9725 - "disapearing query/hang" and "unknown error" with "on duplicate key update" # INSERT INGORE...UPDATE gives bad error or breaks protocol. # -create table t1 (a int not null unique); +create table t1 (a int not null unique) engine=myisam; insert into t1 values (1),(2); insert ignore into t1 select 1 on duplicate key update a=2; select * from t1; insert ignore into t1 select a from t1 on duplicate key update a=a+1 ; select * from t1; +insert into t1 select 1 on duplicate key update a=2; +select * from t1; +--error 1062 +insert into t1 select a from t1 on duplicate key update a=a+1 ; drop table t1; diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test index b029a65284c..4b12f9e4e50 100644 --- a/mysql-test/t/outfile.test +++ b/mysql-test/t/outfile.test @@ -38,6 +38,7 @@ select load_file(concat(@tmpdir,"/outfile-test.3")); #--error 1086 #eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.3" from t1; #enable_query_log; +--error 13,2 select load_file(concat(@tmpdir,"/outfile-test.not-exist")); --exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.1 --exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.2 diff --git a/sql/item_func.cc b/sql/item_func.cc index 8aa3526bbef..05b76eb1604 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3176,7 +3176,7 @@ bool Item_func_match::fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref) table=((Item_field *)item)->field->table; if (!(table->file->table_flags() & HA_CAN_FULLTEXT)) { - my_error(ER_TABLE_CANT_HANDLE_FULLTEXT, MYF(0)); + my_error(ER_TABLE_CANT_HANDLE_FT, MYF(0)); return 1; } table->fulltext_searched=1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7b0f24bcc45..67aade519f5 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1205,6 +1205,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, /* Sort keys in optimized order */ qsort((gptr) key_info_buffer, *key_count, sizeof(KEY), (qsort_cmp) sort_keys); + create_info->null_bits= null_fields; DBUG_RETURN(0); } @@ -1392,7 +1393,6 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, if (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) create_info->data_file_name= create_info->index_file_name= 0; create_info->table_options=db_options; - create_info->null_bits= null_fields; if (rea_create_table(thd, path, create_info, fields, key_count, key_info_buffer)) |