Skip to content

Commit

Permalink
ysql: fix select from wrong table in array_op_test
Browse files Browse the repository at this point in the history
Summary:
This was supposed to land in upstream postgres first, but it seems to
have been swept under the rug.  See discussion
<https://www.postgresql.org/message-id/20210610232915.19587-1-git%40jasonk.me>.

The original message:

In the middle of GIN index testing, there are some selects that are on
a different table array_op_test that doesn't even have an index.  They
probably were supposed to be selects to table array_index_op_test like
the other ones around the area.

Fix that.  The expected output should stay the same because both tables
use the same array.data.

Test Plan: jenkins

Reviewers: zyu

Reviewed By: zyu

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D12104
  • Loading branch information
jaki committed Jun 29, 2021
1 parent d8d7f39 commit 40125c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/postgres/src/test/regress/expected/create_index.out
Original file line number Diff line number Diff line change
Expand Up @@ -2036,23 +2036,23 @@ SELECT * FROM array_index_op_test WHERE i <@ '{}' ORDER BY seqno;
101 | {} | {}
(1 row)

SELECT * FROM array_op_test WHERE i = '{NULL}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i = '{NULL}' ORDER BY seqno;
seqno | i | t
-------+--------+--------
102 | {NULL} | {NULL}
(1 row)

SELECT * FROM array_op_test WHERE i @> '{NULL}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i @> '{NULL}' ORDER BY seqno;
seqno | i | t
-------+---+---
(0 rows)

SELECT * FROM array_op_test WHERE i && '{NULL}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i && '{NULL}' ORDER BY seqno;
seqno | i | t
-------+---+---
(0 rows)

SELECT * FROM array_op_test WHERE i <@ '{NULL}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i <@ '{NULL}' ORDER BY seqno;
seqno | i | t
-------+----+----
101 | {} | {}
Expand Down Expand Up @@ -2327,13 +2327,13 @@ SELECT * FROM array_index_op_test WHERE t = '{}' ORDER BY seqno;
101 | {} | {}
(1 row)

SELECT * FROM array_op_test WHERE i = '{NULL}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i = '{NULL}' ORDER BY seqno;
seqno | i | t
-------+--------+--------
102 | {NULL} | {NULL}
(1 row)

SELECT * FROM array_op_test WHERE i <@ '{NULL}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i <@ '{NULL}' ORDER BY seqno;
seqno | i | t
-------+----+----
101 | {} | {}
Expand Down
12 changes: 6 additions & 6 deletions src/postgres/src/test/regress/sql/create_index.sql
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,10 @@ SELECT * FROM array_index_op_test WHERE i = '{}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i @> '{}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i && '{}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i <@ '{}' ORDER BY seqno;
SELECT * FROM array_op_test WHERE i = '{NULL}' ORDER BY seqno;
SELECT * FROM array_op_test WHERE i @> '{NULL}' ORDER BY seqno;
SELECT * FROM array_op_test WHERE i && '{NULL}' ORDER BY seqno;
SELECT * FROM array_op_test WHERE i <@ '{NULL}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i = '{NULL}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i @> '{NULL}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i && '{NULL}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i <@ '{NULL}' ORDER BY seqno;

CREATE INDEX textarrayidx ON array_index_op_test USING gin (t);

Expand Down Expand Up @@ -655,8 +655,8 @@ SELECT * FROM array_index_op_test WHERE t && '{AAAAAAA80240}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i @> '{32}' AND t && '{AAAAAAA80240}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i && '{32}' AND t @> '{AAAAAAA80240}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE t = '{}' ORDER BY seqno;
SELECT * FROM array_op_test WHERE i = '{NULL}' ORDER BY seqno;
SELECT * FROM array_op_test WHERE i <@ '{NULL}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i = '{NULL}' ORDER BY seqno;
SELECT * FROM array_index_op_test WHERE i <@ '{NULL}' ORDER BY seqno;

RESET enable_seqscan;
RESET enable_indexscan;
Expand Down

0 comments on commit 40125c3

Please sign in to comment.