Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opt: memo cycle detection does not work in some cases in opt tests #83996

Open
mgartner opened this issue Jul 7, 2022 · 0 comments
Open

opt: memo cycle detection does not work in some cases in opt tests #83996

mgartner opened this issue Jul 7, 2022 · 0 comments
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-queries SQL Queries Team
Projects

Comments

@mgartner
Copy link
Collaborator

mgartner commented Jul 7, 2022

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

@mgartner mgartner added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Jul 7, 2022
@mgartner mgartner added this to Triage in SQL Queries via automation Jul 7, 2022
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Jul 7, 2022
@mgartner mgartner moved this from Triage to 22.2 Release in SQL Queries Jul 7, 2022
@rytaft rytaft moved this from 22.2 Release to Backlog in SQL Queries Jul 21, 2022
@mgartner mgartner removed their assignment Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-queries SQL Queries Team
Projects
Status: Backlog
SQL Queries
Backlog (DO NOT ADD NEW ISSUES)
Development

No branches or pull requests

1 participant