From 93d8ccbf12d80aedb0eb5245b1057545a1edca0d Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Wed, 26 Jul 2017 12:29:32 +0300 Subject: [PATCH] testing 5.7 and JSON --- .../datetime-to-timestamp-pk-fail/create.sql | 4 ++-- .../datetime-to-timestamp-pk-fail/extra_args | 2 +- localtests/datetime-to-timestamp/create.sql | 4 ++-- localtests/datetime-to-timestamp/extra_args | 2 +- localtests/enum-pk/create.sql | 2 +- localtests/json57/create.sql | 21 +++++++++++++++++++ localtests/timestamp-to-datetime/create.sql | 2 +- localtests/timestamp/create.sql | 4 ++-- localtests/tz-datetime-ts/create.sql | 2 +- localtests/tz-datetime-ts/extra_args | 2 +- localtests/tz/create.sql | 4 ++-- 11 files changed, 35 insertions(+), 14 deletions(-) create mode 100644 localtests/json57/create.sql diff --git a/localtests/datetime-to-timestamp-pk-fail/create.sql b/localtests/datetime-to-timestamp-pk-fail/create.sql index 7977ff4..c602543 100644 --- a/localtests/datetime-to-timestamp-pk-fail/create.sql +++ b/localtests/datetime-to-timestamp-pk-fail/create.sql @@ -3,9 +3,9 @@ create table gh_ost_test ( id int unsigned auto_increment, i int not null, ts0 timestamp default current_timestamp, - ts1 timestamp, + ts1 timestamp null, dt2 datetime, - t datetime, + t datetime default current_timestamp, updated tinyint unsigned default 0, primary key(id, t), key i_idx(i) diff --git a/localtests/datetime-to-timestamp-pk-fail/extra_args b/localtests/datetime-to-timestamp-pk-fail/extra_args index 6b3f977..e68dde4 100644 --- a/localtests/datetime-to-timestamp-pk-fail/extra_args +++ b/localtests/datetime-to-timestamp-pk-fail/extra_args @@ -1 +1 @@ ---alter="change column t t timestamp not null" +--alter="change column t t timestamp default current_timestamp" diff --git a/localtests/datetime-to-timestamp/create.sql b/localtests/datetime-to-timestamp/create.sql index 95ca5d3..95add7a 100644 --- a/localtests/datetime-to-timestamp/create.sql +++ b/localtests/datetime-to-timestamp/create.sql @@ -3,9 +3,9 @@ create table gh_ost_test ( id int unsigned auto_increment, i int not null, ts0 timestamp default current_timestamp, - ts1 timestamp, + ts1 timestamp null, dt2 datetime, - t datetime, + t datetime null, updated tinyint unsigned default 0, primary key(id), key i_idx(i) diff --git a/localtests/datetime-to-timestamp/extra_args b/localtests/datetime-to-timestamp/extra_args index 6b3f977..ee9bcf0 100644 --- a/localtests/datetime-to-timestamp/extra_args +++ b/localtests/datetime-to-timestamp/extra_args @@ -1 +1 @@ ---alter="change column t t timestamp not null" +--alter="change column t t timestamp null" diff --git a/localtests/enum-pk/create.sql b/localtests/enum-pk/create.sql index 4ba7743..5cf7906 100644 --- a/localtests/enum-pk/create.sql +++ b/localtests/enum-pk/create.sql @@ -2,7 +2,7 @@ drop table if exists gh_ost_test; create table gh_ost_test ( id int auto_increment, i int not null, - e enum('red', 'green', 'blue', 'orange') null default null collate 'utf8_bin', + e enum('red', 'green', 'blue', 'orange') not null default 'red' collate 'utf8_bin', primary key(id, e) ) auto_increment=1; diff --git a/localtests/json57/create.sql b/localtests/json57/create.sql new file mode 100644 index 0000000..83dfe79 --- /dev/null +++ b/localtests/json57/create.sql @@ -0,0 +1,21 @@ +drop table if exists gh_ost_test; +create table gh_ost_test ( + id int auto_increment, + j json, + primary key(id) +) auto_increment=1; + +drop event if exists gh_ost_test; +delimiter ;; +create event gh_ost_test + on schedule every 1 second + starts current_timestamp + ends current_timestamp + interval 60 second + on completion not preserve + enable + do +begin + insert into gh_ost_test values (null, '"sometext"'); + insert into gh_ost_test values (null, '{"key":"val"}'); + insert into gh_ost_test values (null, '{"is-it": true, "count": 3, "elements": []}'); +end ;; diff --git a/localtests/timestamp-to-datetime/create.sql b/localtests/timestamp-to-datetime/create.sql index 10c83d6..f3bce34 100644 --- a/localtests/timestamp-to-datetime/create.sql +++ b/localtests/timestamp-to-datetime/create.sql @@ -3,7 +3,7 @@ create table gh_ost_test ( id int auto_increment, i int not null, ts0 timestamp default current_timestamp, - ts1 timestamp, + ts1 timestamp default current_timestamp, dt2 datetime, t datetime, updated tinyint unsigned default 0, diff --git a/localtests/timestamp/create.sql b/localtests/timestamp/create.sql index 2377ebf..cba7135 100644 --- a/localtests/timestamp/create.sql +++ b/localtests/timestamp/create.sql @@ -3,8 +3,8 @@ create table gh_ost_test ( id int auto_increment, i int not null, ts0 timestamp default current_timestamp, - ts1 timestamp, - ts2 timestamp, + ts1 timestamp default current_timestamp, + ts2 timestamp default current_timestamp, updated tinyint unsigned default 0, primary key(id), key i_idx(i) diff --git a/localtests/tz-datetime-ts/create.sql b/localtests/tz-datetime-ts/create.sql index 510a065..a5c3251 100644 --- a/localtests/tz-datetime-ts/create.sql +++ b/localtests/tz-datetime-ts/create.sql @@ -3,7 +3,7 @@ create table gh_ost_test ( id int auto_increment, i int not null, ts0 timestamp default current_timestamp, - ts1 timestamp, + ts1 timestamp default current_timestamp, dt2 datetime, t datetime, updated tinyint unsigned default 0, diff --git a/localtests/tz-datetime-ts/extra_args b/localtests/tz-datetime-ts/extra_args index 6b3f977..f350007 100644 --- a/localtests/tz-datetime-ts/extra_args +++ b/localtests/tz-datetime-ts/extra_args @@ -1 +1 @@ ---alter="change column t t timestamp not null" +--alter="change column t t timestamp not null default current_timestamp" diff --git a/localtests/tz/create.sql b/localtests/tz/create.sql index f908e6e..aec997f 100644 --- a/localtests/tz/create.sql +++ b/localtests/tz/create.sql @@ -3,8 +3,8 @@ create table gh_ost_test ( id int auto_increment, i int not null, ts0 timestamp default current_timestamp, - ts1 timestamp, - ts2 timestamp, + ts1 timestamp default current_timestamp, + ts2 timestamp default current_timestamp, updated tinyint unsigned default 0, primary key(id), key i_idx(i)