!4199 修复多表更新时的core问题

Merge pull request !4199 from pengjiong/fix_case
This commit is contained in:
opengauss_bot
2023-09-25 09:10:52 +00:00
committed by Gitee
3 changed files with 22 additions and 2 deletions

View File

@ -3819,7 +3819,7 @@ static List* RewriteQuery(Query* parsetree, List* rewrite_events)
bool rewriteView = false;
List* rewriteRelations = NIL;
result_relation = linitial_int(parsetree->resultRelations);
result_relation = linitial2_int(parsetree->resultRelations);
if (result_relation == 0)
return rewritten;

View File

@ -1452,5 +1452,14 @@ drop function trigger_func_update_multiview1();
drop view multiview1;
drop view multiview2;
drop view multiview3;
-- multi update with join
CREATE TABLE t1 (f1 int);
CREATE TABLE t2 (f1 int);
INSERT INTO t2 VALUES (1);
CREATE VIEW v1 AS SELECT * FROM t2;
UPDATE t2 AS A NATURAL JOIN v1 B SET B.f1 = 1;
drop table t1;
drop view v1;
drop table t2;
\c regression
drop database multiupdate;

View File

@ -639,5 +639,16 @@ drop function trigger_func_update_multiview1();
drop view multiview1;
drop view multiview2;
drop view multiview3;
-- multi update with join
CREATE TABLE t1 (f1 int);
CREATE TABLE t2 (f1 int);
INSERT INTO t2 VALUES (1);
CREATE VIEW v1 AS SELECT * FROM t2;
UPDATE t2 AS A NATURAL JOIN v1 B SET B.f1 = 1;
drop table t1;
drop view v1;
drop table t2;
\c regression
drop database multiupdate;
drop database multiupdate;