diff --git a/pkg/ccl/logictestccl/tests/3node-tenant/generated_test.go b/pkg/ccl/logictestccl/tests/3node-tenant/generated_test.go index dc949590dd29..0e53f9e01c56 100644 --- a/pkg/ccl/logictestccl/tests/3node-tenant/generated_test.go +++ b/pkg/ccl/logictestccl/tests/3node-tenant/generated_test.go @@ -322,6 +322,13 @@ func TestTenantLogic_bit( runLogicTest(t, "bit") } +func TestTenantLogic_bpchar( + t *testing.T, +) { + defer leaktest.AfterTest(t)() + runLogicTest(t, "bpchar") +} + func TestTenantLogic_builtin_function( t *testing.T, ) { diff --git a/pkg/sql/logictest/testdata/logic_test/bpchar b/pkg/sql/logictest/testdata/logic_test/bpchar new file mode 100644 index 000000000000..46377711358b --- /dev/null +++ b/pkg/sql/logictest/testdata/logic_test/bpchar @@ -0,0 +1,27 @@ +query T +SELECT 'foo'::BPCHAR +---- +foo + +statement ok +CREATE TABLE t (c BPCHAR PRIMARY KEY, FAMILY (c)) + +statement ok +INSERT INTO t VALUES ('foo'), ('ba'), ('c'), ('foobarbaz') + +query T rowsort +SELECT c FROM t +---- +foo +ba +c +foobarbaz + +query T +SELECT create_statement FROM [SHOW CREATE TABLE t] +---- +CREATE TABLE public.t ( + c BPCHAR NOT NULL, + CONSTRAINT t_pkey PRIMARY KEY (c ASC), + FAMILY fam_0_c (c) +) diff --git a/pkg/sql/logictest/testdata/logic_test/case b/pkg/sql/logictest/testdata/logic_test/case new file mode 100644 index 000000000000..b22e297a0f9f --- /dev/null +++ b/pkg/sql/logictest/testdata/logic_test/case @@ -0,0 +1,47 @@ +# LogicTest: local + +# Regression test for #127889. CASE-like expressions should not impose type +# widths of one branch on other branches. +subtest regression_127889 + +query T +SELECT CASE WHEN true THEN 'foo'::TEXT ELSE 'b'::CHAR END +---- +foo + +query T +SELECT COALESCE(NULL::CHAR, 'bar'::CHAR(2)) +---- +ba + +query T +SELECT IF(false, 'foo'::CHAR, 'bar'::CHAR(2)) +---- +ba + +query T +SELECT CASE WHEN false THEN 'b'::CHAR ELSE 'foo'::TEXT END +---- +foo + +query T +SELECT (CASE WHEN false THEN 'b'::CHAR ELSE 'foo'::TEXT END)::CHAR +---- +f + +query T +SELECT (CASE WHEN false THEN 'b'::CHAR ELSE 'foo'::TEXT END)::BPCHAR +---- +foo + +query R +SELECT CASE WHEN true THEN 1.2345::DECIMAL(5, 4) ELSE NULL::DECIMAL(10, 2) END +---- +1.2345 + +query R +SELECT CASE WHEN false THEN NULL::DECIMAL(10, 2) ELSE 1.2345::DECIMAL(5, 4) END +---- +1.2345 + +subtest end diff --git a/pkg/sql/logictest/testdata/logic_test/cast b/pkg/sql/logictest/testdata/logic_test/cast index a19ccbcb6f32..3b911b074c32 100644 --- a/pkg/sql/logictest/testdata/logic_test/cast +++ b/pkg/sql/logictest/testdata/logic_test/cast @@ -1446,7 +1446,7 @@ CREATE TABLE def_assn_cast ( id INT4, a INT4 DEFAULT 1.0::FLOAT4, b VARCHAR DEFAULT 'true'::BOOL, - c NAME DEFAULT 'foo'::BPCHAR + c NAME DEFAULT 'foo'::CHAR ) statement ok diff --git a/pkg/sql/logictest/testdata/logic_test/decimal b/pkg/sql/logictest/testdata/logic_test/decimal index 406a3723b9bc..8c687e5452f4 100644 --- a/pkg/sql/logictest/testdata/logic_test/decimal +++ b/pkg/sql/logictest/testdata/logic_test/decimal @@ -468,7 +468,7 @@ NaN NaN NaN NaN NaN # TODO(drewk): There are a few differences vs postgres in the number of decimal # places and negative zeros. query RRRRR -WITH v(id, x) AS (VALUES (1, '0'::numeric), (2, '1'::numeric), (3, '-1'::numeric), +WITH v(id, x) AS (VALUES (1, '0'::numeric), (2, '1'::numeric), (3, '-1'::numeric), (4, '4.2'::numeric), (5, 'inf'::numeric), (6, '-inf'::numeric), (7, 'nan'::numeric) ) SELECT x1, x2, diff --git a/pkg/sql/logictest/testdata/logic_test/drop_function b/pkg/sql/logictest/testdata/logic_test/drop_function index d755d7402953..39739738f319 100644 --- a/pkg/sql/logictest/testdata/logic_test/drop_function +++ b/pkg/sql/logictest/testdata/logic_test/drop_function @@ -58,3 +58,33 @@ DROP FUNCTION f114677; statement error pgcode 42883 unknown function: f114677\(\) SHOW CREATE FUNCTION f114677; + +statement ok +CREATE FUNCTION f_char(c CHAR) RETURNS INT LANGUAGE SQL AS 'SELECT 1' + +statement ok +DROP FUNCTION f_char(BPCHAR) + +statement ok +CREATE FUNCTION f_char(c CHAR(2)) RETURNS INT LANGUAGE SQL AS 'SELECT 1' + +statement ok +DROP FUNCTION f_char(BPCHAR) + +statement ok +CREATE FUNCTION f_char(c BPCHAR) RETURNS INT LANGUAGE SQL AS 'SELECT 1' + +statement ok +DROP FUNCTION f_char(BPCHAR) + +statement ok +CREATE FUNCTION f_char(c BPCHAR) RETURNS INT LANGUAGE SQL AS 'SELECT 1' + +statement ok +DROP FUNCTION f_char(CHAR) + +statement ok +CREATE FUNCTION f_char(c BPCHAR) RETURNS INT LANGUAGE SQL AS 'SELECT 1' + +statement ok +DROP FUNCTION f_char(CHAR(2)) diff --git a/pkg/sql/logictest/testdata/logic_test/grant_table b/pkg/sql/logictest/testdata/logic_test/grant_table index 9c70ef121b0f..1d347c276369 100644 --- a/pkg/sql/logictest/testdata/logic_test/grant_table +++ b/pkg/sql/logictest/testdata/logic_test/grant_table @@ -238,18 +238,18 @@ test pg_catalog box2d type test pg_catalog box2d[] type admin ALL false test pg_catalog box2d[] type public USAGE false test pg_catalog box2d[] type root ALL false +test pg_catalog bpchar type admin ALL false +test pg_catalog bpchar type public USAGE false +test pg_catalog bpchar type root ALL false +test pg_catalog bpchar[] type admin ALL false +test pg_catalog bpchar[] type public USAGE false +test pg_catalog bpchar[] type root ALL false test pg_catalog bytes type admin ALL false test pg_catalog bytes type public USAGE false test pg_catalog bytes type root ALL false test pg_catalog bytes[] type admin ALL false test pg_catalog bytes[] type public USAGE false test pg_catalog bytes[] type root ALL false -test pg_catalog char type admin ALL false -test pg_catalog char type public USAGE false -test pg_catalog char type root ALL false -test pg_catalog char[] type admin ALL false -test pg_catalog char[] type public USAGE false -test pg_catalog char[] type root ALL false test pg_catalog date type admin ALL false test pg_catalog date type public USAGE false test pg_catalog date type root ALL false @@ -618,14 +618,14 @@ test pg_catalog box2d type admin ALL test pg_catalog box2d type root ALL false test pg_catalog box2d[] type admin ALL false test pg_catalog box2d[] type root ALL false +test pg_catalog bpchar type admin ALL false +test pg_catalog bpchar type root ALL false +test pg_catalog bpchar[] type admin ALL false +test pg_catalog bpchar[] type root ALL false test pg_catalog bytes type admin ALL false test pg_catalog bytes type root ALL false test pg_catalog bytes[] type admin ALL false test pg_catalog bytes[] type root ALL false -test pg_catalog char type admin ALL false -test pg_catalog char type root ALL false -test pg_catalog char[] type admin ALL false -test pg_catalog char[] type root ALL false test pg_catalog date type admin ALL false test pg_catalog date type root ALL false test pg_catalog date[] type admin ALL false @@ -1182,14 +1182,14 @@ a pg_catalog box2d type admin a pg_catalog box2d type root ALL false a pg_catalog box2d[] type admin ALL false a pg_catalog box2d[] type root ALL false +a pg_catalog bpchar type admin ALL false +a pg_catalog bpchar type root ALL false +a pg_catalog bpchar[] type admin ALL false +a pg_catalog bpchar[] type root ALL false a pg_catalog bytes type admin ALL false a pg_catalog bytes type root ALL false a pg_catalog bytes[] type admin ALL false a pg_catalog bytes[] type root ALL false -a pg_catalog char type admin ALL false -a pg_catalog char type root ALL false -a pg_catalog char[] type admin ALL false -a pg_catalog char[] type root ALL false a pg_catalog date type admin ALL false a pg_catalog date type root ALL false a pg_catalog date[] type admin ALL false @@ -1350,14 +1350,14 @@ defaultdb pg_catalog box2d type admin defaultdb pg_catalog box2d type root ALL false defaultdb pg_catalog box2d[] type admin ALL false defaultdb pg_catalog box2d[] type root ALL false +defaultdb pg_catalog bpchar type admin ALL false +defaultdb pg_catalog bpchar type root ALL false +defaultdb pg_catalog bpchar[] type admin ALL false +defaultdb pg_catalog bpchar[] type root ALL false defaultdb pg_catalog bytes type admin ALL false defaultdb pg_catalog bytes type root ALL false defaultdb pg_catalog bytes[] type admin ALL false defaultdb pg_catalog bytes[] type root ALL false -defaultdb pg_catalog char type admin ALL false -defaultdb pg_catalog char type root ALL false -defaultdb pg_catalog char[] type admin ALL false -defaultdb pg_catalog char[] type root ALL false defaultdb pg_catalog date type admin ALL false defaultdb pg_catalog date type root ALL false defaultdb pg_catalog date[] type admin ALL false @@ -1518,14 +1518,14 @@ postgres pg_catalog box2d type admin postgres pg_catalog box2d type root ALL false postgres pg_catalog box2d[] type admin ALL false postgres pg_catalog box2d[] type root ALL false +postgres pg_catalog bpchar type admin ALL false +postgres pg_catalog bpchar type root ALL false +postgres pg_catalog bpchar[] type admin ALL false +postgres pg_catalog bpchar[] type root ALL false postgres pg_catalog bytes type admin ALL false postgres pg_catalog bytes type root ALL false postgres pg_catalog bytes[] type admin ALL false postgres pg_catalog bytes[] type root ALL false -postgres pg_catalog char type admin ALL false -postgres pg_catalog char type root ALL false -postgres pg_catalog char[] type admin ALL false -postgres pg_catalog char[] type root ALL false postgres pg_catalog date type admin ALL false postgres pg_catalog date type root ALL false postgres pg_catalog date[] type admin ALL false @@ -1686,14 +1686,14 @@ system pg_catalog box2d type admin system pg_catalog box2d type root ALL false system pg_catalog box2d[] type admin ALL false system pg_catalog box2d[] type root ALL false +system pg_catalog bpchar type admin ALL false +system pg_catalog bpchar type root ALL false +system pg_catalog bpchar[] type admin ALL false +system pg_catalog bpchar[] type root ALL false system pg_catalog bytes type admin ALL false system pg_catalog bytes type root ALL false system pg_catalog bytes[] type admin ALL false system pg_catalog bytes[] type root ALL false -system pg_catalog char type admin ALL false -system pg_catalog char type root ALL false -system pg_catalog char[] type admin ALL false -system pg_catalog char[] type root ALL false system pg_catalog date type admin ALL false system pg_catalog date type root ALL false system pg_catalog date[] type admin ALL false @@ -2194,14 +2194,14 @@ test pg_catalog box2d type admin test pg_catalog box2d type root ALL false test pg_catalog box2d[] type admin ALL false test pg_catalog box2d[] type root ALL false +test pg_catalog bpchar type admin ALL false +test pg_catalog bpchar type root ALL false +test pg_catalog bpchar[] type admin ALL false +test pg_catalog bpchar[] type root ALL false test pg_catalog bytes type admin ALL false test pg_catalog bytes type root ALL false test pg_catalog bytes[] type admin ALL false test pg_catalog bytes[] type root ALL false -test pg_catalog char type admin ALL false -test pg_catalog char type root ALL false -test pg_catalog char[] type admin ALL false -test pg_catalog char[] type root ALL false test pg_catalog date type admin ALL false test pg_catalog date type root ALL false test pg_catalog date[] type admin ALL false diff --git a/pkg/sql/logictest/testdata/logic_test/pg_builtins b/pkg/sql/logictest/testdata/logic_test/pg_builtins index 3189522045a5..c582c428f234 100644 --- a/pkg/sql/logictest/testdata/logic_test/pg_builtins +++ b/pkg/sql/logictest/testdata/logic_test/pg_builtins @@ -519,7 +519,7 @@ ORDER BY t.oid ---- text 25 -1 float8 701 -1 -bpchar 1042 5 +bpchar 1042 -1 varchar 1043 68 bit 1560 1 varbit 1562 16 @@ -537,7 +537,7 @@ ORDER BY t.oid ---- text NULL float8 NULL -bpchar 1 +bpchar NULL varchar 64 bit 1 varbit 16 @@ -556,7 +556,7 @@ ORDER BY t.oid ---- text NULL float8 NULL -bpchar 1 +bpchar NULL varchar 64 bit 1 varbit 16 diff --git a/pkg/sql/logictest/tests/fakedist-disk/generated_test.go b/pkg/sql/logictest/tests/fakedist-disk/generated_test.go index b84ab0ade4b4..2302fe960e94 100644 --- a/pkg/sql/logictest/tests/fakedist-disk/generated_test.go +++ b/pkg/sql/logictest/tests/fakedist-disk/generated_test.go @@ -277,6 +277,13 @@ func TestLogic_bit( runLogicTest(t, "bit") } +func TestLogic_bpchar( + t *testing.T, +) { + defer leaktest.AfterTest(t)() + runLogicTest(t, "bpchar") +} + func TestLogic_builtin_function( t *testing.T, ) { diff --git a/pkg/sql/logictest/tests/fakedist-vec-off/generated_test.go b/pkg/sql/logictest/tests/fakedist-vec-off/generated_test.go index 32278eae9677..5b2bd07b81a8 100644 --- a/pkg/sql/logictest/tests/fakedist-vec-off/generated_test.go +++ b/pkg/sql/logictest/tests/fakedist-vec-off/generated_test.go @@ -277,6 +277,13 @@ func TestLogic_bit( runLogicTest(t, "bit") } +func TestLogic_bpchar( + t *testing.T, +) { + defer leaktest.AfterTest(t)() + runLogicTest(t, "bpchar") +} + func TestLogic_builtin_function( t *testing.T, ) { diff --git a/pkg/sql/logictest/tests/fakedist/generated_test.go b/pkg/sql/logictest/tests/fakedist/generated_test.go index 3e19a239c416..af2e3f66312a 100644 --- a/pkg/sql/logictest/tests/fakedist/generated_test.go +++ b/pkg/sql/logictest/tests/fakedist/generated_test.go @@ -277,6 +277,13 @@ func TestLogic_bit( runLogicTest(t, "bit") } +func TestLogic_bpchar( + t *testing.T, +) { + defer leaktest.AfterTest(t)() + runLogicTest(t, "bpchar") +} + func TestLogic_builtin_function( t *testing.T, ) { diff --git a/pkg/sql/logictest/tests/local-legacy-schema-changer/generated_test.go b/pkg/sql/logictest/tests/local-legacy-schema-changer/generated_test.go index 479b76ba31d9..9bce02749ccc 100644 --- a/pkg/sql/logictest/tests/local-legacy-schema-changer/generated_test.go +++ b/pkg/sql/logictest/tests/local-legacy-schema-changer/generated_test.go @@ -277,6 +277,13 @@ func TestLogic_bit( runLogicTest(t, "bit") } +func TestLogic_bpchar( + t *testing.T, +) { + defer leaktest.AfterTest(t)() + runLogicTest(t, "bpchar") +} + func TestLogic_builtin_function( t *testing.T, ) { diff --git a/pkg/sql/logictest/tests/local-vec-off/generated_test.go b/pkg/sql/logictest/tests/local-vec-off/generated_test.go index 173200f70010..150bcf980aca 100644 --- a/pkg/sql/logictest/tests/local-vec-off/generated_test.go +++ b/pkg/sql/logictest/tests/local-vec-off/generated_test.go @@ -277,6 +277,13 @@ func TestLogic_bit( runLogicTest(t, "bit") } +func TestLogic_bpchar( + t *testing.T, +) { + defer leaktest.AfterTest(t)() + runLogicTest(t, "bpchar") +} + func TestLogic_builtin_function( t *testing.T, ) { diff --git a/pkg/sql/logictest/tests/local/generated_test.go b/pkg/sql/logictest/tests/local/generated_test.go index ed70a96f6d72..54e47a85daac 100644 --- a/pkg/sql/logictest/tests/local/generated_test.go +++ b/pkg/sql/logictest/tests/local/generated_test.go @@ -277,6 +277,13 @@ func TestLogic_bit( runLogicTest(t, "bit") } +func TestLogic_bpchar( + t *testing.T, +) { + defer leaktest.AfterTest(t)() + runLogicTest(t, "bpchar") +} + func TestLogic_builtin_function( t *testing.T, ) { @@ -305,6 +312,13 @@ func TestLogic_cascade( runLogicTest(t, "cascade") } +func TestLogic_case( + t *testing.T, +) { + defer leaktest.AfterTest(t)() + runLogicTest(t, "case") +} + func TestLogic_case_sensitive_names( t *testing.T, ) { diff --git a/pkg/sql/opt/optbuilder/scalar.go b/pkg/sql/opt/optbuilder/scalar.go index 11cb87a03f7f..74ce61811ee2 100644 --- a/pkg/sql/opt/optbuilder/scalar.go +++ b/pkg/sql/opt/optbuilder/scalar.go @@ -246,7 +246,7 @@ func (b *Builder) buildScalar( for i := range t.Whens { condExpr := t.Whens[i].Cond.(tree.TypedExpr) cond := b.buildScalar(condExpr, inScope, nil, nil, colRefs) - valExpr, ok := eval.ReType(t.Whens[i].Val.(tree.TypedExpr), valType) + valExpr, ok := eval.ReType(t.Whens[i].Val.(tree.TypedExpr), valType.WithoutTypeModifiers()) if !ok { panic(pgerror.Newf( pgcode.DatatypeMismatch, @@ -260,7 +260,7 @@ func (b *Builder) buildScalar( // Add the ELSE expression to the end of whens as a raw scalar expression. var orElse opt.ScalarExpr if t.Else != nil { - elseExpr, ok := eval.ReType(t.Else.(tree.TypedExpr), valType) + elseExpr, ok := eval.ReType(t.Else.(tree.TypedExpr), valType.WithoutTypeModifiers()) if !ok { panic(pgerror.Newf( pgcode.DatatypeMismatch, @@ -286,7 +286,7 @@ func (b *Builder) buildScalar( // The type of the CoalesceExpr might be different than the inputs (e.g. // when they are NULL). Force all inputs to be the same type, so that we // build coalesce operator with the correct type. - expr, ok := eval.ReType(t.TypedExprAt(i), typ) + expr, ok := eval.ReType(t.TypedExprAt(i), typ.WithoutTypeModifiers()) if !ok { panic(pgerror.Newf( pgcode.DatatypeMismatch, @@ -336,7 +336,7 @@ func (b *Builder) buildScalar( ifTrueExpr := reType(t.True.(tree.TypedExpr), valType) ifTrue := b.buildScalar(ifTrueExpr, inScope, nil, nil, colRefs) whens := memo.ScalarListExpr{b.factory.ConstructWhen(memo.TrueSingleton, ifTrue)} - orElseExpr, ok := eval.ReType(t.Else.(tree.TypedExpr), valType) + orElseExpr, ok := eval.ReType(t.Else.(tree.TypedExpr), valType.WithoutTypeModifiers()) if !ok { panic(pgerror.Newf( pgcode.DatatypeMismatch, diff --git a/pkg/sql/opt/xform/testdata/external/tpcc b/pkg/sql/opt/xform/testdata/external/tpcc index a8e661b79709..33555ea0ad08 100644 --- a/pkg/sql/opt/xform/testdata/external/tpcc +++ b/pkg/sql/opt/xform/testdata/external/tpcc @@ -630,7 +630,11 @@ project │ ├── assignment-cast: DECIMAL(12,2) [as=c_ytd_payment_cast:52, outer=(41), immutable] │ │ └── c_ytd_payment:41 + 3860.61 │ ├── assignment-cast: VARCHAR(500) [as=c_data_cast:53, outer=(24-26,37,44), immutable] +<<<<<<< HEAD │ │ └── CASE c_credit:37 WHEN 'BC' THEN left((((((c_id:24::STRING || c_d_id:25::STRING) || c_w_id:26::STRING) || '5') || '10') || '3860.61') || c_data:44, 500) ELSE c_data:44::STRING END +======= + │ │ └── CASE c_credit:37 WHEN 'BC' THEN left((((((c_id:24::STRING || c_d_id:25::STRING) || c_w_id:26::STRING) || '5') || '10') || '3860.61') || c_data:44, 500)::VARCHAR ELSE c_data:44::VARCHAR END +>>>>>>> 4a11c7d3b8f (opt: fix BPCHAR type and CASE typing) │ └── c_payment_cnt:42 + 1 [as=c_payment_cnt_new:49, outer=(42), immutable] └── projections └── CASE c_credit:14 WHEN 'BC' THEN left(c_data:21, 200) ELSE '' END [as=case:54, outer=(14,21), immutable] diff --git a/pkg/sql/opt/xform/testdata/external/tpcc-later-stats b/pkg/sql/opt/xform/testdata/external/tpcc-later-stats index c5e55c99e7d5..573a3149f46c 100644 --- a/pkg/sql/opt/xform/testdata/external/tpcc-later-stats +++ b/pkg/sql/opt/xform/testdata/external/tpcc-later-stats @@ -633,7 +633,11 @@ project │ ├── assignment-cast: DECIMAL(12,2) [as=c_ytd_payment_cast:52, outer=(41), immutable] │ │ └── c_ytd_payment:41 + 3860.61 │ ├── assignment-cast: VARCHAR(500) [as=c_data_cast:53, outer=(24-26,37,44), immutable] +<<<<<<< HEAD │ │ └── CASE c_credit:37 WHEN 'BC' THEN left((((((c_id:24::STRING || c_d_id:25::STRING) || c_w_id:26::STRING) || '5') || '10') || '3860.61') || c_data:44, 500) ELSE c_data:44::STRING END +======= + │ │ └── CASE c_credit:37 WHEN 'BC' THEN left((((((c_id:24::STRING || c_d_id:25::STRING) || c_w_id:26::STRING) || '5') || '10') || '3860.61') || c_data:44, 500)::VARCHAR ELSE c_data:44::VARCHAR END +>>>>>>> 4a11c7d3b8f (opt: fix BPCHAR type and CASE typing) │ └── c_payment_cnt:42 + 1 [as=c_payment_cnt_new:49, outer=(42), immutable] └── projections └── CASE c_credit:14 WHEN 'BC' THEN left(c_data:21, 200) ELSE '' END [as=case:54, outer=(14,21), immutable] diff --git a/pkg/sql/opt/xform/testdata/external/tpcc-no-stats b/pkg/sql/opt/xform/testdata/external/tpcc-no-stats index 507cd7888bdd..5d817da33dd0 100644 --- a/pkg/sql/opt/xform/testdata/external/tpcc-no-stats +++ b/pkg/sql/opt/xform/testdata/external/tpcc-no-stats @@ -627,7 +627,11 @@ project │ ├── assignment-cast: DECIMAL(12,2) [as=c_ytd_payment_cast:52, outer=(41), immutable] │ │ └── c_ytd_payment:41 + 3860.61 │ ├── assignment-cast: VARCHAR(500) [as=c_data_cast:53, outer=(24-26,37,44), immutable] +<<<<<<< HEAD │ │ └── CASE c_credit:37 WHEN 'BC' THEN left((((((c_id:24::STRING || c_d_id:25::STRING) || c_w_id:26::STRING) || '5') || '10') || '3860.61') || c_data:44, 500) ELSE c_data:44::STRING END +======= + │ │ └── CASE c_credit:37 WHEN 'BC' THEN left((((((c_id:24::STRING || c_d_id:25::STRING) || c_w_id:26::STRING) || '5') || '10') || '3860.61') || c_data:44, 500)::VARCHAR ELSE c_data:44::VARCHAR END +>>>>>>> 4a11c7d3b8f (opt: fix BPCHAR type and CASE typing) │ └── c_payment_cnt:42 + 1 [as=c_payment_cnt_new:49, outer=(42), immutable] └── projections └── CASE c_credit:14 WHEN 'BC' THEN left(c_data:21, 200) ELSE '' END [as=case:54, outer=(14,21), immutable] diff --git a/pkg/sql/opt/xform/testdata/external/tpcc-read-committed b/pkg/sql/opt/xform/testdata/external/tpcc-read-committed new file mode 100644 index 000000000000..09ef9884b07b --- /dev/null +++ b/pkg/sql/opt/xform/testdata/external/tpcc-read-committed @@ -0,0 +1,1497 @@ +import file=tpcc_schema +---- + +import file=tpcc_stats_w100 +---- + + + +# -------------------------------------------------- +# 2.4 The New Order Transaction +# +# The New-Order business transaction consists of entering a complete order +# through a single database transaction. It represents a mid-weight, read-write +# transaction with a high frequency of execution and stringent response time +# requirements to satisfy on-line users. This transaction is the backbone of +# the workload. It is designed to place a variable load on the system to +# reflect on-line database activity as typically found in production +# environments. +# -------------------------------------------------- +opt format=hide-qual isolation=ReadCommitted +UPDATE district +SET d_next_o_id = d_next_o_id + 1 +WHERE d_w_id = 10 AND d_id = 5 +RETURNING d_tax, d_next_o_id +---- +project + ├── columns: d_tax:9 d_next_o_id:11 + ├── cardinality: [0 - 1] + ├── volatile, mutations + ├── key: () + ├── fd: ()-->(9,11) + └── update district + ├── columns: d_id:1!null d_w_id:2!null d_tax:9 d_next_o_id:11 + ├── fetch columns: d_id:14 d_w_id:15 d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 + ├── update-mapping: + │ └── d_next_o_id_new:27 => d_next_o_id:11 + ├── return-mapping: + │ ├── d_id:14 => d_id:1 + │ ├── d_w_id:15 => d_w_id:2 + │ ├── d_tax:22 => d_tax:9 + │ └── d_next_o_id_new:27 => d_next_o_id:11 + ├── cardinality: [0 - 1] + ├── volatile, mutations + ├── key: () + ├── fd: ()-->(1,2,9,11) + └── project + ├── columns: d_next_o_id_new:27 d_id:14!null d_w_id:15!null d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 + ├── cardinality: [0 - 1] + ├── immutable + ├── key: () + ├── fd: ()-->(14-24,27) + ├── scan district + │ ├── columns: d_id:14!null d_w_id:15!null d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 + │ ├── constraint: /15/14: [/10/5 - /10/5] + │ ├── cardinality: [0 - 1] + │ ├── key: () + │ └── fd: ()-->(14-24) + └── projections + └── d_next_o_id:24 + 1 [as=d_next_o_id_new:27, outer=(24), immutable] + +opt format=hide-qual isolation=ReadCommitted +SELECT w_tax FROM warehouse WHERE w_id = 10 +---- +project + ├── columns: w_tax:8 + ├── cardinality: [0 - 1] + ├── key: () + ├── fd: ()-->(8) + └── scan warehouse + ├── columns: w_id:1!null w_tax:8 + ├── constraint: /1: [/10 - /10] + ├── cardinality: [0 - 1] + ├── key: () + └── fd: ()-->(1,8) + +opt format=hide-qual isolation=ReadCommitted +SELECT c_discount, c_last, c_credit +FROM customer +WHERE c_w_id = 10 AND c_d_id = 100 AND c_id = 50 +---- +project + ├── columns: c_discount:16 c_last:6 c_credit:14 + ├── cardinality: [0 - 1] + ├── key: () + ├── fd: ()-->(6,14,16) + └── scan customer + ├── columns: c_id:1!null c_d_id:2!null c_w_id:3!null c_last:6 c_credit:14 c_discount:16 + ├── constraint: /3/2/1: [/10/100/50 - /10/100/50] + ├── cardinality: [0 - 1] + ├── key: () + └── fd: ()-->(1-3,6,14,16) + +opt format=hide-qual isolation=ReadCommitted +SELECT i_price, i_name, i_data +FROM item +WHERE i_id IN (125, 150, 175, 200, 25, 50, 75, 100, 225, 250, 275, 300) +ORDER BY i_id +---- +scan item + ├── columns: i_price:4 i_name:3 i_data:5 [hidden: i_id:1!null] + ├── constraint: /1 + │ ├── [/25 - /25] + │ ├── [/50 - /50] + │ ├── [/75 - /75] + │ ├── [/100 - /100] + │ ├── [/125 - /125] + │ ├── [/150 - /150] + │ ├── [/175 - /175] + │ ├── [/200 - /200] + │ ├── [/225 - /225] + │ ├── [/250 - /250] + │ ├── [/275 - /275] + │ └── [/300 - /300] + ├── cardinality: [0 - 12] + ├── key: (1) + ├── fd: (1)-->(3-5) + └── ordering: +1 + +opt format=hide-qual isolation=ReadCommitted +SELECT s_quantity, s_ytd, s_order_cnt, s_remote_cnt, s_data, s_dist_05 +FROM stock +WHERE (s_i_id, s_w_id) IN ((1000, 4), (900, 4), (1100, 4), (1500, 4), (1400, 4)) +ORDER BY s_i_id +FOR UPDATE +---- +lock stock + ├── columns: s_quantity:3 s_ytd:14 s_order_cnt:15 s_remote_cnt:16 s_data:17 s_dist_05:8 [hidden: s_i_id:1!null s_w_id:2!null] + ├── locking: for-update,durability-guaranteed + ├── cardinality: [0 - 5] + ├── volatile, mutations + ├── key: (1) + ├── fd: ()-->(2), (1)-->(3,8,14-17) + ├── ordering: +1 opt(2) [actual: +1] + └── scan stock + ├── columns: s_i_id:1!null s_w_id:2!null s_quantity:3 s_dist_05:8 s_ytd:14 s_order_cnt:15 s_remote_cnt:16 s_data:17 + ├── constraint: /2/1 + │ ├── [/4/900 - /4/900] + │ ├── [/4/1000 - /4/1000] + │ ├── [/4/1100 - /4/1100] + │ ├── [/4/1400 - /4/1400] + │ └── [/4/1500 - /4/1500] + ├── cardinality: [0 - 5] + ├── key: (1) + ├── fd: ()-->(2), (1)-->(3,8,14-17) + └── ordering: +1 opt(2) [actual: +1] + +opt format=hide-qual isolation=ReadCommitted +INSERT INTO "order" (o_id, o_d_id, o_w_id, o_c_id, o_entry_d, o_ol_cnt, o_all_local) +VALUES (100, 5, 10, 50, '2019-08-26 16:50:41', 10, 1) +---- +insert order + ├── columns: + ├── insert-mapping: + │ ├── column1:11 => o_id:1 + │ ├── column2:12 => "order".o_d_id:2 + │ ├── column3:13 => "order".o_w_id:3 + │ ├── column4:14 => "order".o_c_id:4 + │ ├── column5:15 => o_entry_d:5 + │ ├── o_carrier_id_default:18 => o_carrier_id:6 + │ ├── column6:16 => o_ol_cnt:7 + │ └── column7:17 => o_all_local:8 + ├── input binding: &1 + ├── cardinality: [0 - 0] + ├── volatile, mutations + ├── values + │ ├── columns: column1:11!null column2:12!null column3:13!null column4:14!null column5:15!null column6:16!null column7:17!null o_carrier_id_default:18 + │ ├── cardinality: [1 - 1] + │ ├── key: () + │ ├── fd: ()-->(11-18) + │ └── (100, 5, 10, 50, '2019-08-26 16:50:41', 10, 1, NULL) + └── f-k-checks + └── f-k-checks-item: order(o_w_id,o_d_id,o_c_id) -> customer(c_w_id,c_d_id,c_id) + └── anti-join (lookup customer) + ├── columns: o_w_id:19!null o_d_id:20!null o_c_id:21!null + ├── key columns: [19 20 21] = [24 23 22] + ├── lookup columns are key + ├── locking: for-share,durability-guaranteed + ├── cardinality: [0 - 1] + ├── volatile + ├── key: () + ├── fd: ()-->(19-21) + ├── with-scan &1 + │ ├── columns: o_w_id:19!null o_d_id:20!null o_c_id:21!null + │ ├── mapping: + │ │ ├── column3:13 => o_w_id:19 + │ │ ├── column2:12 => o_d_id:20 + │ │ └── column4:14 => o_c_id:21 + │ ├── cardinality: [1 - 1] + │ ├── key: () + │ └── fd: ()-->(19-21) + └── filters (true) + +opt format=hide-qual isolation=ReadCommitted +INSERT INTO new_order (no_o_id, no_d_id, no_w_id) VALUES (2000, 100, 10) +---- +insert new_order + ├── columns: + ├── insert-mapping: + │ ├── column1:6 => new_order.no_o_id:1 + │ ├── column2:7 => new_order.no_d_id:2 + │ └── column3:8 => new_order.no_w_id:3 + ├── input binding: &1 + ├── cardinality: [0 - 0] + ├── volatile, mutations + ├── values + │ ├── columns: column1:6!null column2:7!null column3:8!null + │ ├── cardinality: [1 - 1] + │ ├── key: () + │ ├── fd: ()-->(6-8) + │ └── (2000, 100, 10) + └── f-k-checks + └── f-k-checks-item: new_order(no_w_id,no_d_id,no_o_id) -> order(o_w_id,o_d_id,o_id) + └── anti-join (lookup order) + ├── columns: no_w_id:9!null no_d_id:10!null no_o_id:11!null + ├── key columns: [9 10 11] = [14 13 12] + ├── lookup columns are key + ├── locking: for-share,durability-guaranteed + ├── cardinality: [0 - 1] + ├── volatile + ├── key: () + ├── fd: ()-->(9-11) + ├── with-scan &1 + │ ├── columns: no_w_id:9!null no_d_id:10!null no_o_id:11!null + │ ├── mapping: + │ │ ├── column3:8 => no_w_id:9 + │ │ ├── column2:7 => no_d_id:10 + │ │ └── column1:6 => no_o_id:11 + │ ├── cardinality: [1 - 1] + │ ├── key: () + │ └── fd: ()-->(9-11) + └── filters (true) + +opt format=hide-qual isolation=ReadCommitted +UPDATE + stock +SET + s_quantity + = CASE (s_i_id, s_w_id) + WHEN (6823, 0) THEN 26 + WHEN (7853, 0) THEN 10 + WHEN (8497, 0) THEN 62 + WHEN (10904, 0) THEN 54 + WHEN (16152, 0) THEN 80 + WHEN (41382, 0) THEN 18 + WHEN (55952, 0) THEN 56 + WHEN (64817, 0) THEN 26 + WHEN (66335, 0) THEN 30 + WHEN (76567, 0) THEN 71 + WHEN (81680, 0) THEN 51 + WHEN (89641, 0) THEN 51 + WHEN (89905, 0) THEN 77 + ELSE crdb_internal.force_error('', 'unknown case') + END, + s_ytd + = CASE (s_i_id, s_w_id) + WHEN (6823, 0) THEN 6 + WHEN (7853, 0) THEN 9 + WHEN (8497, 0) THEN 13 + WHEN (10904, 0) THEN 1 + WHEN (16152, 0) THEN 2 + WHEN (41382, 0) THEN 3 + WHEN (55952, 0) THEN 10 + WHEN (64817, 0) THEN 31 + WHEN (66335, 0) THEN 9 + WHEN (76567, 0) THEN 7 + WHEN (81680, 0) THEN 4 + WHEN (89641, 0) THEN 13 + WHEN (89905, 0) THEN 20 + END, + s_order_cnt + = CASE (s_i_id, s_w_id) + WHEN (6823, 0) THEN 1 + WHEN (7853, 0) THEN 1 + WHEN (8497, 0) THEN 2 + WHEN (10904, 0) THEN 1 + WHEN (16152, 0) THEN 1 + WHEN (41382, 0) THEN 1 + WHEN (55952, 0) THEN 1 + WHEN (64817, 0) THEN 4 + WHEN (66335, 0) THEN 2 + WHEN (76567, 0) THEN 1 + WHEN (81680, 0) THEN 1 + WHEN (89641, 0) THEN 2 + WHEN (89905, 0) THEN 4 + END, + s_remote_cnt + = CASE (s_i_id, s_w_id) + WHEN (6823, 0) THEN 0 + WHEN (7853, 0) THEN 0 + WHEN (8497, 0) THEN 0 + WHEN (10904, 0) THEN 0 + WHEN (16152, 0) THEN 0 + WHEN (41382, 0) THEN 0 + WHEN (55952, 0) THEN 0 + WHEN (64817, 0) THEN 0 + WHEN (66335, 0) THEN 0 + WHEN (76567, 0) THEN 0 + WHEN (81680, 0) THEN 0 + WHEN (89641, 0) THEN 0 + WHEN (89905, 0) THEN 0 + END +WHERE + (s_i_id, s_w_id) + IN ( + (6823, 0), + (7853, 0), + (8497, 0), + (10904, 0), + (16152, 0), + (41382, 0), + (55952, 0), + (64817, 0), + (66335, 0), + (76567, 0), + (81680, 0), + (89641, 0), + (89905, 0) + ) +---- +update stock + ├── columns: + ├── fetch columns: s_i_id:20 s_w_id:21 s_quantity:22 s_dist_01:23 s_dist_02:24 s_dist_03:25 s_dist_04:26 s_dist_05:27 s_dist_06:28 s_dist_07:29 s_dist_08:30 s_dist_09:31 s_dist_10:32 s_ytd:33 s_order_cnt:34 s_remote_cnt:35 s_data:36 + ├── update-mapping: + │ ├── s_quantity_new:39 => s_quantity:3 + │ ├── s_ytd_new:40 => s_ytd:14 + │ ├── s_order_cnt_new:41 => s_order_cnt:15 + │ └── s_remote_cnt_new:42 => s_remote_cnt:16 + ├── cardinality: [0 - 0] + ├── volatile, mutations + └── project + ├── columns: s_quantity_new:39 s_ytd_new:40 s_order_cnt_new:41 s_remote_cnt_new:42 s_i_id:20!null s_w_id:21!null s_quantity:22 s_dist_01:23 s_dist_02:24 s_dist_03:25 s_dist_04:26 s_dist_05:27 s_dist_06:28 s_dist_07:29 s_dist_08:30 s_dist_09:31 s_dist_10:32 s_ytd:33 s_order_cnt:34 s_remote_cnt:35 s_data:36 + ├── cardinality: [0 - 13] + ├── volatile + ├── key: (20) + ├── fd: ()-->(21), (20)-->(22-36,39-42) + ├── scan stock + │ ├── columns: s_i_id:20!null s_w_id:21!null s_quantity:22 s_dist_01:23 s_dist_02:24 s_dist_03:25 s_dist_04:26 s_dist_05:27 s_dist_06:28 s_dist_07:29 s_dist_08:30 s_dist_09:31 s_dist_10:32 s_ytd:33 s_order_cnt:34 s_remote_cnt:35 s_data:36 + │ ├── constraint: /21/20 + │ │ ├── [/0/6823 - /0/6823] + │ │ ├── [/0/7853 - /0/7853] + │ │ ├── [/0/8497 - /0/8497] + │ │ ├── [/0/10904 - /0/10904] + │ │ ├── [/0/16152 - /0/16152] + │ │ ├── [/0/41382 - /0/41382] + │ │ ├── [/0/55952 - /0/55952] + │ │ ├── [/0/64817 - /0/64817] + │ │ ├── [/0/66335 - /0/66335] + │ │ ├── [/0/76567 - /0/76567] + │ │ ├── [/0/81680 - /0/81680] + │ │ ├── [/0/89641 - /0/89641] + │ │ └── [/0/89905 - /0/89905] + │ ├── cardinality: [0 - 13] + │ ├── key: (20) + │ └── fd: ()-->(21), (20)-->(22-36) + └── projections + ├── CASE (s_i_id:20, s_w_id:21) WHEN (6823, 0) THEN 26 WHEN (7853, 0) THEN 10 WHEN (8497, 0) THEN 62 WHEN (10904, 0) THEN 54 WHEN (16152, 0) THEN 80 WHEN (41382, 0) THEN 18 WHEN (55952, 0) THEN 56 WHEN (64817, 0) THEN 26 WHEN (66335, 0) THEN 30 WHEN (76567, 0) THEN 71 WHEN (81680, 0) THEN 51 WHEN (89641, 0) THEN 51 WHEN (89905, 0) THEN 77 ELSE crdb_internal.force_error('', 'unknown case') END [as=s_quantity_new:39, outer=(20,21), volatile] + ├── CASE (s_i_id:20, s_w_id:21) WHEN (6823, 0) THEN 6 WHEN (7853, 0) THEN 9 WHEN (8497, 0) THEN 13 WHEN (10904, 0) THEN 1 WHEN (16152, 0) THEN 2 WHEN (41382, 0) THEN 3 WHEN (55952, 0) THEN 10 WHEN (64817, 0) THEN 31 WHEN (66335, 0) THEN 9 WHEN (76567, 0) THEN 7 WHEN (81680, 0) THEN 4 WHEN (89641, 0) THEN 13 WHEN (89905, 0) THEN 20 ELSE CAST(NULL AS INT8) END [as=s_ytd_new:40, outer=(20,21)] + ├── CASE (s_i_id:20, s_w_id:21) WHEN (6823, 0) THEN 1 WHEN (7853, 0) THEN 1 WHEN (8497, 0) THEN 2 WHEN (10904, 0) THEN 1 WHEN (16152, 0) THEN 1 WHEN (41382, 0) THEN 1 WHEN (55952, 0) THEN 1 WHEN (64817, 0) THEN 4 WHEN (66335, 0) THEN 2 WHEN (76567, 0) THEN 1 WHEN (81680, 0) THEN 1 WHEN (89641, 0) THEN 2 WHEN (89905, 0) THEN 4 ELSE CAST(NULL AS INT8) END [as=s_order_cnt_new:41, outer=(20,21)] + └── CASE (s_i_id:20, s_w_id:21) WHEN (6823, 0) THEN 0 WHEN (7853, 0) THEN 0 WHEN (8497, 0) THEN 0 WHEN (10904, 0) THEN 0 WHEN (16152, 0) THEN 0 WHEN (41382, 0) THEN 0 WHEN (55952, 0) THEN 0 WHEN (64817, 0) THEN 0 WHEN (66335, 0) THEN 0 WHEN (76567, 0) THEN 0 WHEN (81680, 0) THEN 0 WHEN (89641, 0) THEN 0 WHEN (89905, 0) THEN 0 ELSE CAST(NULL AS INT8) END [as=s_remote_cnt_new:42, outer=(20,21)] + +opt format=hide-qual isolation=ReadCommitted +INSERT INTO order_line + (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) +VALUES + (3045, 2, 10, 3, 648, 0, 9, 394.470000, 'YhgLRrwsmd68P2bElAgrnp8u'), + (3045, 2, 10, 5, 25393, 0, 10, 830.600000, 'dLXe0YhgLRrwsmd68P2bElAg'), + (3045, 2, 10, 1, 47887, 0, 9, 204.390000, 'Xe0YhgLRrwsmd68P2bElAgrn'), + (3045, 2, 10, 2, 52000, 0, 6, 561.660000, 'ElAgrnp8ueWNXJpBB0ObpVWo'), + (3045, 2, 10, 4, 56624, 0, 6, 273.360000, 'RsaCXoEzmssaF9m9cdLXe0Yh'), + (3045, 2, 10, 6, 92966, 0, 4, 366.760000, 'saCXoEzmssaF9m9cdLXe0Yhg') +---- +insert order_line + ├── columns: + ├── insert-mapping: + │ ├── column1:13 => order_line.ol_o_id:1 + │ ├── column2:14 => order_line.ol_d_id:2 + │ ├── column3:15 => order_line.ol_w_id:3 + │ ├── column4:16 => ol_number:4 + │ ├── column5:17 => order_line.ol_i_id:5 + │ ├── column6:18 => order_line.ol_supply_w_id:6 + │ ├── ol_delivery_d_default:24 => ol_delivery_d:7 + │ ├── column7:19 => ol_quantity:8 + │ ├── ol_amount_cast:22 => ol_amount:9 + │ └── ol_dist_info_cast:23 => ol_dist_info:10 + ├── input binding: &1 + ├── cardinality: [0 - 0] + ├── volatile, mutations + ├── project + │ ├── columns: ol_delivery_d_default:24 column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null ol_amount_cast:22!null ol_dist_info_cast:23!null + │ ├── cardinality: [6 - 6] + │ ├── fd: ()-->(24) + │ ├── values + │ │ ├── columns: column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null ol_amount_cast:22!null ol_dist_info_cast:23!null + │ │ ├── cardinality: [6 - 6] + │ │ ├── (3045, 2, 10, 3, 648, 0, 9, 394.47, 'YhgLRrwsmd68P2bElAgrnp8u') + │ │ ├── (3045, 2, 10, 5, 25393, 0, 10, 830.60, 'dLXe0YhgLRrwsmd68P2bElAg') + │ │ ├── (3045, 2, 10, 1, 47887, 0, 9, 204.39, 'Xe0YhgLRrwsmd68P2bElAgrn') + │ │ ├── (3045, 2, 10, 2, 52000, 0, 6, 561.66, 'ElAgrnp8ueWNXJpBB0ObpVWo') + │ │ ├── (3045, 2, 10, 4, 56624, 0, 6, 273.36, 'RsaCXoEzmssaF9m9cdLXe0Yh') + │ │ └── (3045, 2, 10, 6, 92966, 0, 4, 366.76, 'saCXoEzmssaF9m9cdLXe0Yhg') + │ └── projections + │ └── CAST(NULL AS TIMESTAMP) [as=ol_delivery_d_default:24] + └── f-k-checks + ├── f-k-checks-item: order_line(ol_w_id,ol_d_id,ol_o_id) -> order(o_w_id,o_d_id,o_id) + │ └── anti-join (lookup order) + │ ├── columns: ol_w_id:25!null ol_d_id:26!null ol_o_id:27!null + │ ├── key columns: [25 26 27] = [30 29 28] + │ ├── lookup columns are key + │ ├── locking: for-share,durability-guaranteed + │ ├── cardinality: [0 - 6] + │ ├── volatile + │ ├── with-scan &1 + │ │ ├── columns: ol_w_id:25!null ol_d_id:26!null ol_o_id:27!null + │ │ ├── mapping: + │ │ │ ├── column3:15 => ol_w_id:25 + │ │ │ ├── column2:14 => ol_d_id:26 + │ │ │ └── column1:13 => ol_o_id:27 + │ │ └── cardinality: [6 - 6] + │ └── filters (true) + └── f-k-checks-item: order_line(ol_supply_w_id,ol_i_id) -> stock(s_w_id,s_i_id) + └── anti-join (lookup stock) + ├── columns: ol_supply_w_id:38!null ol_i_id:39!null + ├── key columns: [38 39] = [41 40] + ├── lookup columns are key + ├── locking: for-share,durability-guaranteed + ├── cardinality: [0 - 6] + ├── volatile + ├── with-scan &1 + │ ├── columns: ol_supply_w_id:38!null ol_i_id:39!null + │ ├── mapping: + │ │ ├── column6:18 => ol_supply_w_id:38 + │ │ └── column5:17 => ol_i_id:39 + │ └── cardinality: [6 - 6] + └── filters (true) + +# -------------------------------------------------- +# 2.5 The Payment Transaction +# +# The Payment business transaction updates the customer's balance and reflects +# the payment on the district and warehouse sales statistics. It represents a +# light-weight, read-write transaction with a high frequency of execution and +# stringent response time requirements to satisfy on-line users. In addition, +# this transaction includes non-primary key access to the CUSTOMER table. +# -------------------------------------------------- +opt format=hide-qual isolation=ReadCommitted +UPDATE warehouse SET w_ytd = w_ytd + 3860.61 WHERE w_id = 10 +RETURNING w_name, w_street_1, w_street_2, w_city, w_state, w_zip +---- +project + ├── columns: w_name:2 w_street_1:3 w_street_2:4 w_city:5 w_state:6 w_zip:7 + ├── cardinality: [0 - 1] + ├── volatile, mutations + ├── key: () + ├── fd: ()-->(2-7) + └── update warehouse + ├── columns: w_id:1!null w_name:2 w_street_1:3 w_street_2:4 w_city:5 w_state:6 w_zip:7 + ├── fetch columns: w_id:12 w_name:13 w_street_1:14 w_street_2:15 w_city:16 w_state:17 w_zip:18 w_tax:19 w_ytd:20 + ├── update-mapping: + │ └── w_ytd_cast:24 => w_ytd:9 + ├── return-mapping: + │ ├── w_id:12 => w_id:1 + │ ├── w_name:13 => w_name:2 + │ ├── w_street_1:14 => w_street_1:3 + │ ├── w_street_2:15 => w_street_2:4 + │ ├── w_city:16 => w_city:5 + │ ├── w_state:17 => w_state:6 + │ └── w_zip:18 => w_zip:7 + ├── cardinality: [0 - 1] + ├── volatile, mutations + ├── key: () + ├── fd: ()-->(1-7) + └── project + ├── columns: w_ytd_cast:24 w_id:12!null w_name:13 w_street_1:14 w_street_2:15 w_city:16 w_state:17 w_zip:18 w_tax:19 w_ytd:20 + ├── cardinality: [0 - 1] + ├── immutable + ├── key: () + ├── fd: ()-->(12-20,24) + ├── scan warehouse + │ ├── columns: w_id:12!null w_name:13 w_street_1:14 w_street_2:15 w_city:16 w_state:17 w_zip:18 w_tax:19 w_ytd:20 + │ ├── constraint: /12: [/10 - /10] + │ ├── cardinality: [0 - 1] + │ ├── key: () + │ └── fd: ()-->(12-20) + └── projections + └── assignment-cast: DECIMAL(12,2) [as=w_ytd_cast:24, outer=(20), immutable] + └── w_ytd:20 + 3860.61 + +opt format=hide-qual isolation=ReadCommitted +UPDATE district SET d_ytd = d_ytd + 3860.61 WHERE (d_w_id = 10) AND (d_id = 5) +RETURNING d_name, d_street_1, d_street_2, d_city, d_state, d_zip +---- +project + ├── columns: d_name:3 d_street_1:4 d_street_2:5 d_city:6 d_state:7 d_zip:8 + ├── cardinality: [0 - 1] + ├── volatile, mutations + ├── key: () + ├── fd: ()-->(3-8) + └── update district + ├── columns: d_id:1!null d_w_id:2!null d_name:3 d_street_1:4 d_street_2:5 d_city:6 d_state:7 d_zip:8 + ├── fetch columns: d_id:14 d_w_id:15 d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 + ├── update-mapping: + │ └── d_ytd_cast:28 => d_ytd:10 + ├── return-mapping: + │ ├── d_id:14 => d_id:1 + │ ├── d_w_id:15 => d_w_id:2 + │ ├── d_name:16 => d_name:3 + │ ├── d_street_1:17 => d_street_1:4 + │ ├── d_street_2:18 => d_street_2:5 + │ ├── d_city:19 => d_city:6 + │ ├── d_state:20 => d_state:7 + │ └── d_zip:21 => d_zip:8 + ├── cardinality: [0 - 1] + ├── volatile, mutations + ├── key: () + ├── fd: ()-->(1-8) + └── project + ├── columns: d_ytd_cast:28 d_id:14!null d_w_id:15!null d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 + ├── cardinality: [0 - 1] + ├── immutable + ├── key: () + ├── fd: ()-->(14-24,28) + ├── scan district + │ ├── columns: d_id:14!null d_w_id:15!null d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 + │ ├── constraint: /15/14: [/10/5 - /10/5] + │ ├── cardinality: [0 - 1] + │ ├── key: () + │ └── fd: ()-->(14-24) + └── projections + └── assignment-cast: DECIMAL(12,2) [as=d_ytd_cast:28, outer=(23), immutable] + └── d_ytd:23 + 3860.61 + +opt format=hide-qual isolation=ReadCommitted +SELECT c_id +FROM customer +WHERE c_w_id = 10 AND c_d_id = 100 AND c_last = 'Smith' +ORDER BY c_first ASC +---- +project + ├── columns: c_id:1!null [hidden: c_first:4] + ├── key: (1) + ├── fd: (1)-->(4) + ├── ordering: +4 + └── scan customer@customer_idx + ├── columns: c_id:1!null c_d_id:2!null c_w_id:3!null c_first:4 c_last:6!null + ├── constraint: /3/2/6/4/1: [/10/100/'Smith' - /10/100/'Smith'] + ├── key: (1) + ├── fd: ()-->(2,3,6), (1)-->(4) + └── ordering: +4 opt(2,3,6) [actual: +4] + +opt format=hide-qual isolation=ReadCommitted +UPDATE customer +SET (c_balance, c_ytd_payment, c_payment_cnt, c_data) + = ( + c_balance - (3860.61:::FLOAT8)::DECIMAL, + c_ytd_payment + (3860.61:::FLOAT8)::DECIMAL, + c_payment_cnt + 1, + CASE c_credit + WHEN 'BC' + THEN "left"( + c_id::STRING + || c_d_id::STRING + || c_w_id::STRING + || (5:::INT8)::STRING + || (10:::INT8)::STRING + || (3860.61:::FLOAT8)::STRING + || c_data, + 500 + ) + ELSE c_data + END + ) +WHERE + (c_w_id = 10 AND c_d_id = 5) AND c_id = 1343 +RETURNING + c_first, + c_middle, + c_last, + c_street_1, + c_street_2, + c_city, + c_state, + c_zip, + c_phone, + c_since, + c_credit, + c_credit_lim, + c_discount, + c_balance, + CASE c_credit WHEN 'BC' THEN "left"(c_data, 200) ELSE '' END +---- +project + ├── columns: c_first:4 c_middle:5 c_last:6 c_street_1:7 c_street_2:8 c_city:9 c_state:10 c_zip:11 c_phone:12 c_since:13 c_credit:14 c_credit_lim:15 c_discount:16 c_balance:17 case:54 + ├── cardinality: [0 - 1] + ├── volatile, mutations + ├── key: () + ├── fd: ()-->(4-17,54) + ├── update customer + │ ├── columns: c_id:1!null c_d_id:2!null c_w_id:3!null c_first:4 c_middle:5 c_last:6 c_street_1:7 c_street_2:8 c_city:9 c_state:10 c_zip:11 c_phone:12 c_since:13 c_credit:14 c_credit_lim:15 c_discount:16 c_balance:17 c_data:21 + │ ├── fetch columns: c_id:24 c_d_id:25 c_w_id:26 c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 + │ ├── update-mapping: + │ │ ├── c_balance_cast:51 => c_balance:17 + │ │ ├── c_ytd_payment_cast:52 => c_ytd_payment:18 + │ │ ├── c_payment_cnt_new:49 => c_payment_cnt:19 + │ │ └── c_data_cast:53 => c_data:21 + │ ├── return-mapping: + │ │ ├── c_id:24 => c_id:1 + │ │ ├── c_d_id:25 => c_d_id:2 + │ │ ├── c_w_id:26 => c_w_id:3 + │ │ ├── c_first:27 => c_first:4 + │ │ ├── c_middle:28 => c_middle:5 + │ │ ├── c_last:29 => c_last:6 + │ │ ├── c_street_1:30 => c_street_1:7 + │ │ ├── c_street_2:31 => c_street_2:8 + │ │ ├── c_city:32 => c_city:9 + │ │ ├── c_state:33 => c_state:10 + │ │ ├── c_zip:34 => c_zip:11 + │ │ ├── c_phone:35 => c_phone:12 + │ │ ├── c_since:36 => c_since:13 + │ │ ├── c_credit:37 => c_credit:14 + │ │ ├── c_credit_lim:38 => c_credit_lim:15 + │ │ ├── c_discount:39 => c_discount:16 + │ │ ├── c_balance_cast:51 => c_balance:17 + │ │ └── c_data_cast:53 => c_data:21 + │ ├── cardinality: [0 - 1] + │ ├── volatile, mutations + │ ├── key: () + │ ├── fd: ()-->(1-17,21) + │ └── project + │ ├── columns: c_balance_cast:51 c_ytd_payment_cast:52 c_data_cast:53 c_payment_cnt_new:49 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 + │ ├── cardinality: [0 - 1] + │ ├── immutable + │ ├── key: () + │ ├── fd: ()-->(24-44,49,51-53) + │ ├── scan customer + │ │ ├── columns: c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 + │ │ ├── constraint: /26/25/24: [/10/5/1343 - /10/5/1343] + │ │ ├── cardinality: [0 - 1] + │ │ ├── key: () + │ │ └── fd: ()-->(24-44) + │ └── projections + │ ├── assignment-cast: DECIMAL(12,2) [as=c_balance_cast:51, outer=(40), immutable] + │ │ └── c_balance:40 - 3860.61 + │ ├── assignment-cast: DECIMAL(12,2) [as=c_ytd_payment_cast:52, outer=(41), immutable] + │ │ └── c_ytd_payment:41 + 3860.61 + │ ├── assignment-cast: VARCHAR(500) [as=c_data_cast:53, outer=(24-26,37,44), immutable] + │ │ └── CASE c_credit:37 WHEN 'BC' THEN left((((((c_id:24::STRING || c_d_id:25::STRING) || c_w_id:26::STRING) || '5') || '10') || '3860.61') || c_data:44, 500)::VARCHAR ELSE c_data:44::VARCHAR END + │ └── c_payment_cnt:42 + 1 [as=c_payment_cnt_new:49, outer=(42), immutable] + └── projections + └── CASE c_credit:14 WHEN 'BC' THEN left(c_data:21, 200) ELSE '' END [as=case:54, outer=(14,21), immutable] + +opt format=hide-qual isolation=ReadCommitted +INSERT INTO history + (h_c_id, h_c_d_id, h_c_w_id, h_d_id, h_w_id, h_amount, h_date, h_data) +VALUES + (1343, 5, 10, 5, 10, 3860.61, '2019-08-26 16:50:41', '8 Kdcgphy3') +---- +insert history + ├── columns: + ├── insert-mapping: + │ ├── rowid_default:22 => rowid:1 + │ ├── column1:12 => history.h_c_id:2 + │ ├── column2:13 => history.h_c_d_id:3 + │ ├── column3:14 => history.h_c_w_id:4 + │ ├── column4:15 => history.h_d_id:5 + │ ├── column5:16 => history.h_w_id:6 + │ ├── column7:18 => h_date:7 + │ ├── h_amount_cast:20 => h_amount:8 + │ └── h_data_cast:21 => h_data:9 + ├── input binding: &1 + ├── cardinality: [0 - 0] + ├── volatile, mutations + ├── values + │ ├── columns: column1:12!null column2:13!null column3:14!null column4:15!null column5:16!null column7:18!null h_amount_cast:20!null h_data_cast:21!null rowid_default:22 + │ ├── cardinality: [1 - 1] + │ ├── volatile + │ ├── key: () + │ ├── fd: ()-->(12-16,18,20-22) + │ └── (1343, 5, 10, 5, 10, '2019-08-26 16:50:41', 3860.61, '8 Kdcgphy3', gen_random_uuid()) + └── f-k-checks + ├── f-k-checks-item: history(h_c_w_id,h_c_d_id,h_c_id) -> customer(c_w_id,c_d_id,c_id) + │ └── anti-join (lookup customer) + │ ├── columns: h_c_w_id:23!null h_c_d_id:24!null h_c_id:25!null + │ ├── key columns: [23 24 25] = [28 27 26] + │ ├── lookup columns are key + │ ├── locking: for-share,durability-guaranteed + │ ├── cardinality: [0 - 1] + │ ├── volatile + │ ├── key: () + │ ├── fd: ()-->(23-25) + │ ├── with-scan &1 + │ │ ├── columns: h_c_w_id:23!null h_c_d_id:24!null h_c_id:25!null + │ │ ├── mapping: + │ │ │ ├── column3:14 => h_c_w_id:23 + │ │ │ ├── column2:13 => h_c_d_id:24 + │ │ │ └── column1:12 => h_c_id:25 + │ │ ├── cardinality: [1 - 1] + │ │ ├── key: () + │ │ └── fd: ()-->(23-25) + │ └── filters (true) + └── f-k-checks-item: history(h_w_id,h_d_id) -> district(d_w_id,d_id) + └── anti-join (lookup district) + ├── columns: h_w_id:49!null h_d_id:50!null + ├── key columns: [49 50] = [52 51] + ├── lookup columns are key + ├── locking: for-share,durability-guaranteed + ├── cardinality: [0 - 1] + ├── volatile + ├── key: () + ├── fd: ()-->(49,50) + ├── with-scan &1 + │ ├── columns: h_w_id:49!null h_d_id:50!null + │ ├── mapping: + │ │ ├── column5:16 => h_w_id:49 + │ │ └── column4:15 => h_d_id:50 + │ ├── cardinality: [1 - 1] + │ ├── key: () + │ └── fd: ()-->(49,50) + └── filters (true) + +# -------------------------------------------------- +# 2.6 The Order Status Transaction +# +# The Order-Status business transaction queries the status of a customer's last +# order. It represents a mid-weight read-only database transaction with a low +# frequency of execution and response time requirement to satisfy on-line +# users. In addition, this table includes non-primary key access to the +# CUSTOMER table. +# -------------------------------------------------- +opt format=hide-qual isolation=ReadCommitted +SELECT c_balance, c_first, c_middle, c_last +FROM customer +WHERE c_w_id = 10 AND c_d_id = 100 AND c_id = 50 +---- +project + ├── columns: c_balance:17 c_first:4 c_middle:5 c_last:6 + ├── cardinality: [0 - 1] + ├── key: () + ├── fd: ()-->(4-6,17) + └── scan customer + ├── columns: c_id:1!null c_d_id:2!null c_w_id:3!null c_first:4 c_middle:5 c_last:6 c_balance:17 + ├── constraint: /3/2/1: [/10/100/50 - /10/100/50] + ├── cardinality: [0 - 1] + ├── key: () + └── fd: ()-->(1-6,17) + +opt format=hide-qual isolation=ReadCommitted +SELECT c_id, c_balance, c_first, c_middle +FROM customer +WHERE c_w_id = 10 AND c_d_id = 100 AND c_last = 'Smith' +ORDER BY c_first ASC +---- +project + ├── columns: c_id:1!null c_balance:17 c_first:4 c_middle:5 + ├── key: (1) + ├── fd: (1)-->(4,5,17) + ├── ordering: +4 + └── index-join customer + ├── columns: c_id:1!null c_d_id:2!null c_w_id:3!null c_first:4 c_middle:5 c_last:6!null c_balance:17 + ├── key: (1) + ├── fd: ()-->(2,3,6), (1)-->(4,5,17) + ├── ordering: +4 opt(2,3,6) [actual: +4] + └── scan customer@customer_idx + ├── columns: c_id:1!null c_d_id:2!null c_w_id:3!null c_first:4 c_last:6!null + ├── constraint: /3/2/6/4/1: [/10/100/'Smith' - /10/100/'Smith'] + ├── key: (1) + ├── fd: ()-->(2,3,6), (1)-->(4) + └── ordering: +4 opt(2,3,6) [actual: +4] + +opt format=hide-qual isolation=ReadCommitted +SELECT o_id, o_entry_d, o_carrier_id +FROM "order" +WHERE o_w_id = 10 AND o_d_id = 100 AND o_c_id = 50 +ORDER BY o_id DESC +LIMIT 1 +---- +project + ├── columns: o_id:1!null o_entry_d:5 o_carrier_id:6 + ├── cardinality: [0 - 1] + ├── key: () + ├── fd: ()-->(1,5,6) + └── scan order@order_idx + ├── columns: o_id:1!null o_d_id:2!null o_w_id:3!null o_c_id:4!null o_entry_d:5 o_carrier_id:6 + ├── constraint: /3/2/4/-1: [/10/100/50 - /10/100/50] + ├── limit: 1 + ├── key: () + └── fd: ()-->(1-6) + +opt format=hide-qual isolation=ReadCommitted +SELECT ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_delivery_d +FROM order_line +WHERE ol_w_id = 10 AND ol_d_id = 100 AND ol_o_id = 1000 +---- +project + ├── columns: ol_i_id:5!null ol_supply_w_id:6 ol_quantity:8 ol_amount:9 ol_delivery_d:7 + └── scan order_line + ├── columns: ol_o_id:1!null ol_d_id:2!null ol_w_id:3!null ol_i_id:5!null ol_supply_w_id:6 ol_delivery_d:7 ol_quantity:8 ol_amount:9 + ├── constraint: /3/2/-1/4: [/10/100/1000 - /10/100/1000] + └── fd: ()-->(1-3) + +# -------------------------------------------------- +# 2.7 The Delivery Transaction +# +# The Delivery business transaction consists of processing a batch of 10 new +# (not yet delivered) orders. Each order is processed (delivered) in full +# within the scope of a read-write database transaction. The number of orders +# delivered as a group (or batched) within the same database transaction is +# implementation specific. The business transaction, comprised of one or more +# (up to 10) database transactions, has a low frequency of execution and must +# complete within a relaxed response time requirement. +# +# The Delivery transaction is intended to be executed in deferred mode through +# a queuing mechanism, rather than interactively, with terminal response +# indicating transaction completion. The result of the deferred execution is +# recorded into a result file. +# -------------------------------------------------- +opt format=hide-qual isolation=ReadCommitted +SELECT no_o_id +FROM new_order +WHERE no_w_id = 10 AND no_d_id = 100 +ORDER BY no_o_id ASC +LIMIT 1 +FOR UPDATE +---- +lock new_order + ├── columns: no_o_id:1!null [hidden: no_d_id:2!null no_w_id:3!null] + ├── locking: for-update,durability-guaranteed + ├── cardinality: [0 - 1] + ├── volatile, mutations + ├── key: () + ├── fd: ()-->(1-3) + └── scan new_order + ├── columns: no_o_id:1!null no_d_id:2!null no_w_id:3!null + ├── constraint: /3/2/1: [/10/100 - /10/100] + ├── limit: 1 + ├── key: () + └── fd: ()-->(1-3) + +opt format=hide-qual isolation=ReadCommitted +SELECT sum(ol_amount) +FROM order_line +WHERE ol_w_id = 10 AND ol_d_id = 100 AND ol_o_id = 1000 +---- +scalar-group-by + ├── columns: sum:13 + ├── cardinality: [1 - 1] + ├── key: () + ├── fd: ()-->(13) + ├── scan order_line + │ ├── columns: ol_o_id:1!null ol_d_id:2!null ol_w_id:3!null ol_amount:9 + │ ├── constraint: /3/2/-1/4: [/10/100/1000 - /10/100/1000] + │ └── fd: ()-->(1-3) + └── aggregations + └── sum [as=sum:13, outer=(9)] + └── ol_amount:9 + +opt format=hide-qual isolation=ReadCommitted +UPDATE "order" +SET o_carrier_id = 10 +WHERE o_w_id = 10 + AND (o_d_id, o_id) IN ( + (10, 2167), + (5, 2167), + (6, 2167), + (9, 2167), + (4, 2167), + (7, 2167), + (8, 2167), + (1, 2167), + (2, 2167), + (3, 2167) + ) +RETURNING + o_d_id, o_c_id +---- +project + ├── columns: o_d_id:2!null o_c_id:4 + ├── cardinality: [0 - 10] + ├── volatile, mutations + ├── key: (2) + ├── fd: (2)-->(4) + └── update order + ├── columns: o_id:1!null o_d_id:2!null o_w_id:3!null o_c_id:4 + ├── fetch columns: o_id:11 o_d_id:12 o_w_id:13 o_c_id:14 o_entry_d:15 o_carrier_id:16 o_ol_cnt:17 o_all_local:18 + ├── update-mapping: + │ └── o_carrier_id_new:21 => o_carrier_id:6 + ├── return-mapping: + │ ├── o_id:11 => o_id:1 + │ ├── o_d_id:12 => o_d_id:2 + │ ├── o_w_id:13 => o_w_id:3 + │ └── o_c_id:14 => o_c_id:4 + ├── cardinality: [0 - 10] + ├── volatile, mutations + ├── key: (2) + ├── fd: ()-->(1,3), (2)-->(4) + └── project + ├── columns: o_carrier_id_new:21!null o_id:11!null o_d_id:12!null o_w_id:13!null o_c_id:14 o_entry_d:15 o_carrier_id:16 o_ol_cnt:17 o_all_local:18 + ├── cardinality: [0 - 10] + ├── key: (12) + ├── fd: ()-->(11,13,21), (12)-->(14-18) + ├── scan order + │ ├── columns: o_id:11!null o_d_id:12!null o_w_id:13!null o_c_id:14 o_entry_d:15 o_carrier_id:16 o_ol_cnt:17 o_all_local:18 + │ ├── constraint: /13/12/-11 + │ │ ├── [/10/1/2167 - /10/1/2167] + │ │ ├── [/10/2/2167 - /10/2/2167] + │ │ ├── [/10/3/2167 - /10/3/2167] + │ │ ├── [/10/4/2167 - /10/4/2167] + │ │ ├── [/10/5/2167 - /10/5/2167] + │ │ ├── [/10/6/2167 - /10/6/2167] + │ │ ├── [/10/7/2167 - /10/7/2167] + │ │ ├── [/10/8/2167 - /10/8/2167] + │ │ ├── [/10/9/2167 - /10/9/2167] + │ │ └── [/10/10/2167 - /10/10/2167] + │ ├── cardinality: [0 - 10] + │ ├── key: (12) + │ └── fd: ()-->(11,13), (12)-->(14-18) + └── projections + └── 10 [as=o_carrier_id_new:21] + +opt format=hide-qual isolation=ReadCommitted +UPDATE customer +SET c_delivery_cnt = c_delivery_cnt + 1, + c_balance = c_balance + CASE c_d_id + WHEN 6 THEN 57214.780000 + WHEN 8 THEN 67755.430000 + WHEN 1 THEN 51177.840000 + WHEN 2 THEN 73840.700000 + WHEN 4 THEN 45906.990000 + WHEN 9 THEN 32523.760000 + WHEN 10 THEN 20240.200000 + WHEN 3 THEN 75299.790000 + WHEN 5 THEN 56543.340000 + WHEN 7 THEN 67157.940000 + END +WHERE c_w_id = 10 AND (c_d_id, c_id) IN ( + (1, 1405), + (2, 137), + (3, 309), + (7, 2377), + (8, 2106), + (10, 417), + (4, 98), + (5, 1683), + (6, 2807), + (9, 1412) + ) +---- +update customer + ├── columns: + ├── fetch columns: c_id:24 c_d_id:25 c_w_id:26 c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 + ├── update-mapping: + │ ├── c_balance_cast:49 => c_balance:17 + │ └── c_delivery_cnt_new:47 => c_delivery_cnt:20 + ├── cardinality: [0 - 0] + ├── volatile, mutations + └── project + ├── columns: c_balance_cast:49 c_delivery_cnt_new:47 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 + ├── cardinality: [0 - 10] + ├── immutable + ├── key: (24,25) + ├── fd: ()-->(26), (24,25)-->(27-44,49), (43)-->(47) + ├── scan customer + │ ├── columns: c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 + │ ├── constraint: /26/25/24 + │ │ ├── [/10/1/1405 - /10/1/1405] + │ │ ├── [/10/2/137 - /10/2/137] + │ │ ├── [/10/3/309 - /10/3/309] + │ │ ├── [/10/4/98 - /10/4/98] + │ │ ├── [/10/5/1683 - /10/5/1683] + │ │ ├── [/10/6/2807 - /10/6/2807] + │ │ ├── [/10/7/2377 - /10/7/2377] + │ │ ├── [/10/8/2106 - /10/8/2106] + │ │ ├── [/10/9/1412 - /10/9/1412] + │ │ └── [/10/10/417 - /10/10/417] + │ ├── cardinality: [0 - 10] + │ ├── key: (24,25) + │ └── fd: ()-->(26), (24,25)-->(27-44) + └── projections + ├── assignment-cast: DECIMAL(12,2) [as=c_balance_cast:49, outer=(25,40), immutable] + │ └── c_balance:40 + CASE c_d_id:25 WHEN 6 THEN 57214.780000 WHEN 8 THEN 67755.430000 WHEN 1 THEN 51177.840000 WHEN 2 THEN 73840.700000 WHEN 4 THEN 45906.990000 WHEN 9 THEN 32523.760000 WHEN 10 THEN 20240.200000 WHEN 3 THEN 75299.790000 WHEN 5 THEN 56543.340000 WHEN 7 THEN 67157.940000 ELSE CAST(NULL AS DECIMAL) END + └── c_delivery_cnt:43 + 1 [as=c_delivery_cnt_new:47, outer=(43), immutable] + +opt format=hide-qual isolation=ReadCommitted +DELETE FROM new_order +WHERE no_w_id = 10 AND (no_d_id, no_o_id) IN ( + (10, 2167), + (5, 2167), + (6, 2167), + (9, 2167), + (4, 2167), + (7, 2167), + (8, 2167), + (1, 2167), + (2, 2167), + (3, 2167) + ) +---- +delete new_order + ├── columns: + ├── fetch columns: no_o_id:6 no_d_id:7 no_w_id:8 + ├── cardinality: [0 - 0] + ├── volatile, mutations + └── scan new_order + ├── columns: no_o_id:6!null no_d_id:7!null no_w_id:8!null + ├── constraint: /8/7/6 + │ ├── [/10/1/2167 - /10/1/2167] + │ ├── [/10/2/2167 - /10/2/2167] + │ ├── [/10/3/2167 - /10/3/2167] + │ ├── [/10/4/2167 - /10/4/2167] + │ ├── [/10/5/2167 - /10/5/2167] + │ ├── [/10/6/2167 - /10/6/2167] + │ ├── [/10/7/2167 - /10/7/2167] + │ ├── [/10/8/2167 - /10/8/2167] + │ ├── [/10/9/2167 - /10/9/2167] + │ └── [/10/10/2167 - /10/10/2167] + ├── cardinality: [0 - 10] + ├── key: (7) + └── fd: ()-->(6,8) + + +opt format=hide-qual isolation=ReadCommitted +UPDATE order_line +SET ol_delivery_d = '2019-08-26 16:50:41' +WHERE ol_w_id = 10 AND (ol_d_id, ol_o_id) IN ( + (10, 2167), + (5, 2167), + (6, 2167), + (9, 2167), + (4, 2167), + (7, 2167), + (8, 2167), + (1, 2167), + (2, 2167), + (3, 2167) + ) +---- +update order_line + ├── columns: + ├── fetch columns: ol_o_id:13 ol_d_id:14 ol_w_id:15 ol_number:16 ol_i_id:17 ol_supply_w_id:18 ol_delivery_d:19 ol_quantity:20 ol_amount:21 ol_dist_info:22 + ├── update-mapping: + │ └── ol_delivery_d_new:25 => ol_delivery_d:7 + ├── cardinality: [0 - 0] + ├── volatile, mutations + └── project + ├── columns: ol_delivery_d_new:25!null ol_o_id:13!null ol_d_id:14!null ol_w_id:15!null ol_number:16!null ol_i_id:17!null ol_supply_w_id:18 ol_delivery_d:19 ol_quantity:20 ol_amount:21 ol_dist_info:22 + ├── key: (14,16) + ├── fd: ()-->(13,15,25), (14,16)-->(17-22) + ├── scan order_line + │ ├── columns: ol_o_id:13!null ol_d_id:14!null ol_w_id:15!null ol_number:16!null ol_i_id:17!null ol_supply_w_id:18 ol_delivery_d:19 ol_quantity:20 ol_amount:21 ol_dist_info:22 + │ ├── constraint: /15/14/-13/16 + │ │ ├── [/10/1/2167 - /10/1/2167] + │ │ ├── [/10/2/2167 - /10/2/2167] + │ │ ├── [/10/3/2167 - /10/3/2167] + │ │ ├── [/10/4/2167 - /10/4/2167] + │ │ ├── [/10/5/2167 - /10/5/2167] + │ │ ├── [/10/6/2167 - /10/6/2167] + │ │ ├── [/10/7/2167 - /10/7/2167] + │ │ ├── [/10/8/2167 - /10/8/2167] + │ │ ├── [/10/9/2167 - /10/9/2167] + │ │ └── [/10/10/2167 - /10/10/2167] + │ ├── key: (14,16) + │ └── fd: ()-->(13,15), (14,16)-->(17-22) + └── projections + └── '2019-08-26 16:50:41' [as=ol_delivery_d_new:25] + +# -------------------------------------------------- +# 2.8 The Stock-Level Transaction +# +# The Stock-Level business transaction determines the number of recently sold +# items that have a stock level below a specified threshold. It represents a +# heavy read-only database transaction with a low frequency of execution, a +# relaxed response time requirement, and relaxed consistency requirements. +# -------------------------------------------------- +opt format=hide-qual isolation=ReadCommitted +SELECT d_next_o_id +FROM district +WHERE d_w_id = 10 AND d_id = 100 +---- +project + ├── columns: d_next_o_id:11 + ├── cardinality: [0 - 1] + ├── key: () + ├── fd: ()-->(11) + └── scan district + ├── columns: d_id:1!null d_w_id:2!null d_next_o_id:11 + ├── constraint: /2/1: [/10/100 - /10/100] + ├── cardinality: [0 - 1] + ├── key: () + └── fd: ()-->(1,2,11) + +opt format=hide-qual isolation=ReadCommitted +SELECT count(DISTINCT s_i_id) +FROM order_line +JOIN stock +ON s_i_id=ol_i_id AND s_w_id=ol_w_id +WHERE ol_w_id = 10 + AND ol_d_id = 100 + AND ol_o_id BETWEEN 1000 - 20 AND 1000 - 1 + AND s_quantity < 15 +---- +scalar-group-by + ├── columns: count:32!null + ├── cardinality: [1 - 1] + ├── key: () + ├── fd: ()-->(32) + ├── distinct-on + │ ├── columns: s_i_id:13!null + │ ├── grouping columns: s_i_id:13!null + │ ├── key: (13) + │ └── inner-join (lookup stock) + │ ├── columns: ol_o_id:1!null ol_d_id:2!null ol_w_id:3!null ol_i_id:5!null s_i_id:13!null s_w_id:14!null s_quantity:15!null + │ ├── key columns: [3 5] = [14 13] + │ ├── lookup columns are key + │ ├── fd: ()-->(2,3,14), (13)-->(15), (5)==(13), (13)==(5), (3)==(14), (14)==(3) + │ ├── scan order_line + │ │ ├── columns: ol_o_id:1!null ol_d_id:2!null ol_w_id:3!null ol_i_id:5!null + │ │ ├── constraint: /3/2/-1/4: [/10/100/999 - /10/100/980] + │ │ └── fd: ()-->(2,3) + │ └── filters + │ ├── s_w_id:14 = 10 [outer=(14), constraints=(/14: [/10 - /10]; tight), fd=()-->(14)] + │ └── s_quantity:15 < 15 [outer=(15), constraints=(/15: (/NULL - /14]; tight)] + └── aggregations + └── count-rows [as=count:32] + +# -------------------------------------------------- +# Consistency Queries +# +# These queries run after TPCC in order to check database consistency. +# They are not part of the benchmark itself. +# -------------------------------------------------- +opt format=hide-qual isolation=ReadCommitted +SELECT count(*) +FROM warehouse +FULL OUTER JOIN +( + SELECT d_w_id, sum(d_ytd) as sum_d_ytd + FROM district + GROUP BY d_w_id +) +ON (w_id = d_w_id) +WHERE w_ytd != sum_d_ytd +---- +scalar-group-by + ├── columns: count:26!null + ├── cardinality: [1 - 1] + ├── immutable + ├── key: () + ├── fd: ()-->(26) + ├── inner-join (merge) + │ ├── columns: w_id:1!null w_ytd:9!null d_w_id:13!null sum:25!null + │ ├── left ordering: +1 + │ ├── right ordering: +13 + │ ├── immutable + │ ├── key: (13) + │ ├── fd: (1)-->(9), (13)-->(25), (1)==(13), (13)==(1) + │ ├── scan warehouse + │ │ ├── columns: w_id:1!null w_ytd:9 + │ │ ├── key: (1) + │ │ ├── fd: (1)-->(9) + │ │ └── ordering: +1 + │ ├── group-by (streaming) + │ │ ├── columns: d_w_id:13!null sum:25 + │ │ ├── grouping columns: d_w_id:13!null + │ │ ├── key: (13) + │ │ ├── fd: (13)-->(25) + │ │ ├── ordering: +13 + │ │ ├── scan district + │ │ │ ├── columns: d_w_id:13!null d_ytd:21 + │ │ │ └── ordering: +13 + │ │ └── aggregations + │ │ └── sum [as=sum:25, outer=(21)] + │ │ └── d_ytd:21 + │ └── filters + │ └── w_ytd:9 != sum:25 [outer=(9,25), immutable, constraints=(/9: (/NULL - ]; /25: (/NULL - ])] + └── aggregations + └── count-rows [as=count_rows:26] + +opt format=hide-qual isolation=ReadCommitted +SELECT d_next_o_id +FROM district +ORDER BY d_w_id, d_id +---- +scan district + ├── columns: d_next_o_id:11 [hidden: d_id:1!null d_w_id:2!null] + ├── key: (1,2) + ├── fd: (1,2)-->(11) + └── ordering: +2,+1 + +opt format=hide-qual isolation=ReadCommitted +SELECT max(no_o_id) +FROM new_order +GROUP BY no_d_id, no_w_id +ORDER BY no_w_id, no_d_id +---- +group-by (streaming) + ├── columns: max:6!null [hidden: no_d_id:2!null no_w_id:3!null] + ├── grouping columns: no_d_id:2!null no_w_id:3!null + ├── key: (2,3) + ├── fd: (2,3)-->(6) + ├── ordering: +3,+2 + ├── scan new_order + │ ├── columns: no_o_id:1!null no_d_id:2!null no_w_id:3!null + │ ├── key: (1-3) + │ └── ordering: +3,+2 + └── aggregations + └── max [as=max:6, outer=(1)] + └── no_o_id:1 + +opt format=hide-qual isolation=ReadCommitted +SELECT max(o_id) +FROM "order" +GROUP BY o_d_id, o_w_id +ORDER BY o_w_id, o_d_id +---- +group-by (streaming) + ├── columns: max:11!null [hidden: o_d_id:2!null o_w_id:3!null] + ├── grouping columns: o_d_id:2!null o_w_id:3!null + ├── key: (2,3) + ├── fd: (2,3)-->(11) + ├── ordering: +3,+2 + ├── scan order@order_idx + │ ├── columns: o_id:1!null o_d_id:2!null o_w_id:3!null + │ ├── key: (1-3) + │ └── ordering: +3,+2 + └── aggregations + └── max [as=max:11, outer=(1)] + └── o_id:1 + +opt format=hide-qual isolation=ReadCommitted +SELECT count(*) +FROM +( + SELECT max(no_o_id) - min(no_o_id) - count(*) AS nod + FROM new_order + GROUP BY no_w_id, no_d_id +) +WHERE nod != -1 +---- +scalar-group-by + ├── columns: count:10!null + ├── cardinality: [1 - 1] + ├── immutable + ├── key: () + ├── fd: ()-->(10) + ├── select + │ ├── columns: no_d_id:2!null no_w_id:3!null max:6!null min:7!null count_rows:8!null + │ ├── immutable + │ ├── key: (2,3) + │ ├── fd: (2,3)-->(6-8) + │ ├── group-by (streaming) + │ │ ├── columns: no_d_id:2!null no_w_id:3!null max:6!null min:7!null count_rows:8!null + │ │ ├── grouping columns: no_d_id:2!null no_w_id:3!null + │ │ ├── internal-ordering: +3,+2 + │ │ ├── key: (2,3) + │ │ ├── fd: (2,3)-->(6-8) + │ │ ├── scan new_order + │ │ │ ├── columns: no_o_id:1!null no_d_id:2!null no_w_id:3!null + │ │ │ ├── key: (1-3) + │ │ │ └── ordering: +3,+2 + │ │ └── aggregations + │ │ ├── max [as=max:6, outer=(1)] + │ │ │ └── no_o_id:1 + │ │ ├── min [as=min:7, outer=(1)] + │ │ │ └── no_o_id:1 + │ │ └── count-rows [as=count_rows:8] + │ └── filters + │ └── ((max:6 - min:7) - count_rows:8) != -1 [outer=(6-8), immutable] + └── aggregations + └── count-rows [as=count_rows:10] + +opt format=hide-qual isolation=ReadCommitted +SELECT sum(o_ol_cnt) +FROM "order" +GROUP BY o_w_id, o_d_id +ORDER BY o_w_id, o_d_id +---- +group-by (streaming) + ├── columns: sum:11 [hidden: o_d_id:2!null o_w_id:3!null] + ├── grouping columns: o_d_id:2!null o_w_id:3!null + ├── key: (2,3) + ├── fd: (2,3)-->(11) + ├── ordering: +3,+2 + ├── scan order + │ ├── columns: o_d_id:2!null o_w_id:3!null o_ol_cnt:7 + │ └── ordering: +3,+2 + └── aggregations + └── sum [as=sum:11, outer=(7)] + └── o_ol_cnt:7 + +opt format=hide-qual isolation=ReadCommitted +SELECT count(*) +FROM order_line +GROUP BY ol_w_id, ol_d_id +ORDER BY ol_w_id, ol_d_id +---- +group-by (streaming) + ├── columns: count:13!null [hidden: ol_d_id:2!null ol_w_id:3!null] + ├── grouping columns: ol_d_id:2!null ol_w_id:3!null + ├── key: (2,3) + ├── fd: (2,3)-->(13) + ├── ordering: +3,+2 + ├── scan order_line + │ ├── columns: ol_d_id:2!null ol_w_id:3!null + │ └── ordering: +3,+2 + └── aggregations + └── count-rows [as=count_rows:13] + +opt format=hide-qual isolation=ReadCommitted +(SELECT no_w_id, no_d_id, no_o_id FROM new_order) +EXCEPT ALL +(SELECT o_w_id, o_d_id, o_id FROM "order" WHERE o_carrier_id IS NULL) +---- +except-all + ├── columns: no_w_id:3!null no_d_id:2!null no_o_id:1!null + ├── left columns: no_w_id:3!null no_d_id:2!null no_o_id:1!null + ├── right columns: o_w_id:8 o_d_id:7 o_id:6 + ├── key: (1-3) + ├── scan new_order + │ ├── columns: no_o_id:1!null no_d_id:2!null no_w_id:3!null + │ └── key: (1-3) + └── project + ├── columns: o_id:6!null o_d_id:7!null o_w_id:8!null + ├── key: (6-8) + └── select + ├── columns: o_id:6!null o_d_id:7!null o_w_id:8!null o_carrier_id:11 + ├── key: (6-8) + ├── fd: ()-->(11) + ├── scan order@order_idx + │ ├── columns: o_id:6!null o_d_id:7!null o_w_id:8!null o_carrier_id:11 + │ ├── key: (6-8) + │ └── fd: (6-8)-->(11) + └── filters + └── o_carrier_id:11 IS NULL [outer=(11), constraints=(/11: [/NULL - /NULL]; tight), fd=()-->(11)] + +opt format=hide-qual isolation=ReadCommitted +(SELECT o_w_id, o_d_id, o_id FROM "order" WHERE o_carrier_id IS NULL) +EXCEPT ALL +(SELECT no_w_id, no_d_id, no_o_id FROM new_order) +---- +except-all + ├── columns: o_w_id:3!null o_d_id:2!null o_id:1!null + ├── left columns: o_w_id:3!null o_d_id:2!null o_id:1!null + ├── right columns: no_w_id:13 no_d_id:12 no_o_id:11 + ├── key: (1-3) + ├── project + │ ├── columns: o_id:1!null o_d_id:2!null o_w_id:3!null + │ ├── key: (1-3) + │ └── select + │ ├── columns: o_id:1!null o_d_id:2!null o_w_id:3!null o_carrier_id:6 + │ ├── key: (1-3) + │ ├── fd: ()-->(6) + │ ├── scan order@order_idx + │ │ ├── columns: o_id:1!null o_d_id:2!null o_w_id:3!null o_carrier_id:6 + │ │ ├── key: (1-3) + │ │ └── fd: (1-3)-->(6) + │ └── filters + │ └── o_carrier_id:6 IS NULL [outer=(6), constraints=(/6: [/NULL - /NULL]; tight), fd=()-->(6)] + └── scan new_order + ├── columns: no_o_id:11!null no_d_id:12!null no_w_id:13!null + └── key: (11-13) + +opt format=hide-qual isolation=ReadCommitted +( + SELECT o_w_id, o_d_id, o_id, o_ol_cnt + FROM "order" + ORDER BY o_w_id, o_d_id, o_id DESC +) +EXCEPT ALL +( + SELECT ol_w_id, ol_d_id, ol_o_id, count(*) + FROM order_line + GROUP BY (ol_w_id, ol_d_id, ol_o_id) + ORDER BY ol_w_id, ol_d_id, ol_o_id DESC +) +---- +except-all + ├── columns: o_w_id:3!null o_d_id:2!null o_id:1!null o_ol_cnt:7 + ├── left columns: o_w_id:3!null o_d_id:2!null o_id:1!null o_ol_cnt:7 + ├── right columns: ol_w_id:13 ol_d_id:12 ol_o_id:11 count_rows:23 + ├── internal-ordering: +3,+2,-1,+7 + ├── key: (1-3) + ├── fd: (1-3)-->(7) + ├── scan order + │ ├── columns: o_id:1!null o_d_id:2!null o_w_id:3!null o_ol_cnt:7 + │ ├── key: (1-3) + │ ├── fd: (1-3)-->(7) + │ └── ordering: +3,+2,-1 + └── group-by (streaming) + ├── columns: ol_o_id:11!null ol_d_id:12!null ol_w_id:13!null count_rows:23!null + ├── grouping columns: ol_o_id:11!null ol_d_id:12!null ol_w_id:13!null + ├── key: (11-13) + ├── fd: (11-13)-->(23) + ├── ordering: +13,+12,-11 + ├── scan order_line + │ ├── columns: ol_o_id:11!null ol_d_id:12!null ol_w_id:13!null + │ └── ordering: +13,+12,-11 + └── aggregations + └── count-rows [as=count_rows:23] + +opt format=hide-qual isolation=ReadCommitted +( + SELECT ol_w_id, ol_d_id, ol_o_id, count(*) + FROM order_line + GROUP BY (ol_w_id, ol_d_id, ol_o_id) + ORDER BY ol_w_id, ol_d_id, ol_o_id DESC +) +EXCEPT ALL +( + SELECT o_w_id, o_d_id, o_id, o_ol_cnt + FROM "order" + ORDER BY o_w_id, o_d_id, o_id DESC +) +---- +except-all + ├── columns: ol_w_id:3!null ol_d_id:2!null ol_o_id:1!null count:13 + ├── left columns: ol_w_id:3!null ol_d_id:2!null ol_o_id:1!null count_rows:13 + ├── right columns: o_w_id:16 o_d_id:15 o_id:14 o_ol_cnt:20 + ├── internal-ordering: +3,+2,-1,+13 + ├── key: (1-3) + ├── fd: (1-3)-->(13) + ├── group-by (streaming) + │ ├── columns: ol_o_id:1!null ol_d_id:2!null ol_w_id:3!null count_rows:13!null + │ ├── grouping columns: ol_o_id:1!null ol_d_id:2!null ol_w_id:3!null + │ ├── key: (1-3) + │ ├── fd: (1-3)-->(13) + │ ├── ordering: +3,+2,-1 + │ ├── scan order_line + │ │ ├── columns: ol_o_id:1!null ol_d_id:2!null ol_w_id:3!null + │ │ └── ordering: +3,+2,-1 + │ └── aggregations + │ └── count-rows [as=count_rows:13] + └── scan order + ├── columns: o_id:14!null o_d_id:15!null o_w_id:16!null o_ol_cnt:20 + ├── key: (14-16) + ├── fd: (14-16)-->(20) + └── ordering: +16,+15,-14 + +opt format=hide-qual isolation=ReadCommitted +SELECT count(*) +FROM +( + SELECT o_w_id, o_d_id, o_id + FROM "order" + WHERE o_carrier_id IS NULL +) +FULL OUTER JOIN +( + SELECT ol_w_id, ol_d_id, ol_o_id + FROM order_line + WHERE ol_delivery_d IS NULL +) +ON (ol_w_id = o_w_id AND ol_d_id = o_d_id AND ol_o_id = o_id) +WHERE ol_o_id IS NULL OR o_id IS NULL +---- +scalar-group-by + ├── columns: count:23!null + ├── cardinality: [1 - 1] + ├── key: () + ├── fd: ()-->(23) + ├── select + │ ├── columns: o_id:1 o_d_id:2 o_w_id:3 ol_o_id:11 ol_d_id:12 ol_w_id:13 + │ ├── full-join (merge) + │ │ ├── columns: o_id:1 o_d_id:2 o_w_id:3 ol_o_id:11 ol_d_id:12 ol_w_id:13 + │ │ ├── left ordering: +13,+12,-11 + │ │ ├── right ordering: +3,+2,-1 + │ │ ├── project + │ │ │ ├── columns: ol_o_id:11!null ol_d_id:12!null ol_w_id:13!null + │ │ │ ├── ordering: +13,+12,-11 + │ │ │ └── select + │ │ │ ├── columns: ol_o_id:11!null ol_d_id:12!null ol_w_id:13!null ol_delivery_d:17 + │ │ │ ├── fd: ()-->(17) + │ │ │ ├── ordering: +13,+12,-11 opt(17) [actual: +13,+12,-11] + │ │ │ ├── scan order_line + │ │ │ │ ├── columns: ol_o_id:11!null ol_d_id:12!null ol_w_id:13!null ol_delivery_d:17 + │ │ │ │ └── ordering: +13,+12,-11 + │ │ │ └── filters + │ │ │ └── ol_delivery_d:17 IS NULL [outer=(17), constraints=(/17: [/NULL - /NULL]; tight), fd=()-->(17)] + │ │ ├── project + │ │ │ ├── columns: o_id:1!null o_d_id:2!null o_w_id:3!null + │ │ │ ├── key: (1-3) + │ │ │ ├── ordering: +3,+2,-1 + │ │ │ └── select + │ │ │ ├── columns: o_id:1!null o_d_id:2!null o_w_id:3!null o_carrier_id:6 + │ │ │ ├── key: (1-3) + │ │ │ ├── fd: ()-->(6) + │ │ │ ├── ordering: +3,+2,-1 opt(6) [actual: +3,+2,-1] + │ │ │ ├── scan order + │ │ │ │ ├── columns: o_id:1!null o_d_id:2!null o_w_id:3!null o_carrier_id:6 + │ │ │ │ ├── key: (1-3) + │ │ │ │ ├── fd: (1-3)-->(6) + │ │ │ │ └── ordering: +3,+2,-1 + │ │ │ └── filters + │ │ │ └── o_carrier_id:6 IS NULL [outer=(6), constraints=(/6: [/NULL - /NULL]; tight), fd=()-->(6)] + │ │ └── filters (true) + │ └── filters + │ └── (ol_o_id:11 IS NULL) OR (o_id:1 IS NULL) [outer=(1,11)] + └── aggregations + └── count-rows [as=count_rows:23] diff --git a/pkg/sql/opt/xform/testdata/rules/select b/pkg/sql/opt/xform/testdata/rules/select index b3073ccddeef..2d56dc456e28 100644 --- a/pkg/sql/opt/xform/testdata/rules/select +++ b/pkg/sql/opt/xform/testdata/rules/select @@ -11523,7 +11523,7 @@ select ├── scan t85356 │ └── columns: c0:1 └── filters - ├── c0:1 = CASE WHEN (c0:1 IS NOT DISTINCT FROM CAST(NULL AS DECIMAL(15,3))) AND CAST(NULL AS BOOL) THEN c0:1 ELSE 1.100 END [outer=(1), immutable, constraints=(/1: (/NULL - ])] + ├── c0:1 = CASE WHEN (c0:1 IS NOT DISTINCT FROM CAST(NULL AS DECIMAL(15,3))) AND CAST(NULL AS BOOL) THEN c0:1::DECIMAL ELSE 1.1 END [outer=(1), immutable, constraints=(/1: (/NULL - ])] └── c0:1 = 2 [outer=(1), immutable, constraints=(/1: [/2 - /2]; tight), fd=()-->(1)] exec-ddl diff --git a/pkg/sql/pgrepl/pgreplparser/BUILD.bazel b/pkg/sql/pgrepl/pgreplparser/BUILD.bazel new file mode 100644 index 000000000000..b060ada76513 --- /dev/null +++ b/pkg/sql/pgrepl/pgreplparser/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "pgreplparser", + srcs = ["pgrepl.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/pgrepl/pgreplparser", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + ], +) diff --git a/pkg/sql/pgrepl/pgreplparser/pgrepl.go b/pkg/sql/pgrepl/pgreplparser/pgrepl.go new file mode 100644 index 000000000000..ad67e02d571d --- /dev/null +++ b/pkg/sql/pgrepl/pgreplparser/pgrepl.go @@ -0,0 +1,1062 @@ +// Code generated by goyacc -p pgrepl -o bazel-out/darwin_arm64-fastbuild/bin/pkg/sql/pgrepl/pgreplparser/pgrepl.go pgrepl-gen.y. DO NOT EDIT. + +//line pgrepl-gen.y:2 + +/*------------------------------------------------------------------------- + * + * repl_gram.y - Parser for the replication commands + * + * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * src/backend/replication/repl_gram.y + * + *------------------------------------------------------------------------- + */ + +package pgreplparser + +import __yyfmt__ "fmt" + +//line pgrepl-gen.y:17 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/pgrepl/lsn" + "github.com/cockroachdb/cockroach/pkg/sql/pgrepl/pgrepltree" + "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode" + "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" +) + +//line pgrepl-gen.y:29 + +func (s *pgreplSymType) ID() int32 { + return s.id +} + +func (s *pgreplSymType) SetID(id int32) { + s.id = id +} + +func (s *pgreplSymType) Pos() int32 { + return s.pos +} + +func (s *pgreplSymType) SetPos(pos int32) { + s.pos = pos +} + +func (s *pgreplSymType) Str() string { + return s.str +} + +func (s *pgreplSymType) SetStr(str string) { + s.str = str +} + +func (s *pgreplSymType) UnionVal() interface{} { + return s.union.val +} + +func (s *pgreplSymType) SetUnionVal(val interface{}) { + s.union.val = val +} + +type pgreplSymUnion struct { + val interface{} +} + +func (u *pgreplSymUnion) replicationStatement() pgrepltree.ReplicationStatement { + return u.val.(pgrepltree.ReplicationStatement) +} + +func (u *pgreplSymUnion) identifySystem() *pgrepltree.IdentifySystem { + return u.val.(*pgrepltree.IdentifySystem) +} + +func (u *pgreplSymUnion) readReplicationSlot() *pgrepltree.ReadReplicationSlot { + return u.val.(*pgrepltree.ReadReplicationSlot) +} + +func (u *pgreplSymUnion) createReplicationSlot() *pgrepltree.CreateReplicationSlot { + return u.val.(*pgrepltree.CreateReplicationSlot) +} + +func (u *pgreplSymUnion) dropReplicationSlot() *pgrepltree.DropReplicationSlot { + return u.val.(*pgrepltree.DropReplicationSlot) +} + +func (u *pgreplSymUnion) startReplication() *pgrepltree.StartReplication { + return u.val.(*pgrepltree.StartReplication) +} + +func (u *pgreplSymUnion) timelineHistory() *pgrepltree.TimelineHistory { + return u.val.(*pgrepltree.TimelineHistory) +} + +func (u *pgreplSymUnion) option() pgrepltree.Option { + return u.val.(pgrepltree.Option) +} + +func (u *pgreplSymUnion) options() pgrepltree.Options { + return u.val.(pgrepltree.Options) +} + +func (u *pgreplSymUnion) numVal() *tree.NumVal { + return u.val.(*tree.NumVal) +} + +func (u *pgreplSymUnion) expr() tree.Expr { + return u.val.(tree.Expr) +} + +func (u *pgreplSymUnion) bool() bool { + return u.val.(bool) +} + +func (u *pgreplSymUnion) lsn() lsn.LSN { + return u.val.(lsn.LSN) +} + +//line pgrepl-gen.y:119 +type pgreplSymType struct { + yys int + id int32 + pos int32 + str string + union pgreplSymUnion +} + +const SCONST = 57346 +const IDENT = 57347 +const UCONST = 57348 +const RECPTR = 57349 +const ERROR = 57350 +const K_BASE_BACKUP = 57351 +const K_IDENTIFY_SYSTEM = 57352 +const K_READ_REPLICATION_SLOT = 57353 +const K_START_REPLICATION = 57354 +const K_CREATE_REPLICATION_SLOT = 57355 +const K_DROP_REPLICATION_SLOT = 57356 +const K_TIMELINE_HISTORY = 57357 +const K_WAIT = 57358 +const K_TIMELINE = 57359 +const K_PHYSICAL = 57360 +const K_LOGICAL = 57361 +const K_SLOT = 57362 +const K_RESERVE_WAL = 57363 +const K_TEMPORARY = 57364 +const K_TWO_PHASE = 57365 +const K_EXPORT_SNAPSHOT = 57366 +const K_NOEXPORT_SNAPSHOT = 57367 +const K_USE_SNAPSHOT = 57368 + +var pgreplToknames = [...]string{ + "$end", + "error", + "$unk", + "SCONST", + "IDENT", + "UCONST", + "RECPTR", + "ERROR", + "K_BASE_BACKUP", + "K_IDENTIFY_SYSTEM", + "K_READ_REPLICATION_SLOT", + "K_START_REPLICATION", + "K_CREATE_REPLICATION_SLOT", + "K_DROP_REPLICATION_SLOT", + "K_TIMELINE_HISTORY", + "K_WAIT", + "K_TIMELINE", + "K_PHYSICAL", + "K_LOGICAL", + "K_SLOT", + "K_RESERVE_WAL", + "K_TEMPORARY", + "K_TWO_PHASE", + "K_EXPORT_SNAPSHOT", + "K_NOEXPORT_SNAPSHOT", + "K_USE_SNAPSHOT", + "';'", + "'('", + "')'", + "','", +} + +var pgreplStatenames = [...]string{} + +const pgreplEofCode = 1 +const pgreplErrCode = 2 +const pgreplInitialStackSize = 16 + +//line pgrepl-gen.y:503 + +//line yacctab:1 +var pgreplExca = [...]int8{ + -1, 1, + 1, -1, + -2, 0, +} + +const pgreplPrivate = 57344 + +const pgreplLast = 91 + +var pgreplAct = [...]int8{ + 83, 67, 27, 28, 30, 86, 87, 68, 31, 32, + 73, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 85, 55, 19, 54, + 55, 79, 20, 80, 76, 77, 78, 52, 12, 11, + 16, 13, 14, 15, 17, 61, 62, 53, 22, 60, + 49, 65, 57, 56, 58, 89, 66, 59, 71, 63, + 26, 84, 70, 50, 25, 24, 23, 48, 18, 75, + 69, 74, 81, 51, 29, 21, 88, 82, 72, 64, + 10, 9, 3, 8, 7, 6, 5, 4, 90, 2, + 1, +} + +var pgreplPact = [...]int16{ + 29, -1000, 1, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, 4, 28, 61, 60, 59, 54, -1000, -1000, + -1, 32, 58, 15, 31, -1000, -1000, 0, -1000, 48, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 50, -1000, + 30, 27, -1000, -1000, -1000, -1, -1000, -1000, -1000, 34, + 49, -21, 57, -1000, -1000, 52, -18, -1000, -1, 10, + -21, -1000, -1000, 56, -3, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -24, -1000, 51, -1000, -1000, 56, -1000, -1000, + -1000, +} + +var pgreplPgo = [...]int8{ + 0, 90, 89, 87, 86, 85, 84, 83, 82, 81, + 80, 2, 3, 79, 78, 77, 0, 76, 75, 74, + 73, 1, 70, 69, 68, 67, +} + +var pgreplR1 = [...]int8{ + 0, 1, 24, 24, 2, 2, 2, 2, 2, 2, + 2, 2, 8, 9, 3, 3, 6, 6, 21, 21, + 22, 22, 23, 23, 23, 23, 23, 7, 7, 4, + 5, 10, 25, 25, 20, 20, 18, 18, 13, 13, + 14, 14, 15, 15, 16, 17, 17, 11, 11, 12, + 12, 12, 12, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, +} + +var pgreplR2 = [...]int8{ + 0, 2, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 4, 1, 5, 6, 3, 1, + 2, 0, 1, 1, 1, 1, 1, 2, 3, 5, + 6, 2, 1, 0, 1, 0, 2, 0, 2, 0, + 3, 0, 1, 3, 2, 1, 0, 3, 1, 1, + 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, +} + +var pgreplChk = [...]int16{ + -1000, -1, -2, -8, -3, -4, -5, -6, -7, -9, + -10, 10, 9, 12, 13, 14, 11, 15, -24, 27, + 28, -18, 20, 5, 5, 5, 6, -11, -12, -19, + 5, 9, 10, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, -25, 18, + 5, -20, 22, 16, 29, 30, 5, 4, 6, 7, + 19, 18, 19, -12, -13, 17, 7, -21, 28, -22, + 5, 6, -14, 28, -11, -23, 24, 25, 26, 21, + 23, -21, -15, -16, 5, 29, 29, 30, -17, 4, + -16, +} + +var pgreplDef = [...]int8{ + 0, -2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 15, 37, 0, 0, 0, 0, 1, 2, + 0, 33, 0, 35, 27, 13, 31, 0, 48, 49, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 0, 32, + 36, 0, 34, 28, 14, 0, 50, 51, 52, 39, + 0, 21, 0, 47, 29, 0, 41, 16, 0, 19, + 21, 38, 30, 0, 0, 20, 22, 23, 24, 25, + 26, 17, 0, 42, 46, 18, 40, 0, 44, 45, + 43, +} + +var pgreplTok1 = [...]int8{ + 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 28, 29, 3, 3, 30, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 27, +} + +var pgreplTok2 = [...]int8{ + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, +} + +var pgreplTok3 = [...]int8{ + 0, +} + +var pgreplErrorMessages = [...]struct { + state int + token int + msg string +}{} + +//line yaccpar:1 + +/* parser for yacc output */ + +var ( + pgreplDebug = 0 + pgreplErrorVerbose = false +) + +type pgreplLexer interface { + Lex(lval *pgreplSymType) int + Error(s string) +} + +type pgreplParser interface { + Parse(pgreplLexer) int + Lookahead() int +} + +type pgreplParserImpl struct { + lval pgreplSymType + stack [pgreplInitialStackSize]pgreplSymType + char int +} + +func (p *pgreplParserImpl) Lookahead() int { + return p.char +} + +func pgreplNewParser() pgreplParser { + return &pgreplParserImpl{} +} + +const pgreplFlag = -1000 + +func pgreplTokname(c int) string { + if c >= 1 && c-1 < len(pgreplToknames) { + if pgreplToknames[c-1] != "" { + return pgreplToknames[c-1] + } + } + return __yyfmt__.Sprintf("tok-%v", c) +} + +func pgreplStatname(s int) string { + if s >= 0 && s < len(pgreplStatenames) { + if pgreplStatenames[s] != "" { + return pgreplStatenames[s] + } + } + return __yyfmt__.Sprintf("state-%v", s) +} + +func pgreplErrorMessage(state, lookAhead int) string { + const TOKSTART = 4 + + if !pgreplErrorVerbose { + return "syntax error" + } + + for _, e := range pgreplErrorMessages { + if e.state == state && e.token == lookAhead { + return "syntax error: " + e.msg + } + } + + res := "syntax error: unexpected " + pgreplTokname(lookAhead) + + // To match Bison, suggest at most four expected tokens. + expected := make([]int, 0, 4) + + // Look for shiftable tokens. + base := int(pgreplPact[state]) + for tok := TOKSTART; tok-1 < len(pgreplToknames); tok++ { + if n := base + tok; n >= 0 && n < pgreplLast && int(pgreplChk[int(pgreplAct[n])]) == tok { + if len(expected) == cap(expected) { + return res + } + expected = append(expected, tok) + } + } + + if pgreplDef[state] == -2 { + i := 0 + for pgreplExca[i] != -1 || int(pgreplExca[i+1]) != state { + i += 2 + } + + // Look for tokens that we accept or reduce. + for i += 2; pgreplExca[i] >= 0; i += 2 { + tok := int(pgreplExca[i]) + if tok < TOKSTART || pgreplExca[i+1] == 0 { + continue + } + if len(expected) == cap(expected) { + return res + } + expected = append(expected, tok) + } + + // If the default action is to accept or reduce, give up. + if pgreplExca[i+1] != 0 { + return res + } + } + + for i, tok := range expected { + if i == 0 { + res += ", expecting " + } else { + res += " or " + } + res += pgreplTokname(tok) + } + return res +} + +func pgrepllex1(lex pgreplLexer, lval *pgreplSymType) (char, token int) { + token = 0 + char = lex.Lex(lval) + if char <= 0 { + token = int(pgreplTok1[0]) + goto out + } + if char < len(pgreplTok1) { + token = int(pgreplTok1[char]) + goto out + } + if char >= pgreplPrivate { + if char < pgreplPrivate+len(pgreplTok2) { + token = int(pgreplTok2[char-pgreplPrivate]) + goto out + } + } + for i := 0; i < len(pgreplTok3); i += 2 { + token = int(pgreplTok3[i+0]) + if token == char { + token = int(pgreplTok3[i+1]) + goto out + } + } + +out: + if token == 0 { + token = int(pgreplTok2[1]) /* unknown char */ + } + if pgreplDebug >= 3 { + __yyfmt__.Printf("lex %s(%d)\n", pgreplTokname(token), uint(char)) + } + return char, token +} + +func pgreplParse(pgrepllex pgreplLexer) int { + return pgreplNewParser().Parse(pgrepllex) +} + +func (pgreplrcvr *pgreplParserImpl) Parse(pgrepllex pgreplLexer) int { + var pgrepln int + var pgreplVAL pgreplSymType + var pgreplDollar []pgreplSymType + _ = pgreplDollar // silence set and not used + pgreplS := pgreplrcvr.stack[:] + + Nerrs := 0 /* number of errors */ + Errflag := 0 /* error recovery flag */ + pgreplstate := 0 + pgreplrcvr.char = -1 + pgrepltoken := -1 // pgreplrcvr.char translated into internal numbering + defer func() { + // Make sure we report no lookahead when not parsing. + pgreplstate = -1 + pgreplrcvr.char = -1 + pgrepltoken = -1 + }() + pgreplp := -1 + goto pgreplstack + +ret0: + return 0 + +ret1: + return 1 + +pgreplstack: + /* put a state and value onto the stack */ + if pgreplDebug >= 4 { + __yyfmt__.Printf("char %v in %v\n", pgreplTokname(pgrepltoken), pgreplStatname(pgreplstate)) + } + + pgreplp++ + if pgreplp >= len(pgreplS) { + nyys := make([]pgreplSymType, len(pgreplS)*2) + copy(nyys, pgreplS) + pgreplS = nyys + } + pgreplS[pgreplp] = pgreplVAL + pgreplS[pgreplp].yys = pgreplstate + +pgreplnewstate: + pgrepln = int(pgreplPact[pgreplstate]) + if pgrepln <= pgreplFlag { + goto pgrepldefault /* simple state */ + } + if pgreplrcvr.char < 0 { + pgreplrcvr.char, pgrepltoken = pgrepllex1(pgrepllex, &pgreplrcvr.lval) + } + pgrepln += pgrepltoken + if pgrepln < 0 || pgrepln >= pgreplLast { + goto pgrepldefault + } + pgrepln = int(pgreplAct[pgrepln]) + if int(pgreplChk[pgrepln]) == pgrepltoken { /* valid shift */ + pgreplrcvr.char = -1 + pgrepltoken = -1 + pgreplVAL = pgreplrcvr.lval + pgreplstate = pgrepln + if Errflag > 0 { + Errflag-- + } + goto pgreplstack + } + +pgrepldefault: + /* default state action */ + pgrepln = int(pgreplDef[pgreplstate]) + if pgrepln == -2 { + if pgreplrcvr.char < 0 { + pgreplrcvr.char, pgrepltoken = pgrepllex1(pgrepllex, &pgreplrcvr.lval) + } + + /* look through exception table */ + xi := 0 + for { + if pgreplExca[xi+0] == -1 && int(pgreplExca[xi+1]) == pgreplstate { + break + } + xi += 2 + } + for xi += 2; ; xi += 2 { + pgrepln = int(pgreplExca[xi+0]) + if pgrepln < 0 || pgrepln == pgrepltoken { + break + } + } + pgrepln = int(pgreplExca[xi+1]) + if pgrepln < 0 { + goto ret0 + } + } + if pgrepln == 0 { + /* error ... attempt to resume parsing */ + switch Errflag { + case 0: /* brand new error */ + pgrepllex.Error(pgreplErrorMessage(pgreplstate, pgrepltoken)) + Nerrs++ + if pgreplDebug >= 1 { + __yyfmt__.Printf("%s", pgreplStatname(pgreplstate)) + __yyfmt__.Printf(" saw %s\n", pgreplTokname(pgrepltoken)) + } + fallthrough + + case 1, 2: /* incompletely recovered error ... try again */ + Errflag = 3 + + /* find a state where "error" is a legal shift action */ + for pgreplp >= 0 { + pgrepln = int(pgreplPact[pgreplS[pgreplp].yys]) + pgreplErrCode + if pgrepln >= 0 && pgrepln < pgreplLast { + pgreplstate = int(pgreplAct[pgrepln]) /* simulate a shift of "error" */ + if int(pgreplChk[pgreplstate]) == pgreplErrCode { + goto pgreplstack + } + } + + /* the current p has no shift on "error", pop stack */ + if pgreplDebug >= 2 { + __yyfmt__.Printf("error recovery pops state %d\n", pgreplS[pgreplp].yys) + } + pgreplp-- + } + /* there is no state on the stack with an error shift ... abort */ + goto ret1 + + case 3: /* no shift yet; clobber input char */ + if pgreplDebug >= 2 { + __yyfmt__.Printf("error recovery discards %s\n", pgreplTokname(pgrepltoken)) + } + if pgrepltoken == pgreplEofCode { + goto ret1 + } + pgreplrcvr.char = -1 + pgrepltoken = -1 + goto pgreplnewstate /* try again in the same state */ + } + } + + /* reduction by production pgrepln */ + if pgreplDebug >= 2 { + __yyfmt__.Printf("reduce %v in:\n\t%v\n", pgrepln, pgreplStatname(pgreplstate)) + } + + pgreplnt := pgrepln + pgreplpt := pgreplp + _ = pgreplpt // guard against "declared and not used" + + pgreplp -= int(pgreplR2[pgrepln]) + // pgreplp is now the index of $0. Perform the default action. Iff the + // reduced production is ε, $1 is possibly out of range. + if pgreplp+1 >= len(pgreplS) { + nyys := make([]pgreplSymType, len(pgreplS)*2) + copy(nyys, pgreplS) + pgreplS = nyys + } + pgreplVAL = pgreplS[pgreplp+1] + + /* consult goto table to find next state */ + pgrepln = int(pgreplR1[pgrepln]) + pgreplg := int(pgreplPgo[pgrepln]) + pgreplj := pgreplg + pgreplS[pgreplp].yys + 1 + + if pgreplj >= pgreplLast { + pgreplstate = int(pgreplAct[pgreplg]) + } else { + pgreplstate = int(pgreplAct[pgreplj]) + if int(pgreplChk[pgreplstate]) != -pgrepln { + pgreplstate = int(pgreplAct[pgreplg]) + } + } + // dummy call; replaced with literal code + switch pgreplnt { + + case 1: + pgreplDollar = pgreplS[pgreplpt-2 : pgreplpt+1] +//line pgrepl-gen.y:172 + { + pgrepllex.(*lexer).stmt = pgreplDollar[1].union.replicationStatement() + } + case 12: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:197 + { + pgreplVAL.union.val = &pgrepltree.IdentifySystem{} + } + case 13: + pgreplDollar = pgreplS[pgreplpt-2 : pgreplpt+1] +//line pgrepl-gen.y:208 + { + pgreplVAL.union.val = &pgrepltree.ReadReplicationSlot{ + Slot: tree.Name(pgreplDollar[2].str), + } + } + case 14: + pgreplDollar = pgreplS[pgreplpt-4 : pgreplpt+1] +//line pgrepl-gen.y:239 + { + pgreplVAL.union.val = &pgrepltree.BaseBackup{ + Options: pgreplDollar[3].union.options(), + } + } + case 15: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:245 + { + pgreplVAL.union.val = &pgrepltree.BaseBackup{} + } + case 16: + pgreplDollar = pgreplS[pgreplpt-5 : pgreplpt+1] +//line pgrepl-gen.y:253 + { + pgreplVAL.union.val = &pgrepltree.CreateReplicationSlot{ + Slot: tree.Name(pgreplDollar[2].str), + Temporary: pgreplDollar[3].union.bool(), + Kind: pgrepltree.PhysicalReplication, + Options: pgreplDollar[5].union.options(), + } + } + case 17: + pgreplDollar = pgreplS[pgreplpt-6 : pgreplpt+1] +//line pgrepl-gen.y:263 + { + pgreplVAL.union.val = &pgrepltree.CreateReplicationSlot{ + Slot: tree.Name(pgreplDollar[2].str), + Temporary: pgreplDollar[3].union.bool(), + Kind: pgrepltree.LogicalReplication, + Plugin: tree.Name(pgreplDollar[5].str), + Options: pgreplDollar[6].union.options(), + } + } + case 18: + pgreplDollar = pgreplS[pgreplpt-3 : pgreplpt+1] +//line pgrepl-gen.y:275 + { + pgreplVAL.union = pgreplDollar[2].union + } + case 19: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:276 + { + pgreplVAL.union = pgreplDollar[1].union + } + case 20: + pgreplDollar = pgreplS[pgreplpt-2 : pgreplpt+1] +//line pgrepl-gen.y:281 + { + pgreplVAL.union.val = append(pgreplDollar[1].union.options(), pgreplDollar[2].union.option()) + } + case 21: + pgreplDollar = pgreplS[pgreplpt-0 : pgreplpt+1] +//line pgrepl-gen.y:283 + { + pgreplVAL.union.val = pgrepltree.Options(nil) + } + case 22: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:288 + { + pgreplVAL.union.val = pgrepltree.Option{ + Key: tree.Name("snapshot"), + Value: tree.NewStrVal("export"), + } + } + case 23: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:295 + { + pgreplVAL.union.val = pgrepltree.Option{ + Key: tree.Name("snapshot"), + Value: tree.NewStrVal("nothing"), + } + } + case 24: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:302 + { + pgreplVAL.union.val = pgrepltree.Option{ + Key: tree.Name("snapshot"), + Value: tree.NewStrVal("use"), + } + } + case 25: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:309 + { + pgreplVAL.union.val = pgrepltree.Option{ + Key: tree.Name("reserve_wal"), + Value: tree.NewStrVal("true"), + } + } + case 26: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:316 + { + pgreplVAL.union.val = pgrepltree.Option{ + Key: tree.Name("two_phase"), + Value: tree.NewStrVal("true"), + } + } + case 27: + pgreplDollar = pgreplS[pgreplpt-2 : pgreplpt+1] +//line pgrepl-gen.y:327 + { + pgreplVAL.union.val = &pgrepltree.DropReplicationSlot{ + Slot: tree.Name(pgreplDollar[2].str), + } + } + case 28: + pgreplDollar = pgreplS[pgreplpt-3 : pgreplpt+1] +//line pgrepl-gen.y:333 + { + pgreplVAL.union.val = &pgrepltree.DropReplicationSlot{ + Slot: tree.Name(pgreplDollar[2].str), + Wait: true, + } + } + case 29: + pgreplDollar = pgreplS[pgreplpt-5 : pgreplpt+1] +//line pgrepl-gen.y:346 + { + ret := &pgrepltree.StartReplication{ + Slot: tree.Name(pgreplDollar[2].str), + Kind: pgrepltree.PhysicalReplication, + LSN: pgreplDollar[4].union.lsn(), + } + if pgreplDollar[5].union.val != nil { + ret.Timeline = pgreplDollar[5].union.numVal() + } + pgreplVAL.union.val = ret + } + case 30: + pgreplDollar = pgreplS[pgreplpt-6 : pgreplpt+1] +//line pgrepl-gen.y:362 + { + pgreplVAL.union.val = &pgrepltree.StartReplication{ + Slot: tree.Name(pgreplDollar[3].str), + Kind: pgrepltree.LogicalReplication, + LSN: pgreplDollar[5].union.lsn(), + Options: pgreplDollar[6].union.options(), + } + } + case 31: + pgreplDollar = pgreplS[pgreplpt-2 : pgreplpt+1] +//line pgrepl-gen.y:376 + { + if i, err := pgreplDollar[2].union.numVal().AsInt64(); err != nil || uint64(i) <= 0 { + pgrepllex.(*lexer).setErr(pgerror.Newf(pgcode.Syntax, "expected a positive integer for timeline")) + return 1 + } + pgreplVAL.union.val = &pgrepltree.TimelineHistory{Timeline: pgreplDollar[2].union.numVal()} + } + case 34: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:391 + { + pgreplVAL.union.val = true + } + case 35: + pgreplDollar = pgreplS[pgreplpt-0 : pgreplpt+1] +//line pgrepl-gen.y:392 + { + pgreplVAL.union.val = false + } + case 36: + pgreplDollar = pgreplS[pgreplpt-2 : pgreplpt+1] +//line pgrepl-gen.y:397 + { + pgreplVAL.str = pgreplDollar[2].str + } + case 37: + pgreplDollar = pgreplS[pgreplpt-0 : pgreplpt+1] +//line pgrepl-gen.y:399 + { + pgreplVAL.str = "" + } + case 38: + pgreplDollar = pgreplS[pgreplpt-2 : pgreplpt+1] +//line pgrepl-gen.y:404 + { + if i, err := pgreplDollar[2].union.numVal().AsInt64(); err != nil || uint64(i) <= 0 { + pgrepllex.(*lexer).setErr(pgerror.Newf(pgcode.Syntax, "expected a positive integer for timeline")) + return 1 + } + pgreplVAL.union.val = pgreplDollar[2].union.numVal() + } + case 39: + pgreplDollar = pgreplS[pgreplpt-0 : pgreplpt+1] +//line pgrepl-gen.y:411 + { + pgreplVAL.union.val = nil + } + case 40: + pgreplDollar = pgreplS[pgreplpt-3 : pgreplpt+1] +//line pgrepl-gen.y:416 + { + pgreplVAL.union = pgreplDollar[2].union + } + case 41: + pgreplDollar = pgreplS[pgreplpt-0 : pgreplpt+1] +//line pgrepl-gen.y:417 + { + pgreplVAL.union.val = pgrepltree.Options(nil) + } + case 42: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:422 + { + pgreplVAL.union.val = pgrepltree.Options{pgreplDollar[1].union.option()} + } + case 43: + pgreplDollar = pgreplS[pgreplpt-3 : pgreplpt+1] +//line pgrepl-gen.y:426 + { + pgreplVAL.union.val = append(pgreplDollar[1].union.options(), pgreplDollar[3].union.option()) + } + case 44: + pgreplDollar = pgreplS[pgreplpt-2 : pgreplpt+1] +//line pgrepl-gen.y:433 + { + pgreplVAL.union.val = pgrepltree.Option{ + Key: tree.Name(pgreplDollar[1].str), + Value: pgreplDollar[2].union.expr(), + } + } + case 45: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:442 + { + pgreplVAL.union.val = tree.NewStrVal(pgreplDollar[1].str) + } + case 46: + pgreplDollar = pgreplS[pgreplpt-0 : pgreplpt+1] +//line pgrepl-gen.y:443 + { + pgreplVAL.union.val = tree.Expr(nil) + } + case 47: + pgreplDollar = pgreplS[pgreplpt-3 : pgreplpt+1] +//line pgrepl-gen.y:448 + { + pgreplVAL.union.val = append(pgreplDollar[1].union.options(), pgreplDollar[3].union.option()) + } + case 48: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:450 + { + pgreplVAL.union.val = pgrepltree.Options{pgreplDollar[1].union.option()} + } + case 49: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:455 + { + pgreplVAL.union.val = pgrepltree.Option{Key: tree.Name(pgreplDollar[1].str)} + } + case 50: + pgreplDollar = pgreplS[pgreplpt-2 : pgreplpt+1] +//line pgrepl-gen.y:459 + { + pgreplVAL.union.val = pgrepltree.Option{ + Key: tree.Name(pgreplDollar[1].str), + Value: tree.NewStrVal(pgreplDollar[2].str), + } + } + case 51: + pgreplDollar = pgreplS[pgreplpt-2 : pgreplpt+1] +//line pgrepl-gen.y:466 + { + pgreplVAL.union.val = pgrepltree.Option{ + Key: tree.Name(pgreplDollar[1].str), + Value: tree.NewStrVal(pgreplDollar[2].str), + } + } + case 52: + pgreplDollar = pgreplS[pgreplpt-2 : pgreplpt+1] +//line pgrepl-gen.y:473 + { + pgreplVAL.union.val = pgrepltree.Option{ + Key: tree.Name(pgreplDollar[1].str), + Value: pgreplDollar[2].union.numVal(), + } + } + case 53: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:482 + { + pgreplVAL.str = pgreplDollar[1].str + } + case 54: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:483 + { + pgreplVAL.str = "base_backup" + } + case 55: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:484 + { + pgreplVAL.str = "identify_system" + } + case 56: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:486 + { + pgreplVAL.str = "start_replication" + } + case 57: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:487 + { + pgreplVAL.str = "create_replication_slot" + } + case 58: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:488 + { + pgreplVAL.str = "drop_replication_slot" + } + case 59: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:489 + { + pgreplVAL.str = "timeline_history" + } + case 60: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:490 + { + pgreplVAL.str = "wait" + } + case 61: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:491 + { + pgreplVAL.str = "timeline" + } + case 62: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:492 + { + pgreplVAL.str = "physical" + } + case 63: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:493 + { + pgreplVAL.str = "logical" + } + case 64: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:494 + { + pgreplVAL.str = "slot" + } + case 65: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:495 + { + pgreplVAL.str = "reserve_wal" + } + case 66: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:496 + { + pgreplVAL.str = "temporary" + } + case 67: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:497 + { + pgreplVAL.str = "two_phase" + } + case 68: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:498 + { + pgreplVAL.str = "export_snapshot" + } + case 69: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:499 + { + pgreplVAL.str = "noexport_snapshot" + } + case 70: + pgreplDollar = pgreplS[pgreplpt-1 : pgreplpt+1] +//line pgrepl-gen.y:500 + { + pgreplVAL.str = "use_snapshot" + } + } + goto pgreplstack /* stack new state and value */ +} diff --git a/pkg/sql/schemachanger/comparator_generated_test.go b/pkg/sql/schemachanger/comparator_generated_test.go new file mode 100644 index 000000000000..e35b35b7c7df --- /dev/null +++ b/pkg/sql/schemachanger/comparator_generated_test.go @@ -0,0 +1,2185 @@ +// Copyright 2023 The Cockroach Authors. +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +// Code generated by sccomparatortestgen, DO NOT EDIT. + +package schemachanger_test + +import ( + "testing" + + "github.com/cockroachdb/cockroach/pkg/util/leaktest" +) + +func TestSchemaChangeComparator_aggregate(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/aggregate" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alias_types(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alias_types" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_column_type(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_column_type" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_database_convert_to_schema(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_database_convert_to_schema" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_database_owner(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_database_owner" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_default_privileges_for_all_roles(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_default_privileges_for_all_roles" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_default_privileges_for_schema(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_default_privileges_for_schema" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_default_privileges_for_sequence(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_default_privileges_for_sequence" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_default_privileges_for_table(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_default_privileges_for_table" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_default_privileges_for_type(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_default_privileges_for_type" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_default_privileges_in_schema(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_default_privileges_in_schema" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_default_privileges_with_grant_option(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_default_privileges_with_grant_option" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_primary_key(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_primary_key" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_role(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_role" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_role_set(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_role_set" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_schema_owner(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_schema_owner" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_sequence(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_sequence" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_sequence_owner(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_sequence_owner" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_table(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_table" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_table_owner(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_table_owner" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_type(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_type" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_type_owner(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_type_owner" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_alter_view_owner(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/alter_view_owner" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_and_or(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/and_or" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_apply_join(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/apply_join" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_array(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/array" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_as_of(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/as_of" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_asyncpg(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/asyncpg" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_auto_span_config_reconciliation_job(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/auto_span_config_reconciliation_job" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_bit(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/bit" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_bpchar(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/bpchar" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_builtin_function(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/builtin_function" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_builtin_function_notenant(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/builtin_function_notenant" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_bytes(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/bytes" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_cascade(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/cascade" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_case(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/case" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_case_sensitive_names(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/case_sensitive_names" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_cast(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/cast" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_ccl(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/ccl" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_check_constraints(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/check_constraints" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_cluster_locks(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/cluster_locks" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_cluster_settings(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/cluster_settings" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_collatedstring(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/collatedstring" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_collatedstring_constraint(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/collatedstring_constraint" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_collatedstring_index1(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/collatedstring_index1" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_collatedstring_index2(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/collatedstring_index2" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_collatedstring_normalization(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/collatedstring_normalization" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_collatedstring_nullinindex(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/collatedstring_nullinindex" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_collatedstring_uniqueindex1(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/collatedstring_uniqueindex1" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_collatedstring_uniqueindex2(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/collatedstring_uniqueindex2" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_column_families(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/column_families" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_comment_on(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/comment_on" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_composite_types(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/composite_types" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_computed(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/computed" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_conditional(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/conditional" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_connect_privilege(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/connect_privilege" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_contention_event(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/contention_event" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_crdb_internal(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/crdb_internal" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_crdb_internal_catalog(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_crdb_internal_default_privileges(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/crdb_internal_default_privileges" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_create_as(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/create_as" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_create_as_non_metamorphic(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/create_as_non_metamorphic" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_create_index(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/create_index" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_create_statements(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/create_statements" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_create_table(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/create_table" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_cross_join(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/cross_join" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_cross_version_tenant_backup(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/cross_version_tenant_backup" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_cursor(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/cursor" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_custom_escape_character(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/custom_escape_character" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_dangerous_statements(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/dangerous_statements" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_database(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/database" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_datetime(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/datetime" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_decimal(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/decimal" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_default(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/default" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_delete(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/delete" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_delete_batch(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/delete_batch" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_dependencies(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/dependencies" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_discard(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/discard" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_disjunction_in_join(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/disjunction_in_join" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_dist_vectorize(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/dist_vectorize" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distinct(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distinct" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distinct_on(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distinct_on" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_agg(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_agg" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_automatic_partial_stats(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_automatic_partial_stats" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_automatic_stats(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_automatic_stats" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_builtin(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_builtin" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_crdb_internal(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_crdb_internal" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_datetime(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_datetime" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_distinct_on(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_distinct_on" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_enum(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_enum" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_event_log(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_event_log" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_expr(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_expr" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_join(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_join" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_numtables(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_numtables" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_srfs(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_srfs" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_stats(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_stats" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_subquery(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_subquery" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_tenant(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_tenant" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_tenant_locality(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_tenant_locality" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_distsql_union(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/distsql_union" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_database(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_database" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_function(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_function" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_index(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_index" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_owned_by(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_owned_by" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_procedure(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_procedure" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_role_with_default_privileges(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_role_with_default_privileges" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_role_with_default_privileges_in_schema(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_role_with_default_privileges_in_schema" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_schema(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_schema" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_sequence(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_sequence" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_table(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_table" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_temp(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_temp" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_type(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_type" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_user(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_user" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_drop_view(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/drop_view" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_edge(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/edge" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_enums(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/enums" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_errors(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/errors" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_event_log(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/event_log" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_event_log_legacy(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/event_log_legacy" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_exclude_data_from_backup(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/exclude_data_from_backup" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_experimental_distsql_planning(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/experimental_distsql_planning" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_experimental_distsql_planning_5node(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/experimental_distsql_planning_5node" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_explain(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/explain" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_explain_analyze(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/explain_analyze" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_export(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/export" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_expression_index(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/expression_index" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_external_connection_privileges(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/external_connection_privileges" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_family(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/family" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_feature_counts(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/feature_counts" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_fk(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/fk" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_float(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/float" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_format(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/format" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_formatting(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/formatting" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_function_lookup(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/function_lookup" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_fuzzystrmatch(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/fuzzystrmatch" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_gc_job_mixed(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/gc_job_mixed" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_gen_test_objects(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/gen_test_objects" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_generator_probe_ranges(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/generator_probe_ranges" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_generic_license(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/generic_license" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_geospatial(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/geospatial" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_geospatial_bbox(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/geospatial_bbox" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_geospatial_index(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/geospatial_index" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_geospatial_meta(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/geospatial_meta" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_geospatial_regression(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/geospatial_regression" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_geospatial_zm(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/geospatial_zm" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_grant_database(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/grant_database" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_grant_in_txn(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/grant_in_txn" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_grant_inherited(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/grant_inherited" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_grant_on_all_sequences_in_schema(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/grant_on_all_sequences_in_schema" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_grant_on_all_tables_in_schema(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/grant_on_all_tables_in_schema" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_grant_revoke_with_grant_option(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/grant_revoke_with_grant_option" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_grant_role(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/grant_role" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_grant_schema(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/grant_schema" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_grant_sequence(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/grant_sequence" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_grant_table(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/grant_table" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_grant_type(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/grant_type" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_group_join(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/group_join" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_guardrails(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/guardrails" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_hash_join(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/hash_join" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_hash_join_dist(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/hash_join_dist" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_hash_sharded_index(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/hash_sharded_index" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_hidden_columns(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/hidden_columns" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_impure(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/impure" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_index_join(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/index_join" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_index_recommendations(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/index_recommendations" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inet(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inet" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inflight_trace_spans(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inflight_trace_spans" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_information_schema(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/information_schema" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inner_join(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inner-join" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_insert(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/insert" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_int_size(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/int_size" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_internal_executor(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/internal_executor" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_interval(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/interval" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inv_stats(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inv_stats" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inverted_filter_geospatial(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inverted_filter_geospatial" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inverted_filter_geospatial_dist(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inverted_filter_geospatial_dist" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inverted_filter_json_array(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inverted_filter_json_array" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inverted_index(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inverted_index" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inverted_index_geospatial(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inverted_index_geospatial" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inverted_index_multi_column(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inverted_index_multi_column" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inverted_join_geospatial(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inverted_join_geospatial" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inverted_join_geospatial_bbox(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inverted_join_geospatial_bbox" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inverted_join_geospatial_dist(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inverted_join_geospatial_dist" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inverted_join_json_array(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inverted_join_json_array" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_inverted_join_multi_column(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/inverted_join_multi_column" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_jobs(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/jobs" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_join(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/join" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_json(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/json" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_json_builtins(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/json_builtins" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_json_index(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/json_index" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_kv_builtin_functions(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/kv_builtin_functions" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_kv_builtin_functions_local(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/kv_builtin_functions_local" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_kv_builtin_functions_tenant(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/kv_builtin_functions_tenant" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_limit(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/limit" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_locality(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/locality" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_lock_timeout(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/lock_timeout" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_lookup_join(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/lookup_join" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_lookup_join_local(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/lookup_join_local" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_lookup_join_spans(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/lookup_join_spans" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_manual_retry(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/manual_retry" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_materialized_view(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/materialized_view" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_merge_join(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/merge_join" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_merge_join_dist(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/merge_join_dist" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_mixed_version_bootstrap_tenant(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/mixed_version_bootstrap_tenant" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_mixed_version_can_login(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/mixed_version_can_login" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_mixed_version_timeseries_range(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/mixed_version_timeseries_range" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_mixed_version_timeseries_range_already_exists(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/mixed_version_timeseries_range_already_exists" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_mixed_version_upgrade_preserve_ttl(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/mixed_version_upgrade_preserve_ttl" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_multi_region(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/multi_region" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_multi_statement(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/multi_statement" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_multiregion_invalid_locality(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/multiregion_invalid_locality" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_name_escapes(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/name_escapes" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_namespace(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/namespace" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_new_schema_changer(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/new_schema_changer" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_no_primary_key(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/no_primary_key" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_notice(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/notice" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_numeric_references(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/numeric_references" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_on_update(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/on_update" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_operator(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/operator" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_optimizer_timeout(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/optimizer_timeout" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_order_by(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/order_by" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_ordinal_references(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/ordinal_references" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_ordinality(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/ordinality" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_orms(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/orms" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_overflow(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/overflow" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_overlaps(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/overlaps" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_owner(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/owner" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_parallel_stmts_compat(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/parallel_stmts_compat" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_partial_index(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/partial_index" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_partial_txn_commit(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/partial_txn_commit" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_partitioning(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/partitioning" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_pg_builtins(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/pg_builtins" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_pg_catalog(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/pg_catalog" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_pg_catalog_pg_default_acl(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/pg_catalog_pg_default_acl" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_pg_catalog_pg_default_acl_with_grant_option(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/pg_catalog_pg_default_acl_with_grant_option" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_pg_extension(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/pg_extension" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_pg_lsn(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/pg_lsn" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_pgcrypto_builtins(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/pgcrypto_builtins" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_pgoidtype(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/pgoidtype" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_plpgsql_builtins(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/plpgsql_builtins" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_plpgsql_license(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/plpgsql_license" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_poison_after_push(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/poison_after_push" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_postgres_jsonb(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/postgres_jsonb" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_postgresjoin(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/postgresjoin" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_prepare(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/prepare" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_privilege_builtins(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/privilege_builtins" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_privileges_comments(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/privileges_comments" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_privileges_table(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/privileges_table" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_proc_invokes_proc(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/proc_invokes_proc" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_procedure(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/procedure" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_procedure_deps(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/procedure_deps" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_procedure_params(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/procedure_params" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_procedure_polymorphic(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/procedure_polymorphic" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_procedure_privileges(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/procedure_privileges" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_procedure_schema_change(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/procedure_schema_change" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_propagate_input_ordering(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/propagate_input_ordering" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_rand_ident(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/rand_ident" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_ranges(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/ranges" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_reassign_owned_by(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/reassign_owned_by" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_record(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/record" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_redact_descriptor(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/redact_descriptor" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_rename_atomic(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/rename_atomic" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_rename_column(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/rename_column" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_rename_constraint(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/rename_constraint" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_rename_database(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/rename_database" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_rename_index(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/rename_index" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_rename_sequence(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/rename_sequence" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_rename_table(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/rename_table" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_rename_view(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/rename_view" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_reset(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/reset" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_retry(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/retry" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_returning(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/returning" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_role(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/role" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_routine_schema_change(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/routine_schema_change" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_row_level_ttl(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/row_level_ttl" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_rows_from(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/rows_from" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_run_control(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/run_control" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_save_table(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/save_table" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_savepoints(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/savepoints" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_scale(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/scale" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_scatter(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/scatter" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_schema(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/schema" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_schema_change_feature_flags(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/schema_change_feature_flags" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_schema_change_in_txn(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/schema_change_in_txn" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_schema_change_retry(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/schema_change_retry" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_schema_locked(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/schema_locked" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_schema_repair(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/schema_repair" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_scrub(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/scrub" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_secondary_index_column_families(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/secondary_index_column_families" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_select(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/select" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_select_for_share(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/select_for_share" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_select_for_update(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/select_for_update" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_select_index(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/select_index" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_select_index_flags(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/select_index_flags" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_select_search_path(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/select_search_path" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_select_table_alias(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/select_table_alias" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_sequences(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/sequences" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_sequences_distsql(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/sequences_distsql" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_sequences_regclass(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/sequences_regclass" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_serial(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/serial" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_serializable_eager_restart(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/serializable_eager_restart" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_set(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/set" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_set_local(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/set_local" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_set_role(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/set_role" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_set_schema(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/set_schema" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_set_time_zone(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/set_time_zone" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_shift(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/shift" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_commit_timestamp(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_commit_timestamp" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_completions(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_completions" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_create(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_create" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_create_all_schemas(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_create_all_schemas" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_create_all_tables(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_create_all_tables" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_create_all_tables_builtin(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_create_all_tables_builtin" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_create_all_types(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_create_all_types" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_create_redact(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_create_redact" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_default_privileges(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_default_privileges" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_external_connections(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_external_connections" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_fingerprints(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_fingerprints" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_grants_on_virtual_table(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_grants_on_virtual_table" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_grants_synthetic(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_grants_synthetic" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_indexes(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_indexes" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_ranges(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_ranges" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_source(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_source" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_tables(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_tables" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_tenant_fingerprints(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_tenant_fingerprints" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_transfer_state(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_transfer_state" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_show_var(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/show_var" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_skip_on_retry(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/skip_on_retry" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_span_builtins(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/span_builtins" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_split_at(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/split_at" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_sql_keys(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/sql_keys" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_sqllite(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/sqllite" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_sqlliveness(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/sqlliveness" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_sqlsmith(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/sqlsmith" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_srfs(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/srfs" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_statement_source(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/statement_source" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_statement_statistics(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/statement_statistics" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_statement_statistics_errors(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/statement_statistics_errors" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_statement_statistics_errors_redacted(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/statement_statistics_errors_redacted" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_stats(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/stats" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_storing(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/storing" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_strict_ddl_atomicity(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/strict_ddl_atomicity" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_suboperators(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/suboperators" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_subquery(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/subquery" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_subquery_correlated(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/subquery_correlated" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_synthetic_privileges(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/synthetic_privileges" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_system(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/system" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_system_columns(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/system_columns" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_system_namespace(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/system_namespace" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_table(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/table" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_target_names(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/target_names" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_temp_table(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/temp_table" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_temp_table_txn(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/temp_table_txn" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_tenant(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/tenant" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_tenant_builtins(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/tenant_builtins" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_tenant_from_tenant(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/tenant_from_tenant" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_tenant_from_tenant_hint(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/tenant_from_tenant_hint" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_tenant_slow_repro(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/tenant_slow_repro" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_tenant_span_stats(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/tenant_span_stats" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_time(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/time" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_timestamp(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/timestamp" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_timetz(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/timetz" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_trigram_builtins(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/trigram_builtins" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_trigram_indexes(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/trigram_indexes" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_truncate(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/truncate" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_truncate_with_concurrent_mutation(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/truncate_with_concurrent_mutation" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_tsvector(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/tsvector" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_tuple(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/tuple" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_tuple_local(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/tuple_local" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_txn(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/txn" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_txn_as_of(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/txn_as_of" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_txn_retry(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/txn_retry" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_txn_stats(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/txn_stats" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_type_privileges(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/type_privileges" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_typing(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/typing" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_calling_udf(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_calling_udf" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_delete(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_delete" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_deps(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_deps" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_fk(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_fk" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_in_column_defaults(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_in_column_defaults" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_in_constraints(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_in_constraints" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_insert(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_insert" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_observability(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_observability" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_oid_ref(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_oid_ref" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_options(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_options" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_params(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_params" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_polymorphic(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_polymorphic" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_prepare(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_prepare" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_privileges(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_privileges" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_privileges_mutations(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_privileges_mutations" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_procedure_mix(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_procedure_mix" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_record(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_record" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_regressions(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_regressions" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_rewrite(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_rewrite" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_schema_change(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_schema_change" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_setof(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_setof" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_star(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_star" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_subquery(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_subquery" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_unsupported(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_unsupported" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_update(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_update" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_udf_upsert(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/udf_upsert" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_union(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/union" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_unique(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/unique" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_update(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/update" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_update_from(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/update_from" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_upgrade_skip_version(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/upgrade_skip_version" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_upsert(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/upsert" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_upsert_non_metamorphic(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/upsert_non_metamorphic" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_user(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/user" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_uuid(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/uuid" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_values(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/values" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_vectorize(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/vectorize" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_vectorize_agg(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/vectorize_agg" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_vectorize_local(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/vectorize_local" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_vectorize_overloads(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/vectorize_overloads" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_vectorize_shutdown(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/vectorize_shutdown" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_vectorize_types(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/vectorize_types" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_vectorize_unsupported(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/vectorize_unsupported" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_vectorize_window(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/vectorize_window" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_vectoross(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/vectoross" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_views(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/views" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_virtual_columns(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/virtual_columns" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_virtual_table_privileges(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/virtual_table_privileges" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_void(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/void" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_where(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/where" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_window(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/window" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_with(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/with" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_workload_indexrecs(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/workload_indexrecs" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_zero(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/zero" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_zigzag_join(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/zigzag_join" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_zone_config(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/zone_config" + runSchemaChangeComparatorTest(t, logicTestFile) +} +func TestSchemaChangeComparator_zone_config_system_tenant(t *testing.T) { + defer leaktest.AfterTest(t)() + var logicTestFile = "pkg/sql/logictest/testdata/logic_test/zone_config_system_tenant" + runSchemaChangeComparatorTest(t, logicTestFile) +} diff --git a/pkg/sql/sem/builtins/fixed_oids.go b/pkg/sql/sem/builtins/fixed_oids.go index 4e4361419007..5b23d1fbd536 100644 --- a/pkg/sql/sem/builtins/fixed_oids.go +++ b/pkg/sql/sem/builtins/fixed_oids.go @@ -1841,10 +1841,10 @@ var builtinOidsArray = []string{ 1867: `geography_recv(input: anyelement) -> geography`, 1868: `geography_out(geography: geography) -> bytes`, 1869: `geography_in(input: anyelement) -> geography`, - 1870: `bpcharsend(char: char) -> bytes`, - 1871: `bpcharrecv(input: anyelement) -> char`, - 1872: `bpcharout(char: char) -> bytes`, - 1873: `bpcharin(input: anyelement) -> char`, + 1870: `bpcharsend(bpchar: bpchar) -> bytes`, + 1871: `bpcharrecv(input: anyelement) -> bpchar`, + 1872: `bpcharout(bpchar: bpchar) -> bytes`, + 1873: `bpcharin(input: anyelement) -> bpchar`, 1874: `geometry_send(geometry: geometry) -> bytes`, 1875: `geometry_recv(input: anyelement) -> geometry`, 1876: `geometry_out(geometry: geometry) -> bytes`, @@ -2290,30 +2290,30 @@ var builtinOidsArray = []string{ 2321: `date(timestamptz: timestamptz) -> date`, 2322: `date(string: string) -> date`, 2323: `date(date: date) -> date`, - 2324: `bpchar(uuid: uuid) -> char`, - 2325: `bpchar(bit: bit) -> char`, - 2326: `bpchar(box2d: box2d) -> char`, - 2327: `bpchar(interval: interval) -> char`, - 2328: `bpchar(decimal: decimal) -> char`, - 2329: `bpchar(tuple: tuple) -> char`, - 2330: `bpchar(date: date) -> char`, - 2331: `bpchar(oid: oid) -> char`, - 2332: `bpchar(geometry: geometry) -> char`, - 2333: `bpchar(time: time) -> char`, - 2334: `bpchar(tsvector: tsvector) -> char`, - 2335: `bpchar(bool: bool) -> char`, - 2336: `bpchar(int: int) -> char`, - 2337: `bpchar(timestamp: timestamp) -> char`, - 2338: `bpchar(timestamptz: timestamptz) -> char`, - 2339: `bpchar(tsquery: tsquery) -> char`, - 2340: `bpchar(float: float) -> char`, - 2341: `bpchar(geography: geography) -> char`, - 2342: `bpchar(inet: inet) -> char`, - 2343: `bpchar(timetz: timetz) -> char`, - 2344: `bpchar(void: void) -> char`, - 2345: `bpchar(bytes: bytes) -> char`, - 2346: `bpchar(jsonb: jsonb) -> char`, - 2347: `bpchar(string: string) -> char`, + 2324: `bpchar(uuid: uuid) -> bpchar`, + 2325: `bpchar(bit: bit) -> bpchar`, + 2326: `bpchar(box2d: box2d) -> bpchar`, + 2327: `bpchar(interval: interval) -> bpchar`, + 2328: `bpchar(decimal: decimal) -> bpchar`, + 2329: `bpchar(tuple: tuple) -> bpchar`, + 2330: `bpchar(date: date) -> bpchar`, + 2331: `bpchar(oid: oid) -> bpchar`, + 2332: `bpchar(geometry: geometry) -> bpchar`, + 2333: `bpchar(time: time) -> bpchar`, + 2334: `bpchar(tsvector: tsvector) -> bpchar`, + 2335: `bpchar(bool: bool) -> bpchar`, + 2336: `bpchar(int: int) -> bpchar`, + 2337: `bpchar(timestamp: timestamp) -> bpchar`, + 2338: `bpchar(timestamptz: timestamptz) -> bpchar`, + 2339: `bpchar(tsquery: tsquery) -> bpchar`, + 2340: `bpchar(float: float) -> bpchar`, + 2341: `bpchar(geography: geography) -> bpchar`, + 2342: `bpchar(inet: inet) -> bpchar`, + 2343: `bpchar(timetz: timetz) -> bpchar`, + 2344: `bpchar(void: void) -> bpchar`, + 2345: `bpchar(bytes: bytes) -> bpchar`, + 2346: `bpchar(jsonb: jsonb) -> bpchar`, + 2347: `bpchar(string: string) -> bpchar`, 2348: `numeric(interval: interval) -> decimal`, 2349: `numeric(decimal: decimal) -> decimal`, 2350: `numeric(date: date) -> decimal`, diff --git a/pkg/sql/sem/tree/overload.go b/pkg/sql/sem/tree/overload.go index 7958e5980c6f..5d0873c9b589 100644 --- a/pkg/sql/sem/tree/overload.go +++ b/pkg/sql/sem/tree/overload.go @@ -316,7 +316,7 @@ type TypeList interface { // Match checks if all types in the TypeList match the corresponding elements in types. Match(types []*types.T) bool // MatchIdentical is similar to match but checks that the types are identical matches, - //instead of equivalent matches. See types.T.Equivalent and types.T.Identical. + // instead of equivalent matches. See types.T.Equivalent and types.T.Identical. MatchIdentical(types []*types.T) bool // MatchAt checks if the parameter type at index i of the TypeList matches type typ. // In all implementations, types.Null will match with each parameter type, allowing @@ -392,7 +392,11 @@ func (p ParamTypes) MatchAt(typ *types.T, i int) bool { // MatchAtIdentical is part of the TypeList interface. func (p ParamTypes) MatchAtIdentical(typ *types.T, i int) bool { - return i < len(p) && (typ.Family() == types.UnknownFamily || p[i].Typ.Identical(typ)) + return i < len(p) && (typ.Family() == types.UnknownFamily || + p[i].Typ.Identical(typ) || + // Special case for CHAR, CHAR(N), and BPCHAR which are not "identical" + // but have the same OID. See #129007. + (p[i].Typ.Oid() == oid.T_bpchar && typ.Oid() == oid.T_bpchar)) } // MatchLen is part of the TypeList interface. diff --git a/pkg/sql/types/types.go b/pkg/sql/types/types.go index c966562fae14..3d9f8b91809d 100644 --- a/pkg/sql/types/types.go +++ b/pkg/sql/types/types.go @@ -95,6 +95,7 @@ import ( // | VARCHAR(N) | STRING | T_varchar | 0 | N | // | CHAR | STRING | T_bpchar | 0 | 1 | // | CHAR(N) | STRING | T_bpchar | 0 | N | +// | BPCHAR | STRING | T_bpchar | 0 | 0 | // | "char" | STRING | T_char | 0 | 0 | // | NAME | STRING | T_name | 0 | 0 | // | | | | | | @@ -1534,6 +1535,9 @@ func (t *T) Name() string { case oid.T_text: return "string" case oid.T_bpchar: + if t.Width() == 0 { + return "bpchar" + } return "char" case oid.T_char: // Yes, that's the name. The ways of PostgreSQL are inscrutable. @@ -2791,6 +2795,9 @@ func (t *T) stringTypeSQL() string { case oid.T_varchar: typName = "VARCHAR" case oid.T_bpchar: + if t.Width() == 0 { + return "BPCHAR" + } typName = "CHAR" case oid.T_char: // Yes, that's the name. The ways of PostgreSQL are inscrutable.