!3418 fastcheck优化,使用例不受其他用例影响,能单独执行,方便后续调整测试组
Merge pull request !3418 from pengjiong/fix_col
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
-- b compatibility case
|
||||
drop database if exists b;
|
||||
create database b dbcompatibility 'b';
|
||||
drop database if exists b_cmpt_db;
|
||||
NOTICE: database "b_cmpt_db" does not exist, skipping
|
||||
create database b_cmpt_db dbcompatibility 'b';
|
||||
--------------------concat--------------------
|
||||
-- concat case in a compatibility
|
||||
\c regression
|
||||
@ -38,7 +39,7 @@ select * from text1 where a is null;
|
||||
|
||||
drop table text1;
|
||||
-- concat case in b compatibility
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
select concat('','A');
|
||||
concat
|
||||
--------
|
||||
@ -98,7 +99,7 @@ select * from text2 where a is not null;
|
||||
|
||||
drop table text2;
|
||||
-- null case in b
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
create table text2 (a char(10));
|
||||
insert into text2 values('');
|
||||
insert into text2 values (null);
|
||||
@ -143,7 +144,7 @@ CONTEXT: referenced column: int2in
|
||||
select int4in('s');
|
||||
ERROR: invalid input syntax for integer: "s"
|
||||
CONTEXT: referenced column: int4in
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
select '-'::int8;
|
||||
int8
|
||||
------
|
||||
@ -293,7 +294,7 @@ select * from test_limit order by 1 limit 6,2;
|
||||
|
||||
drop table test_limit;
|
||||
-- limit case in b
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
create table test_limit(a int);
|
||||
insert into test_limit values (1),(2),(3),(4),(5);
|
||||
select * from test_limit order by 1 limit 2,3;
|
||||
@ -321,7 +322,7 @@ drop table test_limit;
|
||||
--------------timestampdiff-----------------
|
||||
-- timestamp with time zone
|
||||
-- timestamp1 > timestamp2
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
select timestampdiff(year, '2018-01-01 01:01:01.000001', '2019-02-02 02:02:02.000002');
|
||||
timestamp_diff
|
||||
----------------
|
||||
@ -992,7 +993,7 @@ NOTICE: p1:10
|
||||
(1 row)
|
||||
|
||||
drop procedure if exists doiterate;
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
--success
|
||||
create or replace procedure doiterate(p1 int)
|
||||
as
|
||||
@ -1545,7 +1546,7 @@ NOTICE: drop cascades to 3 other objects
|
||||
DETAIL: drop cascades to function test.func1()
|
||||
drop cascades to function test.debug(integer,integer)
|
||||
drop cascades to function test.call(integer,integer)
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
create or replace procedure func_zzm(num1 in int, num2 inout int, res out int)
|
||||
as begin
|
||||
num2 := num2 + 1;
|
||||
@ -1940,7 +1941,7 @@ CONTEXT: referenced column: while_test1
|
||||
(1 row)
|
||||
|
||||
drop function while_test1;
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
create or replace function while_test1() returns void as $$
|
||||
declare _i integer = 0; _r record;
|
||||
begin
|
||||
@ -2345,7 +2346,7 @@ ERROR: 'label:' is only supported in database which dbcompatibility='B'.
|
||||
CONTEXT: compilation of PL/pgSQL function "dorepeat" near line 2
|
||||
drop function if exists dorepeat;
|
||||
NOTICE: function dorepeat() does not exist, skipping
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
--success
|
||||
CREATE or replace PROCEDURE dorepeat(p1 INT)
|
||||
as
|
||||
@ -2481,6 +2482,6 @@ drop table test_table_030;
|
||||
drop function select_into_null_func;
|
||||
reset behavior_compat_options;
|
||||
\c regression
|
||||
drop database b;
|
||||
drop database b_cmpt_db;
|
||||
DROP USER test_c;
|
||||
DROP USER test_d;
|
||||
|
@ -1072,10 +1072,11 @@ DROP PACKAGE pckg_test;
|
||||
NOTICE: drop cascades to function public.proc_test(character varying)
|
||||
DROP PACKAGE PCKG_EXCHANGE_RATE;
|
||||
NOTICE: drop cascades to function public.rate_exchange(character varying,numeric)
|
||||
drop table if exists tb_test;
|
||||
NOTICE: table "tb_test" does not exist, skipping
|
||||
drop synonym if exists tb_test;
|
||||
create table tb_test(col1 int,col2 int,col3 int);
|
||||
drop table if exists pkg_test_tb_test;
|
||||
NOTICE: table "pkg_test_tb_test" does not exist, skipping
|
||||
drop synonym if exists pkg_test_tb_test;
|
||||
NOTICE: synonym "pkg_test_tb_test" does not exist, skipping
|
||||
create table pkg_test_tb_test(col1 int,col2 int,col3 int);
|
||||
create or replace package pckg_test1 as
|
||||
procedure pr_test(i_col1 in varchar2,o_ret inout varchar2,o_ret1 out varchar2);
|
||||
procedure pr_test1(i_col1 in varchar2);
|
||||
@ -1092,7 +1093,7 @@ o_ret1:=0;
|
||||
end;
|
||||
procedure pr_test1(i_col1 in varchar2)as
|
||||
begin
|
||||
for rec in (select col1,col2,col3 from tb_test) loop
|
||||
for rec in (select col1,col2,col3 from pkg_test_tb_test) loop
|
||||
pr_test(rec.col1,rec.col2,rec.col3);
|
||||
end loop;
|
||||
end;
|
||||
@ -1259,7 +1260,7 @@ end pckg_test1;
|
||||
ERROR: function declared in package specification and package body must be the same, function: proc_test1
|
||||
drop procedure read_pro1();
|
||||
drop procedure read_pro2();
|
||||
drop table tb_test;
|
||||
drop table pkg_test_tb_test;
|
||||
drop package pckg_test1;
|
||||
NOTICE: drop cascades to function public.proc_test1(integer)
|
||||
drop package test1.aa;
|
||||
|
@ -4,6 +4,20 @@
|
||||
-- Simple cases
|
||||
-- Enforce use of COMMIT instead of 2PC for temporary objects
|
||||
CREATE TEMP TABLE foo (f1 int, f2 text, f3 int default 42);
|
||||
CREATE TABLE returning_int8_tbl(q1 int8, q2 int8);
|
||||
INSERT INTO returning_int8_tbl VALUES(' 123 ',' 456');
|
||||
INSERT INTO returning_int8_tbl VALUES('123 ','4567890123456789');
|
||||
INSERT INTO returning_int8_tbl VALUES('4567890123456789','123');
|
||||
INSERT INTO returning_int8_tbl VALUES(+4567890123456789,'4567890123456789');
|
||||
INSERT INTO returning_int8_tbl VALUES('+4567890123456789','-4567890123456789');
|
||||
INSERT INTO returning_int8_tbl VALUES(null,null);
|
||||
CREATE TABLE returning_INT4_TBL(f1 int4);
|
||||
INSERT INTO returning_INT4_TBL(f1) VALUES (' 0 ');
|
||||
INSERT INTO returning_INT4_TBL(f1) VALUES ('123456 ');
|
||||
INSERT INTO returning_INT4_TBL(f1) VALUES (' -123456');
|
||||
INSERT INTO returning_INT4_TBL(f1) VALUES ('2147483647');
|
||||
INSERT INTO returning_INT4_TBL(f1) VALUES ('-2147483647');
|
||||
INSERT INTO returning_INT4_TBL(f1) VALUES (null);
|
||||
INSERT INTO foo (f1,f2,f3)
|
||||
VALUES (1, 'test', DEFAULT), (2, 'More', 11), (3, upper('more'), 7+9)
|
||||
RETURNING *, f1+f3 AS sum;
|
||||
@ -57,8 +71,8 @@ SELECT * FROM foo ORDER BY f1;
|
||||
|
||||
-- Subplans and initplans in the RETURNING list
|
||||
INSERT INTO foo SELECT f1+10, f2, f3+99 FROM foo order by 1, 2, 3
|
||||
RETURNING *, f1+112 IN (SELECT q1 FROM int8_tbl) AS subplan,
|
||||
EXISTS(SELECT * FROM int4_tbl) AS initplan;
|
||||
RETURNING *, f1+112 IN (SELECT q1 FROM returning_int8_tbl) AS subplan,
|
||||
EXISTS(SELECT * FROM returning_INT4_TBL) AS initplan;
|
||||
f1 | f2 | f3 | subplan | initplan
|
||||
----+------+-----+---------+----------
|
||||
11 | test | 141 | t | t
|
||||
@ -69,8 +83,8 @@ with t as
|
||||
(
|
||||
UPDATE foo SET f3 = f3 * 2
|
||||
WHERE f1 > 10
|
||||
RETURNING *, f1+112 IN (SELECT q1 FROM int8_tbl) AS subplan,
|
||||
EXISTS(SELECT * FROM int4_tbl) AS initplan
|
||||
RETURNING *, f1+112 IN (SELECT q1 FROM returning_int8_tbl) AS subplan,
|
||||
EXISTS(SELECT * FROM returning_INT4_TBL) AS initplan
|
||||
)
|
||||
select * from t order by 1,2,3,4;
|
||||
f1 | f2 | f3 | subplan | initplan
|
||||
@ -83,8 +97,8 @@ with t as
|
||||
(
|
||||
DELETE FROM foo
|
||||
WHERE f1 > 10
|
||||
RETURNING *, f1+112 IN (SELECT q1 FROM int8_tbl) AS subplan,
|
||||
EXISTS(SELECT * FROM int4_tbl) AS initplan
|
||||
RETURNING *, f1+112 IN (SELECT q1 FROM returning_int8_tbl) AS subplan,
|
||||
EXISTS(SELECT * FROM returning_INT4_TBL) AS initplan
|
||||
)
|
||||
select * from t order by 1,2,3,4;
|
||||
f1 | f2 | f3 | subplan | initplan
|
||||
@ -95,7 +109,7 @@ select * from t order by 1,2,3,4;
|
||||
|
||||
-- Joins
|
||||
UPDATE foo SET f3 = f3*2
|
||||
FROM int4_tbl i
|
||||
FROM returning_INT4_TBL i
|
||||
WHERE foo.f1 + 123455 = i.f1
|
||||
RETURNING foo.*, i.f1 as "i.f1";
|
||||
f1 | f2 | f3 | i.f1
|
||||
@ -111,7 +125,7 @@ SELECT * FROM foo ORDER BY f1;
|
||||
(2 rows)
|
||||
|
||||
DELETE FROM foo
|
||||
USING int4_tbl i
|
||||
USING returning_INT4_TBL i
|
||||
WHERE foo.f1 + 123455 = i.f1
|
||||
RETURNING foo.*, i.f1 as "i.f1";
|
||||
f1 | f2 | f3 | i.f1
|
||||
@ -221,6 +235,8 @@ delete from tbl_return WHERE t1 = 3 RETURNING '1', '2';
|
||||
(4 rows)
|
||||
|
||||
drop table tbl_return;
|
||||
drop table returning_int8_tbl;
|
||||
drop table returning_INT4_TBL;
|
||||
---- Check inheritance cases
|
||||
--
|
||||
--CREATE TEMP TABLE foochild (fc int) INHERITS (foo);
|
||||
|
@ -1,6 +1,6 @@
|
||||
-- b compatibility case
|
||||
drop database if exists b;
|
||||
create database b dbcompatibility 'b';
|
||||
drop database if exists b_cmpt_db;
|
||||
create database b_cmpt_db dbcompatibility 'b';
|
||||
|
||||
--------------------concat--------------------
|
||||
-- concat case in a compatibility
|
||||
@ -16,7 +16,7 @@ select * from text1 where a is null;
|
||||
drop table text1;
|
||||
|
||||
-- concat case in b compatibility
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
select concat('','A');
|
||||
select concat(null,'A');
|
||||
select concat_ws(',', 'A', null);
|
||||
@ -39,7 +39,7 @@ select * from text2 where a is not null;
|
||||
drop table text2;
|
||||
|
||||
-- null case in b
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
create table text2 (a char(10));
|
||||
insert into text2 values('');
|
||||
insert into text2 values (null);
|
||||
@ -56,7 +56,7 @@ select int1in('.1');
|
||||
select int2in('s');
|
||||
select int4in('s');
|
||||
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
select '-'::int8;
|
||||
select int1in('');
|
||||
select int1in('.1');
|
||||
@ -90,7 +90,7 @@ select * from test_limit order by 1 limit 6,2;
|
||||
drop table test_limit;
|
||||
|
||||
-- limit case in b
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
create table test_limit(a int);
|
||||
insert into test_limit values (1),(2),(3),(4),(5);
|
||||
select * from test_limit order by 1 limit 2,3;
|
||||
@ -101,7 +101,7 @@ drop table test_limit;
|
||||
--------------timestampdiff-----------------
|
||||
-- timestamp with time zone
|
||||
-- timestamp1 > timestamp2
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
select timestampdiff(year, '2018-01-01 01:01:01.000001', '2019-02-02 02:02:02.000002');
|
||||
select timestampdiff(quarter, '2018-01-01 01:01:01.000001', '2019-02-02 02:02:02.000002');
|
||||
select timestampdiff(week, '2018-01-01 01:01:01.000001', '2019-02-02 02:02:02.000002');
|
||||
@ -354,7 +354,7 @@ end;
|
||||
call doiterate(3);
|
||||
|
||||
drop procedure if exists doiterate;
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
--success
|
||||
create or replace procedure doiterate(p1 int)
|
||||
as
|
||||
@ -825,7 +825,7 @@ drop function func1;
|
||||
drop procedure debug;
|
||||
drop procedure call;
|
||||
drop schema test CASCADE;
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
|
||||
create or replace procedure func_zzm(num1 in int, num2 inout int, res out int)
|
||||
as begin
|
||||
@ -1185,7 +1185,7 @@ end; $$ language plpgsql;
|
||||
|
||||
select while_test1();
|
||||
drop function while_test1;
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
|
||||
|
||||
create or replace function while_test1() returns void as $$
|
||||
@ -1410,7 +1410,7 @@ raise notice '%',i;
|
||||
end;
|
||||
/
|
||||
drop function if exists dorepeat;
|
||||
\c b
|
||||
\c b_cmpt_db
|
||||
|
||||
--success
|
||||
CREATE or replace PROCEDURE dorepeat(p1 INT)
|
||||
@ -1501,6 +1501,6 @@ drop function select_into_null_func;
|
||||
reset behavior_compat_options;
|
||||
|
||||
\c regression
|
||||
drop database b;
|
||||
drop database b_cmpt_db;
|
||||
DROP USER test_c;
|
||||
DROP USER test_d;
|
||||
|
@ -941,9 +941,9 @@ DROP PACKAGE pckg_test;
|
||||
DROP PACKAGE PCKG_EXCHANGE_RATE;
|
||||
|
||||
|
||||
drop table if exists tb_test;
|
||||
drop synonym if exists tb_test;
|
||||
create table tb_test(col1 int,col2 int,col3 int);
|
||||
drop table if exists pkg_test_tb_test;
|
||||
drop synonym if exists pkg_test_tb_test;
|
||||
create table pkg_test_tb_test(col1 int,col2 int,col3 int);
|
||||
create or replace package pckg_test1 as
|
||||
procedure pr_test(i_col1 in varchar2,o_ret inout varchar2,o_ret1 out varchar2);
|
||||
procedure pr_test1(i_col1 in varchar2);
|
||||
@ -960,7 +960,7 @@ o_ret1:=0;
|
||||
end;
|
||||
procedure pr_test1(i_col1 in varchar2)as
|
||||
begin
|
||||
for rec in (select col1,col2,col3 from tb_test) loop
|
||||
for rec in (select col1,col2,col3 from pkg_test_tb_test) loop
|
||||
pr_test(rec.col1,rec.col2,rec.col3);
|
||||
end loop;
|
||||
end;
|
||||
@ -1101,7 +1101,7 @@ end pckg_test1;
|
||||
drop procedure read_pro1();
|
||||
drop procedure read_pro2();
|
||||
|
||||
drop table tb_test;
|
||||
drop table pkg_test_tb_test;
|
||||
drop package pckg_test1;
|
||||
drop package test1.aa;
|
||||
drop package test2.aa;
|
||||
|
@ -7,6 +7,21 @@
|
||||
-- Enforce use of COMMIT instead of 2PC for temporary objects
|
||||
|
||||
CREATE TEMP TABLE foo (f1 int, f2 text, f3 int default 42);
|
||||
CREATE TABLE returning_int8_tbl(q1 int8, q2 int8);
|
||||
INSERT INTO returning_int8_tbl VALUES(' 123 ',' 456');
|
||||
INSERT INTO returning_int8_tbl VALUES('123 ','4567890123456789');
|
||||
INSERT INTO returning_int8_tbl VALUES('4567890123456789','123');
|
||||
INSERT INTO returning_int8_tbl VALUES(+4567890123456789,'4567890123456789');
|
||||
INSERT INTO returning_int8_tbl VALUES('+4567890123456789','-4567890123456789');
|
||||
INSERT INTO returning_int8_tbl VALUES(null,null);
|
||||
|
||||
CREATE TABLE returning_INT4_TBL(f1 int4);
|
||||
INSERT INTO returning_INT4_TBL(f1) VALUES (' 0 ');
|
||||
INSERT INTO returning_INT4_TBL(f1) VALUES ('123456 ');
|
||||
INSERT INTO returning_INT4_TBL(f1) VALUES (' -123456');
|
||||
INSERT INTO returning_INT4_TBL(f1) VALUES ('2147483647');
|
||||
INSERT INTO returning_INT4_TBL(f1) VALUES ('-2147483647');
|
||||
INSERT INTO returning_INT4_TBL(f1) VALUES (null);
|
||||
|
||||
INSERT INTO foo (f1,f2,f3)
|
||||
VALUES (1, 'test', DEFAULT), (2, 'More', 11), (3, upper('more'), 7+9)
|
||||
@ -29,15 +44,15 @@ SELECT * FROM foo ORDER BY f1;
|
||||
-- Subplans and initplans in the RETURNING list
|
||||
|
||||
INSERT INTO foo SELECT f1+10, f2, f3+99 FROM foo order by 1, 2, 3
|
||||
RETURNING *, f1+112 IN (SELECT q1 FROM int8_tbl) AS subplan,
|
||||
EXISTS(SELECT * FROM int4_tbl) AS initplan;
|
||||
RETURNING *, f1+112 IN (SELECT q1 FROM returning_int8_tbl) AS subplan,
|
||||
EXISTS(SELECT * FROM returning_INT4_TBL) AS initplan;
|
||||
|
||||
with t as
|
||||
(
|
||||
UPDATE foo SET f3 = f3 * 2
|
||||
WHERE f1 > 10
|
||||
RETURNING *, f1+112 IN (SELECT q1 FROM int8_tbl) AS subplan,
|
||||
EXISTS(SELECT * FROM int4_tbl) AS initplan
|
||||
RETURNING *, f1+112 IN (SELECT q1 FROM returning_int8_tbl) AS subplan,
|
||||
EXISTS(SELECT * FROM returning_INT4_TBL) AS initplan
|
||||
)
|
||||
select * from t order by 1,2,3,4;
|
||||
|
||||
@ -45,22 +60,22 @@ with t as
|
||||
(
|
||||
DELETE FROM foo
|
||||
WHERE f1 > 10
|
||||
RETURNING *, f1+112 IN (SELECT q1 FROM int8_tbl) AS subplan,
|
||||
EXISTS(SELECT * FROM int4_tbl) AS initplan
|
||||
RETURNING *, f1+112 IN (SELECT q1 FROM returning_int8_tbl) AS subplan,
|
||||
EXISTS(SELECT * FROM returning_INT4_TBL) AS initplan
|
||||
)
|
||||
select * from t order by 1,2,3,4;
|
||||
|
||||
-- Joins
|
||||
|
||||
UPDATE foo SET f3 = f3*2
|
||||
FROM int4_tbl i
|
||||
FROM returning_INT4_TBL i
|
||||
WHERE foo.f1 + 123455 = i.f1
|
||||
RETURNING foo.*, i.f1 as "i.f1";
|
||||
|
||||
SELECT * FROM foo ORDER BY f1;
|
||||
|
||||
DELETE FROM foo
|
||||
USING int4_tbl i
|
||||
USING returning_INT4_TBL i
|
||||
WHERE foo.f1 + 123455 = i.f1
|
||||
RETURNING foo.*, i.f1 as "i.f1";
|
||||
|
||||
@ -84,6 +99,8 @@ explain (verbose on, costs off)
|
||||
delete from tbl_return WHERE t1 = 3 RETURNING '1', '2';
|
||||
delete from tbl_return WHERE t1 = 3 RETURNING '1', '2';
|
||||
drop table tbl_return;
|
||||
drop table returning_int8_tbl;
|
||||
drop table returning_INT4_TBL;
|
||||
---- Check inheritance cases
|
||||
--
|
||||
--CREATE TEMP TABLE foochild (fc int) INHERITS (foo);
|
||||
|
Reference in New Issue
Block a user