!1443 修复fastcheck_single不稳定的问题

Merge pull request !1443 from pengjiong/fix_fastcheck
This commit is contained in:
opengauss-bot
2021-12-31 09:19:24 +00:00
committed by Gitee
17 changed files with 35 additions and 32 deletions

View File

@ -2,6 +2,7 @@ create database pl_test_cursor_part1 DBCOMPATIBILITY 'pg';
\c pl_test_cursor_part1; \c pl_test_cursor_part1;
create schema hw_cursor_part1; create schema hw_cursor_part1;
set current_schema = hw_cursor_part1; set current_schema = hw_cursor_part1;
set behavior_compat_options = 'skip_insert_gs_source';
create table company(name varchar(100), loc varchar(100), no integer); create table company(name varchar(100), loc varchar(100), no integer);
insert into company values ('macrosoft', 'usa', 001); insert into company values ('macrosoft', 'usa', 001);
insert into company values ('oracle', 'usa', 002); insert into company values ('oracle', 'usa', 002);
@ -605,15 +606,15 @@ DECLARE
CURSOR CURS1 IS SELECT * FROM TEST_TB order by 1; CURSOR CURS1 IS SELECT * FROM TEST_TB order by 1;
TEMP INTEGER:=0; TEMP INTEGER:=0;
BEGIN BEGIN
if not CURS1%isopen then if not CURS1%isopen then
raise notice '%','curosr is open'; raise notice '%','curosr is open';
end if; end if;
FOR VARA IN CURS1 LOOP FOR VARA IN CURS1 LOOP
raise notice '%',CURS1%ROWCOUNT; raise notice '%',CURS1%ROWCOUNT;
END LOOP; END LOOP;
if not CURS1%isopen then if not CURS1%isopen then
raise notice '%','curosr is open'; raise notice '%','curosr is open';
end if; end if;
END; END;
/ /
NOTICE: curosr is open NOTICE: curosr is open
@ -686,9 +687,9 @@ BEGIN
sqlstr := 'select first_name,phone_number,salary from staffs sqlstr := 'select first_name,phone_number,salary from staffs
where section_id = :1'; where section_id = :1';
OPEN my_cur FOR sqlstr USING '30'; OPEN my_cur FOR sqlstr USING '30';
if (my_cur%isopen) then if (my_cur%isopen) then
raise notice '%','cursor is open'; raise notice '%','cursor is open';
end if; end if;
FETCH my_cur INTO name, phone_number, salary; FETCH my_cur INTO name, phone_number, salary;
WHILE my_cur%FOUND LOOP WHILE my_cur%FOUND LOOP

View File

@ -5,6 +5,7 @@ create database pl_test_cursor_part2 DBCOMPATIBILITY 'pg';
\c pl_test_cursor_part2; \c pl_test_cursor_part2;
create schema hw_cursor_part2; create schema hw_cursor_part2;
set current_schema = hw_cursor_part2; set current_schema = hw_cursor_part2;
set behavior_compat_options = 'skip_insert_gs_source';
create table t1(v1 int,v2 varchar2(100)); create table t1(v1 int,v2 varchar2(100));
insert into t1 values (1,'abc1'); insert into t1 values (1,'abc1');
insert into t1 values (2,'abc2'); insert into t1 values (2,'abc2');

View File

