From c7f0fcab23aa392985ac70fc3ae63805989973b5 Mon Sep 17 00:00:00 2001 From: "svoj@mysql.com" <> Date: Sat, 7 May 2005 15:48:56 +0500 Subject: [PATCH 1/9] BUG#7709 fix - Boolean fulltext query against unsupported engines does not fail. --- BitKeeper/etc/logging_ok | 1 + mysql-test/r/innodb.result | 3 +++ mysql-test/t/innodb.test | 9 +++++++++ sql/item_func.cc | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 5a34dbbb1d8..7052d853b00 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -142,6 +142,7 @@ serg@sergbook.mylan serg@sergbook.mysql.com sergefp@mysql.com sinisa@rhols221.adsl.netsonic.fi +svoj@mysql.com tfr@beta.frontier86.ee tfr@indrek.tfr.cafe.ee tfr@sarvik.tfr.cafe.ee diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index f00679801f8..dbfe1c3aff5 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1272,3 +1272,6 @@ Cannot delete or update a parent row: a foreign key constraint fails delete from t1 where id=15; delete from t1 where id=0; 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 diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 2c8002ea841..c25f295cac8 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -911,3 +911,12 @@ delete from t1 where id=15; delete from t1 where id=0; drop table t1; + +# +# BUG#7709 test case - Boolean fulltext query against unsupported +# engines does not fail +# + +CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; +--error 1214; +SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); diff --git a/sql/item_func.cc b/sql/item_func.cc index 334be48dc9a..855e86b2382 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2257,6 +2257,11 @@ bool Item_func_match::fix_fields(THD *thd,struct st_table_list *tlist) key=NO_SUCH_KEY; const_item_cache=0; table=((Item_field *)fields.head())->field->table; + if (!(table->file->table_flags() & HA_CAN_FULLTEXT)) + { + my_error(ER_TABLE_CANT_HANDLE_FULLTEXT, MYF(0)); + return 1; + } table->fulltext_searched=1; record=table->record[0]; if (key == NO_SUCH_KEY && mode != FT_BOOL) From ded73eddf74a6b39b05ba440a59ec82fd673d33e Mon Sep 17 00:00:00 2001 From: "mwagner@ultrafly.mysql.com" <> Date: Sat, 7 May 2005 15:11:31 +0200 Subject: [PATCH 2/9] errmsg.txt: Add newline at EOF for proper processing by comp-err.exe on Windows where fgets() works differently than Linux (Bug #6195). --- BitKeeper/etc/logging_ok | 1 + sql/share/czech/errmsg.txt | 1 + sql/share/danish/errmsg.txt | 1 + sql/share/dutch/errmsg.txt | 1 + sql/share/english/errmsg.txt | 1 + sql/share/estonian/errmsg.txt | 1 + sql/share/french/errmsg.txt | 1 + sql/share/german/errmsg.txt | 1 + sql/share/greek/errmsg.txt | 1 + sql/share/hungarian/errmsg.txt | 1 + sql/share/italian/errmsg.txt | 1 + sql/share/japanese/errmsg.txt | 1 + sql/share/korean/errmsg.txt | 1 + sql/share/norwegian-ny/errmsg.txt | 1 + sql/share/norwegian/errmsg.txt | 1 + sql/share/polish/errmsg.txt | 1 + sql/share/portuguese/errmsg.txt | 1 + sql/share/romanian/errmsg.txt | 1 + sql/share/russian/errmsg.txt | 1 + sql/share/slovak/errmsg.txt | 1 + sql/share/spanish/errmsg.txt | 1 + sql/share/swedish/errmsg.txt | 1 + sql/share/ukrainian/errmsg.txt | 1 + 23 files changed, 23 insertions(+) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 967f8c7cb47..998f8234343 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -107,6 +107,7 @@ monty@work.mysql.com mwagner@cash.mwagner.org mwagner@evoq.mwagner.org mwagner@here.mwagner.org +mwagner@ultrafly.mysql.com mwagner@work.mysql.com mysqldev@build.mysql2.com nick@mysql.com diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 88ecaed386b..70aea3fdf62 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -265,3 +265,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 6210bf7788c..8c0bf688311 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -256,3 +256,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index c3607f4cd0f..c2baf0240af 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -265,3 +265,4 @@ "Kreeg fatale fout %d: '%-.128s' van master tijdens lezen van data uit binaire log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index 7c9d789c86e..ed5977fd78c 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -255,3 +255,4 @@ "Variable '%-.64s' is a %s variable" ] # End of error messages # Do NOT add new error messages here as this makes merges to 4.1 too hard! + diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index 8157a33836e..581baf24e09 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -258,3 +258,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 3c88ccc0378..9aa430aa718 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -253,3 +253,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index 91f3f91a464..7fa896bcc34 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -257,3 +257,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index aff7f8ba3c2..2a2bee5d69a 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -253,3 +253,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index 60dc3204bb4..f998116410f 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -258,3 +258,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index c51c69cf298..2ab360dff4e 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -253,3 +253,4 @@ "Errore fatale %d: '%-.128s' dal master leggendo i dati dal log binario", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index fb604923e4e..4ad7cc3ec37 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -257,3 +257,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index 764cbb78740..3b027796c3b 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -253,3 +253,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index 424530ecf87..5b994d2dc5b 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -255,3 +255,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index 73314ea647b..305bf10899b 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -255,3 +255,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index f24a54ec8e8..8d6b2fa542e 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -258,3 +258,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index 2810ac134b1..6fcc044c6b6 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -255,3 +255,4 @@ "Obteve fatal erro %d: '%-.128s' do master quando lendo dados do binary log", "Slave SQL thread ignorado a consulta devido às normas de replicação-*-tabela" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 552b532c0a2..c218f19e212 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -258,3 +258,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index 668b310a5dc..4419da08051 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -258,3 +258,4 @@ "ðÏÌÕÞÅÎÁ ÎÅÉÓÐÒÁ×ÉÍÁÑ ÏÛÉÂËÁ %d: '%-.128s' ÏÔ ÇÏÌÏ×ÎÏÇÏ ÓÅÒ×ÅÒÁ × ÐÒÏÃÅÓÓÅ ×ÙÂÏÒËÉ ÄÁÎÎÙÈ ÉÚ Ä×ÏÉÞÎÏÇÏ ÖÕÒÎÁÌÁ", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index 8467fad5b11..bb241673706 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -261,3 +261,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index 4ab76a64ca7..2daeebc8eb8 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -256,3 +256,4 @@ "Recibió fatal error %d: '%-.128s' del master cuando leyendo datos del binary log", "Slave SQL thread ignorado el query debido a las reglas de replicación-*-tabla" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index 352a226ef23..a9273f6222c 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -253,3 +253,4 @@ "Fick fatalt fel %d: '%-.128s' från master vid läsning av binärloggen" "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index 131cf07a8e2..371dd16d737 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -259,3 +259,4 @@ "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules" "Variable '%-.64s' is a %s variable" + From fc3ff35be6b32f873709be70d18b77109e76027a Mon Sep 17 00:00:00 2001 From: "svoj@mysql.com" <> Date: Sat, 7 May 2005 21:37:27 +0500 Subject: [PATCH 3/9] Test fix. DROP TABLE added. --- mysql-test/r/innodb.result | 1 + mysql-test/t/innodb.test | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index dbfe1c3aff5..f634edcbe91 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1275,3 +1275,4 @@ 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 +DROP TABLE t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index c25f295cac8..96975d54810 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -920,3 +920,4 @@ drop table t1; CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; --error 1214; SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); +DROP TABLE t1; From d51308aec443aea67a0287abb7486190c8913fee Mon Sep 17 00:00:00 2001 From: "antony@ltantony.mysql.com" <> Date: Sun, 8 May 2005 21:03:50 +0100 Subject: [PATCH 4/9] Bug#6236 Incomplete ALTER TABLE breaks MERGE compatibility Fix implicit NOT NULL not set on ALTER of PK columns --- BitKeeper/etc/logging_ok | 1 + mysql-test/r/alter_table.result | 20 ++++++++++++++++++++ mysql-test/t/alter_table.test | 13 +++++++++++++ sql/sql_table.cc | 23 +++++++++++++++++------ 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index bf0dfb9e31d..5a34dbbb1d8 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -9,6 +9,7 @@ acurtis@pcgem.rdg.cyberkinetica.com ahlentz@co3064164-a.rochd1.qld.optusnet.com.au akishkin@work.mysql.com antony@ltantony.dsl-verizon.net +antony@ltantony.mysql.com antony@ltantony.rdg.cyberkinetica.homeunix.net arjen@bitbike.com arjen@co3064164-a.bitbike.com diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 78925a64e93..80d3ef5e0a5 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -386,3 +386,23 @@ Incorrect table name 't1\\' rename table t1 to `t1\\`; Incorrect table name 't1\\' 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; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 11290134a71..c69f9aabae6 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -254,3 +254,16 @@ alter table t1 rename to `t1\\`; rename table t1 to `t1\\`; drop table t1; +# +# BUG#6236 - ALTER TABLE MODIFY should set implicit NOT NULL on PK columns +# +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; +flush tables; +alter table t1 modify a varchar(10) not null; +show create table t2; +drop table if exists t1, t2; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index cef480fadde..e065e5dfc58 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1795,6 +1795,11 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, } KEY_PART_INFO *key_part= key_info->key_part; + enum Key::Keytype key_type= key_info->flags & HA_NOSAME ? + (!my_strcasecmp(key_name, "PRIMARY") ? + Key::PRIMARY : Key::UNIQUE) : + (key_info->flags & HA_FULLTEXT ? + Key::FULLTEXT : Key::MULTIPLE); key_parts.empty(); for (uint j=0 ; j < key_info->key_parts ; j++,key_part++) { @@ -1824,16 +1829,22 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, cfield->pack_length <= key_part_length)) key_part_length=0; // Use whole field } + if (!(cfield->flags & NOT_NULL_FLAG)) + { + if (key_type == Key::PRIMARY) + { + /* Implicitly set primary key fields to NOT NULL for ISO conf. */ + cfield->flags|= NOT_NULL_FLAG; + cfield->pack_flag&= ~FIELDFLAG_MAYBE_NULL; + } + else + key_info->flags|= HA_NULL_PART_KEY; + } key_parts.push_back(new key_part_spec(cfield->field_name, key_part_length)); } if (key_parts.elements) - key_list.push_back(new Key(key_info->flags & HA_NOSAME ? - (!my_strcasecmp(key_name, "PRIMARY") ? - Key::PRIMARY : Key::UNIQUE) : - (key_info->flags & HA_FULLTEXT ? - Key::FULLTEXT : Key::MULTIPLE), - key_name,key_parts)); + key_list.push_back(new Key(key_type,key_name,key_parts)); } key_it.rewind(); { From b6609031fa867f46395ad405178b98b268530071 Mon Sep 17 00:00:00 2001 From: "antony@ltantony.mysql.com" <> Date: Sun, 8 May 2005 22:56:58 +0100 Subject: [PATCH 5/9] Bug#8191 - SELECT INTO OUTFILE insists on FROM clause Fix bug + include test case. Enable outfile tests. --- BitKeeper/etc/logging_ok | 1 + mysql-test/include/have_outfile.inc | 5 +++ mysql-test/include/test_outfile.inc | 1 + mysql-test/r/have_outfile.require | 3 ++ mysql-test/r/outfile.result | Bin 0 -> 953 bytes mysql-test/t/outfile.test | 60 +++++++++++++++++++--------- sql/sql_yacc.yy | 7 ++-- 7 files changed, 56 insertions(+), 21 deletions(-) create mode 100644 mysql-test/include/have_outfile.inc create mode 100644 mysql-test/include/test_outfile.inc create mode 100644 mysql-test/r/have_outfile.require create mode 100644 mysql-test/r/outfile.result diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index bf0dfb9e31d..5a34dbbb1d8 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -9,6 +9,7 @@ acurtis@pcgem.rdg.cyberkinetica.com ahlentz@co3064164-a.rochd1.qld.optusnet.com.au akishkin@work.mysql.com antony@ltantony.dsl-verizon.net +antony@ltantony.mysql.com antony@ltantony.rdg.cyberkinetica.homeunix.net arjen@bitbike.com arjen@co3064164-a.bitbike.com diff --git a/mysql-test/include/have_outfile.inc b/mysql-test/include/have_outfile.inc new file mode 100644 index 00000000000..31e95f4810a --- /dev/null +++ b/mysql-test/include/have_outfile.inc @@ -0,0 +1,5 @@ +-- require r/have_outfile.require +disable_query_log; +select load_file(concat(@tmpdir,"/outfile.test")); +--exec rm $MYSQL_TEST_DIR/var/tmp/outfile.test +enable_query_log; diff --git a/mysql-test/include/test_outfile.inc b/mysql-test/include/test_outfile.inc new file mode 100644 index 00000000000..0bede4938c6 --- /dev/null +++ b/mysql-test/include/test_outfile.inc @@ -0,0 +1 @@ +eval select "Outfile OK" into outfile "$MYSQL_TEST_DIR/var/tmp/outfile.test"; diff --git a/mysql-test/r/have_outfile.require b/mysql-test/r/have_outfile.require new file mode 100644 index 00000000000..9fc2f8fdb5a --- /dev/null +++ b/mysql-test/r/have_outfile.require @@ -0,0 +1,3 @@ +load_file(concat(@tmpdir,"/outfile.test")) +Outfile OK + diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result new file mode 100644 index 0000000000000000000000000000000000000000..a2720be075aeb427d4f11212b77ba3a2ad254710 GIT binary patch literal 953 zcmcIj!A`?44CU;vuzFc1twiZ|0PVsFahP`FhQ!j=V-aan5_izQC#fcFz$p?tT7J*Z zezqHDdt_A^LcK@&(w;rCTtn?hF`ZH@G2f{jR>oHIHR#ThW7HknfW@OS1Nl5VkTDiN ztuswFU*y@-6t~Lx7;c|8o51yCsAe=)HLrVZD6ef-E6yLd?HlbDnXm)LM8V|wR%Y`+ zNset_name($1,(uint) ((char*) lex->tok_end - $1)); }; -opt_into: +into: INTO OUTFILE TEXT_STRING { THD *thd= current_thd; From 61d7f1db13e544baeb225a4a5b87a8d2cef1d1a4 Mon Sep 17 00:00:00 2001 From: "antony@ltantony.mysql.com" <> Date: Mon, 9 May 2005 08:33:45 +0100 Subject: [PATCH 6/9] Fix outfile test/results --- mysql-test/r/outfile.result | Bin 953 -> 683 bytes mysql-test/t/outfile.test | 17 +++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result index a2720be075aeb427d4f11212b77ba3a2ad254710..a7871592241104fe2a949c98379cfa21dcbe5d68 100644 GIT binary patch delta 14 WcmdnVzM6Hz0mg}i`jh`M?EwHS^#)-8 literal 953 zcmcIj!A`?44CU;vuzFc1twiZ|0PVsFahP`FhQ!j=V-aan5_izQC#fcFz$p?tT7J*Z zezqHDdt_A^LcK@&(w;rCTtn?hF`ZH@G2f{jR>oHIHR#ThW7HknfW@OS1Nl5VkTDiN ztuswFU*y@-6t~Lx7;c|8o51yCsAe=)HLrVZD6ef-E6yLd?HlbDnXm)LM8V|wR%Y`+ zN Date: Wed, 11 May 2005 12:14:46 -0500 Subject: [PATCH 7/9] mysqldump.1.in: Remove obsolete section number. (Bug #10534) --- man/mysqldump.1.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/man/mysqldump.1.in b/man/mysqldump.1.in index 4d841117e59..0f581429af7 100644 --- a/man/mysqldump.1.in +++ b/man/mysqldump.1.in @@ -218,7 +218,8 @@ or ), mysqldump will create rows up to net_buffer_length length. If you increase this variable, you should also ensure that the max_allowed_packet variable in the MySQL server is bigger than the net_buffer_length. .SH EXAMPLES .TP -The most normal use of mysqldump is probably for making a backup of whole databases. See Mysql Manual section 21.2 Database Backups. +The most normal use of mysqldump is probably for making a backup of whole +databases. See the section on Database Backups in the MySQL Reference Manual. .TP mysqldump \-\-opt \fP\fIdatabase\fP > backup-file.sql .TP From 20f969b2568a730af3864b104134926a22e8ae96 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 13 May 2005 11:11:50 +0300 Subject: [PATCH 8/9] Change create_field->offset to store offset from start of fields, independent of null bits. Count null_bits separately from field offsets and adjust them in case of primary key parts. (Previously a CREATE TABLE with a lot of null fields that was part of a primary key caused MySQL to wrongly count the number of bytes needed to store null bits) This is a more complete bug fix for #6236 --- mysql-test/r/alter_table.result | 16 +++++++ mysql-test/t/alter_table.test | 17 +++++++ sql/handler.h | 1 + sql/sql_table.cc | 37 ++++++--------- sql/unireg.cc | 83 ++++++++++++++++++++------------- 5 files changed, 98 insertions(+), 56 deletions(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 80d3ef5e0a5..19d2ca4d6ed 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -406,3 +406,19 @@ t2 CREATE TABLE `t2` ( 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/t/alter_table.test b/mysql-test/t/alter_table.test index c69f9aabae6..af0ec2bca16 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -267,3 +267,20 @@ flush tables; alter table t1 modify a varchar(10) not null; show create table t2; drop table if exists t1, t2; + +# The following is also part of bug #6236 (CREATE TABLE didn't properly count +# not null columns for primary keys) + +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); +--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X +show table status like 't1'; +alter table t1 modify a int; +--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; +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); +--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; diff --git a/sql/handler.h b/sql/handler.h index ac00050b777..e52164a871a 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -164,6 +164,7 @@ typedef struct st_ha_create_information SQL_LIST merge_list; enum db_type db_type; enum row_type row_type; + uint null_bits; /* NULL bits at start of record */ uint options; /* OR of HA_CREATE_ options */ uint raid_type,raid_chunks; uint merge_insert_method; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index e065e5dfc58..e275f902abd 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -363,7 +363,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, create_field *sql_field,*dup_field; int error= -1; uint db_options,field,null_fields,blob_columns; - ulong pos; + ulong record_offset; KEY *key_info,*key_info_buffer; KEY_PART_INFO *key_part_info; int auto_increment=0; @@ -418,10 +418,9 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, } it2.rewind(); } - /* If fixed row records, we need one bit to check for deleted rows */ - if (!(db_options & HA_OPTION_PACK_RECORD)) - null_fields++; - pos=(null_fields+7)/8; + + /* record_offset will be increased with 'length-of-null-bits' later */ + record_offset= 0; it.rewind(); while ((sql_field=it++)) @@ -478,10 +477,10 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, } if (!(sql_field->flags & NOT_NULL_FLAG)) sql_field->pack_flag|=FIELDFLAG_MAYBE_NULL; - sql_field->offset= pos; + sql_field->offset= record_offset; if (MTYP_TYPENR(sql_field->unireg_check) == Field::NEXT_NUMBER) auto_increment++; - pos+=sql_field->pack_length; + record_offset+= sql_field->pack_length; } if (auto_increment > 1) { @@ -578,11 +577,12 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, column->field_name); DBUG_RETURN(-1); } - /* for fulltext keys keyseg length is 1 for blobs (it's ignored in - ft code anyway, and 0 (set to column width later) for char's. - it has to be correct col width for char's, as char data are not - prefixed with length (unlike blobs, where ft code takes data length - from a data prefix, ignoring column->length). + /* + for fulltext keys keyseg length is 1 for blobs (it's ignored in + ft code anyway, and 0 (set to column width later) for char's. + it has to be correct col width for char's, as char data are not + prefixed with length (unlike blobs, where ft code takes data length + from a data prefix, ignoring column->length). */ if (key->type == Key::FULLTEXT) column->length=test(f_is_blob(sql_field->pack_flag)); @@ -609,6 +609,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, /* Implicitly set primary key fields to NOT NULL for ISO conf. */ sql_field->flags|= NOT_NULL_FLAG; sql_field->pack_flag&= ~FIELDFLAG_MAYBE_NULL; + null_fields--; } else key_info->flags|= HA_NULL_PART_KEY; @@ -765,6 +766,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, if (thd->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(path, create_info, fields, key_count, key_info_buffer)) @@ -1829,17 +1831,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, cfield->pack_length <= key_part_length)) key_part_length=0; // Use whole field } - if (!(cfield->flags & NOT_NULL_FLAG)) - { - if (key_type == Key::PRIMARY) - { - /* Implicitly set primary key fields to NOT NULL for ISO conf. */ - cfield->flags|= NOT_NULL_FLAG; - cfield->pack_flag&= ~FIELDFLAG_MAYBE_NULL; - } - else - key_info->flags|= HA_NULL_PART_KEY; - } key_parts.push_back(new key_part_spec(cfield->field_name, key_part_length)); } diff --git a/sql/unireg.cc b/sql/unireg.cc index 218ea6b5b8d..f81370539c6 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -32,18 +32,21 @@ static uchar * pack_screens(List &create_fields, uint *info_length, uint *screens, bool small_file); -static uint pack_keys(uchar *keybuff,uint key_count, KEY *key_info); +static uint pack_keys(uchar *keybuff,uint key_count, KEY *key_info, + ulong data_offset); static bool pack_header(uchar *forminfo, enum db_type table_type, List &create_fields, uint info_length, uint screens, uint table_options, - handler *file); + ulong data_offset, handler *file); static uint get_interval_id(uint *int_count,List &create_fields, create_field *last_field); -static bool pack_fields(File file, List &create_fields); +static bool pack_fields(File file, List &create_fields, + ulong data_offset); static bool make_empty_rec(int file, enum db_type table_type, uint table_options, List &create_fields, - uint reclength,uint null_fields); + uint reclength, uint null_fields, + ulong data_offset); int rea_create_table(my_string file_name, @@ -53,7 +56,7 @@ int rea_create_table(my_string file_name, { uint reclength,info_length,screens,key_info_length,maxlength,null_fields; File file; - ulong filepos; + ulong filepos, data_offset; uchar fileinfo[64],forminfo[288],*keybuff; TYPELIB formnames; uchar *screen_buff; @@ -64,8 +67,15 @@ int rea_create_table(my_string file_name, if (!(screen_buff=pack_screens(create_fields,&info_length,&screens,0))) DBUG_RETURN(1); db_file=get_new_handler((TABLE*) 0, create_info->db_type); + + /* If fixed row records, we need one bit to check for deleted rows */ + if (!(create_info->table_options & HA_OPTION_PACK_RECORD)) + create_info->null_bits++; + data_offset= (create_info->null_bits + 7) / 8; + if (pack_header(forminfo, create_info->db_type,create_fields,info_length, - screens, create_info->table_options, db_file)) + screens, create_info->table_options, + data_offset, db_file)) { NET *net=my_pthread_getspecific_ptr(NET*,THR_NET); my_free((gptr) screen_buff,MYF(0)); @@ -77,7 +87,7 @@ int rea_create_table(my_string file_name, if (!(screen_buff=pack_screens(create_fields,&info_length,&screens,1))) DBUG_RETURN(1); if (pack_header(forminfo, create_info->db_type, create_fields,info_length, - screens, create_info->table_options, db_file)) + screens, create_info->table_options, data_offset, db_file)) { my_free((gptr) screen_buff,MYF(0)); DBUG_RETURN(1); @@ -95,7 +105,7 @@ int rea_create_table(my_string file_name, uint key_buff_length=uint2korr(fileinfo+14); keybuff=(uchar*) my_alloca(key_buff_length); - key_info_length=pack_keys(keybuff,keys,key_info); + key_info_length= pack_keys(keybuff, keys, key_info, data_offset); VOID(get_form_pos(file,fileinfo,&formnames)); if (!(filepos=make_new_entry(file,fileinfo,&formnames,""))) goto err; @@ -117,13 +127,13 @@ int rea_create_table(my_string file_name, (ulong) uint2korr(fileinfo+6)+ (ulong) key_buff_length, MY_SEEK_SET,MYF(0))); if (make_empty_rec(file,create_info->db_type,create_info->table_options, - create_fields,reclength,null_fields)) + create_fields,reclength, null_fields, data_offset)) goto err; VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0))); if (my_write(file,(byte*) forminfo,288,MYF_RW) || my_write(file,(byte*) screen_buff,info_length,MYF_RW) || - pack_fields(file,create_fields)) + pack_fields(file, create_fields, data_offset)) goto err; #ifdef HAVE_CRYPTED_FRM @@ -248,7 +258,8 @@ static uchar * pack_screens(List &create_fields, /* Pack keyinfo and keynames to keybuff for save in form-file. */ -static uint pack_keys(uchar *keybuff,uint key_count,KEY *keyinfo) +static uint pack_keys(uchar *keybuff, uint key_count, KEY *keyinfo, + ulong data_offset) { uint key_parts,length; uchar *pos, *keyname_pos, *key_alg_pos; @@ -273,10 +284,13 @@ static uint pack_keys(uchar *keybuff,uint key_count,KEY *keyinfo) key_part++) { - DBUG_PRINT("loop",("field: %d startpos: %ld length: %ld", - key_part->fieldnr,key_part->offset,key_part->length)); + uint offset; + DBUG_PRINT("loop",("field: %d startpos: %lu length: %ld", + key_part->fieldnr, key_part->offset + data_offset, + key_part->length)); int2store(pos,key_part->fieldnr+1+FIELD_NAME_USED); - int2store(pos+2,key_part->offset+1); + offset= (uint) (key_part->offset+data_offset+1); + int2store(pos+2, offset); pos[4]=0; // Sort order int2store(pos+5,key_part->key_type); int2store(pos+7,key_part->length); @@ -316,8 +330,8 @@ static uint pack_keys(uchar *keybuff,uint key_count,KEY *keyinfo) static bool pack_header(uchar *forminfo, enum db_type table_type, List &create_fields, - uint info_length, uint screens,uint table_options, - handler *file) + uint info_length, uint screens, uint table_options, + ulong data_offset, handler *file) { uint length,int_count,int_length,no_empty, int_parts, time_stamp_pos,null_fields; @@ -351,10 +365,10 @@ static bool pack_header(uchar *forminfo, enum db_type table_type, if ((MTYP_TYPENR(field->unireg_check) == Field::TIMESTAMP_FIELD || f_packtype(field->pack_flag) == (int) FIELD_TYPE_TIMESTAMP) && !time_stamp_pos) - time_stamp_pos=(int) field->offset+1; + time_stamp_pos= (uint) field->offset+ (uint) data_offset + 1; length=field->pack_length; - if ((int) field->offset+length > reclength) - reclength=(int) field->offset+length; + if ((uint) field->offset+ (uint) data_offset+ length > reclength) + reclength=(uint) (field->offset+ data_offset + length); n_length+= (ulong) strlen(field->field_name)+1; field->interval_id=0; if (field->interval) @@ -440,7 +454,8 @@ static uint get_interval_id(uint *int_count,List &create_fields, /* Save fields, fieldnames and intervals */ -static bool pack_fields(File file,List &create_fields) +static bool pack_fields(File file, List &create_fields, + ulong data_offset) { reg2 uint i; uint int_count; @@ -455,11 +470,13 @@ static bool pack_fields(File file,List &create_fields) int_count=0; while ((field=it++)) { + uint recpos; buff[0]= (uchar) field->row; buff[1]= (uchar) field->col; buff[2]= (uchar) field->sc_length; buff[3]= (uchar) field->length; - uint recpos=(uint) field->offset+1; + /* The +1 is here becasue the col offset in .frm file have offset 1 */ + recpos= field->offset+1 + (uint) data_offset; int2store(buff+4,recpos); int2store(buff+6,field->pack_flag); int2store(buff+8,field->unireg_check); @@ -519,11 +536,12 @@ static bool pack_fields(File file,List &create_fields) static bool make_empty_rec(File file,enum db_type table_type, uint table_options, List &create_fields, - uint reclength, uint null_fields) + uint reclength, uint null_fields, + ulong data_offset) { int error; Field::utype type; - uint firstpos,null_count,null_length; + uint firstpos,null_count; uchar *buff,*null_pos; TABLE table; create_field *field; @@ -547,17 +565,16 @@ static bool make_empty_rec(File file,enum db_type table_type, firstpos=reclength; null_count=0; if (!(table_options & HA_OPTION_PACK_RECORD)) - { - null_fields++; // Need one bit for delete mark - null_count++; - } - bfill(buff,(null_length=(null_fields+7)/8),255); + null_count++; // Need one bit for delete mark + DBUG_ASSERT(data_offset == ((null_fields + null_count + 7) / 8)); + bfill(buff, (uint) data_offset, 255); null_pos=buff; List_iterator it(create_fields); while ((field=it++)) { - Field *regfield=make_field((char*) buff+field->offset,field->length, + Field *regfield=make_field((char*) buff+field->offset + data_offset, + field->length, field->flags & NOT_NULL_FLAG ? 0: null_pos+null_count/8, 1 << (null_count & 7), @@ -570,9 +587,9 @@ static bool make_empty_rec(File file,enum db_type table_type, if (!(field->flags & NOT_NULL_FLAG)) null_count++; - if ((uint) field->offset < firstpos && + if ((uint) (field->offset + data_offset) < firstpos && regfield->type() != FIELD_TYPE_NULL) - firstpos= field->offset; + firstpos= field->offset + data_offset; type= (Field::utype) MTYP_TYPENR(field->unireg_check); @@ -596,8 +613,8 @@ static bool make_empty_rec(File file,enum db_type table_type, } /* Fill not used startpos */ - bfill((byte*) buff+null_length,firstpos-null_length,255); - error=(int) my_write(file,(byte*) buff,(uint) reclength,MYF_RW); + bfill((byte*) buff+data_offset, firstpos- (uint) data_offset, 255); + error=(int) my_write(file,(byte*) buff, (uint) reclength,MYF_RW); my_free((gptr) buff,MYF(MY_FAE)); delete handler; DBUG_RETURN(error); From 9b39f8304ef1e9ca9a10803271125431ed15fc0f Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 13 May 2005 23:08:29 +0300 Subject: [PATCH 9/9] Fixed wrong buffer usage for auto-increment key with blob part that caused CHECK TABLE to report that the table was wrong. (Bug #10045) --- myisam/mi_key.c | 31 ++++++++++++++++++++---------- mysql-test/r/auto_increment.result | 14 ++++++++++++++ mysql-test/t/auto_increment.test | 12 ++++++++++++ 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/myisam/mi_key.c b/myisam/mi_key.c index 1688ab74823..06571c570e1 100644 --- a/myisam/mi_key.c +++ b/myisam/mi_key.c @@ -255,8 +255,25 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, } /* _mi_pack_key */ - /* Put a key in record */ - /* Used when only-keyread is wanted */ + +/* + Store found key in record + + SYNOPSIS + _mi_put_key_in_record() + info MyISAM handler + keynr Key number that was used + record Store key here + + Last read key is in info->lastkey + + NOTES + Used when only-keyread is wanted + + RETURN + 0 ok + 1 error +*/ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, byte *record) @@ -267,14 +284,8 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, byte *blob_ptr; DBUG_ENTER("_mi_put_key_in_record"); - if (info->s->base.blobs && info->s->keyinfo[keynr].flag & HA_VAR_LENGTH_KEY) - { - if (!(blob_ptr= - mi_alloc_rec_buff(info, info->s->keyinfo[keynr].keylength, - &info->rec_buff))) - goto err; - } - key=(byte*) info->lastkey; + blob_ptr= info->lastkey2; /* Place to put blob parts */ + key=(byte*) info->lastkey; /* KEy that was read */ key_end=key+info->lastkey_length; for (keyseg=info->s->keyinfo[keynr].seg ; keyseg->type ;keyseg++) { diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 2d6b058d9c5..9345c029127 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -131,3 +131,17 @@ a 1 2 drop table t1; +CREATE TABLE t1 ( a INT AUTO_INCREMENT, b BLOB, PRIMARY KEY (a,b(10))); +INSERT INTO t1 (b) VALUES ('aaaa'); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (b) VALUES (''); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (b) VALUES ('bbbb'); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE IF EXISTS t1; diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index c26983b5eec..e699415a838 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -89,3 +89,15 @@ select last_insert_id(); insert into t1 values (NULL); select * from t1; drop table t1; + +# +# BUG #10045: Problem with composite AUTO_INCREMENT + BLOB key + +CREATE TABLE t1 ( a INT AUTO_INCREMENT, b BLOB, PRIMARY KEY (a,b(10))); +INSERT INTO t1 (b) VALUES ('aaaa'); +CHECK TABLE t1; +INSERT INTO t1 (b) VALUES (''); +CHECK TABLE t1; +INSERT INTO t1 (b) VALUES ('bbbb'); +CHECK TABLE t1; +DROP TABLE IF EXISTS t1;