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

roachtest: django failed #106371

Closed
cockroach-teamcity opened this issue Jul 7, 2023 · 17 comments · Fixed by #106485
Closed

roachtest: django failed #106371

cockroach-teamcity opened this issue Jul 7, 2023 · 17 comments · Fixed by #106485
Assignees
Labels
branch-master Failures and bugs on the master branch. C-test-failure Broken test (automatically or manually discovered). O-roachtest O-robot Originated from a bot. release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. T-sql-queries SQL Queries Team
Milestone

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented Jul 7, 2023

roachtest.django failed with artifacts on master @ 1137aee0089fc2fe161bab0f1c899d2ddc997c90:

(orm_helpers.go:212).summarizeFailed: 
Tests run on Cockroach v23.2.0-alpha.00000000-dev-1137aee0089fc2fe161bab0f1c899d2ddc997c90
Tests run against django cockroach-4.1.x
9951 Total Tests Run
9949 tests passed
2 tests failed
639 tests skipped
2 tests ignored
0 tests passed unexpectedly
2 tests failed unexpectedly
0 tests expected failed but skipped
0 tests expected failed but not run
---
--- SKIP: backends.mysql.test_creation.DatabaseCreationTests.test_create_test_db_unexpected_error due to MySQL tests (expected)
--- FAIL: queries.tests.Queries1Tests.test_ticket2306 (unexpected)
--- FAIL: queries.tests.Queries1Tests.test_ticket4464 (unexpected)
For a full summary look at the django artifacts 
An updated blocklist (djangoBlocklist) is available in the artifacts' django log
test artifacts and logs in: /artifacts/django/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=16 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

/cc @cockroachdb/sql-foundations

This test on roachdash | Improve this report!

Jira issue: CRDB-29537

@cockroach-teamcity cockroach-teamcity added branch-master Failures and bugs on the master branch. C-test-failure Broken test (automatically or manually discovered). O-roachtest O-robot Originated from a bot. release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Jul 7, 2023
@cockroach-teamcity cockroach-teamcity added this to the 23.2 milestone Jul 7, 2023
@rafiss
Copy link
Collaborator

rafiss commented Jul 7, 2023

@DrewKimball @andyyang890 it looks like the error from #105598 was not fully fixed by #105866.

@rafiss rafiss added T-sql-queries SQL Queries Team and removed T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Jul 7, 2023
@DrewKimball
Copy link
Collaborator

Hmm, maybe it wasn't the same issue after all. @rafiss do you know how I can get the specifics of the failure / failing queries?

@rafiss
Copy link
Collaborator

rafiss commented Jul 7, 2023

@andyyang890 had found them here: #105598 (comment)

But not the DDL/schema. Andy, do you already have those handy?

@andyyang890
Copy link
Collaborator

@DrewKimball @rafiss

I tried getting the list of all the statements that are run but there are way too many (in the order of hundreds). After some trial and error, I was able to create a smaller repro though:

CREATE TABLE queries_note (
  id INT8 NOT NULL DEFAULT unique_rowid(),
  note VARCHAR(100) NOT NULL,
  misc VARCHAR(25) NOT NULL,
  tag_id INT8 NULL,
  negate BOOL NOT NULL,
  CONSTRAINT queries_note_pkey PRIMARY KEY (id ASC)
);

CREATE TABLE queries_item (
  id INT8 NOT NULL DEFAULT unique_rowid(),
  name VARCHAR(10) NOT NULL,
  created TIMESTAMPTZ NOT NULL,
  modified TIMESTAMPTZ NULL,
  creator_id INT8 NOT NULL,
  note_id INT8 NOT NULL,
  CONSTRAINT queries_item_pkey PRIMARY KEY (id ASC),
  CONSTRAINT queries_item_note_id_9de00e4b_fk_queries_note_id FOREIGN KEY (note_id) REFERENCES queries_note(id)
);