@ -6,6 +6,7 @@ create database pl_test_cursor_part3 DBCOMPATIBILITY 'pg';
\c pl_test_cursor_part3; \c pl_test_cursor_part3;
CREATE schema hw_cursor_part3; CREATE schema hw_cursor_part3;
set current_schema = hw_cursor_part3; set current_schema = hw_cursor_part3;
set behavior_compat_options = 'skip_insert_gs_source';
create table t1(v1 int,v2 varchar2(100)); create table t1(v1 int,v2 varchar2(100));
insert into t1 values (1,'abc1'); insert into t1 values (1,'abc1');
insert into t1 values (2,'abc2'); insert into t1 values (2,'abc2');
@ -182,7 +183,6 @@ begin
close cur; close cur;
end; end;
/ /
\set VERBOSITY terse
call sp_testsp_delete(); call sp_testsp_delete();
NOTICE: test delete: sql%isopen=false NOTICE: test delete: sql%isopen=false
NOTICE: test delete: sql%notfound=true NOTICE: test delete: sql%notfound=true
@ -195,7 +195,6 @@ NOTICE: test delete: sql%rowcount=3
(1 row) (1 row)
\set VERBOSITY default
create table JOINT_DEBUG_CURSOR_FUNC_TABLE_012(C_INT integer,C_CHAR char(10)) ; create table JOINT_DEBUG_CURSOR_FUNC_TABLE_012(C_INT integer,C_CHAR char(10)) ;
insert into JOINT_DEBUG_CURSOR_FUNC_TABLE_012 values(10,'hello'); insert into JOINT_DEBUG_CURSOR_FUNC_TABLE_012 values(10,'hello');
insert into JOINT_DEBUG_CURSOR_FUNC_TABLE_012 values(10,'nihao'); insert into JOINT_DEBUG_CURSOR_FUNC_TABLE_012 values(10,'nihao');

View File

@ -2,6 +2,7 @@
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
CREATE schema hw_cursor_part4; CREATE schema hw_cursor_part4;
set current_schema = hw_cursor_part4; set current_schema = hw_cursor_part4;
set behavior_compat_options = 'skip_insert_gs_source';
CREATE TABLE TBL(V1 INTEGER); CREATE TABLE TBL(V1 INTEGER);
INSERT INTO TBL VALUES(1); INSERT INTO TBL VALUES(1);
INSERT INTO TBL VALUES(2); INSERT INTO TBL VALUES(2);

View File

@ -1,5 +1,6 @@
CREATE schema hw_cursor_part5; CREATE schema hw_cursor_part5;
set current_schema = hw_cursor_part5; set current_schema = hw_cursor_part5;
set behavior_compat_options = 'skip_insert_gs_source';
CREATE TABLE TEST_TB(ID INTEGER); CREATE TABLE TEST_TB(ID INTEGER);
INSERT INTO TEST_TB VALUES(123); INSERT INTO TEST_TB VALUES(123);
INSERT INTO TEST_TB VALUES(124); INSERT INTO TEST_TB VALUES(124);

View File

@ -1,5 +1,6 @@
CREATE schema hw_cursor_part6; CREATE schema hw_cursor_part6;
set current_schema = hw_cursor_part6; set current_schema = hw_cursor_part6;
set behavior_compat_options = 'skip_insert_gs_source';
create table company(name varchar(100), loc varchar(100), no integer); create table company(name varchar(100), loc varchar(100), no integer);
insert into company values ('macrosoft', 'usa', 001); insert into company values ('macrosoft', 'usa', 001);
insert into company values ('oracle', 'usa', 002); insert into company values ('oracle', 'usa', 002);

View File

@ -3,6 +3,7 @@
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
create schema hw_cursor_part7; create schema hw_cursor_part7;
set current_schema = hw_cursor_part7; set current_schema = hw_cursor_part7;
set behavior_compat_options = 'skip_insert_gs_source';
create table t1(v1 int,v2 varchar2(100)); create table t1(v1 int,v2 varchar2(100));
insert into t1 values (1,'abc1'); insert into t1 values (1,'abc1');
insert into t1 values (2,'abc2'); insert into t1 values (2,'abc2');

View File

@ -2,6 +2,7 @@ create database pl_test_cursor_part8 DBCOMPATIBILITY 'pg';
\c pl_test_cursor_part8; \c pl_test_cursor_part8;
CREATE schema hw_cursor_part8; CREATE schema hw_cursor_part8;
SET current_schema = hw_cursor_part8; SET current_schema = hw_cursor_part8;
set behavior_compat_options = 'skip_insert_gs_source';
CREATE TABLE TEST_TB(ID INTEGER); CREATE TABLE TEST_TB(ID INTEGER);
INSERT INTO TEST_TB VALUES(123); INSERT INTO TEST_TB VALUES(123);
INSERT INTO TEST_TB VALUES(124); INSERT INTO TEST_TB VALUES(124);

