Skip to content

Commit

Permalink
Merge #108993
Browse files Browse the repository at this point in the history
108993: logictest: remove unnecessary usage of a sequence r=rafiss a=rafiss

This should make the test less flaky, since the IDs were not always stable.

fixes #108890
Release note: None

Co-authored-by: Rafi Shamim <[email protected]>
  • Loading branch information
craig[bot] and rafiss committed Aug 18, 2023
2 parents 99a37c5 + 0b7d3f4 commit 104ed81
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions pkg/sql/logictest/testdata/logic_test/alter_table
Original file line number Diff line number Diff line change
Expand Up @@ -2209,12 +2209,9 @@ COMMIT
# backfill has occurred.
subtest add_multiple_in_txn

statement ok
CREATE SEQUENCE IF NOT EXISTS multipleinstmt_seq MAXVALUE 9007199254740991;

statement ok
CREATE TABLE IF NOT EXISTS multipleinstmt (
id INT8 DEFAULT nextval('multipleinstmt_seq') PRIMARY KEY, key STRING, value STRING
key STRING PRIMARY KEY, value STRING
);

statement ok
Expand All @@ -2229,23 +2226,23 @@ ALTER TABLE multipleinstmt ADD COLUMN IF NOT EXISTS a BOOL DEFAULT false;
ALTER TABLE multipleinstmt ADD COLUMN IF NOT EXISTS b STRING;
COMMIT;

query ITTBT
SELECT * FROM multipleinstmt ORDER BY id ASC;
query TTBT
SELECT * FROM multipleinstmt ORDER BY key ASC;
----
1 a a false NULL
2 b b false NULL
3 c c false NULL
a a false NULL
b b false NULL
c c false NULL

statement ok
ALTER TABLE multipleinstmt ADD COLUMN IF NOT EXISTS c BOOL DEFAULT true,
ADD COLUMN IF NOT EXISTS d STRING;

query ITTBTBT
SELECT * FROM multipleinstmt ORDER BY id ASC;
query TTBTBT
SELECT * FROM multipleinstmt ORDER BY key ASC;
----
1 a a false NULL true NULL
2 b b false NULL true NULL
3 c c false NULL true NULL
a a false NULL true NULL
b b false NULL true NULL
c c false NULL true NULL

skip_on_retry

Expand Down Expand Up @@ -2412,8 +2409,8 @@ FROM (
LEFT JOIN pg_catalog.pg_depend r ON l.table_id = r.objid;
----
table_id name state refobjid
202 test_serial_b_seq PUBLIC 201
201 test_serial PUBLIC NULL
201 test_serial_b_seq PUBLIC 200
200 test_serial PUBLIC NULL

statement ok
DROP TABLE test_serial;
Expand Down Expand Up @@ -2447,8 +2444,8 @@ FROM (
LEFT JOIN pg_catalog.pg_depend r ON l.table_id = r.objid;
----
table_id name state refobjid
204 test_serial_b_seq PUBLIC 203
203 test_serial PUBLIC NULL
203 test_serial_b_seq PUBLIC 202
202 test_serial PUBLIC NULL

statement ok
ALTER TABLE test_serial DROP COLUMN b;
Expand All @@ -2463,7 +2460,7 @@ FROM (
LEFT JOIN pg_catalog.pg_depend r ON l.table_id = r.objid;
----
table_id name state refobjid
203 test_serial PUBLIC NULL
202 test_serial PUBLIC NULL

statement ok
DROP TABLE test_serial;
Expand Down

0 comments on commit 104ed81

Please sign in to comment.