openGauss-server/src/test/regress/input/row_compression/twophase.source

48 lines
2.8 KiB
Plaintext

create schema "compress_2PC";
create table "compress_2PC".file_count(id int, count int);
checkpoint;
\! @abs_bindir@/gsql -r -p @portstring@ -d regression -c "insert into \"compress_2PC\".file_count values(1, `find @abs_srcdir@ | wc -l`)"
-- create rollback
start transaction;
create table "compress_2PC".normal(a text,b integer);
create table "compress_2PC".compress1(a text,b integer) with (compresstype=2);
create table "compress_2PC".compress2(a text,b integer) with (compresstype=2,compress_chunk_size=2048,compress_prealloc_chunks=1);
create table "compress_2PC".compress3(a text,b integer) with (compresstype=2,compress_chunk_size=1024,compress_prealloc_chunks=1);
create table "compress_2PC".compress4(a text,b integer) with (compresstype=2,compress_chunk_size=512,compress_prealloc_chunks=1);
rollback;
-- drop commit
create table "compress_2PC".normal(id int);
create table "compress_2PC".compress1(id int) with (compresstype=2);
create table "compress_2PC".compress2(id int) with (compresstype=2,compress_chunk_size=2048,compress_prealloc_chunks=1);
create table "compress_2PC".compress3(id int) with (compresstype=2,compress_chunk_size=1024,compress_prealloc_chunks=1);
create table "compress_2PC".compress4(id int) with (compresstype=2,compress_chunk_size=512,compress_prealloc_chunks=1);
start transaction;
drop table "compress_2PC".normal;
drop table "compress_2PC".compress1;
drop table "compress_2PC".compress2;
drop table "compress_2PC".compress3;
drop table "compress_2PC".compress4;
commit;
-- 2pc create rollback
begin;
create table "compress_2PC".test_abort2(b integer) with (compresstype=2,compress_chunk_size=2048,compress_prealloc_chunks=1);
prepare transaction 'the first prepare transaction';
rollback prepared 'the first prepare transaction';
--2pc drop rollback
create table "compress_2PC".test_commit1(a text,b integer) with (compresstype=2,compress_prealloc_chunks=1);
create table "compress_2PC".test_commit2(a text,b integer) with (compresstype=2,compress_chunk_size=2048,compress_prealloc_chunks=1);
create table "compress_2PC".test_commit3(a text,b integer) with (compresstype=2,compress_chunk_size=1024,compress_prealloc_chunks=1);
create table "compress_2PC".test_commit4(a text,b integer) with (compresstype=2,compress_chunk_size=512,compress_prealloc_chunks=1);
create table "compress_2PC".test_commit5(a text,b integer);
begin;
drop table "compress_2PC".test_commit1;
drop table"compress_2PC". test_commit2;
drop table "compress_2PC".test_commit3;
drop table "compress_2PC".test_commit4;
drop table "compress_2PC".test_commit5;
prepare transaction 'the first prepare transaction';
commit prepared 'the first prepare transaction';
-- checkpoint
checkpoint;
\! @abs_bindir@/gsql -r -p @portstring@ -d regression -c "insert into \"compress_2PC\".file_count values(2, `find @abs_srcdir@ | wc -l`)"
select count(distinct(count)) from "compress_2PC".file_count;