View File

@ -542,8 +542,7 @@ test: hw_function_p_3 hw_function_p_4
test: create_c_function test: create_c_function
test: cstore_replication_table_delete test: cstore_replication_table_delete
test: hw_cursor_part1 hw_cursor_part2 hw_cursor_part3 hw_cursor_part4 hw_cursor_part7 test: hw_cursor_part1 hw_cursor_part2 hw_cursor_part3 hw_cursor_part4 hw_cursor_part7 hw_cursor_part8 hw_cursor_part5 hw_cursor_part6
#test: hw_cursor_part8 hw_cursor_part5 hw_cursor_part6
test: vec_append_part1 vec_append_part2 vec_append_part3 test: vec_append_part1 vec_append_part2 vec_append_part3
test: vec_cursor_part1 vec_cursor_part2 test: vec_cursor_part1 vec_cursor_part2
test: vec_delete_part1 vec_delete_part2 test: vec_delete_part1 vec_delete_part2

View File

@ -3,7 +3,7 @@ create database pl_test_cursor_part1 DBCOMPATIBILITY 'pg';
create schema hw_cursor_part1; create schema hw_cursor_part1;
set current_schema = hw_cursor_part1; set current_schema = hw_cursor_part1;
set behavior_compat_options = 'skip_insert_gs_source';
create table company(name varchar(100), loc varchar(100), no integer); create table company(name varchar(100), loc varchar(100), no integer);
insert into company values ('macrosoft', 'usa', 001); insert into company values ('macrosoft', 'usa', 001);
@ -474,15 +474,15 @@ DECLARE
CURSOR CURS1 IS SELECT * FROM TEST_TB order by 1; CURSOR CURS1 IS SELECT * FROM TEST_TB order by 1;
TEMP INTEGER:=0; TEMP INTEGER:=0;
BEGIN BEGIN
if not CURS1%isopen then if not CURS1%isopen then
raise notice '%','curosr is open'; raise notice '%','curosr is open';
end if; end if;
FOR VARA IN CURS1 LOOP FOR VARA IN CURS1 LOOP
raise notice '%',CURS1%ROWCOUNT; raise notice '%',CURS1%ROWCOUNT;
END LOOP; END LOOP;
if not CURS1%isopen then if not CURS1%isopen then
raise notice '%','curosr is open'; raise notice '%','curosr is open';
end if; end if;
END; END;
/ /
@ -537,9 +537,9 @@ BEGIN
sqlstr := 'select first_name,phone_number,salary from staffs sqlstr := 'select first_name,phone_number,salary from staffs
where section_id = :1'; where section_id = :1';
OPEN my_cur FOR sqlstr USING '30'; OPEN my_cur FOR sqlstr USING '30';
if (my_cur%isopen) then if (my_cur%isopen) then
raise notice '%','cursor is open'; raise notice '%','cursor is open';
end if; end if;
FETCH my_cur INTO name, phone_number, salary; FETCH my_cur INTO name, phone_number, salary;
WHILE my_cur%FOUND LOOP WHILE my_cur%FOUND LOOP

View File

@ -5,7 +5,7 @@ create database pl_test_cursor_part2 DBCOMPATIBILITY 'pg';
\c pl_test_cursor_part2; \c pl_test_cursor_part2;
create schema hw_cursor_part2; create schema hw_cursor_part2;
set current_schema = hw_cursor_part2; set current_schema = hw_cursor_part2;
set behavior_compat_options = 'skip_insert_gs_source';
create table t1(v1 int,v2 varchar2(100)); create table t1(v1 int,v2 varchar2(100));
insert into t1 values (1,'abc1'); insert into t1 values (1,'abc1');
insert into t1 values (2,'abc2'); insert into t1 values (2,'abc2');

View File