CREATE TABLE queries_item_tags (                                                                      
  id INT8 NOT NULL DEFAULT unique_rowid(),                                                                 
  item_id INT8 NOT NULL,                                                                                   
  tag_id INT8 NOT NULL,                                                                                    
  CONSTRAINT queries_item_tags_pkey PRIMARY KEY (id ASC),                                                  
  CONSTRAINT queries_item_tags_item_id_9b8a9088_fk_queries_item_id FOREIGN KEY (item_id) REFERENCES queries_item(id),                                                   
  UNIQUE INDEX queries_item_tags_item_id_tag_id_d9956f47_uniq (item_id ASC, tag_id ASC)                    
);

INSERT INTO queries_note(id, note, misc, tag_id, negate) VALUES (2, 'n2', 'bar', NULL, true);
INSERT INTO queries_note(id, note, misc, tag_id, negate) VALUES (3, 'n3', 'foo', NULL, false);

INSERT INTO queries_item(id, name, created, modified, creator_id, note_id) VALUES (880570233050497025, 'one', '2007-12-19T22:25:00-06:00'::TIMESTAMPTZ, '2007-12-19T22:25:00-06:00'::TIMESTAMPTZ, 880570233030508545, 3);
INSERT INTO queries_item(id, name, created, modified, creator_id, note_id) VALUES (880570233074155521, 'two', '2007-12-19T21:00:00-06:00'::TIMESTAMPTZ, NULL, 880570233034539009, 2);

INSERT INTO queries_item_tags(item_id, tag_id) VALUES (880570233050497025, 880570232933416961), (880570233050497025, 880570232939020289) ON CONFLICT DO NOTHING;
INSERT INTO queries_item_tags(item_id, tag_id) VALUES (880570233074155521, 880570232933416961), (880570233074155521, 880570232944820225) ON CONFLICT DO NOTHING;

SELECT queries_item.id, queries_item.name, queries_item.created, queries_item.modified, queries_item.creator_id, queries_item.note_id
FROM queries_item
INNER JOIN queries_item_tags
ON (queries_item.id = queries_item_tags.item_id)
INNER JOIN queries_item_tags AS t4
ON (queries_item.id = t4.item_id)
INNER JOIN queries_note
ON (queries_item.note_id = queries_note.id)
WHERE ((queries_item_tags.tag_id = 880570232933416961)
AND (t4.tag_id = 880570232939020289))
ORDER BY queries_note.note DESC, queries_item.name ASC;

Expected:

          id         | name |        created         |        modified        |     creator_id     | note_id
---------------------+------+------------------------+------------------------+--------------------+----------
  880570233050497025 | one  | 2007-12-20 04:25:00+00 | 2007-12-20 04:25:00+00 | 880570233030508545 |       3

Actual:

  id | name | created | modified | creator_id | note_id
-----+------+---------+----------+------------+----------

@DrewKimball
Copy link
Collaborator

Thanks for the repro!

@cockroach-teamcity
Copy link
Member Author

roachtest.django failed with artifacts on master @ 43c26aec0072f76e02e6d5ffc1b7079026b24630:

(orm_helpers.go:212).summarizeFailed: 
Tests run on Cockroach v23.2.0-alpha.00000000-dev-43c26aec0072f76e02e6d5ffc1b7079026b24630
Tests run against django cockroach-4.1.x
9951 Total Tests Run
9949 tests passed
2 tests failed
639 tests skipped
2 tests ignored
0 tests passed unexpectedly
2 tests failed unexpectedly
0 tests expected failed but skipped
0 tests expected failed but not run
---
--- FAIL: queries.tests.Queries1Tests.test_ticket4464 (unexpected)
--- FAIL: queries.tests.Queries1Tests.test_ticket2306 (unexpected)
--- SKIP: backends.mysql.test_creation.DatabaseCreationTests.test_create_test_db_unexpected_error due to MySQL tests (expected)
For a full summary look at the django artifacts 
An updated blocklist (djangoBlocklist) is available in the artifacts' django log
test artifacts and logs in: /artifacts/django/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=16 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

This test on roachdash | Improve this report!

