-
Notifications
You must be signed in to change notification settings - Fork 4.1k
opt: memo cycle detection does not work in some cases in opt tests #83996
Copy link
Copy link
Open
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-queriesSQL Queries TeamSQL Queries Team
Description
Before #83875 was merged, the opt test below creates a memo cycle, but the cycle is not detected as it should be. The cycel is detected when running the same SQL statements in cockroach demo, so perhaps there is something in opttester or the test catalog that prevents cycle detection from working. We may be able to remove the memo-cycles opttester option once we fix this issue, because it would be superfluous - a cycle should result in an error so there is no need to print memo cycles in the memo output.
exec-ddl
CREATE TABLE table80901_1 (
col1_5 DECIMAL,
col1_7 BOOL,
col1_9 OID,
col1_11 STRING,
col1_12 STRING,
col1_14 STRING,
col1_15 STRING,
col1_16 STRING,
col1_17 STRING
);
----
exec-ddl
CREATE TABLE table80901_3 (col3_2 OID, col3_4 FLOAT8, col3_9 STRING);
----
memo
SELECT (
SELECT NULL
FROM table80901_1 AS tab_42924
JOIN table80901_1 AS tab_42927
LEFT JOIN table80901_3 AS tab_42928 ON tab_42921.col1_7
JOIN table80901_3 AS tab_42929
ON tab_42927.col1_9 = tab_42929.col3_2
ON tab_42924.col1_17 = tab_42927.col1_15
AND tab_42924.col1_12 = tab_42929.col3_9
AND tab_42924.col1_14 = tab_42928.col3_9
AND tab_42924.col1_14 = tab_42929.col3_9
AND tab_42924.col1_11 = tab_42927.col1_17
AND tab_42924.col1_11 = tab_42927.col1_16
AND tab_42924.col1_15 = tab_42929.col3_9
AND tab_42924.col1_5 = tab_42929.crdb_internal_mvcc_timestamp
)
FROM table80901_1 AS tab_42921;
----
Jira issue: CRDB-17396
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-queriesSQL Queries TeamSQL Queries Team
Type
Projects
Status
Backlog