@ -6,7 +6,7 @@ create database pl_test_cursor_part3 DBCOMPATIBILITY 'pg';
\c pl_test_cursor_part3; \c pl_test_cursor_part3;
CREATE schema hw_cursor_part3; CREATE schema hw_cursor_part3;
set current_schema = hw_cursor_part3; set current_schema = hw_cursor_part3;
set behavior_compat_options = 'skip_insert_gs_source';
create table t1(v1 int,v2 varchar2(100)); create table t1(v1 int,v2 varchar2(100));
insert into t1 values (1,'abc1'); insert into t1 values (1,'abc1');
insert into t1 values (2,'abc2'); insert into t1 values (2,'abc2');
@ -160,9 +160,7 @@ begin
close cur; close cur;
end; end;
/ /
\set VERBOSITY terse
call sp_testsp_delete(); call sp_testsp_delete();
\set VERBOSITY default
create table JOINT_DEBUG_CURSOR_FUNC_TABLE_012(C_INT integer,C_CHAR char(10)) ; create table JOINT_DEBUG_CURSOR_FUNC_TABLE_012(C_INT integer,C_CHAR char(10)) ;

View File

@ -2,7 +2,7 @@
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
CREATE schema hw_cursor_part4; CREATE schema hw_cursor_part4;
set current_schema = hw_cursor_part4; set current_schema = hw_cursor_part4;
set behavior_compat_options = 'skip_insert_gs_source';
CREATE TABLE TBL(V1 INTEGER); CREATE TABLE TBL(V1 INTEGER);
INSERT INTO TBL VALUES(1); INSERT INTO TBL VALUES(1);
INSERT INTO TBL VALUES(2); INSERT INTO TBL VALUES(2);

View File

@ -1,6 +1,6 @@
CREATE schema hw_cursor_part5; CREATE schema hw_cursor_part5;
set current_schema = hw_cursor_part5; set current_schema = hw_cursor_part5;
set behavior_compat_options = 'skip_insert_gs_source';
CREATE TABLE TEST_TB(ID INTEGER); CREATE TABLE TEST_TB(ID INTEGER);
INSERT INTO TEST_TB VALUES(123); INSERT INTO TEST_TB VALUES(123);
INSERT INTO TEST_TB VALUES(124); INSERT INTO TEST_TB VALUES(124);

View File

@ -1,6 +1,6 @@
CREATE schema hw_cursor_part6; CREATE schema hw_cursor_part6;
set current_schema = hw_cursor_part6; set current_schema = hw_cursor_part6;
set behavior_compat_options = 'skip_insert_gs_source';
create table company(name varchar(100), loc varchar(100), no integer); create table company(name varchar(100), loc varchar(100), no integer);
insert into company values ('macrosoft', 'usa', 001); insert into company values ('macrosoft', 'usa', 001);

View File

@ -3,7 +3,7 @@
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
create schema hw_cursor_part7; create schema hw_cursor_part7;
set current_schema = hw_cursor_part7; set current_schema = hw_cursor_part7;
set behavior_compat_options = 'skip_insert_gs_source';
create table t1(v1 int,v2 varchar2(100)); create table t1(v1 int,v2 varchar2(100));
insert into t1 values (1,'abc1'); insert into t1 values (1,'abc1');
insert into t1 values (2,'abc2'); insert into t1 values (2,'abc2');

View File

@ -2,7 +2,7 @@ create database pl_test_cursor_part8 DBCOMPATIBILITY 'pg';
\c pl_test_cursor_part8; \c pl_test_cursor_part8;
CREATE schema hw_cursor_part8; CREATE schema hw_cursor_part8;
SET current_schema = hw_cursor_part8; SET current_schema = hw_cursor_part8;
set behavior_compat_options = 'skip_insert_gs_source';
CREATE TABLE TEST_TB(ID INTEGER); CREATE TABLE TEST_TB(ID INTEGER);
INSERT INTO TEST_TB VALUES(123); INSERT INTO TEST_TB VALUES(123);
INSERT INTO TEST_TB VALUES(124); INSERT INTO TEST_TB VALUES(124);