Skip to content

Commit

Permalink
logictestL remove unnecessary usage of a sequence
Browse files Browse the repository at this point in the history
This should make the test less flaky, since the IDs were not always
stable.

Release note: None
  • Loading branch information
rafiss committed Aug 18, 2023
1 parent 581d897 commit bab410e
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 @@ -2207,12 +2207,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 @@ -2227,23 +2224,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

subtest column_backfiller_update_batching

Expand Down Expand Up @@ -2408,8 +2405,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 @@ -2443,8 +2440,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 @@ -2459,7 +2456,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 bab410e

Please sign in to comment.