diff --git a/ClickHouse.Octonica/Tests/UserTests/Issue1174Tests/Tests.UserTests.Issue1174Tests.TestConcurrentSelect(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/UserTests/Issue1174Tests/Tests.UserTests.Issue1174Tests.TestConcurrentSelect(ClickHouse.Octonica).sql index 9bc69c787db9..11b11eddecc8 100644 --- a/ClickHouse.Octonica/Tests/UserTests/Issue1174Tests/Tests.UserTests.Issue1174Tests.TestConcurrentSelect(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/UserTests/Issue1174Tests/Tests.UserTests.Issue1174Tests.TestConcurrentSelect(ClickHouse.Octonica).sql @@ -8,13 +8,3 @@ FROM User t1 LIMIT 1 -BeforeExecute --- ClickHouse.Octonica ClickHouse (asynchronously) - -SELECT - t1.Id, - t1.Name -FROM - User t1 -LIMIT 1 - diff --git a/DB2/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(DB2).sql b/DB2/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(DB2).sql index b93073a5e76f..d60bab7d8a42 100644 --- a/DB2/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(DB2).sql +++ b/DB2/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(DB2).sql @@ -6,8 +6,8 @@ UPDATE SET (TRANS_CHANNEL, IDF) = ( SELECT - "channel_1"."Trans_Channel", - "channel_1"."Idf" + Coalesce("channel_1"."Trans_Channel", 1), + Coalesce("channel_1"."Idf", 0) FROM "Issue2815Table1" "ext_1" LEFT JOIN "Issue2815Table2" "source_1" ON "source_1".ISO = "ext_1".SRC_BIC @@ -57,3 +57,19 @@ WHERE ("Issue2815Table1".TRANS_CHANNEL = "ext".TRANS_CHANNEL OR "Issue2815Table1".TRANS_CHANNEL IS NULL AND "ext".TRANS_CHANNEL IS NULL) ) +BeforeExecute +-- DB2 DB2.LUW DB2LUW + +SELECT + "t1".SRC_BIC, + "t1".DES_BIC, + "t1".IDF, + "t1".TREA_CENT, + "t1".NOT_HANDLED, + "t1".TRANS_CHANNEL +FROM + "Issue2815Table1" "t1" +ORDER BY + "t1".SRC_BIC, + "t1".DES_BIC + diff --git a/Firebird.2.5/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.2.5).sql b/Firebird.2.5/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.2.5).sql index f06a0825e0c6..dab4212849a6 100644 --- a/Firebird.2.5/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.2.5).sql +++ b/Firebird.2.5/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.2.5).sql @@ -6,7 +6,7 @@ UPDATE SET TRANS_CHANNEL = ( SELECT - "channel_1"."Trans_Channel" + Coalesce("channel_1"."Trans_Channel", 1) FROM "Issue2815Table1" "ext_1" LEFT JOIN "Issue2815Table2" "source_1" ON "source_1".ISO = "ext_1".SRC_BIC @@ -32,7 +32,7 @@ SET ), IDF = ( SELECT - "channel_2"."Idf" + Coalesce("channel_2"."Idf", 0) FROM "Issue2815Table1" "ext_2" LEFT JOIN "Issue2815Table2" "source_2" ON "source_2".ISO = "ext_2".SRC_BIC @@ -83,3 +83,19 @@ WHERE ("Issue2815Table1".TRANS_CHANNEL = "ext".TRANS_CHANNEL OR "Issue2815Table1".TRANS_CHANNEL IS NULL AND "ext".TRANS_CHANNEL IS NULL) ) +BeforeExecute +-- Firebird.2.5 Firebird + +SELECT + "t1".SRC_BIC, + "t1".DES_BIC, + "t1".IDF, + "t1".TREA_CENT, + "t1".NOT_HANDLED, + "t1".TRANS_CHANNEL +FROM + "Issue2815Table1" "t1" +ORDER BY + "t1".SRC_BIC, + "t1".DES_BIC + diff --git a/Firebird.3/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.3).sql b/Firebird.3/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.3).sql index 434ad52651b0..9f6259e2805e 100644 --- a/Firebird.3/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.3).sql +++ b/Firebird.3/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.3).sql @@ -6,7 +6,7 @@ UPDATE SET TRANS_CHANNEL = ( SELECT - "channel_1"."Trans_Channel" + Coalesce("channel_1"."Trans_Channel", 1) FROM "Issue2815Table1" "ext_1" LEFT JOIN "Issue2815Table2" "source_1" ON "source_1".ISO = "ext_1".SRC_BIC @@ -31,7 +31,7 @@ SET ), IDF = ( SELECT - "channel_2"."Idf" + Coalesce("channel_2"."Idf", 0) FROM "Issue2815Table1" "ext_2" LEFT JOIN "Issue2815Table2" "source_2" ON "source_2".ISO = "ext_2".SRC_BIC @@ -81,3 +81,19 @@ WHERE ("Issue2815Table1".TRANS_CHANNEL = "ext".TRANS_CHANNEL OR "Issue2815Table1".TRANS_CHANNEL IS NULL AND "ext".TRANS_CHANNEL IS NULL) ) +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "t1".SRC_BIC, + "t1".DES_BIC, + "t1".IDF, + "t1".TREA_CENT, + "t1".NOT_HANDLED, + "t1".TRANS_CHANNEL +FROM + "Issue2815Table1" "t1" +ORDER BY + "t1".SRC_BIC, + "t1".DES_BIC + diff --git a/Firebird.4/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.4).sql b/Firebird.4/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.4).sql index 4762d3a3a23c..25ba92aec572 100644 --- a/Firebird.4/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.4).sql +++ b/Firebird.4/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.4).sql @@ -6,7 +6,7 @@ UPDATE SET TRANS_CHANNEL = ( SELECT - "channel_1"."Trans_Channel" + Coalesce("channel_1"."Trans_Channel", 1) FROM "Issue2815Table1" "ext_1" LEFT JOIN "Issue2815Table2" "source_1" ON "source_1".ISO = "ext_1".SRC_BIC @@ -31,7 +31,7 @@ SET ), IDF = ( SELECT - "channel_2"."Idf" + Coalesce("channel_2"."Idf", 0) FROM "Issue2815Table1" "ext_2" LEFT JOIN "Issue2815Table2" "source_2" ON "source_2".ISO = "ext_2".SRC_BIC @@ -81,3 +81,19 @@ WHERE ("Issue2815Table1".TRANS_CHANNEL = "ext".TRANS_CHANNEL OR "Issue2815Table1".TRANS_CHANNEL IS NULL AND "ext".TRANS_CHANNEL IS NULL) ) +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "t1".SRC_BIC, + "t1".DES_BIC, + "t1".IDF, + "t1".TREA_CENT, + "t1".NOT_HANDLED, + "t1".TRANS_CHANNEL +FROM + "Issue2815Table1" "t1" +ORDER BY + "t1".SRC_BIC, + "t1".DES_BIC + diff --git a/Firebird.5/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.5).sql b/Firebird.5/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.5).sql index d740974f8ea4..02c422ebbc4c 100644 --- a/Firebird.5/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.5).sql +++ b/Firebird.5/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Firebird.5).sql @@ -6,7 +6,7 @@ UPDATE SET TRANS_CHANNEL = ( SELECT - "channel_1"."Trans_Channel" + Coalesce("channel_1"."Trans_Channel", 1) FROM "Issue2815Table1" "ext_1" LEFT JOIN "Issue2815Table2" "source_1" ON "source_1".ISO = "ext_1".SRC_BIC @@ -31,7 +31,7 @@ SET ), IDF = ( SELECT - "channel_2"."Idf" + Coalesce("channel_2"."Idf", 0) FROM "Issue2815Table1" "ext_2" LEFT JOIN "Issue2815Table2" "source_2" ON "source_2".ISO = "ext_2".SRC_BIC @@ -81,3 +81,19 @@ WHERE ("Issue2815Table1".TRANS_CHANNEL = "ext".TRANS_CHANNEL OR "Issue2815Table1".TRANS_CHANNEL IS NULL AND "ext".TRANS_CHANNEL IS NULL) ) +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "t1".SRC_BIC, + "t1".DES_BIC, + "t1".IDF, + "t1".TREA_CENT, + "t1".NOT_HANDLED, + "t1".TRANS_CHANNEL +FROM + "Issue2815Table1" "t1" +ORDER BY + "t1".SRC_BIC, + "t1".DES_BIC + diff --git a/Informix.DB2/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Informix.DB2).sql b/Informix.DB2/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Informix.DB2).sql index cf191f0c22f2..6466286e9318 100644 --- a/Informix.DB2/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Informix.DB2).sql +++ b/Informix.DB2/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Informix.DB2).sql @@ -6,7 +6,7 @@ UPDATE SET TRANS_CHANNEL = ( SELECT - channel_1.Trans_Channel + Nvl(channel_1.Trans_Channel, 1) FROM Issue2815Table1 ext_1 LEFT JOIN Issue2815Table2 source_1 ON source_1.ISO = ext_1.SRC_BIC @@ -31,7 +31,7 @@ SET ), IDF = ( SELECT - channel_2.Idf + Nvl(channel_2.Idf, 0) FROM Issue2815Table1 ext_2 LEFT JOIN Issue2815Table2 source_2 ON source_2.ISO = ext_2.SRC_BIC @@ -81,3 +81,19 @@ WHERE (Issue2815Table1.TRANS_CHANNEL = ext.TRANS_CHANNEL OR Issue2815Table1.TRANS_CHANNEL IS NULL AND ext.TRANS_CHANNEL IS NULL) ) +BeforeExecute +-- Informix.DB2 Informix + +SELECT + t1.SRC_BIC, + t1.DES_BIC, + t1.IDF, + t1.TREA_CENT, + t1.NOT_HANDLED, + t1.TRANS_CHANNEL +FROM + Issue2815Table1 t1 +ORDER BY + t1.SRC_BIC, + t1.DES_BIC + diff --git a/MariaDB.11/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MariaDB.11).sql b/MariaDB.11/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MariaDB.11).sql index ebaa0484b420..7978eb819bba 100644 --- a/MariaDB.11/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MariaDB.11).sql +++ b/MariaDB.11/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MariaDB.11).sql @@ -14,8 +14,24 @@ UPDATE ELSE 2 END SET - `ext`.`TRANS_CHANNEL` = Coalesce(`channel`.`Trans_Channel`, 0), - `ext`.`IDF` = `channel`.`Idf` + `ext`.`TRANS_CHANNEL` = Coalesce(`channel`.`Trans_Channel`, 1), + `ext`.`IDF` = Coalesce(`channel`.`Idf`, 0) WHERE `ext`.`NOT_HANDLED` = 2 AND `ext`.`TRANS_CHANNEL` IS NULL +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `t1`.`SRC_BIC`, + `t1`.`DES_BIC`, + `t1`.`IDF`, + `t1`.`TREA_CENT`, + `t1`.`NOT_HANDLED`, + `t1`.`TRANS_CHANNEL` +FROM + `Issue2815Table1` `t1` +ORDER BY + `t1`.`SRC_BIC`, + `t1`.`DES_BIC` + diff --git a/MySql.5.7/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySql.5.7).sql b/MySql.5.7/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySql.5.7).sql index 7b3cba9b58bf..3902460df01b 100644 --- a/MySql.5.7/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySql.5.7).sql +++ b/MySql.5.7/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySql.5.7).sql @@ -14,8 +14,24 @@ UPDATE ELSE 2 END SET - `ext`.`TRANS_CHANNEL` = Coalesce(`channel`.`Trans_Channel`, 0), - `ext`.`IDF` = `channel`.`Idf` + `ext`.`TRANS_CHANNEL` = Coalesce(`channel`.`Trans_Channel`, 1), + `ext`.`IDF` = Coalesce(`channel`.`Idf`, 0) WHERE `ext`.`NOT_HANDLED` = 2 AND `ext`.`TRANS_CHANNEL` IS NULL +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `t1`.`SRC_BIC`, + `t1`.`DES_BIC`, + `t1`.`IDF`, + `t1`.`TREA_CENT`, + `t1`.`NOT_HANDLED`, + `t1`.`TRANS_CHANNEL` +FROM + `Issue2815Table1` `t1` +ORDER BY + `t1`.`SRC_BIC`, + `t1`.`DES_BIC` + diff --git a/MySql.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySql.8.0).sql b/MySql.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySql.8.0).sql index 5b459a317b8e..67a0542546f7 100644 --- a/MySql.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySql.8.0).sql +++ b/MySql.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySql.8.0).sql @@ -14,8 +14,24 @@ UPDATE ELSE 2 END SET - `ext`.`TRANS_CHANNEL` = Coalesce(`channel`.`Trans_Channel`, 0), - `ext`.`IDF` = `channel`.`Idf` + `ext`.`TRANS_CHANNEL` = Coalesce(`channel`.`Trans_Channel`, 1), + `ext`.`IDF` = Coalesce(`channel`.`Idf`, 0) WHERE `ext`.`NOT_HANDLED` = 2 AND `ext`.`TRANS_CHANNEL` IS NULL +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`SRC_BIC`, + `t1`.`DES_BIC`, + `t1`.`IDF`, + `t1`.`TREA_CENT`, + `t1`.`NOT_HANDLED`, + `t1`.`TRANS_CHANNEL` +FROM + `Issue2815Table1` `t1` +ORDER BY + `t1`.`SRC_BIC`, + `t1`.`DES_BIC` + diff --git a/MySqlConnector.5.7/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySqlConnector.5.7).sql b/MySqlConnector.5.7/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySqlConnector.5.7).sql index 7ea98c37a98d..b072b8ecf23e 100644 --- a/MySqlConnector.5.7/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySqlConnector.5.7).sql +++ b/MySqlConnector.5.7/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySqlConnector.5.7).sql @@ -14,8 +14,24 @@ UPDATE ELSE 2 END SET - `ext`.`TRANS_CHANNEL` = Coalesce(`channel`.`Trans_Channel`, 0), - `ext`.`IDF` = `channel`.`Idf` + `ext`.`TRANS_CHANNEL` = Coalesce(`channel`.`Trans_Channel`, 1), + `ext`.`IDF` = Coalesce(`channel`.`Idf`, 0) WHERE `ext`.`NOT_HANDLED` = 2 AND `ext`.`TRANS_CHANNEL` IS NULL +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `t1`.`SRC_BIC`, + `t1`.`DES_BIC`, + `t1`.`IDF`, + `t1`.`TREA_CENT`, + `t1`.`NOT_HANDLED`, + `t1`.`TRANS_CHANNEL` +FROM + `Issue2815Table1` `t1` +ORDER BY + `t1`.`SRC_BIC`, + `t1`.`DES_BIC` + diff --git a/MySqlConnector.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySqlConnector.8.0).sql index 2f3edd5675b8..f6204f8d4cff 100644 --- a/MySqlConnector.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(MySqlConnector.8.0).sql @@ -14,8 +14,24 @@ UPDATE ELSE 2 END SET - `ext`.`TRANS_CHANNEL` = Coalesce(`channel`.`Trans_Channel`, 0), - `ext`.`IDF` = `channel`.`Idf` + `ext`.`TRANS_CHANNEL` = Coalesce(`channel`.`Trans_Channel`, 1), + `ext`.`IDF` = Coalesce(`channel`.`Idf`, 0) WHERE `ext`.`NOT_HANDLED` = 2 AND `ext`.`TRANS_CHANNEL` IS NULL +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`SRC_BIC`, + `t1`.`DES_BIC`, + `t1`.`IDF`, + `t1`.`TREA_CENT`, + `t1`.`NOT_HANDLED`, + `t1`.`TRANS_CHANNEL` +FROM + `Issue2815Table1` `t1` +ORDER BY + `t1`.`SRC_BIC`, + `t1`.`DES_BIC` + diff --git a/Oracle.11.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.11.Managed).sql b/Oracle.11.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.11.Managed).sql index 6d9b20725523..951aea9ce8dd 100644 --- a/Oracle.11.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.11.Managed).sql +++ b/Oracle.11.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.11.Managed).sql @@ -6,8 +6,8 @@ UPDATE SET (TRANS_CHANNEL, IDF) = ( SELECT - channel_1."Trans_Channel", - channel_1."Idf" + Coalesce(channel_1."Trans_Channel", 1), + Coalesce(channel_1."Idf", 0) FROM "Issue2815Table1" ext_1 LEFT JOIN "Issue2815Table2" source_1 ON source_1.ISO = ext_1.SRC_BIC @@ -57,3 +57,19 @@ WHERE ("Issue2815Table1".TRANS_CHANNEL = ext.TRANS_CHANNEL OR "Issue2815Table1".TRANS_CHANNEL IS NULL AND ext.TRANS_CHANNEL IS NULL) ) +BeforeExecute +-- Oracle.11.Managed Oracle11 + +SELECT + t1.SRC_BIC, + t1.DES_BIC, + t1.IDF, + t1.TREA_CENT, + t1.NOT_HANDLED, + t1.TRANS_CHANNEL +FROM + "Issue2815Table1" t1 +ORDER BY + t1.SRC_BIC, + t1.DES_BIC + diff --git a/Oracle.12.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.12.Managed).sql b/Oracle.12.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.12.Managed).sql index f298a60001de..8eae37c563f4 100644 --- a/Oracle.12.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.12.Managed).sql +++ b/Oracle.12.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.12.Managed).sql @@ -6,8 +6,8 @@ UPDATE SET (TRANS_CHANNEL, IDF) = ( SELECT - channel_1."Trans_Channel", - channel_1."Idf" + Coalesce(channel_1."Trans_Channel", 1), + Coalesce(channel_1."Idf", 0) FROM "Issue2815Table1" ext_1 LEFT JOIN "Issue2815Table2" source_1 ON source_1.ISO = ext_1.SRC_BIC @@ -57,3 +57,19 @@ WHERE ("Issue2815Table1".TRANS_CHANNEL = ext.TRANS_CHANNEL OR "Issue2815Table1".TRANS_CHANNEL IS NULL AND ext.TRANS_CHANNEL IS NULL) ) +BeforeExecute +-- Oracle.12.Managed Oracle.Managed Oracle12 + +SELECT + t1.SRC_BIC, + t1.DES_BIC, + t1.IDF, + t1.TREA_CENT, + t1.NOT_HANDLED, + t1.TRANS_CHANNEL +FROM + "Issue2815Table1" t1 +ORDER BY + t1.SRC_BIC, + t1.DES_BIC + diff --git a/Oracle.18.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.18.Managed).sql index e8396f686b9b..d7e03735c0a0 100644 --- a/Oracle.18.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.18.Managed).sql @@ -6,8 +6,8 @@ UPDATE SET (TRANS_CHANNEL, IDF) = ( SELECT - channel_1."Trans_Channel", - channel_1."Idf" + Coalesce(channel_1."Trans_Channel", 1), + Coalesce(channel_1."Idf", 0) FROM "Issue2815Table1" ext_1 LEFT JOIN "Issue2815Table2" source_1 ON source_1.ISO = ext_1.SRC_BIC @@ -57,3 +57,19 @@ WHERE ("Issue2815Table1".TRANS_CHANNEL = ext.TRANS_CHANNEL OR "Issue2815Table1".TRANS_CHANNEL IS NULL AND ext.TRANS_CHANNEL IS NULL) ) +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + t1.SRC_BIC, + t1.DES_BIC, + t1.IDF, + t1.TREA_CENT, + t1.NOT_HANDLED, + t1.TRANS_CHANNEL +FROM + "Issue2815Table1" t1 +ORDER BY + t1.SRC_BIC, + t1.DES_BIC + diff --git a/Oracle.19.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.19.Managed).sql index 6927f8e73913..a101e22fb66b 100644 --- a/Oracle.19.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.19.Managed).sql @@ -6,8 +6,8 @@ UPDATE SET (TRANS_CHANNEL, IDF) = ( SELECT - channel_1."Trans_Channel", - channel_1."Idf" + Coalesce(channel_1."Trans_Channel", 1), + Coalesce(channel_1."Idf", 0) FROM "Issue2815Table1" ext_1 LEFT JOIN "Issue2815Table2" source_1 ON source_1.ISO = ext_1.SRC_BIC @@ -57,3 +57,19 @@ WHERE ("Issue2815Table1".TRANS_CHANNEL = ext.TRANS_CHANNEL OR "Issue2815Table1".TRANS_CHANNEL IS NULL AND ext.TRANS_CHANNEL IS NULL) ) +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + t1.SRC_BIC, + t1.DES_BIC, + t1.IDF, + t1.TREA_CENT, + t1.NOT_HANDLED, + t1.TRANS_CHANNEL +FROM + "Issue2815Table1" t1 +ORDER BY + t1.SRC_BIC, + t1.DES_BIC + diff --git a/Oracle.21.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.21.Managed).sql b/Oracle.21.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.21.Managed).sql index c9f95774cdc1..16e4b73aaa26 100644 --- a/Oracle.21.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.21.Managed).sql +++ b/Oracle.21.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.21.Managed).sql @@ -6,8 +6,8 @@ UPDATE SET (TRANS_CHANNEL, IDF) = ( SELECT - channel_1."Trans_Channel", - channel_1."Idf" + Coalesce(channel_1."Trans_Channel", 1), + Coalesce(channel_1."Idf", 0) FROM "Issue2815Table1" ext_1 LEFT JOIN "Issue2815Table2" source_1 ON source_1.ISO = ext_1.SRC_BIC @@ -57,3 +57,19 @@ WHERE ("Issue2815Table1".TRANS_CHANNEL = ext.TRANS_CHANNEL OR "Issue2815Table1".TRANS_CHANNEL IS NULL AND ext.TRANS_CHANNEL IS NULL) ) +BeforeExecute +-- Oracle.21.Managed Oracle.Managed Oracle12 + +SELECT + t1.SRC_BIC, + t1.DES_BIC, + t1.IDF, + t1.TREA_CENT, + t1.NOT_HANDLED, + t1.TRANS_CHANNEL +FROM + "Issue2815Table1" t1 +ORDER BY + t1.SRC_BIC, + t1.DES_BIC + diff --git a/Oracle.23.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.23.Managed).sql b/Oracle.23.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.23.Managed).sql index 7ebc78b0a2e2..952aecf7e005 100644 --- a/Oracle.23.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.23.Managed).sql +++ b/Oracle.23.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Oracle.23.Managed).sql @@ -6,8 +6,8 @@ UPDATE SET (TRANS_CHANNEL, IDF) = ( SELECT - channel_1."Trans_Channel", - channel_1."Idf" + Coalesce(channel_1."Trans_Channel", 1), + Coalesce(channel_1."Idf", 0) FROM "Issue2815Table1" ext_1 LEFT JOIN "Issue2815Table2" source_1 ON source_1.ISO = ext_1.SRC_BIC @@ -57,3 +57,19 @@ WHERE ("Issue2815Table1".TRANS_CHANNEL = ext.TRANS_CHANNEL OR "Issue2815Table1".TRANS_CHANNEL IS NULL AND ext.TRANS_CHANNEL IS NULL) ) +BeforeExecute +-- Oracle.23.Managed Oracle.Managed Oracle12 + +SELECT + t1.SRC_BIC, + t1.DES_BIC, + t1.IDF, + t1.TREA_CENT, + t1.NOT_HANDLED, + t1.TRANS_CHANNEL +FROM + "Issue2815Table1" t1 +ORDER BY + t1.SRC_BIC, + t1.DES_BIC + diff --git a/PostgreSQL.13.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.13.LinqService).sql index e6376971f7cd..afe819ec237c 100644 --- a/PostgreSQL.13.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.13.LinqService).sql @@ -8,13 +8,11 @@ UPDATE SET is_deleted = :is_deleted FROM - element_services sr, - "Components" cm + component_categories ct + INNER JOIN element_services sr ON sr.id = ct.service_id + LEFT JOIN "Components" cm ON ct.id = cm.category_id AND NOT cm.is_deleted WHERE - sr.id = 'TestProcessService' AND - sr.id = component_categories.service_id AND - component_categories.id = cm.category_id AND - NOT cm.is_deleted + sr.id = 'TestProcessService' AND component_categories.id = ct.id BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.13.LinqService).sql index d9922c1b92c6..e8b0d2cc4731 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.13.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.13.LinqService).sql index f4e0ac31c611..e5d14cf46694 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.13.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.13.LinqService).sql index 268294fcb3f9..e5df9b01947c 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.13.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.13.LinqService).sql index 268294fcb3f9..e5df9b01947c 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.13.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.13.LinqService).sql index 4b9f4845366d..af362bf6a135 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.13.LinqService).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.13.LinqService).sql index 4b9f4845366d..af362bf6a135 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.13.LinqService).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.13.LinqService).sql index 3706ceb41a53..392ddb205dc1 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.13.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 2 + "ChildID" = c_1."ChildID" + 2 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.13.LinqService).sql index 690f4ec91b59..c5e813520bcc 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.13.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.13.LinqService).sql index e0c577fe43bb..2950c0b3e24a 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.13.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.13.LinqService).sql index e0c577fe43bb..2950c0b3e24a 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.13.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.13.LinqService).sql index d9922c1b92c6..e8b0d2cc4731 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.13.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.13.LinqService).sql index d9922c1b92c6..e8b0d2cc4731 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.13.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.13.LinqService).sql index aad6cf767ad5..37e47ede0458 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.13.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.13.LinqService).sql index cc95a59c2649..4bbc2130f3a2 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.13.LinqService).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.13.LinqService).sql index d68566b160b0..b75d902be08c 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.13.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.13.LinqService).sql index a90205a026e5..e719e722231f 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.13.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.13.LinqService).sql index a90205a026e5..e719e722231f 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.13.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.13.LinqService).sql index bc34812735fc..d6c9ab3202f3 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.13.LinqService).sql @@ -14,11 +14,12 @@ UPDATE SET "ParentID" = c_2."ParentID" + 1000 FROM - "Child" c_1, - "Child" c_2 + "Parent" p + INNER JOIN "Child" c_1 ON p."ParentID" = c_1."ParentID" + LEFT JOIN "Child" c_2 ON c_2."ChildID" = 11 WHERE - "Parent"."ParentID" = 1 AND "Parent"."ParentID" = c_1."ParentID" AND - c_2."ChildID" = 11 + p."ParentID" = 1 AND "Parent"."ParentID" = p."ParentID" AND + ("Parent"."Value1" = p."Value1" OR "Parent"."Value1" IS NULL AND p."Value1" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.13).sql index e6376971f7cd..afe819ec237c 100644 --- a/PostgreSQL.13/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.13).sql @@ -8,13 +8,11 @@ UPDATE SET is_deleted = :is_deleted FROM - element_services sr, - "Components" cm + component_categories ct + INNER JOIN element_services sr ON sr.id = ct.service_id + LEFT JOIN "Components" cm ON ct.id = cm.category_id AND NOT cm.is_deleted WHERE - sr.id = 'TestProcessService' AND - sr.id = component_categories.service_id AND - component_categories.id = cm.category_id AND - NOT cm.is_deleted + sr.id = 'TestProcessService' AND component_categories.id = ct.id BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.13).sql index d9922c1b92c6..e8b0d2cc4731 100644 --- a/PostgreSQL.13/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.13).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.13).sql index f4e0ac31c611..e5d14cf46694 100644 --- a/PostgreSQL.13/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.13).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.13).sql index fc7bb4ec2074..8866f92bc4fc 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.13).sql @@ -4,25 +4,43 @@ UPDATE "Issue2815Table1" SET - "TRANS_CHANNEL" = channel."Trans_Channel", - "IDF" = channel."Idf" + "TRANS_CHANNEL" = Coalesce(channel."Trans_Channel", 1), + "IDF" = Coalesce(channel."Idf", 0) FROM - "Issue2815Table2" source, - "Issue2815Table2" destination, - "Issue2815Table3" channel -WHERE - "Issue2815Table1"."NOT_HANDLED" = 2 AND - "Issue2815Table1"."TRANS_CHANNEL" IS NULL AND - source."ISO" = "Issue2815Table1"."SRC_BIC" AND - destination."ISO" = "Issue2815Table1"."DES_BIC" AND - channel."TreasuryCenter" = "Issue2815Table1"."TREA_CENT" AND - channel."BIC" = "Issue2815Table1"."SRC_BIC" AND - channel."Sepa" = CASE - WHEN source."SEPA" AND destination."SEPA" THEN CASE - WHEN source."ISO" = destination."ISO" OR source."ISO" IS NULL AND destination."ISO" IS NULL - THEN 0 - ELSE 1 + "Issue2815Table1" ext + LEFT JOIN "Issue2815Table2" source ON source."ISO" = ext."SRC_BIC" + LEFT JOIN "Issue2815Table2" destination ON destination."ISO" = ext."DES_BIC" + LEFT JOIN "Issue2815Table3" channel ON channel."TreasuryCenter" = ext."TREA_CENT" AND channel."BIC" = ext."SRC_BIC" AND channel."Sepa" = CASE + WHEN source."SEPA" AND destination."SEPA" THEN CASE + WHEN source."ISO" = destination."ISO" OR source."ISO" IS NULL AND destination."ISO" IS NULL + THEN 0 + ELSE 1 + END + ELSE 2 END - ELSE 2 - END +WHERE + ext."NOT_HANDLED" = 2 AND + ext."TRANS_CHANNEL" IS NULL AND + "Issue2815Table1"."SRC_BIC" = ext."SRC_BIC" AND + "Issue2815Table1"."DES_BIC" = ext."DES_BIC" AND + "Issue2815Table1"."IDF" = ext."IDF" AND + "Issue2815Table1"."TREA_CENT" = ext."TREA_CENT" AND + "Issue2815Table1"."NOT_HANDLED" = ext."NOT_HANDLED" AND + ("Issue2815Table1"."TRANS_CHANNEL" = ext."TRANS_CHANNEL" OR "Issue2815Table1"."TRANS_CHANNEL" IS NULL AND ext."TRANS_CHANNEL" IS NULL) + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."SRC_BIC", + t1."DES_BIC", + t1."IDF", + t1."TREA_CENT", + t1."NOT_HANDLED", + t1."TRANS_CHANNEL" +FROM + "Issue2815Table1" t1 +ORDER BY + t1."SRC_BIC", + t1."DES_BIC" diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.13).sql index 268294fcb3f9..e5df9b01947c 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.13).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.13).sql index 268294fcb3f9..e5df9b01947c 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.13).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.13).sql index 4b9f4845366d..af362bf6a135 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.13).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.13).sql index 4b9f4845366d..af362bf6a135 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.13).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.13).sql index 3706ceb41a53..392ddb205dc1 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.13).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 2 + "ChildID" = c_1."ChildID" + 2 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.13).sql index 690f4ec91b59..c5e813520bcc 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.13).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.13).sql index e0c577fe43bb..2950c0b3e24a 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.13).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.13).sql index e0c577fe43bb..2950c0b3e24a 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.13).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.13).sql index d9922c1b92c6..e8b0d2cc4731 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.13).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.13).sql index d9922c1b92c6..e8b0d2cc4731 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.13).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.13).sql index aad6cf767ad5..37e47ede0458 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.13).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.13).sql index cc95a59c2649..4bbc2130f3a2 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.13).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.13).sql index d68566b160b0..b75d902be08c 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.13).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.13).sql index a90205a026e5..e719e722231f 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.13).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.13).sql index a90205a026e5..e719e722231f 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.13).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.13).sql index bc34812735fc..d6c9ab3202f3 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.13).sql @@ -14,11 +14,12 @@ UPDATE SET "ParentID" = c_2."ParentID" + 1000 FROM - "Child" c_1, - "Child" c_2 + "Parent" p + INNER JOIN "Child" c_1 ON p."ParentID" = c_1."ParentID" + LEFT JOIN "Child" c_2 ON c_2."ChildID" = 11 WHERE - "Parent"."ParentID" = 1 AND "Parent"."ParentID" = c_1."ParentID" AND - c_2."ChildID" = 11 + p."ParentID" = 1 AND "Parent"."ParentID" = p."ParentID" AND + ("Parent"."Value1" = p."Value1" OR "Parent"."Value1" IS NULL AND p."Value1" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.14.LinqService).sql index 3e2fb9880347..a205555d1bd0 100644 --- a/PostgreSQL.14.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.14.LinqService).sql @@ -8,13 +8,11 @@ UPDATE SET is_deleted = :is_deleted FROM - element_services sr, - "Components" cm + component_categories ct + INNER JOIN element_services sr ON sr.id = ct.service_id + LEFT JOIN "Components" cm ON ct.id = cm.category_id AND NOT cm.is_deleted WHERE - sr.id = 'TestProcessService' AND - sr.id = component_categories.service_id AND - component_categories.id = cm.category_id AND - NOT cm.is_deleted + sr.id = 'TestProcessService' AND component_categories.id = ct.id BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.14.LinqService).sql index b4cd0747f03e..2ca66e9cc7c2 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.14.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.14.LinqService).sql index 6cba45e69c0a..31d2aad4d5da 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.14.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.14.LinqService).sql index 15da63133139..225977eb2712 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.14.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.14.LinqService).sql index 15da63133139..225977eb2712 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.14.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.14.LinqService).sql index 13c4f19898a5..ee50b365cdc3 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.14.LinqService).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.14.LinqService).sql index 13c4f19898a5..ee50b365cdc3 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.14.LinqService).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.14.LinqService).sql index cd2e932ca89b..854b0b316eac 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.14.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 2 + "ChildID" = c_1."ChildID" + 2 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.14.LinqService).sql index b0e32e31f862..ede6e9afb009 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.14.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.14.LinqService).sql index 574c2e0a6365..4b259ee308b3 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.14.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.14.LinqService).sql index 574c2e0a6365..4b259ee308b3 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.14.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.14.LinqService).sql index b4cd0747f03e..2ca66e9cc7c2 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.14.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.14.LinqService).sql index b4cd0747f03e..2ca66e9cc7c2 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.14.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.14.LinqService).sql index 92b446bc39c3..845048815e9a 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.14.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.14.LinqService).sql index d4047c8f8503..bf877c90ea0f 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.14.LinqService).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.14.LinqService).sql index 69b4fec891df..fb029892d543 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.14.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.14.LinqService).sql index 958569f89683..5f5b4665cc89 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.14.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.14.LinqService).sql index 958569f89683..5f5b4665cc89 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.14.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.14.LinqService).sql index ec6e30f97284..2b4266612693 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.14.LinqService).sql @@ -14,11 +14,12 @@ UPDATE SET "ParentID" = c_2."ParentID" + 1000 FROM - "Child" c_1, - "Child" c_2 + "Parent" p + INNER JOIN "Child" c_1 ON p."ParentID" = c_1."ParentID" + LEFT JOIN "Child" c_2 ON c_2."ChildID" = 11 WHERE - "Parent"."ParentID" = 1 AND "Parent"."ParentID" = c_1."ParentID" AND - c_2."ChildID" = 11 + p."ParentID" = 1 AND "Parent"."ParentID" = p."ParentID" AND + ("Parent"."Value1" = p."Value1" OR "Parent"."Value1" IS NULL AND p."Value1" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.14).sql index 3e2fb9880347..a205555d1bd0 100644 --- a/PostgreSQL.14/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.14).sql @@ -8,13 +8,11 @@ UPDATE SET is_deleted = :is_deleted FROM - element_services sr, - "Components" cm + component_categories ct + INNER JOIN element_services sr ON sr.id = ct.service_id + LEFT JOIN "Components" cm ON ct.id = cm.category_id AND NOT cm.is_deleted WHERE - sr.id = 'TestProcessService' AND - sr.id = component_categories.service_id AND - component_categories.id = cm.category_id AND - NOT cm.is_deleted + sr.id = 'TestProcessService' AND component_categories.id = ct.id BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.14).sql index b4cd0747f03e..2ca66e9cc7c2 100644 --- a/PostgreSQL.14/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.14).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.14).sql index 6cba45e69c0a..31d2aad4d5da 100644 --- a/PostgreSQL.14/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.14).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.14).sql index 1d3fa58a19fd..481d523e824b 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.14).sql @@ -4,25 +4,43 @@ UPDATE "Issue2815Table1" SET - "TRANS_CHANNEL" = channel."Trans_Channel", - "IDF" = channel."Idf" + "TRANS_CHANNEL" = Coalesce(channel."Trans_Channel", 1), + "IDF" = Coalesce(channel."Idf", 0) FROM - "Issue2815Table2" source, - "Issue2815Table2" destination, - "Issue2815Table3" channel -WHERE - "Issue2815Table1"."NOT_HANDLED" = 2 AND - "Issue2815Table1"."TRANS_CHANNEL" IS NULL AND - source."ISO" = "Issue2815Table1"."SRC_BIC" AND - destination."ISO" = "Issue2815Table1"."DES_BIC" AND - channel."TreasuryCenter" = "Issue2815Table1"."TREA_CENT" AND - channel."BIC" = "Issue2815Table1"."SRC_BIC" AND - channel."Sepa" = CASE - WHEN source."SEPA" AND destination."SEPA" THEN CASE - WHEN source."ISO" = destination."ISO" OR source."ISO" IS NULL AND destination."ISO" IS NULL - THEN 0 - ELSE 1 + "Issue2815Table1" ext + LEFT JOIN "Issue2815Table2" source ON source."ISO" = ext."SRC_BIC" + LEFT JOIN "Issue2815Table2" destination ON destination."ISO" = ext."DES_BIC" + LEFT JOIN "Issue2815Table3" channel ON channel."TreasuryCenter" = ext."TREA_CENT" AND channel."BIC" = ext."SRC_BIC" AND channel."Sepa" = CASE + WHEN source."SEPA" AND destination."SEPA" THEN CASE + WHEN source."ISO" = destination."ISO" OR source."ISO" IS NULL AND destination."ISO" IS NULL + THEN 0 + ELSE 1 + END + ELSE 2 END - ELSE 2 - END +WHERE + ext."NOT_HANDLED" = 2 AND + ext."TRANS_CHANNEL" IS NULL AND + "Issue2815Table1"."SRC_BIC" = ext."SRC_BIC" AND + "Issue2815Table1"."DES_BIC" = ext."DES_BIC" AND + "Issue2815Table1"."IDF" = ext."IDF" AND + "Issue2815Table1"."TREA_CENT" = ext."TREA_CENT" AND + "Issue2815Table1"."NOT_HANDLED" = ext."NOT_HANDLED" AND + ("Issue2815Table1"."TRANS_CHANNEL" = ext."TRANS_CHANNEL" OR "Issue2815Table1"."TRANS_CHANNEL" IS NULL AND ext."TRANS_CHANNEL" IS NULL) + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."SRC_BIC", + t1."DES_BIC", + t1."IDF", + t1."TREA_CENT", + t1."NOT_HANDLED", + t1."TRANS_CHANNEL" +FROM + "Issue2815Table1" t1 +ORDER BY + t1."SRC_BIC", + t1."DES_BIC" diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.14).sql index 15da63133139..225977eb2712 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.14).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.14).sql index 15da63133139..225977eb2712 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.14).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.14).sql index 13c4f19898a5..ee50b365cdc3 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.14).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.14).sql index 13c4f19898a5..ee50b365cdc3 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.14).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.14).sql index cd2e932ca89b..854b0b316eac 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.14).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 2 + "ChildID" = c_1."ChildID" + 2 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.14).sql index b0e32e31f862..ede6e9afb009 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.14).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.14).sql index 574c2e0a6365..4b259ee308b3 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.14).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.14).sql index 574c2e0a6365..4b259ee308b3 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.14).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.14).sql index b4cd0747f03e..2ca66e9cc7c2 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.14).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.14).sql index b4cd0747f03e..2ca66e9cc7c2 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.14).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.14).sql index 92b446bc39c3..845048815e9a 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.14).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.14).sql index d4047c8f8503..bf877c90ea0f 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.14).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.14).sql index 69b4fec891df..fb029892d543 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.14).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.14).sql index 958569f89683..5f5b4665cc89 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.14).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.14).sql index 958569f89683..5f5b4665cc89 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.14).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.14).sql index ec6e30f97284..2b4266612693 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.14).sql @@ -14,11 +14,12 @@ UPDATE SET "ParentID" = c_2."ParentID" + 1000 FROM - "Child" c_1, - "Child" c_2 + "Parent" p + INNER JOIN "Child" c_1 ON p."ParentID" = c_1."ParentID" + LEFT JOIN "Child" c_2 ON c_2."ChildID" = 11 WHERE - "Parent"."ParentID" = 1 AND "Parent"."ParentID" = c_1."ParentID" AND - c_2."ChildID" = 11 + p."ParentID" = 1 AND "Parent"."ParentID" = p."ParentID" AND + ("Parent"."Value1" = p."Value1" OR "Parent"."Value1" IS NULL AND p."Value1" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.15.LinqService).sql index f221d589428b..194d839c0034 100644 --- a/PostgreSQL.15.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.15.LinqService).sql @@ -8,13 +8,11 @@ UPDATE SET is_deleted = :is_deleted FROM - element_services sr, - "Components" cm + component_categories ct + INNER JOIN element_services sr ON sr.id = ct.service_id + LEFT JOIN "Components" cm ON ct.id = cm.category_id AND NOT cm.is_deleted WHERE - sr.id = 'TestProcessService' AND - sr.id = component_categories.service_id AND - component_categories.id = cm.category_id AND - NOT cm.is_deleted + sr.id = 'TestProcessService' AND component_categories.id = ct.id BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.15.LinqService).sql index ebd8f90cb8c7..cda841a254d4 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.15.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.15.LinqService).sql index 5e2d6e5b5d1a..1449ba21eeaf 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.15.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.15.LinqService).sql index 49cb100d2c6c..8cd82bd126b0 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.15.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.15.LinqService).sql index 49cb100d2c6c..8cd82bd126b0 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.15.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.15.LinqService).sql index 91d5f0938a2e..49db8814d663 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.15.LinqService).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.15.LinqService).sql index 91d5f0938a2e..49db8814d663 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.15.LinqService).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.15.LinqService).sql index 497eea425af0..4804246e9e47 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.15.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 2 + "ChildID" = c_1."ChildID" + 2 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.15.LinqService).sql index 2f8f3293d2ca..7dd580b855d2 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.15.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.15.LinqService).sql index 0579b2697354..bc39be57c633 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.15.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.15.LinqService).sql index 0579b2697354..bc39be57c633 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.15.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.15.LinqService).sql index ebd8f90cb8c7..cda841a254d4 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.15.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.15.LinqService).sql index ebd8f90cb8c7..cda841a254d4 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.15.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.15.LinqService).sql index c9662c72aea2..42b4df1d0910 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.15.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.15.LinqService).sql index 7b09b9518f39..b8fbfe8023c4 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.15.LinqService).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.15.LinqService).sql index 0a8f46ad4357..62cda618e167 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.15.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.15.LinqService).sql index d4f5df2a6897..264a49afdce1 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.15.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.15.LinqService).sql index d4f5df2a6897..264a49afdce1 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.15.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.15.LinqService).sql index f70393c62ef9..4cd5000d3299 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.15.LinqService).sql @@ -14,11 +14,12 @@ UPDATE SET "ParentID" = c_2."ParentID" + 1000 FROM - "Child" c_1, - "Child" c_2 + "Parent" p + INNER JOIN "Child" c_1 ON p."ParentID" = c_1."ParentID" + LEFT JOIN "Child" c_2 ON c_2."ChildID" = 11 WHERE - "Parent"."ParentID" = 1 AND "Parent"."ParentID" = c_1."ParentID" AND - c_2."ChildID" = 11 + p."ParentID" = 1 AND "Parent"."ParentID" = p."ParentID" AND + ("Parent"."Value1" = p."Value1" OR "Parent"."Value1" IS NULL AND p."Value1" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.15).sql index f221d589428b..194d839c0034 100644 --- a/PostgreSQL.15/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.15).sql @@ -8,13 +8,11 @@ UPDATE SET is_deleted = :is_deleted FROM - element_services sr, - "Components" cm + component_categories ct + INNER JOIN element_services sr ON sr.id = ct.service_id + LEFT JOIN "Components" cm ON ct.id = cm.category_id AND NOT cm.is_deleted WHERE - sr.id = 'TestProcessService' AND - sr.id = component_categories.service_id AND - component_categories.id = cm.category_id AND - NOT cm.is_deleted + sr.id = 'TestProcessService' AND component_categories.id = ct.id BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.15).sql index ebd8f90cb8c7..cda841a254d4 100644 --- a/PostgreSQL.15/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.15).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.15).sql index 5e2d6e5b5d1a..1449ba21eeaf 100644 --- a/PostgreSQL.15/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.15).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.15).sql index bf611ba006e3..437b97acb01a 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.15).sql @@ -4,25 +4,43 @@ UPDATE "Issue2815Table1" SET - "TRANS_CHANNEL" = channel."Trans_Channel", - "IDF" = channel."Idf" + "TRANS_CHANNEL" = Coalesce(channel."Trans_Channel", 1), + "IDF" = Coalesce(channel."Idf", 0) FROM - "Issue2815Table2" source, - "Issue2815Table2" destination, - "Issue2815Table3" channel -WHERE - "Issue2815Table1"."NOT_HANDLED" = 2 AND - "Issue2815Table1"."TRANS_CHANNEL" IS NULL AND - source."ISO" = "Issue2815Table1"."SRC_BIC" AND - destination."ISO" = "Issue2815Table1"."DES_BIC" AND - channel."TreasuryCenter" = "Issue2815Table1"."TREA_CENT" AND - channel."BIC" = "Issue2815Table1"."SRC_BIC" AND - channel."Sepa" = CASE - WHEN source."SEPA" AND destination."SEPA" THEN CASE - WHEN source."ISO" = destination."ISO" OR source."ISO" IS NULL AND destination."ISO" IS NULL - THEN 0 - ELSE 1 + "Issue2815Table1" ext + LEFT JOIN "Issue2815Table2" source ON source."ISO" = ext."SRC_BIC" + LEFT JOIN "Issue2815Table2" destination ON destination."ISO" = ext."DES_BIC" + LEFT JOIN "Issue2815Table3" channel ON channel."TreasuryCenter" = ext."TREA_CENT" AND channel."BIC" = ext."SRC_BIC" AND channel."Sepa" = CASE + WHEN source."SEPA" AND destination."SEPA" THEN CASE + WHEN source."ISO" = destination."ISO" OR source."ISO" IS NULL AND destination."ISO" IS NULL + THEN 0 + ELSE 1 + END + ELSE 2 END - ELSE 2 - END +WHERE + ext."NOT_HANDLED" = 2 AND + ext."TRANS_CHANNEL" IS NULL AND + "Issue2815Table1"."SRC_BIC" = ext."SRC_BIC" AND + "Issue2815Table1"."DES_BIC" = ext."DES_BIC" AND + "Issue2815Table1"."IDF" = ext."IDF" AND + "Issue2815Table1"."TREA_CENT" = ext."TREA_CENT" AND + "Issue2815Table1"."NOT_HANDLED" = ext."NOT_HANDLED" AND + ("Issue2815Table1"."TRANS_CHANNEL" = ext."TRANS_CHANNEL" OR "Issue2815Table1"."TRANS_CHANNEL" IS NULL AND ext."TRANS_CHANNEL" IS NULL) + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."SRC_BIC", + t1."DES_BIC", + t1."IDF", + t1."TREA_CENT", + t1."NOT_HANDLED", + t1."TRANS_CHANNEL" +FROM + "Issue2815Table1" t1 +ORDER BY + t1."SRC_BIC", + t1."DES_BIC" diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.15).sql index 49cb100d2c6c..8cd82bd126b0 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.15).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.15).sql index 49cb100d2c6c..8cd82bd126b0 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.15).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.15).sql index 91d5f0938a2e..49db8814d663 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.15).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.15).sql index 91d5f0938a2e..49db8814d663 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.15).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.15).sql index 497eea425af0..4804246e9e47 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.15).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 2 + "ChildID" = c_1."ChildID" + 2 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.15).sql index 2f8f3293d2ca..7dd580b855d2 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.15).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.15).sql index 0579b2697354..bc39be57c633 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.15).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.15).sql index 0579b2697354..bc39be57c633 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.15).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.15).sql index ebd8f90cb8c7..cda841a254d4 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.15).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.15).sql index ebd8f90cb8c7..cda841a254d4 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.15).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.15).sql index c9662c72aea2..42b4df1d0910 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.15).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.15).sql index 7b09b9518f39..b8fbfe8023c4 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.15).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.15).sql index 0a8f46ad4357..62cda618e167 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.15).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.15).sql index d4f5df2a6897..264a49afdce1 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.15).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.15).sql index d4f5df2a6897..264a49afdce1 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.15).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.15).sql index f70393c62ef9..4cd5000d3299 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.15).sql @@ -14,11 +14,12 @@ UPDATE SET "ParentID" = c_2."ParentID" + 1000 FROM - "Child" c_1, - "Child" c_2 + "Parent" p + INNER JOIN "Child" c_1 ON p."ParentID" = c_1."ParentID" + LEFT JOIN "Child" c_2 ON c_2."ChildID" = 11 WHERE - "Parent"."ParentID" = 1 AND "Parent"."ParentID" = c_1."ParentID" AND - c_2."ChildID" = 11 + p."ParentID" = 1 AND "Parent"."ParentID" = p."ParentID" AND + ("Parent"."Value1" = p."Value1" OR "Parent"."Value1" IS NULL AND p."Value1" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.16.LinqService).sql index 901e1e37b61c..f4e8aed48d7d 100644 --- a/PostgreSQL.16.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.16.LinqService).sql @@ -8,13 +8,11 @@ UPDATE SET is_deleted = :is_deleted FROM - element_services sr, - "Components" cm + component_categories ct + INNER JOIN element_services sr ON sr.id = ct.service_id + LEFT JOIN "Components" cm ON ct.id = cm.category_id AND NOT cm.is_deleted WHERE - sr.id = 'TestProcessService' AND - sr.id = component_categories.service_id AND - component_categories.id = cm.category_id AND - NOT cm.is_deleted + sr.id = 'TestProcessService' AND component_categories.id = ct.id BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.16.LinqService).sql index df0b6047e6c3..70ca55af5b17 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.16.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.16.LinqService).sql index 042162b28fa2..be476232c554 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.16.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.16.LinqService).sql index a96d1722219d..9a3cac421044 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.16.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.16.LinqService).sql index a96d1722219d..9a3cac421044 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.16.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.16.LinqService).sql index 6549a242317a..b26cf06b2f10 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.16.LinqService).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.16.LinqService).sql index 6549a242317a..b26cf06b2f10 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.16.LinqService).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.16.LinqService).sql index 2fe6ca68d38d..1e45cc894e89 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.16.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 2 + "ChildID" = c_1."ChildID" + 2 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.16.LinqService).sql index 2cebca31c4e0..cdb5213228c3 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.16.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.16.LinqService).sql index b26ee053f8af..dfd1c8970e6f 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.16.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.16.LinqService).sql index b26ee053f8af..dfd1c8970e6f 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.16.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.16.LinqService).sql index df0b6047e6c3..70ca55af5b17 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.16.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.16.LinqService).sql index df0b6047e6c3..70ca55af5b17 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.16.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.16.LinqService).sql index f58f28f94014..f66af8281563 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.16.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.16.LinqService).sql index 9348ad8cf35d..3cd8439da6d9 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.16.LinqService).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.16.LinqService).sql index 55078cbc742f..885b4ea6e838 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.16.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.16.LinqService).sql index f7d44cfa9a9f..4312fd2aff60 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.16.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.16.LinqService).sql index f7d44cfa9a9f..4312fd2aff60 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.16.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.16.LinqService).sql index 5322769b22bd..e57570e27953 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.16.LinqService).sql @@ -14,11 +14,12 @@ UPDATE SET "ParentID" = c_2."ParentID" + 1000 FROM - "Child" c_1, - "Child" c_2 + "Parent" p + INNER JOIN "Child" c_1 ON p."ParentID" = c_1."ParentID" + LEFT JOIN "Child" c_2 ON c_2."ChildID" = 11 WHERE - "Parent"."ParentID" = 1 AND "Parent"."ParentID" = c_1."ParentID" AND - c_2."ChildID" = 11 + p."ParentID" = 1 AND "Parent"."ParentID" = p."ParentID" AND + ("Parent"."Value1" = p."Value1" OR "Parent"."Value1" IS NULL AND p."Value1" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.16).sql index 901e1e37b61c..f4e8aed48d7d 100644 --- a/PostgreSQL.16/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.16).sql @@ -8,13 +8,11 @@ UPDATE SET is_deleted = :is_deleted FROM - element_services sr, - "Components" cm + component_categories ct + INNER JOIN element_services sr ON sr.id = ct.service_id + LEFT JOIN "Components" cm ON ct.id = cm.category_id AND NOT cm.is_deleted WHERE - sr.id = 'TestProcessService' AND - sr.id = component_categories.service_id AND - component_categories.id = cm.category_id AND - NOT cm.is_deleted + sr.id = 'TestProcessService' AND component_categories.id = ct.id BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.16).sql index df0b6047e6c3..70ca55af5b17 100644 --- a/PostgreSQL.16/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.16).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.16).sql index 042162b28fa2..be476232c554 100644 --- a/PostgreSQL.16/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.16).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.16).sql index d531eced605b..8f5ce10e1d9c 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.16).sql @@ -4,25 +4,43 @@ UPDATE "Issue2815Table1" SET - "TRANS_CHANNEL" = channel."Trans_Channel", - "IDF" = channel."Idf" + "TRANS_CHANNEL" = Coalesce(channel."Trans_Channel", 1), + "IDF" = Coalesce(channel."Idf", 0) FROM - "Issue2815Table2" source, - "Issue2815Table2" destination, - "Issue2815Table3" channel -WHERE - "Issue2815Table1"."NOT_HANDLED" = 2 AND - "Issue2815Table1"."TRANS_CHANNEL" IS NULL AND - source."ISO" = "Issue2815Table1"."SRC_BIC" AND - destination."ISO" = "Issue2815Table1"."DES_BIC" AND - channel."TreasuryCenter" = "Issue2815Table1"."TREA_CENT" AND - channel."BIC" = "Issue2815Table1"."SRC_BIC" AND - channel."Sepa" = CASE - WHEN source."SEPA" AND destination."SEPA" THEN CASE - WHEN source."ISO" = destination."ISO" OR source."ISO" IS NULL AND destination."ISO" IS NULL - THEN 0 - ELSE 1 + "Issue2815Table1" ext + LEFT JOIN "Issue2815Table2" source ON source."ISO" = ext."SRC_BIC" + LEFT JOIN "Issue2815Table2" destination ON destination."ISO" = ext."DES_BIC" + LEFT JOIN "Issue2815Table3" channel ON channel."TreasuryCenter" = ext."TREA_CENT" AND channel."BIC" = ext."SRC_BIC" AND channel."Sepa" = CASE + WHEN source."SEPA" AND destination."SEPA" THEN CASE + WHEN source."ISO" = destination."ISO" OR source."ISO" IS NULL AND destination."ISO" IS NULL + THEN 0 + ELSE 1 + END + ELSE 2 END - ELSE 2 - END +WHERE + ext."NOT_HANDLED" = 2 AND + ext."TRANS_CHANNEL" IS NULL AND + "Issue2815Table1"."SRC_BIC" = ext."SRC_BIC" AND + "Issue2815Table1"."DES_BIC" = ext."DES_BIC" AND + "Issue2815Table1"."IDF" = ext."IDF" AND + "Issue2815Table1"."TREA_CENT" = ext."TREA_CENT" AND + "Issue2815Table1"."NOT_HANDLED" = ext."NOT_HANDLED" AND + ("Issue2815Table1"."TRANS_CHANNEL" = ext."TRANS_CHANNEL" OR "Issue2815Table1"."TRANS_CHANNEL" IS NULL AND ext."TRANS_CHANNEL" IS NULL) + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."SRC_BIC", + t1."DES_BIC", + t1."IDF", + t1."TREA_CENT", + t1."NOT_HANDLED", + t1."TRANS_CHANNEL" +FROM + "Issue2815Table1" t1 +ORDER BY + t1."SRC_BIC", + t1."DES_BIC" diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.16).sql index a96d1722219d..9a3cac421044 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.16).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.16).sql index a96d1722219d..9a3cac421044 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.16).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.16).sql index 6549a242317a..b26cf06b2f10 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.16).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.16).sql index 6549a242317a..b26cf06b2f10 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.16).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.16).sql index 2fe6ca68d38d..1e45cc894e89 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.16).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 2 + "ChildID" = c_1."ChildID" + 2 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.16).sql index 2cebca31c4e0..cdb5213228c3 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.16).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.16).sql index b26ee053f8af..dfd1c8970e6f 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.16).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.16).sql index b26ee053f8af..dfd1c8970e6f 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.16).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.16).sql index df0b6047e6c3..70ca55af5b17 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.16).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.16).sql index df0b6047e6c3..70ca55af5b17 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.16).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.16).sql index f58f28f94014..f66af8281563 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.16).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.16).sql index 9348ad8cf35d..3cd8439da6d9 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.16).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.16).sql index 55078cbc742f..885b4ea6e838 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.16).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.16).sql index f7d44cfa9a9f..4312fd2aff60 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.16).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.16).sql index f7d44cfa9a9f..4312fd2aff60 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.16).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.16).sql index 5322769b22bd..e57570e27953 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.16).sql @@ -14,11 +14,12 @@ UPDATE SET "ParentID" = c_2."ParentID" + 1000 FROM - "Child" c_1, - "Child" c_2 + "Parent" p + INNER JOIN "Child" c_1 ON p."ParentID" = c_1."ParentID" + LEFT JOIN "Child" c_2 ON c_2."ChildID" = 11 WHERE - "Parent"."ParentID" = 1 AND "Parent"."ParentID" = c_1."ParentID" AND - c_2."ChildID" = 11 + p."ParentID" = 1 AND "Parent"."ParentID" = p."ParentID" AND + ("Parent"."Value1" = p."Value1" OR "Parent"."Value1" IS NULL AND p."Value1" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.17.LinqService).sql index 473c585423d7..610f453279eb 100644 --- a/PostgreSQL.17.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.17.LinqService).sql @@ -8,13 +8,11 @@ UPDATE SET is_deleted = :is_deleted FROM - element_services sr, - "Components" cm + component_categories ct + INNER JOIN element_services sr ON sr.id = ct.service_id + LEFT JOIN "Components" cm ON ct.id = cm.category_id AND NOT cm.is_deleted WHERE - sr.id = 'TestProcessService' AND - sr.id = component_categories.service_id AND - component_categories.id = cm.category_id AND - NOT cm.is_deleted + sr.id = 'TestProcessService' AND component_categories.id = ct.id BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.17.LinqService).sql index c3e5ffd2f765..f92d1b16a854 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.17.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.17.LinqService).sql index 61642e52024c..ef871f8d5505 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.17.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.17.LinqService).sql index 3459aa1138ad..1b241c6a8735 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.17.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.17.LinqService).sql index 3459aa1138ad..1b241c6a8735 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.17.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.17.LinqService).sql index a3dd3178aa6c..e03958d648db 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.17.LinqService).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.17.LinqService).sql index a3dd3178aa6c..e03958d648db 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.17.LinqService).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.17.LinqService).sql index 34c12397d876..9251735d7162 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.17.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 2 + "ChildID" = c_1."ChildID" + 2 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.17.LinqService).sql index 484cc2c34c7f..4096c30e720d 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.17.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.17.LinqService).sql index f6df3dc895a7..08e3c747e878 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.17.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.17.LinqService).sql index f6df3dc895a7..08e3c747e878 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.17.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.17.LinqService).sql index c3e5ffd2f765..f92d1b16a854 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.17.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.17.LinqService).sql index c3e5ffd2f765..f92d1b16a854 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.17.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.17.LinqService).sql index 3425ba4826ad..8d8b093c07c2 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.17.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.17.LinqService).sql index a456af9b53ed..03b05e5bce8f 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.17.LinqService).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.17.LinqService).sql index a86ab37f053e..c4928b8057eb 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.17.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.17.LinqService).sql index 4adc39a65532..dac27a9fbc13 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.17.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.17.LinqService).sql index 4adc39a65532..dac27a9fbc13 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.17.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.17.LinqService).sql index 07d9b84a92e1..c434de67747f 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.17.LinqService).sql @@ -14,11 +14,12 @@ UPDATE SET "ParentID" = c_2."ParentID" + 1000 FROM - "Child" c_1, - "Child" c_2 + "Parent" p + INNER JOIN "Child" c_1 ON p."ParentID" = c_1."ParentID" + LEFT JOIN "Child" c_2 ON c_2."ChildID" = 11 WHERE - "Parent"."ParentID" = 1 AND "Parent"."ParentID" = c_1."ParentID" AND - c_2."ChildID" = 11 + p."ParentID" = 1 AND "Parent"."ParentID" = p."ParentID" AND + ("Parent"."Value1" = p."Value1" OR "Parent"."Value1" IS NULL AND p."Value1" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.17).sql index 473c585423d7..610f453279eb 100644 --- a/PostgreSQL.17/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(PostgreSQL.17).sql @@ -8,13 +8,11 @@ UPDATE SET is_deleted = :is_deleted FROM - element_services sr, - "Components" cm + component_categories ct + INNER JOIN element_services sr ON sr.id = ct.service_id + LEFT JOIN "Components" cm ON ct.id = cm.category_id AND NOT cm.is_deleted WHERE - sr.id = 'TestProcessService' AND - sr.id = component_categories.service_id AND - component_categories.id = cm.category_id AND - NOT cm.is_deleted + sr.id = 'TestProcessService' AND component_categories.id = ct.id BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.17).sql index c3e5ffd2f765..f92d1b16a854 100644 --- a/PostgreSQL.17/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(PostgreSQL.17).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.17).sql index 61642e52024c..ef871f8d5505 100644 --- a/PostgreSQL.17/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(PostgreSQL.17).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.17).sql index 922e2dd11629..bc48e07295bb 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(PostgreSQL.17).sql @@ -4,25 +4,43 @@ UPDATE "Issue2815Table1" SET - "TRANS_CHANNEL" = channel."Trans_Channel", - "IDF" = channel."Idf" + "TRANS_CHANNEL" = Coalesce(channel."Trans_Channel", 1), + "IDF" = Coalesce(channel."Idf", 0) FROM - "Issue2815Table2" source, - "Issue2815Table2" destination, - "Issue2815Table3" channel -WHERE - "Issue2815Table1"."NOT_HANDLED" = 2 AND - "Issue2815Table1"."TRANS_CHANNEL" IS NULL AND - source."ISO" = "Issue2815Table1"."SRC_BIC" AND - destination."ISO" = "Issue2815Table1"."DES_BIC" AND - channel."TreasuryCenter" = "Issue2815Table1"."TREA_CENT" AND - channel."BIC" = "Issue2815Table1"."SRC_BIC" AND - channel."Sepa" = CASE - WHEN source."SEPA" AND destination."SEPA" THEN CASE - WHEN source."ISO" = destination."ISO" OR source."ISO" IS NULL AND destination."ISO" IS NULL - THEN 0 - ELSE 1 + "Issue2815Table1" ext + LEFT JOIN "Issue2815Table2" source ON source."ISO" = ext."SRC_BIC" + LEFT JOIN "Issue2815Table2" destination ON destination."ISO" = ext."DES_BIC" + LEFT JOIN "Issue2815Table3" channel ON channel."TreasuryCenter" = ext."TREA_CENT" AND channel."BIC" = ext."SRC_BIC" AND channel."Sepa" = CASE + WHEN source."SEPA" AND destination."SEPA" THEN CASE + WHEN source."ISO" = destination."ISO" OR source."ISO" IS NULL AND destination."ISO" IS NULL + THEN 0 + ELSE 1 + END + ELSE 2 END - ELSE 2 - END +WHERE + ext."NOT_HANDLED" = 2 AND + ext."TRANS_CHANNEL" IS NULL AND + "Issue2815Table1"."SRC_BIC" = ext."SRC_BIC" AND + "Issue2815Table1"."DES_BIC" = ext."DES_BIC" AND + "Issue2815Table1"."IDF" = ext."IDF" AND + "Issue2815Table1"."TREA_CENT" = ext."TREA_CENT" AND + "Issue2815Table1"."NOT_HANDLED" = ext."NOT_HANDLED" AND + ("Issue2815Table1"."TRANS_CHANNEL" = ext."TRANS_CHANNEL" OR "Issue2815Table1"."TRANS_CHANNEL" IS NULL AND ext."TRANS_CHANNEL" IS NULL) + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."SRC_BIC", + t1."DES_BIC", + t1."IDF", + t1."TREA_CENT", + t1."NOT_HANDLED", + t1."TRANS_CHANNEL" +FROM + "Issue2815Table1" t1 +ORDER BY + t1."SRC_BIC", + t1."DES_BIC" diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.17).sql index 3459aa1138ad..1b241c6a8735 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(PostgreSQL.17).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.17).sql index 3459aa1138ad..1b241c6a8735 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(PostgreSQL.17).sql @@ -6,9 +6,10 @@ UPDATE SET "Value1" = "a_Relation"."RelatedValue3" FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.17).sql index a3dd3178aa6c..e03958d648db 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(PostgreSQL.17).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.17).sql index a3dd3178aa6c..e03958d648db 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(PostgreSQL.17).sql @@ -4,13 +4,14 @@ UPDATE "UpdatedEntities" SET - "Value1" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", - "Value2" = "UpdatedEntities"."Value1" + "UpdatedEntities"."Value2" + "UpdatedEntities"."Value3", + "Value1" = v."Value1" + v."Value2" + v."Value3", + "Value2" = v."Value1" + v."Value2" + v."Value3", "Value3" = 1 FROM - "UpdateRelation" "a_Relation" + "UpdatedEntities" v + LEFT JOIN "UpdateRelation" "a_Relation" ON v."RelationId" = "a_Relation".id WHERE - "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities"."RelationId" = "a_Relation".id + "a_Relation"."RelatedValue1" = 11 AND "UpdatedEntities".id = v.id BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.17).sql index 34c12397d876..9251735d7162 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(PostgreSQL.17).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 2 + "ChildID" = c_1."ChildID" + 2 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.17).sql index 484cc2c34c7f..4096c30e720d 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(PostgreSQL.17).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.17).sql index f6df3dc895a7..08e3c747e878 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(PostgreSQL.17).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.17).sql index f6df3dc895a7..08e3c747e878 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(PostgreSQL.17).sql @@ -6,19 +6,19 @@ UPDATE SET col1 = gt_s_one.col1, col2 = gt_s_one.col2, - col3 = Replace(gt_s_one.col3, 'auth.', ''), + col3 = Replace(x.col3, 'auth.', ''), col4 = gt_s_one.col4, col5 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '1' + WHEN x.col3 = 'empty' THEN '1' ELSE '0' END, col6 = CASE - WHEN gt_s_one.col3 = 'empty' THEN '' + WHEN x.col3 = 'empty' THEN '' ELSE y1.id::text END FROM - access_mode y1 + gt_s_one x + LEFT JOIN access_mode y1 ON Upper(Replace(x.col3, 'auth.', '')) = Upper(y1.code) OR x.col3 IS NULL AND y1.code IS NULL WHERE - Upper(Replace(gt_s_one.col3, 'auth.', '')) = Upper(y1.code) OR - gt_s_one.col3 IS NULL AND y1.code IS NULL + gt_s_one.id = x.id diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.17).sql index c3e5ffd2f765..f92d1b16a854 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(PostgreSQL.17).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.17).sql index c3e5ffd2f765..f92d1b16a854 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(PostgreSQL.17).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.17).sql index 3425ba4826ad..8d8b093c07c2 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(PostgreSQL.17).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.17).sql index a456af9b53ed..03b05e5bce8f 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(PostgreSQL.17).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1 + "ChildID" = c_1."ChildID" + 1 FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.17).sql index a86ab37f053e..c4928b8057eb 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(PostgreSQL.17).sql @@ -38,10 +38,13 @@ UPDATE SET "ChildID" = :ChildID FROM - "Parent" "a_Parent" + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE - "Child"."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" + c_1."ChildID" = :id AND + "a_Parent"."Value1" = 1 AND + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.17).sql index 4adc39a65532..dac27a9fbc13 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(PostgreSQL.17).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.17).sql index 4adc39a65532..dac27a9fbc13 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(PostgreSQL.17).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE "Child" SET - "ChildID" = "Child"."ChildID" + 1, + "ChildID" = c_1."ChildID" + 1, "ParentID" = p."ParentID" FROM - "Parent" "a_Parent", - "Parent" p + "Child" c_1 + LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" + INNER JOIN "Parent" p ON c_1."ParentID" = p."ParentID" WHERE - "Child"."ChildID" = :id AND + c_1."ChildID" = :id AND "a_Parent"."Value1" = 1 AND - "Child"."ParentID" = "a_Parent"."ParentID" AND - "Child"."ParentID" = p."ParentID" + "Child"."ParentID" = c_1."ParentID" AND + "Child"."ChildID" = c_1."ChildID" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.17).sql index 07d9b84a92e1..c434de67747f 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(PostgreSQL.17).sql @@ -14,11 +14,12 @@ UPDATE SET "ParentID" = c_2."ParentID" + 1000 FROM - "Child" c_1, - "Child" c_2 + "Parent" p + INNER JOIN "Child" c_1 ON p."ParentID" = c_1."ParentID" + LEFT JOIN "Child" c_2 ON c_2."ChildID" = 11 WHERE - "Parent"."ParentID" = 1 AND "Parent"."ParentID" = c_1."ParentID" AND - c_2."ChildID" = 11 + p."ParentID" = 1 AND "Parent"."ParentID" = p."ParentID" AND + ("Parent"."Value1" = p."Value1" OR "Parent"."Value1" IS NULL AND p."Value1" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/SQLite.Classic.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.LinqService).sql index 62e862ef4538..ca899f24480d 100644 --- a/SQLite.Classic.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.LinqService).sql @@ -8,13 +8,11 @@ UPDATE SET [is_deleted] = @is_deleted FROM - [element_services] [sr], - [Components] [cm] + [component_categories] [ct] + INNER JOIN [element_services] [sr] ON [sr].[id] = [ct].[service_id] + LEFT JOIN [Components] [cm] ON [ct].[id] = [cm].[category_id] AND NOT [cm].[is_deleted] WHERE - [sr].[id] = 'TestProcessService' AND - [sr].[id] = [component_categories].[service_id] AND - [component_categories].[id] = [cm].[category_id] AND - NOT [cm].[is_deleted] + [sr].[id] = 'TestProcessService' AND [component_categories].[id] = [ct].[id] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.LinqService).sql index 30b1e0c71ad6..90da78f90933 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.LinqService).sql index 65da5f1dd954..4ef7e159b4b7 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.LinqService).sql index 68b126a92f1d..fdb27cb5e959 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.LinqService).sql index 68b126a92f1d..fdb27cb5e959 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.LinqService).sql index c2ae9a9d8d0c..430514f5290b 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.LinqService).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.LinqService).sql index c2ae9a9d8d0c..430514f5290b 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.LinqService).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.LinqService).sql index a0be1ec3b829..ffe55c959922 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 2 + [ChildID] = [c_1].[ChildID] + 2 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.LinqService).sql index 96fd2bb24446..9db65fdc0890 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.LinqService).sql index 746d66f370a8..303e3239f779 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.LinqService).sql index 746d66f370a8..303e3239f779 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.LinqService).sql index 30b1e0c71ad6..90da78f90933 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.LinqService).sql index 30b1e0c71ad6..90da78f90933 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.LinqService).sql index efdbdc3e2a6d..0e6c55b78a17 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.LinqService).sql index cd0a9200006a..4d934f0eb6ee 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.LinqService).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.LinqService).sql index 55be40fe8b30..19444b78e353 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.LinqService).sql index 62b5b8ab3e5c..1389a46ba5c2 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.LinqService).sql index 62b5b8ab3e5c..1389a46ba5c2 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.LinqService).sql index 776f9fbfab69..c75955a5efd1 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.LinqService).sql @@ -14,11 +14,12 @@ UPDATE SET [ParentID] = [c_2].[ParentID] + 1000 FROM - [Child] [c_1], - [Child] [c_2] + [Parent] [p] + INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] + LEFT JOIN [Child] [c_2] ON [c_2].[ChildID] = 11 WHERE - [Parent].[ParentID] = 1 AND [Parent].[ParentID] = [c_1].[ParentID] AND - [c_2].[ChildID] = 11 + [p].[ParentID] = 1 AND [Parent].[ParentID] = [p].[ParentID] AND + ([Parent].[Value1] = [p].[Value1] OR [Parent].[Value1] IS NULL AND [p].[Value1] IS NULL) BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPM.LinqService).sql index 94e8719adf14..98f68251c0af 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPM.LinqService).sql @@ -8,13 +8,11 @@ UPDATE SET [is_deleted] = @is_deleted FROM - [element_services] [sr], - [Components] [cm] + [component_categories] [ct] + INNER JOIN [element_services] [sr] ON [sr].[id] = [ct].[service_id] + LEFT JOIN [Components] [cm] ON [ct].[id] = [cm].[category_id] AND NOT [cm].[is_deleted] WHERE - [sr].[id] = 'TestProcessService' AND - [sr].[id] = [component_categories].[service_id] AND - [component_categories].[id] = [cm].[category_id] AND - NOT [cm].[is_deleted] + [sr].[id] = 'TestProcessService' AND [component_categories].[id] = [ct].[id] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPM.LinqService).sql index 49deb063d96f..64e5b94043f4 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPM.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPM.LinqService).sql index 3b2813b74d24..36e002abb1bd 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPM.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPM.LinqService).sql index b5aa51c59443..770d282dfd12 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPM.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPM.LinqService).sql index b5aa51c59443..770d282dfd12 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPM.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPM.LinqService).sql index 95cd4369e829..f618e41e3cbb 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPM.LinqService).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPM.LinqService).sql index 95cd4369e829..f618e41e3cbb 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPM.LinqService).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPM.LinqService).sql index 64291ca51388..e658ed709f12 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPM.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 2 + [ChildID] = [c_1].[ChildID] + 2 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPM.LinqService).sql index 4bdc8a04d236..602af20094a9 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPM.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPM.LinqService).sql index a749f29f1f45..9d89245bd855 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPM.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPM.LinqService).sql index a749f29f1f45..9d89245bd855 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPM.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPM.LinqService).sql index 49deb063d96f..64e5b94043f4 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPM.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPM.LinqService).sql index 49deb063d96f..64e5b94043f4 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPM.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPM.LinqService).sql index 7e7d8793015e..964b3a4ffe85 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPM.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPM.LinqService).sql index 881629fc0fec..885c3930f49d 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPM.LinqService).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPM.LinqService).sql index 0e993c3334a1..430db866667e 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPM.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPM.LinqService).sql index 1c8d18b0aafb..e1175a86870e 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPM.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPM.LinqService).sql index 1c8d18b0aafb..e1175a86870e 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPM.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPM.LinqService).sql index 31930c959287..ea8774665a29 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPM.LinqService).sql @@ -14,11 +14,12 @@ UPDATE SET [ParentID] = [c_2].[ParentID] + 1000 FROM - [Child] [c_1], - [Child] [c_2] + [Parent] [p] + INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] + LEFT JOIN [Child] [c_2] ON [c_2].[ChildID] = 11 WHERE - [Parent].[ParentID] = 1 AND [Parent].[ParentID] = [c_1].[ParentID] AND - [c_2].[ChildID] = 11 + [p].[ParentID] = 1 AND [Parent].[ParentID] = [p].[ParentID] AND + ([Parent].[Value1] = [p].[Value1] OR [Parent].[Value1] IS NULL AND [p].[Value1] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPM).sql index 94e8719adf14..98f68251c0af 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPM).sql @@ -8,13 +8,11 @@ UPDATE SET [is_deleted] = @is_deleted FROM - [element_services] [sr], - [Components] [cm] + [component_categories] [ct] + INNER JOIN [element_services] [sr] ON [sr].[id] = [ct].[service_id] + LEFT JOIN [Components] [cm] ON [ct].[id] = [cm].[category_id] AND NOT [cm].[is_deleted] WHERE - [sr].[id] = 'TestProcessService' AND - [sr].[id] = [component_categories].[service_id] AND - [component_categories].[id] = [cm].[category_id] AND - NOT [cm].[is_deleted] + [sr].[id] = 'TestProcessService' AND [component_categories].[id] = [ct].[id] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.Classic.MPM).sql index c9e855c24af4..729336ad76f0 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.Classic.MPM).sql @@ -283,7 +283,7 @@ FROM [RefResourceStorageShelfDTO] [b2] WHERE [a2].[Id] = [b2].[StorageShelfID] - ) as [c1] + ) as [ResourceID] FROM ( SELECT @@ -315,15 +315,15 @@ FROM [RefResourceStorageShelfDTO] [b1] WHERE [a1].[Id] = [b1].[StorageShelfID] - ) as [c1] + ) as [ResourceID] FROM [ChannelDTO] [c_1] INNER JOIN [AisleDTO] [a] ON [c_1].[AisleID] = [a].[Id] LEFT JOIN [MaterialDTO] [m_1] ON [c_1].[MaterialID] = [m_1].[Id] LEFT JOIN [StorageShelfDTO] [a1] ON [c_1].[Id] = [a1].[ChannelID] AND 1 = [a1].[DepthCoordinate] ) [t1] - LEFT JOIN [WmsLoadCarrierDTO] [c1] ON [c1].[Id] = [t1].[c1] - LEFT JOIN [CTE_1] [i1] ON [i1].[IR_ResourceID] = [t1].[c1] AND [i1].[RN] = 1 + LEFT JOIN [WmsLoadCarrierDTO] [c1] ON [c1].[Id] = [t1].[ResourceID] + LEFT JOIN [CTE_1] [i1] ON [i1].[IR_ResourceID] = [t1].[ResourceID] AND [i1].[RN] = 1 LEFT JOIN [MaterialDTO] [m1] ON [m1].[Id] = [i1].[IR_MaterialID] LEFT JOIN [StorageShelfDTO] [a2] ON [t1].[Id] = [a2].[ChannelID] AND 2 = [a2].[DepthCoordinate] ) [x] diff --git a/SQLite.Classic.MPM/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPM).sql index 49deb063d96f..64e5b94043f4 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPM).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPM).sql index 3b2813b74d24..36e002abb1bd 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPM).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.Classic.MPM).sql index d369c915af5d..890fb8428af3 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.Classic.MPM).sql @@ -4,25 +4,43 @@ UPDATE [Issue2815Table1] SET - [TRANS_CHANNEL] = [channel].[Trans_Channel], - [IDF] = [channel].[Idf] + [TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [IDF] = Coalesce([channel].[Idf], 0) FROM - [Issue2815Table2] [source], - [Issue2815Table2] [destination], - [Issue2815Table3] [channel] -WHERE - [Issue2815Table1].[NOT_HANDLED] = 2 AND - [Issue2815Table1].[TRANS_CHANNEL] IS NULL AND - [source].[ISO] = [Issue2815Table1].[SRC_BIC] AND - [destination].[ISO] = [Issue2815Table1].[DES_BIC] AND - [channel].[TreasuryCenter] = [Issue2815Table1].[TREA_CENT] AND - [channel].[BIC] = [Issue2815Table1].[SRC_BIC] AND - [channel].[Sepa] = CASE - WHEN [source].[SEPA] AND [destination].[SEPA] THEN CASE - WHEN [source].[ISO] = [destination].[ISO] OR [source].[ISO] IS NULL AND [destination].[ISO] IS NULL - THEN 0 - ELSE 1 + [Issue2815Table1] [ext] + LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] + LEFT JOIN [Issue2815Table2] [destination] ON [destination].[ISO] = [ext].[DES_BIC] + LEFT JOIN [Issue2815Table3] [channel] ON [channel].[TreasuryCenter] = [ext].[TREA_CENT] AND [channel].[BIC] = [ext].[SRC_BIC] AND [channel].[Sepa] = CASE + WHEN [source].[SEPA] AND [destination].[SEPA] THEN CASE + WHEN [source].[ISO] = [destination].[ISO] OR [source].[ISO] IS NULL AND [destination].[ISO] IS NULL + THEN 0 + ELSE 1 + END + ELSE 2 END - ELSE 2 - END +WHERE + [ext].[NOT_HANDLED] = 2 AND + [ext].[TRANS_CHANNEL] IS NULL AND + [Issue2815Table1].[SRC_BIC] = [ext].[SRC_BIC] AND + [Issue2815Table1].[DES_BIC] = [ext].[DES_BIC] AND + [Issue2815Table1].[IDF] = [ext].[IDF] AND + [Issue2815Table1].[TREA_CENT] = [ext].[TREA_CENT] AND + [Issue2815Table1].[NOT_HANDLED] = [ext].[NOT_HANDLED] AND + ([Issue2815Table1].[TRANS_CHANNEL] = [ext].[TRANS_CHANNEL] OR [Issue2815Table1].[TRANS_CHANNEL] IS NULL AND [ext].[TRANS_CHANNEL] IS NULL) + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPM).sql index b5aa51c59443..770d282dfd12 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPM).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPM).sql index b5aa51c59443..770d282dfd12 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPM).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPM).sql index 95cd4369e829..f618e41e3cbb 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPM).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPM).sql index 95cd4369e829..f618e41e3cbb 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPM).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPM).sql index 64291ca51388..e658ed709f12 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPM).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 2 + [ChildID] = [c_1].[ChildID] + 2 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPM).sql index 4bdc8a04d236..602af20094a9 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPM).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPM).sql index a749f29f1f45..9d89245bd855 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPM).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPM).sql index a749f29f1f45..9d89245bd855 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPM).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPM).sql index 49deb063d96f..64e5b94043f4 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPM).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPM).sql index 49deb063d96f..64e5b94043f4 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPM).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPM).sql index 7e7d8793015e..964b3a4ffe85 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPM).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPM).sql index 881629fc0fec..885c3930f49d 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPM).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPM).sql index 0e993c3334a1..430db866667e 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPM).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPM).sql index 1c8d18b0aafb..e1175a86870e 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPM).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPM).sql index 1c8d18b0aafb..e1175a86870e 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPM).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPM).sql index 31930c959287..ea8774665a29 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPM).sql @@ -14,11 +14,12 @@ UPDATE SET [ParentID] = [c_2].[ParentID] + 1000 FROM - [Child] [c_1], - [Child] [c_2] + [Parent] [p] + INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] + LEFT JOIN [Child] [c_2] ON [c_2].[ChildID] = 11 WHERE - [Parent].[ParentID] = 1 AND [Parent].[ParentID] = [c_1].[ParentID] AND - [c_2].[ChildID] = 11 + [p].[ParentID] = 1 AND [Parent].[ParentID] = [p].[ParentID] AND + ([Parent].[Value1] = [p].[Value1] OR [Parent].[Value1] IS NULL AND [p].[Value1] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPU.LinqService).sql index 6c1d300ebf38..cadc46ded582 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPU.LinqService).sql @@ -8,13 +8,11 @@ UPDATE SET [is_deleted] = @is_deleted FROM - [element_services] [sr], - [Components] [cm] + [component_categories] [ct] + INNER JOIN [element_services] [sr] ON [sr].[id] = [ct].[service_id] + LEFT JOIN [Components] [cm] ON [ct].[id] = [cm].[category_id] AND NOT [cm].[is_deleted] WHERE - [sr].[id] = 'TestProcessService' AND - [sr].[id] = [component_categories].[service_id] AND - [component_categories].[id] = [cm].[category_id] AND - NOT [cm].[is_deleted] + [sr].[id] = 'TestProcessService' AND [component_categories].[id] = [ct].[id] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPU.LinqService).sql index fc6e1251b761..3e009a91f65d 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPU.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPU.LinqService).sql index be6d28eb66e7..2f56fb56494f 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPU.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPU.LinqService).sql index a2561735a81f..f2679105c478 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPU.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPU.LinqService).sql index a2561735a81f..f2679105c478 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPU.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPU.LinqService).sql index ae6f1897ff1b..9b895d2bb8cc 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPU.LinqService).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPU.LinqService).sql index ae6f1897ff1b..9b895d2bb8cc 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPU.LinqService).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPU.LinqService).sql index 783602b7a94e..65557e67add3 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPU.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 2 + [ChildID] = [c_1].[ChildID] + 2 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPU.LinqService).sql index 464cfcc0b64e..6d0b9df15780 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPU.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPU.LinqService).sql index 3ffa51a5f699..b1fbf3a7517b 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPU.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPU.LinqService).sql index 3ffa51a5f699..b1fbf3a7517b 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPU.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPU.LinqService).sql index fc6e1251b761..3e009a91f65d 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPU.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPU.LinqService).sql index fc6e1251b761..3e009a91f65d 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPU.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPU.LinqService).sql index 2987639ff298..e364df2d9236 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPU.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPU.LinqService).sql index 6beb59b13072..ad9421f7c165 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPU.LinqService).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPU.LinqService).sql index 3bbbc40d4327..e904437c9fcd 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPU.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPU.LinqService).sql index 14217feb0707..aa155d858c4b 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPU.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPU.LinqService).sql index 14217feb0707..aa155d858c4b 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPU.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPU.LinqService).sql index e064d7c76421..7bf8497b38dd 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPU.LinqService).sql @@ -14,11 +14,12 @@ UPDATE SET [ParentID] = [c_2].[ParentID] + 1000 FROM - [Child] [c_1], - [Child] [c_2] + [Parent] [p] + INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] + LEFT JOIN [Child] [c_2] ON [c_2].[ChildID] = 11 WHERE - [Parent].[ParentID] = 1 AND [Parent].[ParentID] = [c_1].[ParentID] AND - [c_2].[ChildID] = 11 + [p].[ParentID] = 1 AND [Parent].[ParentID] = [p].[ParentID] AND + ([Parent].[Value1] = [p].[Value1] OR [Parent].[Value1] IS NULL AND [p].[Value1] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPU).sql index 6c1d300ebf38..cadc46ded582 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic.MPU).sql @@ -8,13 +8,11 @@ UPDATE SET [is_deleted] = @is_deleted FROM - [element_services] [sr], - [Components] [cm] + [component_categories] [ct] + INNER JOIN [element_services] [sr] ON [sr].[id] = [ct].[service_id] + LEFT JOIN [Components] [cm] ON [ct].[id] = [cm].[category_id] AND NOT [cm].[is_deleted] WHERE - [sr].[id] = 'TestProcessService' AND - [sr].[id] = [component_categories].[service_id] AND - [component_categories].[id] = [cm].[category_id] AND - NOT [cm].[is_deleted] + [sr].[id] = 'TestProcessService' AND [component_categories].[id] = [ct].[id] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.Classic.MPU).sql index 3db2375938a6..ca969d2a7813 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.Classic.MPU).sql @@ -283,7 +283,7 @@ FROM [RefResourceStorageShelfDTO] [b2] WHERE [a2].[Id] = [b2].[StorageShelfID] - ) as [c1] + ) as [ResourceID] FROM ( SELECT @@ -315,15 +315,15 @@ FROM [RefResourceStorageShelfDTO] [b1] WHERE [a1].[Id] = [b1].[StorageShelfID] - ) as [c1] + ) as [ResourceID] FROM [ChannelDTO] [c_1] INNER JOIN [AisleDTO] [a] ON [c_1].[AisleID] = [a].[Id] LEFT JOIN [MaterialDTO] [m_1] ON [c_1].[MaterialID] = [m_1].[Id] LEFT JOIN [StorageShelfDTO] [a1] ON [c_1].[Id] = [a1].[ChannelID] AND 1 = [a1].[DepthCoordinate] ) [t1] - LEFT JOIN [WmsLoadCarrierDTO] [c1] ON [c1].[Id] = [t1].[c1] - LEFT JOIN [CTE_1] [i1] ON [i1].[IR_ResourceID] = [t1].[c1] AND [i1].[RN] = 1 + LEFT JOIN [WmsLoadCarrierDTO] [c1] ON [c1].[Id] = [t1].[ResourceID] + LEFT JOIN [CTE_1] [i1] ON [i1].[IR_ResourceID] = [t1].[ResourceID] AND [i1].[RN] = 1 LEFT JOIN [MaterialDTO] [m1] ON [m1].[Id] = [i1].[IR_MaterialID] LEFT JOIN [StorageShelfDTO] [a2] ON [t1].[Id] = [a2].[ChannelID] AND 2 = [a2].[DepthCoordinate] ) [x] diff --git a/SQLite.Classic.MPU/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPU).sql index fc6e1251b761..3e009a91f65d 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic.MPU).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPU).sql index be6d28eb66e7..2f56fb56494f 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic.MPU).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.Classic.MPU).sql index e0870aa7fe7f..cb7e9699ce8f 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.Classic.MPU).sql @@ -4,25 +4,43 @@ UPDATE [Issue2815Table1] SET - [TRANS_CHANNEL] = [channel].[Trans_Channel], - [IDF] = [channel].[Idf] + [TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [IDF] = Coalesce([channel].[Idf], 0) FROM - [Issue2815Table2] [source], - [Issue2815Table2] [destination], - [Issue2815Table3] [channel] -WHERE - [Issue2815Table1].[NOT_HANDLED] = 2 AND - [Issue2815Table1].[TRANS_CHANNEL] IS NULL AND - [source].[ISO] = [Issue2815Table1].[SRC_BIC] AND - [destination].[ISO] = [Issue2815Table1].[DES_BIC] AND - [channel].[TreasuryCenter] = [Issue2815Table1].[TREA_CENT] AND - [channel].[BIC] = [Issue2815Table1].[SRC_BIC] AND - [channel].[Sepa] = CASE - WHEN [source].[SEPA] AND [destination].[SEPA] THEN CASE - WHEN [source].[ISO] = [destination].[ISO] OR [source].[ISO] IS NULL AND [destination].[ISO] IS NULL - THEN 0 - ELSE 1 + [Issue2815Table1] [ext] + LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] + LEFT JOIN [Issue2815Table2] [destination] ON [destination].[ISO] = [ext].[DES_BIC] + LEFT JOIN [Issue2815Table3] [channel] ON [channel].[TreasuryCenter] = [ext].[TREA_CENT] AND [channel].[BIC] = [ext].[SRC_BIC] AND [channel].[Sepa] = CASE + WHEN [source].[SEPA] AND [destination].[SEPA] THEN CASE + WHEN [source].[ISO] = [destination].[ISO] OR [source].[ISO] IS NULL AND [destination].[ISO] IS NULL + THEN 0 + ELSE 1 + END + ELSE 2 END - ELSE 2 - END +WHERE + [ext].[NOT_HANDLED] = 2 AND + [ext].[TRANS_CHANNEL] IS NULL AND + [Issue2815Table1].[SRC_BIC] = [ext].[SRC_BIC] AND + [Issue2815Table1].[DES_BIC] = [ext].[DES_BIC] AND + [Issue2815Table1].[IDF] = [ext].[IDF] AND + [Issue2815Table1].[TREA_CENT] = [ext].[TREA_CENT] AND + [Issue2815Table1].[NOT_HANDLED] = [ext].[NOT_HANDLED] AND + ([Issue2815Table1].[TRANS_CHANNEL] = [ext].[TRANS_CHANNEL] OR [Issue2815Table1].[TRANS_CHANNEL] IS NULL AND [ext].[TRANS_CHANNEL] IS NULL) + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPU).sql index a2561735a81f..f2679105c478 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic.MPU).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPU).sql index a2561735a81f..f2679105c478 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic.MPU).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPU).sql index ae6f1897ff1b..9b895d2bb8cc 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic.MPU).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPU).sql index ae6f1897ff1b..9b895d2bb8cc 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic.MPU).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPU).sql index 783602b7a94e..65557e67add3 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic.MPU).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 2 + [ChildID] = [c_1].[ChildID] + 2 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPU).sql index 464cfcc0b64e..6d0b9df15780 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic.MPU).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPU).sql index 3ffa51a5f699..b1fbf3a7517b 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic.MPU).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPU).sql index 3ffa51a5f699..b1fbf3a7517b 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic.MPU).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPU).sql index fc6e1251b761..3e009a91f65d 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic.MPU).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPU).sql index fc6e1251b761..3e009a91f65d 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic.MPU).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPU).sql index 2987639ff298..e364df2d9236 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic.MPU).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPU).sql index 6beb59b13072..ad9421f7c165 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic.MPU).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPU).sql index 3bbbc40d4327..e904437c9fcd 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic.MPU).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPU).sql index 14217feb0707..aa155d858c4b 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic.MPU).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPU).sql index 14217feb0707..aa155d858c4b 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic.MPU).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPU).sql index e064d7c76421..7bf8497b38dd 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic.MPU).sql @@ -14,11 +14,12 @@ UPDATE SET [ParentID] = [c_2].[ParentID] + 1000 FROM - [Child] [c_1], - [Child] [c_2] + [Parent] [p] + INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] + LEFT JOIN [Child] [c_2] ON [c_2].[ChildID] = 11 WHERE - [Parent].[ParentID] = 1 AND [Parent].[ParentID] = [c_1].[ParentID] AND - [c_2].[ChildID] = 11 + [p].[ParentID] = 1 AND [Parent].[ParentID] = [p].[ParentID] AND + ([Parent].[Value1] = [p].[Value1] OR [Parent].[Value1] IS NULL AND [p].[Value1] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic).sql b/SQLite.Classic/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic).sql index 62e862ef4538..ca899f24480d 100644 --- a/SQLite.Classic/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.Classic).sql @@ -8,13 +8,11 @@ UPDATE SET [is_deleted] = @is_deleted FROM - [element_services] [sr], - [Components] [cm] + [component_categories] [ct] + INNER JOIN [element_services] [sr] ON [sr].[id] = [ct].[service_id] + LEFT JOIN [Components] [cm] ON [ct].[id] = [cm].[category_id] AND NOT [cm].[is_deleted] WHERE - [sr].[id] = 'TestProcessService' AND - [sr].[id] = [component_categories].[service_id] AND - [component_categories].[id] = [cm].[category_id] AND - NOT [cm].[is_deleted] + [sr].[id] = 'TestProcessService' AND [component_categories].[id] = [ct].[id] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.Classic).sql b/SQLite.Classic/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.Classic).sql index 957b5714bef0..066fee11ebef 100644 --- a/SQLite.Classic/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.Classic).sql @@ -283,7 +283,7 @@ FROM [RefResourceStorageShelfDTO] [b2] WHERE [a2].[Id] = [b2].[StorageShelfID] - ) as [c1] + ) as [ResourceID] FROM ( SELECT @@ -315,15 +315,15 @@ FROM [RefResourceStorageShelfDTO] [b1] WHERE [a1].[Id] = [b1].[StorageShelfID] - ) as [c1] + ) as [ResourceID] FROM [ChannelDTO] [c_1] INNER JOIN [AisleDTO] [a] ON [c_1].[AisleID] = [a].[Id] LEFT JOIN [MaterialDTO] [m_1] ON [c_1].[MaterialID] = [m_1].[Id] LEFT JOIN [StorageShelfDTO] [a1] ON [c_1].[Id] = [a1].[ChannelID] AND 1 = [a1].[DepthCoordinate] ) [t1] - LEFT JOIN [WmsLoadCarrierDTO] [c1] ON [c1].[Id] = [t1].[c1] - LEFT JOIN [CTE_1] [i1] ON [i1].[IR_ResourceID] = [t1].[c1] AND [i1].[RN] = 1 + LEFT JOIN [WmsLoadCarrierDTO] [c1] ON [c1].[Id] = [t1].[ResourceID] + LEFT JOIN [CTE_1] [i1] ON [i1].[IR_ResourceID] = [t1].[ResourceID] AND [i1].[RN] = 1 LEFT JOIN [MaterialDTO] [m1] ON [m1].[Id] = [i1].[IR_MaterialID] LEFT JOIN [StorageShelfDTO] [a2] ON [t1].[Id] = [a2].[ChannelID] AND 2 = [a2].[DepthCoordinate] ) [x] diff --git a/SQLite.Classic/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic).sql index 30b1e0c71ad6..90da78f90933 100644 --- a/SQLite.Classic/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.Classic).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic).sql index 65da5f1dd954..4ef7e159b4b7 100644 --- a/SQLite.Classic/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.Classic).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.Classic).sql index db4c45b20b9f..672c7bd59265 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.Classic).sql @@ -4,25 +4,43 @@ UPDATE [Issue2815Table1] SET - [TRANS_CHANNEL] = [channel].[Trans_Channel], - [IDF] = [channel].[Idf] + [TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [IDF] = Coalesce([channel].[Idf], 0) FROM - [Issue2815Table2] [source], - [Issue2815Table2] [destination], - [Issue2815Table3] [channel] -WHERE - [Issue2815Table1].[NOT_HANDLED] = 2 AND - [Issue2815Table1].[TRANS_CHANNEL] IS NULL AND - [source].[ISO] = [Issue2815Table1].[SRC_BIC] AND - [destination].[ISO] = [Issue2815Table1].[DES_BIC] AND - [channel].[TreasuryCenter] = [Issue2815Table1].[TREA_CENT] AND - [channel].[BIC] = [Issue2815Table1].[SRC_BIC] AND - [channel].[Sepa] = CASE - WHEN [source].[SEPA] AND [destination].[SEPA] THEN CASE - WHEN [source].[ISO] = [destination].[ISO] OR [source].[ISO] IS NULL AND [destination].[ISO] IS NULL - THEN 0 - ELSE 1 + [Issue2815Table1] [ext] + LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] + LEFT JOIN [Issue2815Table2] [destination] ON [destination].[ISO] = [ext].[DES_BIC] + LEFT JOIN [Issue2815Table3] [channel] ON [channel].[TreasuryCenter] = [ext].[TREA_CENT] AND [channel].[BIC] = [ext].[SRC_BIC] AND [channel].[Sepa] = CASE + WHEN [source].[SEPA] AND [destination].[SEPA] THEN CASE + WHEN [source].[ISO] = [destination].[ISO] OR [source].[ISO] IS NULL AND [destination].[ISO] IS NULL + THEN 0 + ELSE 1 + END + ELSE 2 END - ELSE 2 - END +WHERE + [ext].[NOT_HANDLED] = 2 AND + [ext].[TRANS_CHANNEL] IS NULL AND + [Issue2815Table1].[SRC_BIC] = [ext].[SRC_BIC] AND + [Issue2815Table1].[DES_BIC] = [ext].[DES_BIC] AND + [Issue2815Table1].[IDF] = [ext].[IDF] AND + [Issue2815Table1].[TREA_CENT] = [ext].[TREA_CENT] AND + [Issue2815Table1].[NOT_HANDLED] = [ext].[NOT_HANDLED] AND + ([Issue2815Table1].[TRANS_CHANNEL] = [ext].[TRANS_CHANNEL] OR [Issue2815Table1].[TRANS_CHANNEL] IS NULL AND [ext].[TRANS_CHANNEL] IS NULL) + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] diff --git a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic).sql index 68b126a92f1d..fdb27cb5e959 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.Classic).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic).sql index 68b126a92f1d..fdb27cb5e959 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.Classic).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic).sql index c2ae9a9d8d0c..430514f5290b 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.Classic).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic).sql index c2ae9a9d8d0c..430514f5290b 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.Classic).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic).sql index a0be1ec3b829..ffe55c959922 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.Classic).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 2 + [ChildID] = [c_1].[ChildID] + 2 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic).sql index 96fd2bb24446..9db65fdc0890 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.Classic).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic).sql index 746d66f370a8..303e3239f779 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.Classic).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic).sql index 746d66f370a8..303e3239f779 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.Classic).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic).sql index 30b1e0c71ad6..90da78f90933 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.Classic).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic).sql index 30b1e0c71ad6..90da78f90933 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.Classic).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic).sql index efdbdc3e2a6d..0e6c55b78a17 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.Classic).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic).sql index cd0a9200006a..4d934f0eb6ee 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.Classic).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] diff --git a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic).sql index 55be40fe8b30..19444b78e353 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.Classic).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic).sql index 62b5b8ab3e5c..1389a46ba5c2 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.Classic).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic).sql index 62b5b8ab3e5c..1389a46ba5c2 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.Classic).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic).sql index 776f9fbfab69..c75955a5efd1 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.Classic).sql @@ -14,11 +14,12 @@ UPDATE SET [ParentID] = [c_2].[ParentID] + 1000 FROM - [Child] [c_1], - [Child] [c_2] + [Parent] [p] + INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] + LEFT JOIN [Child] [c_2] ON [c_2].[ChildID] = 11 WHERE - [Parent].[ParentID] = 1 AND [Parent].[ParentID] = [c_1].[ParentID] AND - [c_2].[ChildID] = 11 + [p].[ParentID] = 1 AND [Parent].[ParentID] = [p].[ParentID] AND + ([Parent].[Value1] = [p].[Value1] OR [Parent].[Value1] IS NULL AND [p].[Value1] IS NULL) BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.MS.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.MS.LinqService).sql index accf958bd5b8..7a4352f9e40e 100644 --- a/SQLite.MS.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.MS.LinqService).sql @@ -8,13 +8,11 @@ UPDATE SET [is_deleted] = @is_deleted FROM - [element_services] [sr], - [Components] [cm] + [component_categories] [ct] + INNER JOIN [element_services] [sr] ON [sr].[id] = [ct].[service_id] + LEFT JOIN [Components] [cm] ON [ct].[id] = [cm].[category_id] AND NOT [cm].[is_deleted] WHERE - [sr].[id] = 'TestProcessService' AND - [sr].[id] = [component_categories].[service_id] AND - [component_categories].[id] = [cm].[category_id] AND - NOT [cm].[is_deleted] + [sr].[id] = 'TestProcessService' AND [component_categories].[id] = [ct].[id] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.MS.LinqService).sql index 113e823f64b4..d109f5b05a14 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.MS.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.MS.LinqService).sql index 3149ef63e420..966cd693d920 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.MS.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.MS.LinqService).sql index deacafcf546b..181af01679a0 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.MS.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.MS.LinqService).sql index deacafcf546b..181af01679a0 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.MS.LinqService).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.MS.LinqService).sql index 9bacff7f5fb7..b9085759d141 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.MS.LinqService).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.MS.LinqService).sql index 9bacff7f5fb7..b9085759d141 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.MS.LinqService).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.MS.LinqService).sql index 1b54b6aa539d..29ee5a1f88a0 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.MS.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 2 + [ChildID] = [c_1].[ChildID] + 2 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.MS.LinqService).sql index 8b266060346f..769911779782 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.MS.LinqService).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.MS.LinqService).sql index 6302f4a0de0e..9c9b23925017 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.MS.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.MS.LinqService).sql index 6302f4a0de0e..9c9b23925017 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.MS.LinqService).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.MS.LinqService).sql index 113e823f64b4..d109f5b05a14 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.MS.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.MS.LinqService).sql index 113e823f64b4..d109f5b05a14 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.MS.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.MS.LinqService).sql index 75c7651ba9b0..f93230f8842b 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.MS.LinqService).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite (asynchronously) diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.MS.LinqService).sql index 8ab711964c95..945bbd7aa075 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.MS.LinqService).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.MS.LinqService).sql index d1ddd143545b..fda03ece4708 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.MS.LinqService).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.MS.LinqService).sql index e5956286e5d0..d51485373831 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.MS.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.MS.LinqService).sql index e5956286e5d0..d51485373831 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.MS.LinqService).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.MS.LinqService).sql index 05bf0135c6bb..6ae815cc20dd 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.MS.LinqService).sql @@ -14,11 +14,12 @@ UPDATE SET [ParentID] = [c_2].[ParentID] + 1000 FROM - [Child] [c_1], - [Child] [c_2] + [Parent] [p] + INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] + LEFT JOIN [Child] [c_2] ON [c_2].[ChildID] = 11 WHERE - [Parent].[ParentID] = 1 AND [Parent].[ParentID] = [c_1].[ParentID] AND - [c_2].[ChildID] = 11 + [p].[ParentID] = 1 AND [Parent].[ParentID] = [p].[ParentID] AND + ([Parent].[Value1] = [p].[Value1] OR [Parent].[Value1] IS NULL AND [p].[Value1] IS NULL) BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.MS).sql b/SQLite.MS/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.MS).sql index accf958bd5b8..7a4352f9e40e 100644 --- a/SQLite.MS/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.MS).sql +++ b/SQLite.MS/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(SQLite.MS).sql @@ -8,13 +8,11 @@ UPDATE SET [is_deleted] = @is_deleted FROM - [element_services] [sr], - [Components] [cm] + [component_categories] [ct] + INNER JOIN [element_services] [sr] ON [sr].[id] = [ct].[service_id] + LEFT JOIN [Components] [cm] ON [ct].[id] = [cm].[category_id] AND NOT [cm].[is_deleted] WHERE - [sr].[id] = 'TestProcessService' AND - [sr].[id] = [component_categories].[service_id] AND - [component_categories].[id] = [cm].[category_id] AND - NOT [cm].[is_deleted] + [sr].[id] = 'TestProcessService' AND [component_categories].[id] = [ct].[id] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.MS).sql b/SQLite.MS/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.MS).sql index c4cb227d9337..0df18f6cf84e 100644 --- a/SQLite.MS/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.MS).sql +++ b/SQLite.MS/Tests/UserTests/Issue3305Tests/Tests.UserTests.Issue3305Tests.TestComplexQueryWms(SQLite.MS).sql @@ -283,7 +283,7 @@ FROM [RefResourceStorageShelfDTO] [b2] WHERE [a2].[Id] = [b2].[StorageShelfID] - ) as [c1] + ) as [ResourceID] FROM ( SELECT @@ -315,15 +315,15 @@ FROM [RefResourceStorageShelfDTO] [b1] WHERE [a1].[Id] = [b1].[StorageShelfID] - ) as [c1] + ) as [ResourceID] FROM [ChannelDTO] [c_1] INNER JOIN [AisleDTO] [a] ON [c_1].[AisleID] = [a].[Id] LEFT JOIN [MaterialDTO] [m_1] ON [c_1].[MaterialID] = [m_1].[Id] LEFT JOIN [StorageShelfDTO] [a1] ON [c_1].[Id] = [a1].[ChannelID] AND 1 = [a1].[DepthCoordinate] ) [t1] - LEFT JOIN [WmsLoadCarrierDTO] [c1] ON [c1].[Id] = [t1].[c1] - LEFT JOIN [CTE_1] [i1] ON [i1].[IR_ResourceID] = [t1].[c1] AND [i1].[RN] = 1 + LEFT JOIN [WmsLoadCarrierDTO] [c1] ON [c1].[Id] = [t1].[ResourceID] + LEFT JOIN [CTE_1] [i1] ON [i1].[IR_ResourceID] = [t1].[ResourceID] AND [i1].[RN] = 1 LEFT JOIN [MaterialDTO] [m1] ON [m1].[Id] = [i1].[IR_MaterialID] LEFT JOIN [StorageShelfDTO] [a2] ON [t1].[Id] = [a2].[ChannelID] AND 2 = [a2].[DepthCoordinate] ) [x] diff --git a/SQLite.MS/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.MS).sql index 113e823f64b4..d109f5b05a14 100644 --- a/SQLite.MS/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SQLite.MS).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.MS).sql index 3149ef63e420..966cd693d920 100644 --- a/SQLite.MS/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SQLite.MS).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.MS).sql index eb0550338107..922fd887f82f 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SQLite.MS).sql @@ -4,25 +4,43 @@ UPDATE [Issue2815Table1] SET - [TRANS_CHANNEL] = [channel].[Trans_Channel], - [IDF] = [channel].[Idf] + [TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [IDF] = Coalesce([channel].[Idf], 0) FROM - [Issue2815Table2] [source], - [Issue2815Table2] [destination], - [Issue2815Table3] [channel] -WHERE - [Issue2815Table1].[NOT_HANDLED] = 2 AND - [Issue2815Table1].[TRANS_CHANNEL] IS NULL AND - [source].[ISO] = [Issue2815Table1].[SRC_BIC] AND - [destination].[ISO] = [Issue2815Table1].[DES_BIC] AND - [channel].[TreasuryCenter] = [Issue2815Table1].[TREA_CENT] AND - [channel].[BIC] = [Issue2815Table1].[SRC_BIC] AND - [channel].[Sepa] = CASE - WHEN [source].[SEPA] AND [destination].[SEPA] THEN CASE - WHEN [source].[ISO] = [destination].[ISO] OR [source].[ISO] IS NULL AND [destination].[ISO] IS NULL - THEN 0 - ELSE 1 + [Issue2815Table1] [ext] + LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] + LEFT JOIN [Issue2815Table2] [destination] ON [destination].[ISO] = [ext].[DES_BIC] + LEFT JOIN [Issue2815Table3] [channel] ON [channel].[TreasuryCenter] = [ext].[TREA_CENT] AND [channel].[BIC] = [ext].[SRC_BIC] AND [channel].[Sepa] = CASE + WHEN [source].[SEPA] AND [destination].[SEPA] THEN CASE + WHEN [source].[ISO] = [destination].[ISO] OR [source].[ISO] IS NULL AND [destination].[ISO] IS NULL + THEN 0 + ELSE 1 + END + ELSE 2 END - ELSE 2 - END +WHERE + [ext].[NOT_HANDLED] = 2 AND + [ext].[TRANS_CHANNEL] IS NULL AND + [Issue2815Table1].[SRC_BIC] = [ext].[SRC_BIC] AND + [Issue2815Table1].[DES_BIC] = [ext].[DES_BIC] AND + [Issue2815Table1].[IDF] = [ext].[IDF] AND + [Issue2815Table1].[TREA_CENT] = [ext].[TREA_CENT] AND + [Issue2815Table1].[NOT_HANDLED] = [ext].[NOT_HANDLED] AND + ([Issue2815Table1].[TRANS_CHANNEL] = [ext].[TRANS_CHANNEL] OR [Issue2815Table1].[TRANS_CHANNEL] IS NULL AND [ext].[TRANS_CHANNEL] IS NULL) + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] diff --git a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.MS).sql index deacafcf546b..181af01679a0 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(SQLite.MS).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.MS).sql index deacafcf546b..181af01679a0 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(SQLite.MS).sql @@ -6,9 +6,10 @@ UPDATE SET [Value1] = [a_Relation].[RelatedValue3] FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.MS).sql index 9bacff7f5fb7..b9085759d141 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(SQLite.MS).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.MS).sql index 9bacff7f5fb7..b9085759d141 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(SQLite.MS).sql @@ -4,13 +4,14 @@ UPDATE [UpdatedEntities] SET - [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], - [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], + [Value1] = [v].[Value1] + [v].[Value2] + [v].[Value3], + [Value2] = [v].[Value1] + [v].[Value2] + [v].[Value3], [Value3] = 1 FROM - [UpdateRelation] [a_Relation] + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.MS).sql index 1b54b6aa539d..29ee5a1f88a0 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SQLite.MS).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 2 + [ChildID] = [c_1].[ChildID] + 2 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.MS).sql index 8b266060346f..769911779782 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SQLite.MS).sql @@ -42,12 +42,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.MS).sql index 6302f4a0de0e..9c9b23925017 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(SQLite.MS).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.MS).sql index 6302f4a0de0e..9c9b23925017 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(SQLite.MS).sql @@ -6,19 +6,19 @@ UPDATE SET [col1] = [gt_s_one].[col1], [col2] = [gt_s_one].[col2], - [col3] = Replace([gt_s_one].[col3], 'auth.', ''), + [col3] = Replace([x].[col3], 'auth.', ''), [col4] = [gt_s_one].[col4], [col5] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '1' + WHEN [x].[col3] = 'empty' THEN '1' ELSE '0' END, [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' + WHEN [x].[col3] = 'empty' THEN '' ELSE CAST([y1].[id] AS NVarChar(11)) END FROM - [access_mode] [y1] + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL WHERE - Upper(Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + [gt_s_one].[id] = [x].[id] diff --git a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.MS).sql index 113e823f64b4..d109f5b05a14 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SQLite.MS).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.MS).sql index 113e823f64b4..d109f5b05a14 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SQLite.MS).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.MS).sql index 75c7651ba9b0..f93230f8842b 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SQLite.MS).sql @@ -34,12 +34,15 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite (asynchronously) diff --git a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.MS).sql index 8ab711964c95..945bbd7aa075 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(SQLite.MS).sql @@ -6,10 +6,13 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1 + [ChildID] = [c_1].[ChildID] + 1 FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] diff --git a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.MS).sql index d1ddd143545b..fda03ece4708 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SQLite.MS).sql @@ -38,10 +38,13 @@ UPDATE SET [ChildID] = @ChildID FROM - [Parent] [a_Parent] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.MS).sql index e5956286e5d0..d51485373831 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(SQLite.MS).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.MS).sql index e5956286e5d0..d51485373831 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(SQLite.MS).sql @@ -34,16 +34,17 @@ SET @id = 1001 UPDATE [Child] SET - [ChildID] = [Child].[ChildID] + 1, + [ChildID] = [c_1].[ChildID] + 1, [ParentID] = [p].[ParentID] FROM - [Parent] [a_Parent], - [Parent] [p] + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] WHERE - [Child].[ChildID] = @id AND + [c_1].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.MS).sql index 05bf0135c6bb..6ae815cc20dd 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(SQLite.MS).sql @@ -14,11 +14,12 @@ UPDATE SET [ParentID] = [c_2].[ParentID] + 1000 FROM - [Child] [c_1], - [Child] [c_2] + [Parent] [p] + INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] + LEFT JOIN [Child] [c_2] ON [c_2].[ChildID] = 11 WHERE - [Parent].[ParentID] = 1 AND [Parent].[ParentID] = [c_1].[ParentID] AND - [c_2].[ChildID] = 11 + [p].[ParentID] = 1 AND [Parent].[ParentID] = [p].[ParentID] AND + ([Parent].[Value1] = [p].[Value1] OR [Parent].[Value1] IS NULL AND [p].[Value1] IS NULL) BeforeExecute -- SQLite.MS SQLite diff --git a/SapHana.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SapHana.Odbc).sql b/SapHana.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SapHana.Odbc).sql index 2b11d47aa9c4..fda024554098 100644 --- a/SapHana.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SapHana.Odbc).sql @@ -6,7 +6,7 @@ UPDATE SET "TRANS_CHANNEL" = ( SELECT - "channel_1"."Trans_Channel" + Coalesce("channel_1"."Trans_Channel", 1) FROM "Issue2815Table1" "ext_1" LEFT JOIN "Issue2815Table2" "source_1" ON "source_1"."ISO" = "ext_1"."SRC_BIC" @@ -32,7 +32,7 @@ SET ), "IDF" = ( SELECT - "channel_2"."Idf" + Coalesce("channel_2"."Idf", 0) FROM "Issue2815Table1" "ext_2" LEFT JOIN "Issue2815Table2" "source_2" ON "source_2"."ISO" = "ext_2"."SRC_BIC" @@ -83,3 +83,19 @@ WHERE ("Issue2815Table1"."TRANS_CHANNEL" = "ext"."TRANS_CHANNEL" OR "Issue2815Table1"."TRANS_CHANNEL" IS NULL AND "ext"."TRANS_CHANNEL" IS NULL) ) +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."SRC_BIC", + "t1"."DES_BIC", + "t1"."IDF", + "t1"."TREA_CENT", + "t1"."NOT_HANDLED", + "t1"."TRANS_CHANNEL" +FROM + "Issue2815Table1" "t1" +ORDER BY + "t1"."SRC_BIC", + "t1"."DES_BIC" + diff --git a/SqlServer.2005.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2005.MS).sql index 0c73ddaf21e8..a790cb1ddad4 100644 --- a/SqlServer.2005.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2005.MS).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -21,3 +21,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2005.MS SqlServer.2005 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2005/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2005).sql b/SqlServer.2005/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2005).sql index 734ac45b3ab7..299b8667d929 100644 --- a/SqlServer.2005/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2005).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -21,3 +21,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2005 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2008.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2008.MS).sql index 8071d504e4dd..34692243cf0f 100644 --- a/SqlServer.2008.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2008.MS).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -21,3 +21,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2008/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2008).sql b/SqlServer.2008/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2008).sql index eeafcfa48c7c..e146610a7876 100644 --- a/SqlServer.2008/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2008).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -21,3 +21,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2008 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2012.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2012.MS).sql index 7eb21cee5797..8ad36509e405 100644 --- a/SqlServer.2012.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2012.MS).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2012/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2012).sql b/SqlServer.2012/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2012).sql index 31d63b4f68ed..f48e4fff606d 100644 --- a/SqlServer.2012/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2012).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2012 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2014.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2014.MS).sql index f09a618908e0..1beebd157e3e 100644 --- a/SqlServer.2014.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2014.MS).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2014/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2014).sql b/SqlServer.2014/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2014).sql index 33f55b98fac9..9ac9bc239d25 100644 --- a/SqlServer.2014/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2014).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2014 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2016.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2016.MS).sql index 07503d59cc8c..83d3214c82bf 100644 --- a/SqlServer.2016.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2016.MS).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2016/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2016).sql b/SqlServer.2016/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2016).sql index eb69c725ace9..defb7a4ae4c7 100644 --- a/SqlServer.2016/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2016).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2016 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2017.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2017.MS).sql index bef8f9451697..00948fd6c3d8 100644 --- a/SqlServer.2017.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2017.MS).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2017/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2017).sql b/SqlServer.2017/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2017).sql index 5670650d53a7..9767fa9b2199 100644 --- a/SqlServer.2017/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2017).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2017 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2019.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2019.MS).sql index 3c57fb597ad7..738d013d5ccf 100644 --- a/SqlServer.2019.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2019.MS).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2019/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2019).sql b/SqlServer.2019/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2019).sql index 7ca4eb3ddf6b..db7761b65e9c 100644 --- a/SqlServer.2019/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2019).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2019 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2022.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2022.MS).sql index a57709c4b289..eb4d0d2991b4 100644 --- a/SqlServer.2022.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2022.MS).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.2022/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2022).sql b/SqlServer.2022/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2022).sql index 6b31f7c385f6..e5653f3cded9 100644 --- a/SqlServer.2022/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.2022).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.2022 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.Contained.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.Contained.MS).sql index b3557b9f1640..f23c096cf33b 100644 --- a/SqlServer.Contained.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.Contained.MS).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.Contained/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.Contained).sql index e665590c076d..4b7e05a3ba7d 100644 --- a/SqlServer.Contained/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.Contained).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.SA.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.SA.MS).sql index a0b4e945b289..699a2090ee35 100644 --- a/SqlServer.SA.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.SA.MS).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/SqlServer.SA/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.SA).sql b/SqlServer.SA/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.SA).sql index 22349a8210c3..538e3e81a4ca 100644 --- a/SqlServer.SA/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(SqlServer.SA).sql @@ -4,8 +4,8 @@ UPDATE [ext] SET - [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 0), - [ext].[IDF] = [channel].[Idf] + [ext].[TRANS_CHANNEL] = Coalesce([channel].[Trans_Channel], 1), + [ext].[IDF] = Coalesce([channel].[Idf], 0) FROM [Issue2815Table1] [ext] LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] @@ -14,3 +14,19 @@ FROM WHERE [ext].[NOT_HANDLED] = 2 AND [ext].[TRANS_CHANNEL] IS NULL +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] + diff --git a/Sybase.Managed.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(Sybase.Managed.LinqService).sql index cb03682766c3..9f0646e79463 100644 --- a/Sybase.Managed.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(Sybase.Managed.LinqService).sql @@ -7,14 +7,17 @@ UPDATE [component_categories] SET [is_deleted] = @is_deleted -FROM - [element_services] [sr], - [Components] [cm] WHERE - [sr].[id] = 'TestProcessService' AND - [sr].[id] = [component_categories].[service_id] AND - [component_categories].[id] = [cm].[category_id] AND - [cm].[is_deleted] = 0 + EXISTS( + SELECT + * + FROM + [component_categories] [ct] + INNER JOIN [element_services] [sr] ON [sr].[id] = [ct].[service_id] + LEFT JOIN [Components] [cm] ON [ct].[id] = [cm].[category_id] AND [cm].[is_deleted] = 0 + WHERE + [sr].[id] = 'TestProcessService' AND [component_categories].[id] = [ct].[id] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(Sybase.Managed.LinqService).sql index 955cabaf15a2..46c2dd38f6c5 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(Sybase.Managed.LinqService).sql @@ -35,11 +35,19 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(Sybase.Managed.LinqService).sql index e9fa046e18d4..dde5093576a8 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(Sybase.Managed.LinqService).sql @@ -37,11 +37,19 @@ UPDATE [Child] SET [ChildID] = @ChildID -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(Sybase.Managed.LinqService).sql index 4e6f969c85c9..cf416658d996 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(Sybase.Managed.LinqService).sql @@ -4,11 +4,25 @@ UPDATE [UpdatedEntities] SET - [Value1] = [a_Relation].[RelatedValue3] -FROM - [UpdateRelation] [a_Relation] + [Value1] = ( + SELECT + [a_Relation_1].[RelatedValue3] + FROM + [UpdatedEntities] [v_1] + LEFT JOIN [UpdateRelation] [a_Relation_1] ON [v_1].[RelationId] = [a_Relation_1].[id] + WHERE + [a_Relation_1].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v_1].[id] + ) WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + EXISTS( + SELECT + * + FROM + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] + WHERE + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(Sybase.Managed.LinqService).sql index 4e6f969c85c9..cf416658d996 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(Sybase.Managed.LinqService).sql @@ -4,11 +4,25 @@ UPDATE [UpdatedEntities] SET - [Value1] = [a_Relation].[RelatedValue3] -FROM - [UpdateRelation] [a_Relation] + [Value1] = ( + SELECT + [a_Relation_1].[RelatedValue3] + FROM + [UpdatedEntities] [v_1] + LEFT JOIN [UpdateRelation] [a_Relation_1] ON [v_1].[RelationId] = [a_Relation_1].[id] + WHERE + [a_Relation_1].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v_1].[id] + ) WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + EXISTS( + SELECT + * + FROM + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] + WHERE + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(Sybase.Managed.LinqService).sql index 9d9d501c14d7..431c342c1a04 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(Sybase.Managed.LinqService).sql @@ -7,10 +7,16 @@ SET [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], [Value3] = 1 -FROM - [UpdateRelation] [a_Relation] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + EXISTS( + SELECT + * + FROM + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] + WHERE + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(Sybase.Managed.LinqService).sql index 9d9d501c14d7..431c342c1a04 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(Sybase.Managed.LinqService).sql @@ -7,10 +7,16 @@ SET [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], [Value3] = 1 -FROM - [UpdateRelation] [a_Relation] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + EXISTS( + SELECT + * + FROM + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] + WHERE + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(Sybase.Managed.LinqService).sql index db72aa997b68..8ffeb4a39808 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(Sybase.Managed.LinqService).sql @@ -44,11 +44,19 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 2 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(Sybase.Managed.LinqService).sql index a385d72e8efe..da518bde0f0b 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(Sybase.Managed.LinqService).sql @@ -44,11 +44,19 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(Sybase.Managed.LinqService).sql index 7ef232ad9de9..34d5697acecc 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(Sybase.Managed.LinqService).sql @@ -12,13 +12,26 @@ SET WHEN [gt_s_one].[col3] = 'empty' THEN '1' ELSE '0' END, - [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' - ELSE CAST([y1].[id] AS NVarChar(11)) - END -FROM - [access_mode] [y1] + [col6] = ( + SELECT + CASE + WHEN [gt_s_one].[col3] = 'empty' THEN '' + ELSE CAST([y1_1].[id] AS NVarChar(11)) + END + FROM + [gt_s_one] [x_1] + LEFT JOIN [access_mode] [y1_1] ON Upper(Str_Replace([x_1].[col3], 'auth.', '')) = Upper([y1_1].[code]) OR [x_1].[col3] IS NULL AND [y1_1].[code] IS NULL + WHERE + [gt_s_one].[id] = [x_1].[id] + ) WHERE - Upper(Str_Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + EXISTS( + SELECT + * + FROM + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Str_Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL + WHERE + [gt_s_one].[id] = [x].[id] + ) diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(Sybase.Managed.LinqService).sql index 7ef232ad9de9..34d5697acecc 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(Sybase.Managed.LinqService).sql @@ -12,13 +12,26 @@ SET WHEN [gt_s_one].[col3] = 'empty' THEN '1' ELSE '0' END, - [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' - ELSE CAST([y1].[id] AS NVarChar(11)) - END -FROM - [access_mode] [y1] + [col6] = ( + SELECT + CASE + WHEN [gt_s_one].[col3] = 'empty' THEN '' + ELSE CAST([y1_1].[id] AS NVarChar(11)) + END + FROM + [gt_s_one] [x_1] + LEFT JOIN [access_mode] [y1_1] ON Upper(Str_Replace([x_1].[col3], 'auth.', '')) = Upper([y1_1].[code]) OR [x_1].[col3] IS NULL AND [y1_1].[code] IS NULL + WHERE + [gt_s_one].[id] = [x_1].[id] + ) WHERE - Upper(Str_Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + EXISTS( + SELECT + * + FROM + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Str_Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL + WHERE + [gt_s_one].[id] = [x].[id] + ) diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(Sybase.Managed.LinqService).sql index 955cabaf15a2..46c2dd38f6c5 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(Sybase.Managed.LinqService).sql @@ -35,11 +35,19 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(Sybase.Managed.LinqService).sql index 955cabaf15a2..46c2dd38f6c5 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(Sybase.Managed.LinqService).sql @@ -35,11 +35,19 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(Sybase.Managed.LinqService).sql index e2fa7dfcefdc..f7cc5191256f 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(Sybase.Managed.LinqService).sql @@ -35,11 +35,19 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase (asynchronously) diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(Sybase.Managed.LinqService).sql index d44614174927..f5397d48a27b 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(Sybase.Managed.LinqService).sql @@ -7,9 +7,17 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(Sybase.Managed.LinqService).sql index 71c270026b97..4706455fe6ab 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(Sybase.Managed.LinqService).sql @@ -37,11 +37,19 @@ UPDATE [Child] SET [ChildID] = @ChildID -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(Sybase.Managed.LinqService).sql index cc110f3e7a9f..de42e4a5bd97 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(Sybase.Managed.LinqService).sql @@ -35,15 +35,33 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1, - [ParentID] = [p].[ParentID] -FROM - [Parent] [a_Parent], - [Parent] [p] + [ParentID] = ( + SELECT + [p_1].[ParentID] + FROM + [Child] [c_2] + LEFT JOIN [Parent] [a_Parent_1] ON [c_2].[ParentID] = [a_Parent_1].[ParentID] + INNER JOIN [Parent] [p_1] ON [c_2].[ParentID] = [p_1].[ParentID] + WHERE + [c_2].[ChildID] = @id AND + [a_Parent_1].[Value1] = 1 AND + [Child].[ParentID] = [c_2].[ParentID] AND + [Child].[ChildID] = [c_2].[ChildID] + ) WHERE - [Child].[ChildID] = @id AND - [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(Sybase.Managed.LinqService).sql index cc110f3e7a9f..de42e4a5bd97 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(Sybase.Managed.LinqService).sql @@ -35,15 +35,33 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1, - [ParentID] = [p].[ParentID] -FROM - [Parent] [a_Parent], - [Parent] [p] + [ParentID] = ( + SELECT + [p_1].[ParentID] + FROM + [Child] [c_2] + LEFT JOIN [Parent] [a_Parent_1] ON [c_2].[ParentID] = [a_Parent_1].[ParentID] + INNER JOIN [Parent] [p_1] ON [c_2].[ParentID] = [p_1].[ParentID] + WHERE + [c_2].[ChildID] = @id AND + [a_Parent_1].[Value1] = 1 AND + [Child].[ParentID] = [c_2].[ParentID] AND + [Child].[ChildID] = [c_2].[ChildID] + ) WHERE - [Child].[ChildID] = @id AND - [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(Sybase.Managed.LinqService).sql index 0027f24605a0..1a4138998f06 100644 --- a/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(Sybase.Managed.LinqService).sql @@ -13,13 +13,29 @@ BeforeExecute UPDATE [Parent] SET - [ParentID] = [c_2].[ParentID] + 1000 -FROM - [Child] [c_1], - [Child] [c_2] + [ParentID] = ( + SELECT + [c_4].[ParentID] + 1000 + FROM + [Parent] [p_1] + INNER JOIN [Child] [c_3] ON [p_1].[ParentID] = [c_3].[ParentID] + LEFT JOIN [Child] [c_4] ON [c_4].[ChildID] = 11 + WHERE + [p_1].[ParentID] = 1 AND [Parent].[ParentID] = [p_1].[ParentID] AND + ([Parent].[Value1] = [p_1].[Value1] OR [Parent].[Value1] IS NULL AND [p_1].[Value1] IS NULL) + ) WHERE - [Parent].[ParentID] = 1 AND [Parent].[ParentID] = [c_1].[ParentID] AND - [c_2].[ChildID] = 11 + EXISTS( + SELECT + * + FROM + [Parent] [p] + INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] + LEFT JOIN [Child] [c_2] ON [c_2].[ChildID] = 11 + WHERE + [p].[ParentID] = 1 AND [Parent].[ParentID] = [p].[ParentID] AND + ([Parent].[Value1] = [p].[Value1] OR [Parent].[Value1] IS NULL AND [p].[Value1] IS NULL) + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(Sybase.Managed).sql b/Sybase.Managed/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(Sybase.Managed).sql index cb03682766c3..9f0646e79463 100644 --- a/Sybase.Managed/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/UserTests/Issue3186Tests/Tests.UserTests.Issue3186Tests.UpdateWhenTableFirstWithLeftJoin(Sybase.Managed).sql @@ -7,14 +7,17 @@ UPDATE [component_categories] SET [is_deleted] = @is_deleted -FROM - [element_services] [sr], - [Components] [cm] WHERE - [sr].[id] = 'TestProcessService' AND - [sr].[id] = [component_categories].[service_id] AND - [component_categories].[id] = [cm].[category_id] AND - [cm].[is_deleted] = 0 + EXISTS( + SELECT + * + FROM + [component_categories] [ct] + INNER JOIN [element_services] [sr] ON [sr].[id] = [ct].[service_id] + LEFT JOIN [Components] [cm] ON [ct].[id] = [cm].[category_id] AND [cm].[is_deleted] = 0 + WHERE + [sr].[id] = 'TestProcessService' AND [component_categories].[id] = [ct].[id] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(Sybase.Managed).sql index 955cabaf15a2..46c2dd38f6c5 100644 --- a/Sybase.Managed/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(Sybase.Managed).sql @@ -35,11 +35,19 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(Sybase.Managed).sql index e9fa046e18d4..dde5093576a8 100644 --- a/Sybase.Managed/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(Sybase.Managed).sql @@ -37,11 +37,19 @@ UPDATE [Child] SET [ChildID] = @ChildID -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Sybase.Managed).sql index b5e0edfb53cc..c8fcb2c4390d 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2815Test2(Sybase.Managed).sql @@ -4,25 +4,98 @@ UPDATE [Issue2815Table1] SET - [TRANS_CHANNEL] = [channel].[Trans_Channel], - [IDF] = [channel].[Idf] -FROM - [Issue2815Table2] [source], - [Issue2815Table2] [destination], - [Issue2815Table3] [channel] + [TRANS_CHANNEL] = ( + SELECT + Coalesce([channel_1].[Trans_Channel], 1) + FROM + [Issue2815Table1] [ext_1] + LEFT JOIN [Issue2815Table2] [source_1] ON [source_1].[ISO] = [ext_1].[SRC_BIC] + LEFT JOIN [Issue2815Table2] [destination_1] ON [destination_1].[ISO] = [ext_1].[DES_BIC] + LEFT JOIN [Issue2815Table3] [channel_1] ON [channel_1].[TreasuryCenter] = [ext_1].[TREA_CENT] AND [channel_1].[BIC] = [ext_1].[SRC_BIC] AND [channel_1].[Sepa] = CASE + WHEN [source_1].[SEPA] = 1 AND [destination_1].[SEPA] = 1 + THEN CASE + WHEN [source_1].[ISO] = [destination_1].[ISO] OR [source_1].[ISO] IS NULL AND [destination_1].[ISO] IS NULL + THEN 0 + ELSE 1 + END + ELSE 2 + END + WHERE + [ext_1].[NOT_HANDLED] = 2 AND + [ext_1].[TRANS_CHANNEL] IS NULL AND + [Issue2815Table1].[SRC_BIC] = [ext_1].[SRC_BIC] AND + [Issue2815Table1].[DES_BIC] = [ext_1].[DES_BIC] AND + [Issue2815Table1].[IDF] = [ext_1].[IDF] AND + [Issue2815Table1].[TREA_CENT] = [ext_1].[TREA_CENT] AND + [Issue2815Table1].[NOT_HANDLED] = [ext_1].[NOT_HANDLED] AND + ([Issue2815Table1].[TRANS_CHANNEL] = [ext_1].[TRANS_CHANNEL] OR [Issue2815Table1].[TRANS_CHANNEL] IS NULL AND [ext_1].[TRANS_CHANNEL] IS NULL) + ), + [IDF] = ( + SELECT + Coalesce([channel_2].[Idf], 0) + FROM + [Issue2815Table1] [ext_2] + LEFT JOIN [Issue2815Table2] [source_2] ON [source_2].[ISO] = [ext_2].[SRC_BIC] + LEFT JOIN [Issue2815Table2] [destination_2] ON [destination_2].[ISO] = [ext_2].[DES_BIC] + LEFT JOIN [Issue2815Table3] [channel_2] ON [channel_2].[TreasuryCenter] = [ext_2].[TREA_CENT] AND [channel_2].[BIC] = [ext_2].[SRC_BIC] AND [channel_2].[Sepa] = CASE + WHEN [source_2].[SEPA] = 1 AND [destination_2].[SEPA] = 1 + THEN CASE + WHEN [source_2].[ISO] = [destination_2].[ISO] OR [source_2].[ISO] IS NULL AND [destination_2].[ISO] IS NULL + THEN 0 + ELSE 1 + END + ELSE 2 + END + WHERE + [ext_2].[NOT_HANDLED] = 2 AND + [ext_2].[TRANS_CHANNEL] IS NULL AND + [Issue2815Table1].[SRC_BIC] = [ext_2].[SRC_BIC] AND + [Issue2815Table1].[DES_BIC] = [ext_2].[DES_BIC] AND + [Issue2815Table1].[IDF] = [ext_2].[IDF] AND + [Issue2815Table1].[TREA_CENT] = [ext_2].[TREA_CENT] AND + [Issue2815Table1].[NOT_HANDLED] = [ext_2].[NOT_HANDLED] AND + ([Issue2815Table1].[TRANS_CHANNEL] = [ext_2].[TRANS_CHANNEL] OR [Issue2815Table1].[TRANS_CHANNEL] IS NULL AND [ext_2].[TRANS_CHANNEL] IS NULL) + ) WHERE - [Issue2815Table1].[NOT_HANDLED] = 2 AND - [Issue2815Table1].[TRANS_CHANNEL] IS NULL AND - [source].[ISO] = [Issue2815Table1].[SRC_BIC] AND - [destination].[ISO] = [Issue2815Table1].[DES_BIC] AND - [channel].[TreasuryCenter] = [Issue2815Table1].[TREA_CENT] AND - [channel].[BIC] = [Issue2815Table1].[SRC_BIC] AND - [channel].[Sepa] = CASE - WHEN [source].[SEPA] = 1 AND [destination].[SEPA] = 1 THEN CASE - WHEN [source].[ISO] = [destination].[ISO] OR [source].[ISO] IS NULL AND [destination].[ISO] IS NULL - THEN 0 - ELSE 1 - END - ELSE 2 - END + EXISTS( + SELECT + * + FROM + [Issue2815Table1] [ext] + LEFT JOIN [Issue2815Table2] [source] ON [source].[ISO] = [ext].[SRC_BIC] + LEFT JOIN [Issue2815Table2] [destination] ON [destination].[ISO] = [ext].[DES_BIC] + LEFT JOIN [Issue2815Table3] [channel] ON [channel].[TreasuryCenter] = [ext].[TREA_CENT] AND [channel].[BIC] = [ext].[SRC_BIC] AND [channel].[Sepa] = CASE + WHEN [source].[SEPA] = 1 AND [destination].[SEPA] = 1 THEN CASE + WHEN [source].[ISO] = [destination].[ISO] OR [source].[ISO] IS NULL AND [destination].[ISO] IS NULL + THEN 0 + ELSE 1 + END + ELSE 2 + END + WHERE + [ext].[NOT_HANDLED] = 2 AND + [ext].[TRANS_CHANNEL] IS NULL AND + [Issue2815Table1].[SRC_BIC] = [ext].[SRC_BIC] AND + [Issue2815Table1].[DES_BIC] = [ext].[DES_BIC] AND + [Issue2815Table1].[IDF] = [ext].[IDF] AND + [Issue2815Table1].[TREA_CENT] = [ext].[TREA_CENT] AND + [Issue2815Table1].[NOT_HANDLED] = [ext].[NOT_HANDLED] AND + ([Issue2815Table1].[TRANS_CHANNEL] = [ext].[TRANS_CHANNEL] OR [Issue2815Table1].[TRANS_CHANNEL] IS NULL AND [ext].[TRANS_CHANNEL] IS NULL) + ) + +BeforeExecute +-- Sybase.Managed Sybase + +SELECT + [t1].[SRC_BIC], + [t1].[DES_BIC], + [t1].[IDF], + [t1].[TREA_CENT], + [t1].[NOT_HANDLED], + [t1].[TRANS_CHANNEL] +FROM + [Issue2815Table1] [t1] +ORDER BY + [t1].[SRC_BIC], + [t1].[DES_BIC] diff --git a/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(Sybase.Managed).sql index 4e6f969c85c9..cf416658d996 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociation(Sybase.Managed).sql @@ -4,11 +4,25 @@ UPDATE [UpdatedEntities] SET - [Value1] = [a_Relation].[RelatedValue3] -FROM - [UpdateRelation] [a_Relation] + [Value1] = ( + SELECT + [a_Relation_1].[RelatedValue3] + FROM + [UpdatedEntities] [v_1] + LEFT JOIN [UpdateRelation] [a_Relation_1] ON [v_1].[RelationId] = [a_Relation_1].[id] + WHERE + [a_Relation_1].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v_1].[id] + ) WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + EXISTS( + SELECT + * + FROM + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] + WHERE + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(Sybase.Managed).sql index 4e6f969c85c9..cf416658d996 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationAsUpdatable(Sybase.Managed).sql @@ -4,11 +4,25 @@ UPDATE [UpdatedEntities] SET - [Value1] = [a_Relation].[RelatedValue3] -FROM - [UpdateRelation] [a_Relation] + [Value1] = ( + SELECT + [a_Relation_1].[RelatedValue3] + FROM + [UpdatedEntities] [v_1] + LEFT JOIN [UpdateRelation] [a_Relation_1] ON [v_1].[RelationId] = [a_Relation_1].[id] + WHERE + [a_Relation_1].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v_1].[id] + ) WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + EXISTS( + SELECT + * + FROM + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] + WHERE + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(Sybase.Managed).sql index 9d9d501c14d7..431c342c1a04 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimple(Sybase.Managed).sql @@ -7,10 +7,16 @@ SET [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], [Value3] = 1 -FROM - [UpdateRelation] [a_Relation] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + EXISTS( + SELECT + * + FROM + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] + WHERE + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(Sybase.Managed).sql index 9d9d501c14d7..431c342c1a04 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.UpdateTestAssociationSimpleAsUpdatable(Sybase.Managed).sql @@ -7,10 +7,16 @@ SET [Value1] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], [Value2] = [UpdatedEntities].[Value1] + [UpdatedEntities].[Value2] + [UpdatedEntities].[Value3], [Value3] = 1 -FROM - [UpdateRelation] [a_Relation] WHERE - [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[RelationId] = [a_Relation].[id] + EXISTS( + SELECT + * + FROM + [UpdatedEntities] [v] + LEFT JOIN [UpdateRelation] [a_Relation] ON [v].[RelationId] = [a_Relation].[id] + WHERE + [a_Relation].[RelatedValue1] = 11 AND [UpdatedEntities].[id] = [v].[id] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(Sybase.Managed).sql index db72aa997b68..8ffeb4a39808 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(Sybase.Managed).sql @@ -44,11 +44,19 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 2 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(Sybase.Managed).sql index a385d72e8efe..da518bde0f0b 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(Sybase.Managed).sql @@ -44,11 +44,19 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(Sybase.Managed).sql index 7ef232ad9de9..34d5697acecc 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoin(Sybase.Managed).sql @@ -12,13 +12,26 @@ SET WHEN [gt_s_one].[col3] = 'empty' THEN '1' ELSE '0' END, - [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' - ELSE CAST([y1].[id] AS NVarChar(11)) - END -FROM - [access_mode] [y1] + [col6] = ( + SELECT + CASE + WHEN [gt_s_one].[col3] = 'empty' THEN '' + ELSE CAST([y1_1].[id] AS NVarChar(11)) + END + FROM + [gt_s_one] [x_1] + LEFT JOIN [access_mode] [y1_1] ON Upper(Str_Replace([x_1].[col3], 'auth.', '')) = Upper([y1_1].[code]) OR [x_1].[col3] IS NULL AND [y1_1].[code] IS NULL + WHERE + [gt_s_one].[id] = [x_1].[id] + ) WHERE - Upper(Str_Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + EXISTS( + SELECT + * + FROM + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Str_Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL + WHERE + [gt_s_one].[id] = [x].[id] + ) diff --git a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(Sybase.Managed).sql index 7ef232ad9de9..34d5697acecc 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.TestUpdateFromJoinOld(Sybase.Managed).sql @@ -12,13 +12,26 @@ SET WHEN [gt_s_one].[col3] = 'empty' THEN '1' ELSE '0' END, - [col6] = CASE - WHEN [gt_s_one].[col3] = 'empty' THEN '' - ELSE CAST([y1].[id] AS NVarChar(11)) - END -FROM - [access_mode] [y1] + [col6] = ( + SELECT + CASE + WHEN [gt_s_one].[col3] = 'empty' THEN '' + ELSE CAST([y1_1].[id] AS NVarChar(11)) + END + FROM + [gt_s_one] [x_1] + LEFT JOIN [access_mode] [y1_1] ON Upper(Str_Replace([x_1].[col3], 'auth.', '')) = Upper([y1_1].[code]) OR [x_1].[col3] IS NULL AND [y1_1].[code] IS NULL + WHERE + [gt_s_one].[id] = [x_1].[id] + ) WHERE - Upper(Str_Replace([gt_s_one].[col3], 'auth.', '')) = Upper([y1].[code]) OR - [gt_s_one].[col3] IS NULL AND [y1].[code] IS NULL + EXISTS( + SELECT + * + FROM + [gt_s_one] [x] + LEFT JOIN [access_mode] [y1] ON Upper(Str_Replace([x].[col3], 'auth.', '')) = Upper([y1].[code]) OR [x].[col3] IS NULL AND [y1].[code] IS NULL + WHERE + [gt_s_one].[id] = [x].[id] + ) diff --git a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(Sybase.Managed).sql index 955cabaf15a2..46c2dd38f6c5 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(Sybase.Managed).sql @@ -35,11 +35,19 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(Sybase.Managed).sql index 955cabaf15a2..46c2dd38f6c5 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(Sybase.Managed).sql @@ -35,11 +35,19 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(Sybase.Managed).sql index e2fa7dfcefdc..f7cc5191256f 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(Sybase.Managed).sql @@ -35,11 +35,19 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase (asynchronously) diff --git a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(Sybase.Managed).sql index d44614174927..f5397d48a27b 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4String(Sybase.Managed).sql @@ -7,9 +7,17 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1 -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) diff --git a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(Sybase.Managed).sql index 71c270026b97..4706455fe6ab 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(Sybase.Managed).sql @@ -37,11 +37,19 @@ UPDATE [Child] SET [ChildID] = @ChildID -FROM - [Parent] [a_Parent] WHERE - [Child].[ChildID] = @id AND [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(Sybase.Managed).sql index cc110f3e7a9f..de42e4a5bd97 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9(Sybase.Managed).sql @@ -35,15 +35,33 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1, - [ParentID] = [p].[ParentID] -FROM - [Parent] [a_Parent], - [Parent] [p] + [ParentID] = ( + SELECT + [p_1].[ParentID] + FROM + [Child] [c_2] + LEFT JOIN [Parent] [a_Parent_1] ON [c_2].[ParentID] = [a_Parent_1].[ParentID] + INNER JOIN [Parent] [p_1] ON [c_2].[ParentID] = [p_1].[ParentID] + WHERE + [c_2].[ChildID] = @id AND + [a_Parent_1].[Value1] = 1 AND + [Child].[ParentID] = [c_2].[ParentID] AND + [Child].[ChildID] = [c_2].[ChildID] + ) WHERE - [Child].[ChildID] = @id AND - [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(Sybase.Managed).sql index cc110f3e7a9f..de42e4a5bd97 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update9Old(Sybase.Managed).sql @@ -35,15 +35,33 @@ UPDATE [Child] SET [ChildID] = [Child].[ChildID] + 1, - [ParentID] = [p].[ParentID] -FROM - [Parent] [a_Parent], - [Parent] [p] + [ParentID] = ( + SELECT + [p_1].[ParentID] + FROM + [Child] [c_2] + LEFT JOIN [Parent] [a_Parent_1] ON [c_2].[ParentID] = [a_Parent_1].[ParentID] + INNER JOIN [Parent] [p_1] ON [c_2].[ParentID] = [p_1].[ParentID] + WHERE + [c_2].[ChildID] = @id AND + [a_Parent_1].[Value1] = 1 AND + [Child].[ParentID] = [c_2].[ParentID] AND + [Child].[ChildID] = [c_2].[ChildID] + ) WHERE - [Child].[ChildID] = @id AND - [a_Parent].[Value1] = 1 AND - [Child].[ParentID] = [a_Parent].[ParentID] AND - [Child].[ParentID] = [p].[ParentID] + EXISTS( + SELECT + * + FROM + [Child] [c_1] + LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] + INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] + WHERE + [c_1].[ChildID] = @id AND + [a_Parent].[Value1] = 1 AND + [Child].[ParentID] = [c_1].[ParentID] AND + [Child].[ChildID] = [c_1].[ChildID] + ) BeforeExecute -- Sybase.Managed Sybase diff --git a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(Sybase.Managed).sql b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(Sybase.Managed).sql index 0027f24605a0..1a4138998f06 100644 --- a/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateSetSelect(Sybase.Managed).sql @@ -13,13 +13,29 @@ BeforeExecute UPDATE [Parent] SET - [ParentID] = [c_2].[ParentID] + 1000 -FROM - [Child] [c_1], - [Child] [c_2] + [ParentID] = ( + SELECT + [c_4].[ParentID] + 1000 + FROM + [Parent] [p_1] + INNER JOIN [Child] [c_3] ON [p_1].[ParentID] = [c_3].[ParentID] + LEFT JOIN [Child] [c_4] ON [c_4].[ChildID] = 11 + WHERE + [p_1].[ParentID] = 1 AND [Parent].[ParentID] = [p_1].[ParentID] AND + ([Parent].[Value1] = [p_1].[Value1] OR [Parent].[Value1] IS NULL AND [p_1].[Value1] IS NULL) + ) WHERE - [Parent].[ParentID] = 1 AND [Parent].[ParentID] = [c_1].[ParentID] AND - [c_2].[ChildID] = 11 + EXISTS( + SELECT + * + FROM + [Parent] [p] + INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] + LEFT JOIN [Child] [c_2] ON [c_2].[ChildID] = 11 + WHERE + [p].[ParentID] = 1 AND [Parent].[ParentID] = [p].[ParentID] AND + ([Parent].[Value1] = [p].[Value1] OR [Parent].[Value1] IS NULL AND [p].[Value1] IS NULL) + ) BeforeExecute -- Sybase.Managed Sybase