polardbxengine/mysql-test/suite/ndb/t/ndb_wl946_pre.test

92 lines
2.6 KiB
Plaintext

--source include/have_ndb.inc
--source suite/ndb/include/backup_restore_setup.inc
# runs before and after wl#946 / wl#6231
# result file is same (avoid ndb_desc if new types are possible)
# also creates a backup used in ndb_wl946_post.test
select @@session.time_zone;
set time_zone = '+00:00';
select @@session.time_zone;
--echo # create table
--let $prec=
--let $frac=
--source ndb_wl946_create.inc
show create table t1;
--echo # test defaults
insert into t1 (a) values (0);
select * from t1;
delete from t1;
--echo # load data
load data local infile 'suite/ndb/data/wl946_pre.dat'
into table t1 fields terminated by ',' lines terminated by '\n';
--echo # check contents
select count(*), sum(crc32(concat(a,b,c,d,e,f))) from t1;
--echo # run backup
--source include/ndb_backup.inc
--echo # index queries
--source ndb_wl946_pre_query.inc
--echo # check results via innodb
alter table t1 engine=innodb;
show create table t1;
--enable_warnings
select count(*), sum(crc32(concat(a,b,c,d,e,f))) from t1;
--source ndb_wl946_pre_query.inc
--echo # drop table
drop table t1;
--echo # restore meta from backup
--exec $NDB_RESTORE -b $the_backup_id -n 1 -m --print-meta $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
show create table t1;
--echo # restore data from backup
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
--exec $NDB_RESTORE -b $the_backup_id -n 2 -r $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
--echo # check contents
select count(*), sum(crc32(concat(a,b,c,d,e,f))) from t1;
--echo # drop table
drop table t1;
--echo # restore meta from wl946_pre
--exec $NDB_RESTORE -b 1 -n 1 -m --print-meta $NDB_SAVED_BACKUPS/wl946_pre >> $NDB_TOOLS_OUTPUT
# datetime,timestamp default wrong on solaris (probably bug#53818)
# show create table t1;
# ndb_restore creates old types
--source show_attributes.inc
--source show_indexes.inc
--echo # restore data from wl946_pre
--exec $NDB_RESTORE -b 1 -n 1 -r $NDB_SAVED_BACKUPS/wl946_pre >> $NDB_TOOLS_OUTPUT
--exec $NDB_RESTORE -b 1 -n 2 -r $NDB_SAVED_BACKUPS/wl946_pre >> $NDB_TOOLS_OUTPUT
--echo # check contents
# The `t1` table is not expected to be usable. It contains old
# temporal types which have been removed in 8.0. The upgrade of the
# table metadata is not supported
--disable_query_log
call mtr.add_suppression("NDB: Table upgrade required");
--enable_query_log
--error ER_NO_SUCH_TABLE
select count(*), sum(crc32(concat(a,b,c,d,e,f))) from t1;
SHOW WARNINGS;
set time_zone = default;
select @@session.time_zone;
--exec $NDB_DROP_TABLE --no-defaults -d test t1 >> $NDB_TOOLS_OUTPUT
--source suite/ndb/include/backup_restore_cleanup.inc
--remove_file $NDB_TOOLS_OUTPUT