DrewKimball added a commit to DrewKimball/cockroach that referenced this issue Jul 8, 2023
Self-join equality inference was added by cockroachdb#105214, so that the `FuncDeps`
for a self-join would include equalities between *every* pair of columns
at the same ordinal position in the base table if there was an equality
between key columns (also at the same ordinal position). However, the
key column check was performed using the FDs of the join inputs rather
than the base table's FDs. This could lead to incorrectly adding self-join
equality filters. For example, consider the following:
```
CREATE TABLE xy (x INT NOT NULL, y INT NOT NULL);
INSERT INTO xy VALUES (1, 1), (1, 2);

SELECT * FROM xy a JOIN xy b ON a.x = b.x;

SELECT * FROM (SELECT * FROM xy LIMIT 1) a
JOIN (SELECT * FROM xy LIMIT 1) b ON a.x = b.x;
```
In the first query above, `a.x = b.x` does not consitute joining on
key columns. But in the second query, both inputs have one row and
so *any* set of columns is a key. However, there are no guarantees
which row is being joined from each table - if `a` is the `(1, 1)`
row and `b` is the `(1, 2)` row, inferring a `a.y = b.y` filter
will incorrectly cause the join to return no rows.

This patch fixes the problem by requiring the initial self-join
equalities to form a key over the *base* table, not just the inputs
of the join.

Fixes cockroachdb#106371

Release note: None
@cockroach-teamcity
Copy link
Member Author

roachtest.django failed with artifacts on master @ 0207c613fa7c8f3ab66c4518ee1e52dabb863426:

(orm_helpers.go:212).summarizeFailed: 
Tests run on Cockroach v23.2.0-alpha.00000000-dev-0207c613fa7c8f3ab66c4518ee1e52dabb863426
Tests run against django cockroach-4.1.x
9951 Total Tests Run
9949 tests passed
2 tests failed
639 tests skipped
2 tests ignored
0 tests passed unexpectedly
2 tests failed unexpectedly
0 tests expected failed but skipped
0 tests expected failed but not run
---
--- SKIP: backends.mysql.test_creation.DatabaseCreationTests.test_create_test_db_unexpected_error due to MySQL tests (expected)
--- FAIL: queries.tests.Queries1Tests.test_ticket2306 (unexpected)
--- FAIL: queries.tests.Queries1Tests.test_ticket4464 (unexpected)
For a full summary look at the django artifacts 
An updated blocklist (djangoBlocklist) is available in the artifacts' django log
test artifacts and logs in: /artifacts/django/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=16 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

This test on roachdash | Improve this report!

@cockroach-teamcity
Copy link
Member Author

roachtest.django failed with artifacts on master @ 0207c613fa7c8f3ab66c4518ee1e52dabb863426:

(orm_helpers.go:212).summarizeFailed: 
Tests run on Cockroach v23.2.0-alpha.00000000-dev-0207c613fa7c8f3ab66c4518ee1e52dabb863426
Tests run against django cockroach-4.1.x
9951 Total Tests Run
9949 tests passed
2 tests failed
639 tests skipped
2 tests ignored
0 tests passed unexpectedly
2 tests failed unexpectedly
0 tests expected failed but skipped
0 tests expected failed but not run
---
--- FAIL: queries.tests.Queries1Tests.test_ticket2306 (unexpected)
--- FAIL: queries.tests.Queries1Tests.test_ticket4464 (unexpected)
--- SKIP: backends.mysql.test_creation.DatabaseCreationTests.test_create_test_db_unexpected_error due to MySQL tests (expected)
For a full summary look at the django artifacts 
An updated blocklist (djangoBlocklist) is available in the artifacts' django log
test artifacts and logs in: /artifacts/django/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=16 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

This test on roachdash | Improve this report!

@cockroach-teamcity
Copy link
Member Author

roachtest.django failed with artifacts on master @ 382a6efb7985b1993e0398c7b29f0e0b746587f4:

(orm_helpers.go:212).summarizeFailed: 
Tests run on Cockroach v23.2.0-alpha.00000000-dev-382a6efb7985b1993e0398c7b29f0e0b746587f4
Tests run against django cockroach-4.1.x
9951 Total Tests Run
9949 tests passed
2 tests failed
639 tests skipped
2 tests ignored
0 tests passed unexpectedly
2 tests failed unexpectedly
0 tests expected failed but skipped
0 tests expected failed but not run
---
--- FAIL: queries.tests.Queries1Tests.test_ticket4464 (unexpected)
--- FAIL: queries.tests.Queries1Tests.test_ticket2306 (unexpected)
--- SKIP: backends.mysql.test_creation.DatabaseCreationTests.test_create_test_db_unexpected_error due to MySQL tests (expected)
For a full summary look at the django artifacts 
An updated blocklist (djangoBlocklist) is available in the artifacts' django log
test artifacts and logs in: /artifacts/django/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=16 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

