You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -269,6 +268,13 @@ public static Object[][] testCTEStmtsDP() {
269
268
{COMPLEX_CTE, 4},
270
269
{"WITH 'date' as const1, 'time' as const2, Tmp1 as (SELECT 1), Tmp2 as (SELECT * FROM Tmp1) SELECT * FROM Tmp2 ", 0},
271
270
{"WITH query1 AS ( WITH 'a' as date1 SELECT * FROM tracking.event WHERE project='a' AND time>=starting_time AND time<ending_time GROUP BY date, user_id ) SELECT * FROM query1", 0},
271
+
{"WITH a AS (SELECT ?), (SELECT 2) AS b SELECT b, *, c FROM a", 1},
272
+
{"WITH a AS (SELECT ?), (SELECT 2) AS b, c as (SELECT ?) SELECT *, b FROM a, c", 2},
273
+
{"WITH (SELECT 2) AS b, a as (select ?), (select 3) AS c SELECT *, b, c FROM a", 1},
274
+
{"WITH a AS (SELECT 2), (WITH 'a' as b1 SELECT 3, b1) AS b SELECT b, * FROM a", 0},
275
+
{"WITH a AS (SELECT ?), (WITH ? as b1 SELECT 3, b1) AS b SELECT b, * FROM a", 2},
276
+
{"WITH a AS (SELECT 2), (WITH 'a' as b1 SELECT 3, b1) AS b, c AS (SELECT 4) SELECT b, * FROM a, c", 0},
277
+
272
278
};
273
279
}
274
280
@@ -285,6 +291,8 @@ public Object[][] testMiscStmtDp() {
285
291
returnnewObject[][] {
286
292
{"SELECT INTERVAL '1 day'", 0},
287
293
{"SELECT INTERVAL 1 day", 0},
294
+
{"SELECT ?", 1},
295
+
{"(SELECT ?)", 1},
288
296
{"SELECT * FROM table key WHERE ts = ?", 1},
289
297
{"SELECT * FROM table source WHERE ts = ?", 1},
290
298
{"SELECT * FROM table after WHERE ts = ?", 1},
@@ -540,7 +548,7 @@ public static Object[][] testStatementWithoutResultSetDP() {
540
548
{"CREATE VIEW `test_db`.`source_table` source AS ( SELECT * FROM source_a UNION SELECT * FROM source_b) ENGINE = MaterializedView", 0, false},
541
549
{"CREATE VIEW `test_db`.`source_table` source AS ( SELECT * FROM source_a UNION SELECT * FROM source_b) ENGINE = MaterializedView()", 0, false},
542
550
{"CREATE VIEW `test_db`.`source_table` source AS ( SELECT * FROM source_a UNION SELECT * FROM source_b) ENGINE = MaterializedView() COMMENT 'for tests'", 0, false},
0 commit comments