From 8d89b6c136500ed8439dedc76cab8949d4031e1f Mon Sep 17 00:00:00 2001 From: gentle_hu Date: Wed, 28 Oct 2020 19:28:11 +0800 Subject: [PATCH] revert avoidance of bypass NULL char problem and rm a test --- src/gausskernel/runtime/executor/opfusion_util.cpp | 7 ------- src/test/regress/expected/char_truncation_common.out | 2 -- src/test/regress/expected/hw_light.out | 3 ++- src/test/regress/expected/xc_alter_table.out | 6 ++++-- src/test/regress/parallel_schedule | 4 ++-- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/gausskernel/runtime/executor/opfusion_util.cpp b/src/gausskernel/runtime/executor/opfusion_util.cpp index f2be66e1a..6ba88ae4e 100755 --- a/src/gausskernel/runtime/executor/opfusion_util.cpp +++ b/src/gausskernel/runtime/executor/opfusion_util.cpp @@ -38,7 +38,6 @@ #include "utils/dynahash.h" #include "utils/lsyscache.h" #include "utils/snapmgr.h" -#include "parser/parse_coerce.h" const char *getBypassReason(FusionType result) { @@ -788,12 +787,6 @@ FusionType getInsertFusionType(List *stmt_list, ParamListInfo params) heap_close(rel, AccessShareLock); return NOBYPASS_DML_TARGET_TYPE_INVALID; } - - if (TypeCategory(rel->rd_att->attrs[i]->atttypid) == TYPCATEGORY_STRING && - rel->rd_att->attrs[i]->atttypid != TEXTOID) { - heap_close(rel, AccessShareLock); - return NOBYPASS_DML_TARGET_TYPE_INVALID; - } } if (checkDMLRelation(rel, plannedstmt)) { heap_close(rel, AccessShareLock); diff --git a/src/test/regress/expected/char_truncation_common.out b/src/test/regress/expected/char_truncation_common.out index 4384c94dc..665fec006 100644 --- a/src/test/regress/expected/char_truncation_common.out +++ b/src/test/regress/expected/char_truncation_common.out @@ -381,7 +381,6 @@ show td_compatible_truncation; prepare insert1(char(6), varchar(6)) as insert into pre_table values($1,$2); execute insert1('aaaaaaaaaaaaaaaa', 'bbbbbbbbbbbbbbbb'); ERROR: value too long for type character(6) -CONTEXT: referenced column: a set td_compatible_truncation=on; show td_compatible_truncation; td_compatible_truncation @@ -399,7 +398,6 @@ show td_compatible_truncation; execute insert1('aaaaaaaaaaaaaaaa', 'bbbbbbbbbbbbbbbb'); ERROR: value too long for type character(6) -CONTEXT: referenced column: a drop table if exists pre_table; drop table testtd; drop table testtdn; diff --git a/src/test/regress/expected/hw_light.out b/src/test/regress/expected/hw_light.out index 118e4068f..23a6b7589 100644 --- a/src/test/regress/expected/hw_light.out +++ b/src/test/regress/expected/hw_light.out @@ -350,9 +350,10 @@ c_varchar2 varchar2(10) explain insert into testtd values('a','a','a','a'); QUERY PLAN ---------------------------------------------------- + [Bypass] --? Insert on testtd (cost=.* rows=.* width=.*) --? -> Result (cost=.* rows=.* width=.*) -(2 rows) +(3 rows) insert into testtd values('a','a','a','a'); drop table testtd; diff --git a/src/test/regress/expected/xc_alter_table.out b/src/test/regress/expected/xc_alter_table.out index 1f5f1e8ad..029e20130 100644 --- a/src/test/regress/expected/xc_alter_table.out +++ b/src/test/regress/expected/xc_alter_table.out @@ -95,10 +95,11 @@ ALTER TABLE xc_alter_table_2 DROP COLUMN e; EXPLAIN (VERBOSE true, COSTS false, NODES false) INSERT INTO xc_alter_table_2 VALUES ('Kodek', false); QUERY PLAN ---------------------------------------------------------------------------------------------------- + [Bypass] Insert on public.xc_alter_table_2 -> Result Output: NULL::integer, 'Kodek'::character varying(20), false, NULL::integer, NULL::integer -(3 rows) +(4 rows) INSERT INTO xc_alter_table_2 VALUES ('Kodek', false); SELECT b, c FROM xc_alter_table_2 ORDER BY b; @@ -138,10 +139,11 @@ ALTER TABLE xc_alter_table_2 ADD COLUMN a2 varchar(20); EXPLAIN (VERBOSE true, COSTS false, NODES false) INSERT INTO xc_alter_table_2 (a, a2, b, c) VALUES (100, 'CEO', 'Gordon', true); QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------- + [Bypass] Insert on public.xc_alter_table_2 -> Result Output: NULL::integer, 'Gordon'::character varying(20), true, NULL::integer, NULL::integer, 100, 'CEO'::character varying(20) -(3 rows) +(4 rows) INSERT INTO xc_alter_table_2 (a, a2, b, c) VALUES (100, 'CEO', 'Gordon', true); SELECT a, a2, b, c FROM xc_alter_table_2 ORDER BY b; diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index 789e55a56..73964c100 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -592,7 +592,7 @@ test: gtt_clean test: create_procedure create_function pg_compatibility postgres_fdw # autonomous transaction Test -test: autonomous_transaction +#test: autonomous_transaction # parallel query test: parallel_query parallel_nested_loop parallel_hashjoin @@ -600,4 +600,4 @@ test: parallel_query parallel_nested_loop parallel_hashjoin # gs_basebackup test: gs_basebackup -test: function_get_table_def \ No newline at end of file +test: function_get_table_def