This test on roachdash | Improve this report!

@cockroach-teamcity
Copy link
Member Author

roachtest.django failed with artifacts on master @ a6dbdee0e07325f58a8baf30c199c9cf7ad46614:

(orm_helpers.go:212).summarizeFailed: 
Tests run on Cockroach v23.2.0-alpha.00000000-dev-a6dbdee0e07325f58a8baf30c199c9cf7ad46614
Tests run against django cockroach-4.1.x
9951 Total Tests Run
9949 tests passed
2 tests failed
639 tests skipped
2 tests ignored
0 tests passed unexpectedly
2 tests failed unexpectedly
0 tests expected failed but skipped
0 tests expected failed but not run
---
--- FAIL: queries.tests.Queries1Tests.test_ticket2306 (unexpected)
--- FAIL: queries.tests.Queries1Tests.test_ticket4464 (unexpected)
--- SKIP: backends.mysql.test_creation.DatabaseCreationTests.test_create_test_db_unexpected_error due to MySQL tests (expected)
For a full summary look at the django artifacts 
An updated blocklist (djangoBlocklist) is available in the artifacts' django log
test artifacts and logs in: /artifacts/django/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=16 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

This test on roachdash | Improve this report!

@cockroach-teamcity
Copy link
Member Author

roachtest.django failed with artifacts on master @ 8dcde9c4635f27cefdbc167729c95bf865d9dfd5:

(orm_helpers.go:212).summarizeFailed: 
Tests run on Cockroach v23.2.0-alpha.00000000-dev-8dcde9c4635f27cefdbc167729c95bf865d9dfd5
Tests run against django cockroach-4.1.x
9951 Total Tests Run
9949 tests passed
2 tests failed
639 tests skipped
2 tests ignored
0 tests passed unexpectedly
2 tests failed unexpectedly
0 tests expected failed but skipped
0 tests expected failed but not run
---
--- FAIL: queries.tests.Queries1Tests.test_ticket2306 (unexpected)
--- FAIL: queries.tests.Queries1Tests.test_ticket4464 (unexpected)
--- SKIP: backends.mysql.test_creation.DatabaseCreationTests.test_create_test_db_unexpected_error due to MySQL tests (expected)
For a full summary look at the django artifacts 
An updated blocklist (djangoBlocklist) is available in the artifacts' django log
test artifacts and logs in: /artifacts/django/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=16 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

This test on roachdash | Improve this report!

@cockroach-teamcity
Copy link
Member Author

roachtest.django failed with artifacts on master @ ac6d73de8e27cae4e087bb42ee03bfc515939104:

(orm_helpers.go:212).summarizeFailed: 
Tests run on Cockroach v23.2.0-alpha.00000000-dev-ac6d73de8e27cae4e087bb42ee03bfc515939104
Tests run against django cockroach-4.1.x
9951 Total Tests Run
9949 tests passed
2 tests failed
639 tests skipped
2 tests ignored
0 tests passed unexpectedly
2 tests failed unexpectedly
0 tests expected failed but skipped
0 tests expected failed but not run
---
--- SKIP: backends.mysql.test_creation.DatabaseCreationTests.test_create_test_db_unexpected_error due to MySQL tests (expected)
--- FAIL: queries.tests.Queries1Tests.test_ticket4464 (unexpected)
--- FAIL: queries.tests.Queries1Tests.test_ticket2306 (unexpected)
For a full summary look at the django artifacts 
An updated blocklist (djangoBlocklist) is available in the artifacts' django log
test artifacts and logs in: /artifacts/django/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=16 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

This test on roachdash | Improve this report!

@cockroach-teamcity
Copy link
Member Author

roachtest.django failed with artifacts on master @ b4dfdc01809da4ac76b32ec5e2ff9a50d9adeee3:

