mariadb/mysql-test/t/create_options.test
Sergei Golubchik e24e1668bc MWL#43 CREATE TABLE options (by Sanja)
Docs/sp-imp-spec.txt:
  New sql_mode added.
include/my_base.h:
  Flag in frm of create options.
libmysqld/CMakeLists.txt:
  New files added.
libmysqld/Makefile.am:
  New files added.
mysql-test/r/events_bugs.result:
  New sql_mode added.
mysql-test/r/information_schema.result:
  New sql_mode added.
mysql-test/r/sp.result:
  New sql_mode added.
mysql-test/r/system_mysql_db.result:
  New sql_mode added.
mysql-test/suite/funcs_1/r/is_columns_mysql.result:
  New sql_mode added.
mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result:
  New sql_mode added.
mysql-test/t/events_bugs.test:
  New sql_mode added.
mysql-test/t/sp.test:
  New sql_mode added.
scripts/mysql_system_tables.sql:
  New sql_mode added.
scripts/mysql_system_tables_fix.sql:
  New sql_mode added.
sql/CMakeLists.txt:
  New files added.
sql/Makefile.am:
  New files added.
sql/event_db_repository.cc:
  New sql_mode added.
sql/field.cc:
  Create options support added.
sql/field.h:
  Create options support added.
sql/ha_partition.cc:
  Create options support added.
sql/handler.cc:
  Create options support added.
sql/handler.h:
  Create options support added.
sql/log_event.h:
  New sql_mode added.
sql/mysql_priv.h:
  New sql_mode added.
sql/mysqld.cc:
  New sql_mode added.
sql/share/errmsg.txt:
  New error messages added.
sql/sp.cc:
  New sql_mode added.
sql/sp_head.cc:
  Create options support added.
sql/sql_class.cc:
  Create options support added.
  Debug added.
sql/sql_class.h:
  Create options support added.
sql/sql_insert.cc:
  my_safe_a* moved to mysqld_priv.h
sql/sql_lex.h:
  Create options support added.
sql/sql_parse.cc:
  Create options support added.
sql/sql_show.cc:
  Create options support added.
sql/sql_table.cc:
  Create options support added.
sql/sql_view.cc:
  New sql_mode added.
sql/sql_yacc.yy:
  Create options support added.
sql/structs.h:
  Create options support added.
sql/table.cc:
  Create options support added.
sql/table.h:
  Create options support added.
sql/unireg.cc:
  Create options support added.
storage/example/ha_example.cc:
  Create options example.
storage/example/ha_example.h:
  Create options example.
storage/pbxt/src/discover_xt.cc:
  Create options support added.
2010-04-08 14:10:05 +02:00

68 lines
1.8 KiB
Text

--disable_warnings
drop table if exists t1;
--enable_warnings
SET @OLD_SQL_MODE=@@SQL_MODE;
SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS';
create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1='1v1';
show create table t1;
drop table t1;
--echo #reassiginig options in the same line
create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1=1v1 TKEY1=DEFAULT tkey1=1v2 tkey2=2v1;
show create table t1;
-- echo #add option
alter table t1 tkey4=4v1;
show create table t1;
--echo #remove options
alter table t1 tkey3=DEFAULT tkey4=DEFAULT;
show create table t1;
drop table t1;
create table t1 (a int fkey1=v1, key akey (a) kkey1=v1) tkey1=1v1 tkey1=1v2 TKEY1=DEFAULT tkey2=2v1 tkey3=3v1;
show create table t1;
--echo #change field with option with the same value
alter table t1 change a a int `FKEY1`='v1';
show create table t1;
--echo #change field with option with a different value
alter table t1 change a a int fkey1=v2;
show create table t1;
--echo #new column no options
alter table t1 add column b int;
show create table t1;
--echo #new key with options
alter table t1 add key bkey (b) kkey2=v1;
show create table t1;
--echo #new column with options
alter table t1 add column c int fkey1=v1 fkey2=v2;
show create table t1;
--echo #new key no options
alter table t1 add key ckey (c);
show create table t1;
--echo #drop column
alter table t1 drop b;
show create table t1;
--echo #add column with options after delete
alter table t1 add column b int fkey2=v1;
show create table t1;
--echo #add key
alter table t1 add key bkey (b) kkey2=v2;
show create table t1;
drop table t1;
#numeric (unquoted) value
create table t1 (a int) tkey1=100;
show create table t1;
drop table t1;
--echo #error on unknown option
SET SQL_MODE='';
--error ER_UNKNOWN_OPTION
create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1=1v1;
SET @@SQL_MODE=@OLD_SQL_MODE;