summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb_alter_table/t/fractional_time_alter_table.test
diff options
context:
space:
mode:
Diffstat (limited to 'storage/tokudb/mysql-test/tokudb_alter_table/t/fractional_time_alter_table.test')
-rw-r--r--storage/tokudb/mysql-test/tokudb_alter_table/t/fractional_time_alter_table.test164
1 files changed, 164 insertions, 0 deletions
diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/t/fractional_time_alter_table.test b/storage/tokudb/mysql-test/tokudb_alter_table/t/fractional_time_alter_table.test
new file mode 100644
index 00000000000..eee661023a8
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb_alter_table/t/fractional_time_alter_table.test
@@ -0,0 +1,164 @@
+SET DEFAULT_STORAGE_ENGINE = 'tokudb';
+
+--disable_warnings
+DROP TABLE IF EXISTS foo;
+--enable_warnings
+set tokudb_disable_slow_alter=on;
+
+create table foo (
+ a timestamp,
+ b timestamp(1),
+ c timestamp(2),
+ d timestamp(3),
+ e timestamp(4),
+ f timestamp(5),
+ g timestamp(6)
+) engine=TokuDB;
+
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a timestamp(1);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a timestamp(2);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a timestamp(3);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a timestamp(4);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a timestamp(5);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a timestamp(6);
+
+alter table foo change b b timestamp(2);
+show create table foo;
+alter table foo change b b timestamp(1);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change b b timestamp(3);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change b b timestamp(4);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change b b timestamp(5);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change b b timestamp(6);
+
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change d d timestamp(2);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change d d timestamp(5);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change d d timestamp(6);
+
+alter table foo change f f timestamp(6);
+alter table foo change f f timestamp(5);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change f f timestamp(4);
+drop table foo;
+
+
+create table foo (
+ a datetime,
+ b datetime(1),
+ c datetime(2),
+ d datetime(3),
+ e datetime(4),
+ f datetime(5),
+ g datetime(6)
+) engine=TokuDB;
+
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a datetime(1);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a datetime(2);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a datetime(3);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a datetime(4);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a datetime(5);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a datetime(6);
+
+alter table foo change b b datetime(2);
+show create table foo;
+alter table foo change b b datetime(1);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change b b datetime(3);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change b b datetime(4);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change b b datetime(5);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change b b datetime(6);
+
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change d d datetime(2);
+alter table foo change d d datetime(5);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change d d datetime(6);
+
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change g g datetime(5);
+drop table foo;
+
+
+create table foo (
+ a time,
+ b time(1),
+ c time(2),
+ d time(3),
+ e time(4),
+ f time(5),
+ g time(6)
+) engine=TokuDB;
+
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a time(1);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a time(2);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a time(3);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a time(4);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a time(5);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change a a time(6);
+
+alter table foo change b b time(2);
+show create table foo;
+alter table foo change b b time(1);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change b b time(3);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change b b time(4);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change b b time(5);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change b b time(6);
+
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change d d time(2);
+alter table foo change d d time(5);
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change d d time(6);
+
+--error ER_UNSUPPORTED_EXTENSION
+alter table foo change g g time(5);
+drop table foo;
+
+
+create table foo (a int, b int) engine=TokuDB;
+insert into foo values (1,2);
+alter table foo add column tt timestamp(3) NOT NULL Default '1981-11-01 10:11:13.123' after a;
+select * from foo;
+alter table foo drop column tt;
+
+alter table foo add column tt datetime(3) NOT NULL Default '1981-11-01 10:11:13.123' after a;
+select * from foo;
+alter table foo drop column tt;
+
+
+alter table foo add column tt time(3) NOT NULL Default '10:11:13.123' after a;
+select * from foo;
+alter table foo drop column tt;
+
+drop table foo;