(orm_helpers.go:212).summarizeFailed: 
Tests run on Cockroach v23.2.0-alpha.00000000-dev-b4dfdc01809da4ac76b32ec5e2ff9a50d9adeee3
Tests run against django cockroach-4.1.x
9951 Total Tests Run
9949 tests passed
2 tests failed
639 tests skipped
2 tests ignored
0 tests passed unexpectedly
2 tests failed unexpectedly
0 tests expected failed but skipped
0 tests expected failed but not run
---
--- FAIL: queries.tests.Queries1Tests.test_ticket2306 (unexpected)
--- SKIP: backends.mysql.test_creation.DatabaseCreationTests.test_create_test_db_unexpected_error due to MySQL tests (expected)
--- FAIL: queries.tests.Queries1Tests.test_ticket4464 (unexpected)
For a full summary look at the django artifacts 
An updated blocklist (djangoBlocklist) is available in the artifacts' django log
test artifacts and logs in: /artifacts/django/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=16 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

This test on roachdash | Improve this report!

@cockroach-teamcity
Copy link
Member Author

roachtest.django failed with artifacts on master @ c609b823b0a1fda5b7d605e4645cd452a6009961:

(orm_helpers.go:212).summarizeFailed: 
Tests run on Cockroach v23.2.0-alpha.00000000-dev-c609b823b0a1fda5b7d605e4645cd452a6009961
Tests run against django cockroach-4.1.x
9951 Total Tests Run
9949 tests passed
2 tests failed
639 tests skipped
2 tests ignored
0 tests passed unexpectedly
2 tests failed unexpectedly
0 tests expected failed but skipped
0 tests expected failed but not run
---
--- FAIL: queries.tests.Queries1Tests.test_ticket2306 (unexpected)
--- FAIL: queries.tests.Queries1Tests.test_ticket4464 (unexpected)
--- SKIP: backends.mysql.test_creation.DatabaseCreationTests.test_create_test_db_unexpected_error due to MySQL tests (expected)
For a full summary look at the django artifacts 
An updated blocklist (djangoBlocklist) is available in the artifacts' django log
test artifacts and logs in: /artifacts/django/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=16 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

This test on roachdash | Improve this report!

@cockroach-teamcity
Copy link
Member Author

roachtest.django failed with artifacts on master @ c89d586897843c96bcf78f143f2c67763819f4a3:

(orm_helpers.go:212).summarizeFailed: 
Tests run on Cockroach v23.2.0-alpha.00000000-dev-c89d586897843c96bcf78f143f2c67763819f4a3
Tests run against django cockroach-4.1.x
9951 Total Tests Run
9949 tests passed
2 tests failed
639 tests skipped
2 tests ignored
0 tests passed unexpectedly
2 tests failed unexpectedly
0 tests expected failed but skipped
0 tests expected failed but not run
---
--- FAIL: queries.tests.Queries1Tests.test_ticket2306 (unexpected)
--- SKIP: backends.mysql.test_creation.DatabaseCreationTests.test_create_test_db_unexpected_error due to MySQL tests (expected)
--- FAIL: queries.tests.Queries1Tests.test_ticket4464 (unexpected)
For a full summary look at the django artifacts 
An updated blocklist (djangoBlocklist) is available in the artifacts' django log
test artifacts and logs in: /artifacts/django/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=16 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

This test on roachdash | Improve this report!

@cockroach-teamcity
Copy link
Member Author

roachtest.django failed with artifacts on master @ 7675ca4998134028f0623e04737b5cb69fcc33a9:

(cluster.go:2180).Start: ~ COCKROACH_CONNECT_TIMEOUT=1200 ./cockroach sql --url 'postgres://root@localhost:26257?sslmode=disable' -e "CREATE SCHEDULE IF NOT EXISTS test_only_backup FOR BACKUP INTO 'gs://cockroach-backup-testing-private/roachprod-scheduled-backups/teamcity-10950435-1689659335-93-n1cpu16/1689664378313204210?AUTH=implicit' RECURRING '*/15 * * * *' FULL BACKUP '@hourly' WITH SCHEDULE OPTIONS first_run = 'now'"
ERROR: unexpected error occurred when checking for existing backups in gs://cockroach-backup-testing-private/roachprod-scheduled-backups/teamcity-10950435-1689659335-93-n1cpu16/1689664378313204210?AUTH=implicit: unable to list files in gcs bucket: googleapi: Error 403: [email protected] does not have storage.objects.list access to the Google Cloud Storage bucket. Permission 'storage.objects.list' denied on resource (or it may not exist).
SQLSTATE: 58030
Failed running "sql": COMMAND_PROBLEM: exit status 1
test artifacts and logs in: /artifacts/django/run_1

