修复同名多表更新CORE问题

This commit is contained in:
li-judong
2023-12-14 10:48:52 +08:00
committed by totaj
parent bbaf4b4ea8
commit ff2dc72833
3 changed files with 47 additions and 16 deletions

View File

@ -1,6 +1,17 @@
create database multiupdate DBCOMPATIBILITY = 'B';
\c multiupdate;
\h update
-- issue
CREATE TEMPORARY TABLE t0 ( c54 INT , c9 INT ) ;
INSERT INTO t0 VALUES ( 25 , -8 ) , ( -88 , -77 ) ;
UPDATE t0 , ( SELECT t2 . c54 AS c17 FROM t0 , t0 AS t1 LEFT OUTER JOIN t0 AS t2 USING ( c9 , c54 ) ) AS t3 JOIN t0 AS t4 ON t4 . c9 = t4 . c54 NATURAL INNER JOIN t0 AS t5 SET t4 . c54 = -32 WHERE t4 . c54 = ( SELECT c54 AS c4 FROM t0 LIMIT 1 ) ;
WITH t6 AS ( SELECT c54 AS c12 FROM t0 ) SELECT t0 . c9 AS c9 FROM t0 CROSS JOIN t0 AS t7 WHERE t0 . c54 = -33 ;
drop table t0;
create table t0(c1 int, c2 int, c3 int, c4 int);
insert into t0 values(25, -8, -88, -8),(-88, -77, 25, -8);
update t0 a, t0 b set b.c1=10, a.c2=200, b.c3=20, a.c4=100;
select * from t0;
drop table t0;
-- three relation
drop table if exists t_t_mutil_t1;
drop table if exists t_t_mutil_t2;