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

release-23.1: logictest: remove unnecessary usage of a sequence #109006

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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