Parameters: ROACHTEST_arch=amd64 , ROACHTEST_cloud=gce , ROACHTEST_cpu=16 , ROACHTEST_encrypted=false , ROACHTEST_fs=ext4 , ROACHTEST_localSSD=true , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

This test on roachdash | Improve this report!

@stevendanna
Copy link
Collaborator

Most recent failure is #107056. Leaving open as there are other unresolved failures.

craig bot pushed a commit that referenced this issue Jul 18, 2023
106485: opt: only infer self-join equality with a key over the base table r=DrewKimball a=DrewKimball

#### opt: only infer self-join equality with a key over the base table

Self-join equality inference was added by #105214, so that the `FuncDeps`
for a self-join would include equalities between *every* pair of columns
at the same ordinal position in the base table if there was an equality
between key columns (also at the same ordinal position). However, the
key column check was performed using the FDs of the join inputs rather
than the base table's FDs. This could lead to incorrectly adding self-join
equality filters. For example, consider the following:
```
CREATE TABLE t106371 (x INT NOT NULL, y INT NOT NULL);
INSERT INTO t106371 VALUES (1, 1), (1, 2);

SELECT * FROM t106371 a JOIN t106371 b ON a.x = b.x;

SELECT * FROM (SELECT * FROM t106371 ORDER BY y DESC LIMIT 1) a
JOIN (SELECT DISTINCT ON (x) * FROM t106371) b ON a.x = b.x;
```
In the first query above, `a.x = b.x` does not consitute joining on
key columns. But in the second query, one input has one row and the
other de-duplicated by the `x` column and so `x` is a key over both
inputs. However, the query as written will select different rows for
each input - `a` will return the `(1, 2)` row, while `b` will return
the `(1, 1)` row. Inferring a `a.y = b.y` filter will incorrectly cause
the join to return no rows.

This patch fixes the problem by requiring the initial self-join
equalities to form a key over the *base* table, not just the inputs
of the join.

Fixes #106371

Release note: None

106779: acceptance: Fix DockerCSharp Test r=rimadeodhar a=rimadeodhar

This PR updates the .net framework within the csproj setup to .net 6. 
Additionally, it also fixes the CS program that we run as
a part of this test with the new npgsql DateTime
changes made as a part of npgsql 6 version update. The old datetime 
types have been deprecated and needed to be removed. 
With these fixes, the test is running successfully and can be unskipped.

Epic: none
Fixes: #86852
Release note: none

107104: cli: fix debug zip with new columns for cluster settings r=maryliag a=maryliag

The addition of new columns on cluster_settings view done on #104449 were causing debug zip fails to add the information from that table, since the query used to gather the information was doing a join and not considering the new columns.

This commit updates the query to use the explicit columns, so even if new columns are added it won't be a problem in the future. It also adds tests for all custom querys used to generate the debug zip, so this type of issue would have been caught.

The file `crdb_internal.cluster_settings.txt` in debug zips was
empty due to this bug on v23.1.5 (only version affected by this bug).

Fixes #107103

Release note (bug fix): Debug zip now are properly showing the information from cluster_settings. The file `crdb_internal.cluster_settings.txt` in debug zips was
empty due to this bug on v23.1.5 (only version affected by this bug).

Co-authored-by: Drew Kimball <[email protected]>
Co-authored-by: rimadeodhar <[email protected]>
Co-authored-by: maryliag <[email protected]>
@craig craig bot closed this as completed in 1da6390 Jul 18, 2023
@mgartner mgartner moved this to Done in SQL Queries Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-master Failures and bugs on the master branch. C-test-failure Broken test (automatically or manually discovered). O-roachtest O-robot Originated from a bot. release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. T-sql-queries SQL Queries Team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants