mariadb/mysql-test/suite/versioning/t/not_embedded.test
Aleksey Midenkov f9f6b190cc Versioning test suite cleanups
Merged truncate_privilege and sysvars-notembedded into not_embedded.test
Merged partition_innodb into trx_id.test
2022-01-13 23:35:16 +03:00

79 lines
1.9 KiB
Text

--source include/not_embedded.inc
--source include/have_innodb.inc
--echo #
--echo # SYSTEM_VERSIONING_ASOF sysvar
--echo #
create table t (a int) with system versioning;
set @before= UNIX_TIMESTAMP(now(6));
insert into t values (1);
set @after= UNIX_TIMESTAMP(now(6));
update t set a= 2;
set global system_versioning_asof= FROM_UNIXTIME(@after);
set system_versioning_asof= FROM_UNIXTIME(@after);
select * from t as nonempty;
--connect (subcon,127.0.0.1,root,,,$SERVER_MYPORT_1)
--connection subcon
select * from t as nonempty;
--disconnect subcon
--connection default
set global system_versioning_asof= FROM_UNIXTIME(@before);
select * from t as nonempty;
--connect (subcon,127.0.0.1,root,,,$SERVER_MYPORT_1)
--connection subcon
select * from t as empty;
--disconnect subcon
--connection default
drop table t;
set global system_versioning_asof= DEFAULT;
set system_versioning_asof= DEFAULT;
--echo #
--echo # DELETE HISTORY and privileges
--echo #
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
connect (root,localhost,root,,test);
connection root;
--disable_warnings
create database mysqltest;
--enable_warnings
create user mysqltest_1@localhost;
connect (user1,localhost,mysqltest_1,,test);
connection user1;
connection root;
create table mysqltest.t (a int) with system versioning;
connection user1;
show grants;
--error ER_TABLEACCESS_DENIED_ERROR
delete history from mysqltest.t before system_time now();
connection root;
grant delete history on mysqltest.* to mysqltest_1@localhost;
grant delete history on mysqltest.t to mysqltest_1@localhost;
connection user1;
show grants;
delete history from mysqltest.t before system_time now();
connection root;
grant all on *.* to mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
--disconnect user1
--disconnect root
--connection default