From cb29a6eb945359376ae3a7b40d76ff2f4747fecb Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Tue, 17 Dec 2024 19:21:50 -0800 Subject: [PATCH] sql: extend SHOW CREATE TABLE to use fully-qualified names This commit extends SHOW CREATE TABLE syntax to use fully-qualified names for tables as well as user-defined types used in the table. This is needed to make the recreation of stmt bundles collected on multi-region tables easier. Note that for UDTs this behavior was already the case up until this Summer when we switched to not showing the DB name for portability. The stmt bundle recreation case needs the exact reproduction since we might be dealing with cross-DB references and things like `crdb_internal_region` type unavailable in the current DB when creating a multi-region table. `SHOW CREATE TABLE` syntax is extended to support `FULLY_QUALIFIED` option. We already had a documented `REDACT` option, so any combination of these two options is now supported. However, at least as of right now, I chose to not document this new option. We now use the new option when building the stmt bundle. It is powered by adding two new columns `create_statement_fq` and `create_redactable_fq` to `crdb_internal.create_statements` virtual table. These columns are only populated for tables and will remain empty strings for views and sequences. The delegated show query is adjusted to use the proper column based on the options. Release note: None --- docs/generated/sql/bnf/stmt_block.bnf | 7 +- .../testdata/logic_test/crdb_internal_tenant | 4 +- pkg/sql/catalog/schemaexpr/column.go | 10 ++- pkg/sql/crdb_internal.go | 53 ++++++++++---- pkg/sql/delegate/show_table.go | 8 ++- pkg/sql/explain_bundle.go | 8 +-- .../testdata/logic_test/crdb_internal | 69 +++++++++++++++---- .../logictest/testdata/logic_test/sequences | 6 +- .../logictest/testdata/logic_test/show_create | 21 ++++++ .../opt/exec/execbuilder/testdata/explain_env | 26 +++---- pkg/sql/parser/sql.y | 57 ++++++++++++--- pkg/sql/parser/testdata/show | 24 +++++++ pkg/sql/sem/tree/show.go | 20 +++--- pkg/sql/show_create.go | 6 +- 14 files changed, 245 insertions(+), 74 deletions(-) diff --git a/docs/generated/sql/bnf/stmt_block.bnf b/docs/generated/sql/bnf/stmt_block.bnf index 86a6542fdd6d..62ee4888d977 100644 --- a/docs/generated/sql/bnf/stmt_block.bnf +++ b/docs/generated/sql/bnf/stmt_block.bnf @@ -1186,6 +1186,7 @@ unreserved_keyword ::= | 'FORCE_ZIGZAG' | 'FORWARD' | 'FREEZE' + | 'FULLY_QUALIFIED' | 'FUNCTION' | 'FUNCTIONS' | 'GENERATED' @@ -2044,7 +2045,7 @@ with_comment ::= | opt_show_create_format_options ::= - 'WITH' 'REDACT' + 'WITH' show_create_format_options opt_on_targets_roles ::= 'ON' targets_roles @@ -2845,6 +2846,9 @@ extra_var_value ::= show_backup_options_list ::= ( show_backup_options ) ( ( ',' show_backup_options ) )* +show_create_format_options ::= + 'REDACT' + targets_roles ::= 'ROLE' role_spec_list | 'SCHEMA' schema_name_list @@ -3904,6 +3908,7 @@ bare_label_keywords ::= | 'FORWARD' | 'FREEZE' | 'FULL' + | 'FULLY_QUALIFIED' | 'FUNCTION' | 'FUNCTIONS' | 'GENERATED' diff --git a/pkg/ccl/logictestccl/testdata/logic_test/crdb_internal_tenant b/pkg/ccl/logictestccl/testdata/logic_test/crdb_internal_tenant index 9d8d14340a25..a2c7c1ce1573 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/crdb_internal_tenant +++ b/pkg/ccl/logictestccl/testdata/logic_test/crdb_internal_tenant @@ -187,10 +187,10 @@ SELECT * FROM crdb_internal.builtin_functions WHERE function = '' ---- function signature category details schema oid -query ITTITTTTTTTTBBBB colnames +query ITTITTTTTTTTTTBBBB colnames SELECT * FROM crdb_internal.create_statements WHERE database_name = '' ---- -database_id database_name schema_name descriptor_id descriptor_type descriptor_name create_statement state create_nofks alter_statements validate_statements create_redactable has_partitions is_multi_region is_virtual is_temporary +database_id database_name schema_name descriptor_id descriptor_type descriptor_name create_statement create_statement_fq state create_nofks alter_statements validate_statements create_redactable create_redactable_fq has_partitions is_multi_region is_virtual is_temporary query ITITTBTB colnames SELECT * FROM crdb_internal.table_columns WHERE descriptor_name = '' diff --git a/pkg/sql/catalog/schemaexpr/column.go b/pkg/sql/catalog/schemaexpr/column.go index 1db4bbe87309..4f4f19a7d4af 100644 --- a/pkg/sql/catalog/schemaexpr/column.go +++ b/pkg/sql/catalog/schemaexpr/column.go @@ -85,12 +85,17 @@ func FormatColumnForDisplay( semaCtx *tree.SemaContext, sessionData *sessiondata.SessionData, redactableValues bool, + fullyQualifyUDTNames bool, ) (string, error) { f := tree.NewFmtCtx(tree.FmtSimple) name := col.GetName() f.FormatNameP(&name) f.WriteByte(' ') - f.WriteString(col.GetType().SQLString()) + if fullyQualifyUDTNames { + f.WriteString(col.GetType().SQLStringFullyQualified()) + } else { + f.WriteString(col.GetType().SQLString()) + } if col.IsHidden() { f.WriteString(" NOT VISIBLE") } @@ -103,6 +108,9 @@ func FormatColumnForDisplay( if redactableValues { fmtFlags |= tree.FmtMarkRedactionNode | tree.FmtOmitNameRedaction } + if fullyQualifyUDTNames { + fmtFlags |= tree.FmtAlwaysQualifyUserDefinedTypeNames + } if col.HasDefault() { if col.IsGeneratedAsIdentity() { if col.IsGeneratedAlwaysAsIdentity() { diff --git a/pkg/sql/crdb_internal.go b/pkg/sql/crdb_internal.go index 80a5342b56a9..92ccf5497579 100644 --- a/pkg/sql/crdb_internal.go +++ b/pkg/sql/crdb_internal.go @@ -3770,11 +3770,13 @@ CREATE TABLE crdb_internal.create_statements ( descriptor_type STRING NOT NULL, descriptor_name STRING NOT NULL, create_statement STRING NOT NULL, + create_statement_fq STRING NOT NULL, state STRING NOT NULL, create_nofks STRING NOT NULL, alter_statements STRING[] NOT NULL, validate_statements STRING[] NOT NULL, create_redactable STRING NOT NULL, + create_redactable_fq STRING NOT NULL, has_partitions BOOL NOT NULL, is_multi_region BOOL NOT NULL, is_virtual BOOL NOT NULL, @@ -3785,24 +3787,34 @@ CREATE TABLE crdb_internal.create_statements ( func(ctx context.Context, p *planner, h oidHasher, db catalog.DatabaseDescriptor, sc catalog.SchemaDescriptor, table catalog.TableDescriptor, lookup simpleSchemaResolver, addRow func(...tree.Datum) error, ) error { - contextName := "" + dbPrefix := "" parentNameStr := tree.DNull if db != nil { - contextName = db.GetName() - parentNameStr = tree.NewDString(contextName) + dbPrefix = db.GetName() + parentNameStr = tree.NewDString(dbPrefix) } scNameStr := tree.NewDString(sc.GetName()) var descType tree.Datum - var stmt, createNofk, createRedactable string + var createStmt, createStmtFQ, createNofk, createRedactable, createRedactableFQ string alterStmts := tree.NewDArray(types.String) validateStmts := tree.NewDArray(types.String) namePrefix := tree.ObjectNamePrefix{SchemaName: tree.Name(sc.GetName()), ExplicitSchema: true} name := tree.MakeTableNameFromPrefix(namePrefix, tree.Name(table.GetName())) + var fqName tree.TableName + if db != nil { + fqNamePrefix := tree.ObjectNamePrefix{ + CatalogName: tree.Name(db.GetName()), ExplicitCatalog: true, + SchemaName: tree.Name(sc.GetName()), ExplicitSchema: true, + } + fqName = tree.MakeTableNameFromPrefix(fqNamePrefix, tree.Name(table.GetName())) + } else { + fqName = tree.MakeUnqualifiedTableName(tree.Name(table.GetName())) + } var err error if table.IsView() { descType = typeView - stmt, err = ShowCreateView( + createStmt, err = ShowCreateView( ctx, p.EvalContext(), &p.semaCtx, p.SessionData(), &name, table, false, /* redactableValues */ ) if err != nil { @@ -3813,28 +3825,41 @@ CREATE TABLE crdb_internal.create_statements ( ) } else if table.IsSequence() { descType = typeSequence - stmt, err = ShowCreateSequence(ctx, &name, table) - createRedactable = stmt + createStmt, err = ShowCreateSequence(ctx, &name, table) + createRedactable = createStmt } else { descType = typeTable displayOptions := ShowCreateDisplayOptions{ FKDisplayMode: OmitFKClausesFromCreate, } - createNofk, err = ShowCreateTable(ctx, p, &name, contextName, table, lookup, displayOptions) + createNofk, err = ShowCreateTable(ctx, p, &name, dbPrefix, table, lookup, displayOptions) if err != nil { return err } - if err := showAlterStatement(ctx, &name, contextName, lookup, table, alterStmts, validateStmts); err != nil { + if err := showAlterStatement(ctx, &name, dbPrefix, lookup, table, alterStmts, validateStmts); err != nil { return err } displayOptions.FKDisplayMode = IncludeFkClausesInCreate - stmt, err = ShowCreateTable(ctx, p, &name, contextName, table, lookup, displayOptions) + createStmt, err = ShowCreateTable(ctx, p, &name, dbPrefix, table, lookup, displayOptions) if err != nil { return err } + displayOptions.FullyQualifyUDTNames = true + createStmtFQ, err = ShowCreateTable(ctx, p, &fqName, "" /* dbPrefix */, table, lookup, displayOptions) + if err != nil { + return err + } + displayOptions.FullyQualifyUDTNames = false displayOptions.RedactableValues = true createRedactable, err = ShowCreateTable( - ctx, p, &name, contextName, table, lookup, displayOptions, + ctx, p, &name, dbPrefix, table, lookup, displayOptions, + ) + if err != nil { + return err + } + displayOptions.FullyQualifyUDTNames = true + createRedactableFQ, err = ShowCreateTable( + ctx, p, &fqName, "" /* dbPrefix */, table, lookup, displayOptions, ) } if err != nil { @@ -3844,7 +3869,7 @@ CREATE TABLE crdb_internal.create_statements ( descID := tree.NewDInt(tree.DInt(table.GetID())) dbDescID := tree.NewDInt(tree.DInt(table.GetParentID())) if createNofk == "" { - createNofk = stmt + createNofk = createStmt } hasPartitions := nil != catalog.FindIndex(table, catalog.IndexOpts{}, func(idx catalog.Index) bool { return idx.PartitioningColumnCount() != 0 @@ -3856,12 +3881,14 @@ CREATE TABLE crdb_internal.create_statements ( descID, descType, tree.NewDString(table.GetName()), - tree.NewDString(stmt), + tree.NewDString(createStmt), + tree.NewDString(createStmtFQ), tree.NewDString(table.GetState().String()), tree.NewDString(createNofk), alterStmts, validateStmts, tree.NewDString(createRedactable), + tree.NewDString(createRedactableFQ), tree.MakeDBool(tree.DBool(hasPartitions)), tree.MakeDBool(tree.DBool(db != nil && db.IsMultiRegion())), tree.MakeDBool(tree.DBool(table.IsVirtualTable())), diff --git a/pkg/sql/delegate/show_table.go b/pkg/sql/delegate/show_table.go index a93364713d49..4eeb61e6660b 100644 --- a/pkg/sql/delegate/show_table.go +++ b/pkg/sql/delegate/show_table.go @@ -50,9 +50,13 @@ WHERE name = %s func (d *delegator) delegateShowCreateTable(n *tree.ShowCreate) (tree.Statement, error) { createField := "create_statement" - switch n.FmtOpt { - case tree.ShowCreateFormatOptionRedactedValues: + switch { + case n.FmtOpt.RedactedValues && !n.FmtOpt.FullyQualified: createField = "crdb_internal.redact(create_redactable)" + case !n.FmtOpt.RedactedValues && n.FmtOpt.FullyQualified: + createField = "create_statement_fq" + case n.FmtOpt.RedactedValues && n.FmtOpt.FullyQualified: + createField = "crdb_internal.redact(create_redactable_fq)" } showCreateQuery := ` diff --git a/pkg/sql/explain_bundle.go b/pkg/sql/explain_bundle.go index 1d5dc668b4d4..a458de1a5d4d 100644 --- a/pkg/sql/explain_bundle.go +++ b/pkg/sql/explain_bundle.go @@ -983,15 +983,11 @@ func (c *stmtEnvCollector) PrintCreateTable( ) error { var formatOption string if redactValues { - formatOption = " WITH REDACT" + formatOption = ", REDACT" } createStatement, err := c.query( - fmt.Sprintf("SELECT create_statement FROM [SHOW CREATE TABLE %s%s]", tn.FQString(), formatOption), + fmt.Sprintf("SELECT create_statement FROM [SHOW CREATE TABLE %s WITH FULLY_QUALIFIED%s]", tn.FQString(), formatOption), ) - // We need to replace schema.table_name in the create statement with the fully - // qualified table name. - createStatement = strings.Replace(createStatement, - fmt.Sprintf("%s.%s", tn.SchemaName, tn.Table()), tn.FQString(), 1) if err != nil { return err } diff --git a/pkg/sql/logictest/testdata/logic_test/crdb_internal b/pkg/sql/logictest/testdata/logic_test/crdb_internal index b85c64bc379d..64906d11fa1a 100644 --- a/pkg/sql/logictest/testdata/logic_test/crdb_internal +++ b/pkg/sql/logictest/testdata/logic_test/crdb_internal @@ -374,10 +374,10 @@ SELECT * FROM crdb_internal.builtin_functions WHERE function = '' ---- function signature category details schema oid -query ITTITTTTTTTTBBBB colnames +query ITTITTTTTTTTTTBBBB colnames SELECT * FROM crdb_internal.create_statements WHERE database_name = '' ---- -database_id database_name schema_name descriptor_id descriptor_type descriptor_name create_statement state create_nofks alter_statements validate_statements create_redactable has_partitions is_multi_region is_virtual is_temporary +database_id database_name schema_name descriptor_id descriptor_type descriptor_name create_statement create_statement_fq state create_nofks alter_statements validate_statements create_redactable create_redactable_fq has_partitions is_multi_region is_virtual is_temporary query ITITTBTB colnames SELECT * FROM crdb_internal.table_columns WHERE descriptor_name = '' @@ -1127,8 +1127,10 @@ SELECT is_temporary FROM crdb_internal.create_statements WHERE descriptor_name = true statement ok -CREATE TABLE defaultdb.public.in_other_db (x INT PRIMARY KEY); -CREATE TABLE public.in_this_db (x INT PRIMARY KEY); +CREATE TYPE defaultdb.public.udt AS ENUM (); +CREATE TABLE defaultdb.public.in_other_db (x INT PRIMARY KEY, e defaultdb.public.udt, FAMILY (x, e)); +CREATE TYPE public.udt AS ENUM (); +CREATE TABLE public.in_this_db (x INT PRIMARY KEY, e public.udt, FAMILY (x, e)); # Verify that we can inspect all databases by using "" as the database name. query TTT colnames @@ -1141,7 +1143,48 @@ database_name schema_name descriptor_name defaultdb public in_other_db test public in_this_db -# Also verify that using the virtul index on descriptor_id works. +# Check that table and UDT names are fully-qualified in the right column. +query TT colnames +SELECT database_name, create_statement +FROM "".crdb_internal.create_statements +WHERE descriptor_name IN ('in_other_db', 'in_this_db') +ORDER BY 1 +---- +database_name create_statement +defaultdb CREATE TABLE public.in_other_db ( + x INT8 NOT NULL, + e public.udt NULL, + CONSTRAINT in_other_db_pkey PRIMARY KEY (x ASC), + FAMILY fam_0_x_e (x, e) + ) +test CREATE TABLE public.in_this_db ( + x INT8 NOT NULL, + e public.udt NULL, + CONSTRAINT in_this_db_pkey PRIMARY KEY (x ASC), + FAMILY fam_0_x_e (x, e) + ) + +query TT colnames +SELECT database_name, create_statement_fq +FROM "".crdb_internal.create_statements +WHERE descriptor_name IN ('in_other_db', 'in_this_db') +ORDER BY 1 +---- +database_name create_statement_fq +defaultdb CREATE TABLE defaultdb.public.in_other_db ( + x INT8 NOT NULL, + e defaultdb.public.udt NULL, + CONSTRAINT in_other_db_pkey PRIMARY KEY (x ASC), + FAMILY fam_0_x_e (x, e) + ) +test CREATE TABLE test.public.in_this_db ( + x INT8 NOT NULL, + e test.public.udt NULL, + CONSTRAINT in_this_db_pkey PRIMARY KEY (x ASC), + FAMILY fam_0_x_e (x, e) + ) + +# Also verify that using the virtual index on descriptor_id works. query TTT colnames SELECT database_name, schema_name, descriptor_name FROM "".crdb_internal.create_statements @@ -1512,19 +1555,19 @@ FROM crdb_internal.create_procedure_statements WHERE procedure_name IN ('p', 'p2') ORDER BY procedure_id; ---- -104 test 105 public 139 p CREATE PROCEDURE public.p(INT8) +104 test 105 public 143 p CREATE PROCEDURE public.p(INT8) LANGUAGE SQL SECURITY INVOKER AS $$ SELECT 1; $$ -104 test 105 public 140 p CREATE PROCEDURE public.p(STRING, b INT8) +104 test 105 public 144 p CREATE PROCEDURE public.p(STRING, b INT8) LANGUAGE SQL SECURITY INVOKER AS $$ SELECT 'hello'; $$ -104 test 142 sc 143 p2 CREATE PROCEDURE sc.p2(STRING) +104 test 146 sc 147 p2 CREATE PROCEDURE sc.p2(STRING) LANGUAGE SQL SECURITY INVOKER AS $$ @@ -1543,25 +1586,25 @@ FROM "".crdb_internal.create_procedure_statements WHERE procedure_name IN ('p', 'p2', 'p_cross_db') ORDER BY procedure_id; ---- -104 test 105 public 139 p CREATE PROCEDURE public.p(INT8) +104 test 105 public 143 p CREATE PROCEDURE public.p(INT8) LANGUAGE SQL SECURITY INVOKER AS $$ SELECT 1; $$ -104 test 105 public 140 p CREATE PROCEDURE public.p(STRING, b INT8) +104 test 105 public 144 p CREATE PROCEDURE public.p(STRING, b INT8) LANGUAGE SQL SECURITY INVOKER AS $$ SELECT 'hello'; $$ -104 test 142 sc 143 p2 CREATE PROCEDURE sc.p2(STRING) +104 test 146 sc 147 p2 CREATE PROCEDURE sc.p2(STRING) LANGUAGE SQL SECURITY INVOKER AS $$ SELECT 'hello'; $$ -144 test_cross_db 145 public 146 p_cross_db CREATE PROCEDURE public.p_cross_db() +148 test_cross_db 149 public 150 p_cross_db CREATE PROCEDURE public.p_cross_db() LANGUAGE SQL SECURITY INVOKER AS $$ @@ -1686,4 +1729,4 @@ CREATE TYPE other_db.public.enum1 AS ENUM ('yo'); query ITTITTT SELECT * FROM "".crdb_internal.create_type_statements WHERE descriptor_id = (('other_db.public.enum1'::regtype::int) - 100000)::oid ---- -121 other_db public 151 enum1 CREATE TYPE other_db.public.enum1 AS ENUM ('yo') {yo} +121 other_db public 155 enum1 CREATE TYPE other_db.public.enum1 AS ENUM ('yo') {yo} diff --git a/pkg/sql/logictest/testdata/logic_test/sequences b/pkg/sql/logictest/testdata/logic_test/sequences index 87f51c986707..7ad5ed289f72 100644 --- a/pkg/sql/logictest/testdata/logic_test/sequences +++ b/pkg/sql/logictest/testdata/logic_test/sequences @@ -133,11 +133,11 @@ CREATE SEQUENCE ignored_options_test NO CYCLE statement ok CREATE SEQUENCE show_create_test -query ITTITTTTTTTTBBBB colnames +query ITTITTTTTTTTTTBBBB colnames SELECT * FROM crdb_internal.create_statements WHERE descriptor_name = 'show_create_test' ---- -database_id database_name schema_name descriptor_id descriptor_type descriptor_name create_statement state create_nofks alter_statements validate_statements create_redactable has_partitions is_multi_region is_virtual is_temporary -104 test public 111 sequence show_create_test CREATE SEQUENCE public.show_create_test MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1 PUBLIC CREATE SEQUENCE public.show_create_test MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1 {} {} CREATE SEQUENCE public.show_create_test MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1 false false false false +database_id database_name schema_name descriptor_id descriptor_type descriptor_name create_statement create_statement_fq state create_nofks alter_statements validate_statements create_redactable create_redactable_fq has_partitions is_multi_region is_virtual is_temporary +104 test public 111 sequence show_create_test CREATE SEQUENCE public.show_create_test MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1 · PUBLIC CREATE SEQUENCE public.show_create_test MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1 {} {} CREATE SEQUENCE public.show_create_test MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1 · false false false false query TT colnames SHOW CREATE SEQUENCE show_create_test diff --git a/pkg/sql/logictest/testdata/logic_test/show_create b/pkg/sql/logictest/testdata/logic_test/show_create index 45a1cd37d005..e855476247f5 100644 --- a/pkg/sql/logictest/testdata/logic_test/show_create +++ b/pkg/sql/logictest/testdata/logic_test/show_create @@ -149,6 +149,16 @@ CREATE TABLE public.t ( ); COMMENT ON COLUMN public.t.c IS 'first comment' +query T +SELECT create_statement FROM [SHOW CREATE TABLE t WITH FULLY_QUALIFIED]; +---- +CREATE TABLE test.public.t ( + c INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC) +); +COMMENT ON COLUMN test.public.t.c IS 'first comment' + # Skipping in legacy mode, as it does not support altering column types that # require a backfill. Subsequent column type alterations are also skipped for # the same reason. @@ -234,6 +244,17 @@ CREATE TABLE public.t_with_comps ( FAMILY f1 (c1, sc1, sc2) ) +query T +SELECT create_statement FROM [SHOW CREATE TABLE T_WITH_COMPS WITH FULLY_QUALIFIED]; +---- +CREATE TABLE test.public.t_with_comps ( + c1 INT8 NOT NULL, + sc1 test.sc1.comp1 NULL, + sc2 test.sc2.comp1 NULL, + CONSTRAINT t_with_comps_pkey PRIMARY KEY (c1 ASC), + FAMILY f1 (c1, sc1, sc2) +) + statement ok DROP TABLE T_WITH_COMPS; DROP TYPE SC1.COMP1; diff --git a/pkg/sql/opt/exec/execbuilder/testdata/explain_env b/pkg/sql/opt/exec/execbuilder/testdata/explain_env index e48baf94911d..dfef0d79af88 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/explain_env +++ b/pkg/sql/opt/exec/execbuilder/testdata/explain_env @@ -41,7 +41,7 @@ CREATE TABLE y ( query T EXPLAIN (OPT, ENV) SELECT * FROM x WHERE b = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0U9GOm0YUfd75iitebFcGg61IEdZKJWQ2pXXwCkiaaLUaDcPQjIKZDTO4uFWlfIR_pT_QT9kvqQZvbFclidI0PCDN5dxz7j2csW14yRslZO1DKNnbRlL25ukT4B1neSuqgjegudKwPaAQsm1IcQYF1TSnisMljAxgtER9WSit3lVwCbIslwC2DQUvaVtp2NKq5T7QVsseKuqCd6ThTG42vC6oFrJWhNc0r3jxCQIzhOkPVy_SDCdmmiyKn4F6VzmsKXIias2bmlaONlSkkb8SpakWSgumHKqILIkWm3502_vrTzUa1LE9V31U6AGrnNPCI1mWw0zHlYeYzGjKMZAN1YIRJquKM2OGc_JiVNJK8WF23bT8v7BvRG18OTikjMijYYFHrvsZ_lI2nFGl1f83stopzTek_4WKmAUO9S8QQGGCgwxDFjxZ4T7Fzl2bV4I5HYzRBYUozh5DvM4gfrFaTdFF_lA5nMJ1nGZJEMUZdOTuLd_BdRI9D5LX8BN-DWMKQRpOpugiip_iV9CRnIiig3He19FkiVCwMrsNyUfxjzjMIM2CLEqzKExhdIMAAH7v3-ax6PYXosRv3PLBnZ7KTFbtplaWDzfH4gFvHc-35_iGU80LQrXlgzV3vce269muB67nu67vutYZ2KRZ1EwTJtvaNHjuufYbobQ0GSJ6d2cGs86bRWEazgp1W1VHpnMecyWPCvOFN1_03_6Yfq0H-TfxoJ_wy2yYf40N6Ha0_ER6dya97b_Su_1YencD6W0_pPcfuC0pDfJqneDoWXxAbieQ4Cuc4DjEKXxI8Jieom_6-uhvPx_93WD0-33xq-tVEMUwXl9nU8DxywmkeGWw38FVsn4OHfz8A04w5HAJiyWybdtGitEauu8fbh-C-_3-fv_-fv8emKyVbqiotQ-z-czz4Wa2ABtmi1v0dwAAAP__GYf9hw== +https://cockroachdb.github.io/text/decode.html#eJy0U9GOm0YUfd75iitebFcGg61IEdZKJWQ2pXXwCkiaaLUaDcPQjIKZDTO4uFWlfIR_pT_QT9kvqQZvbUclidI0PCDN5dxz7j2csW14yRslZO1DKNnbRlL25ukT4B1neSuqgjegudKwPaAQsm1IcQYF1TSnisMljAxgtER9WSit3lVwCbIslwC2DQUvaVtp2NKq5T7QVsseKuqCd6ThTG42vC6oFrJWhNc0r3jxCQIzhOkPVy_SDCdmmiyKn4F6VzmsKXIias2bmlaONlSkkb8SpakWSgumHKqILIkWm3502_vrTzUa1LE9V31U6AGrnNPCI1mWw0zHlYeYzGjKMZAN1YIRJquKM2OGc_JiVNJK8WF23bT8v7BvRG18OTikjMijYYFHrvsZ_lI2nFGl1f83stopzTek_4WKmAUO9S8QQGGCgwxDFjxZ4T7Fzl2bV4I5HYzRBYUozh5DvM4gfrFaTdFF_lA5nMJ1nGZJEMUZdOTuLd_BdRI9D5LX8BN-DWMKQRpOpugiip_iV9CRnIiig3He19FkiVCwMrsNyUfxjzjMIM2CLEqzKExhdIMAAH7v3-ax6PYXosRv3PLBnZ7KTFbtplaWDzfH4gFvHc-35_iGU80LQrXlgzV3vce269muB67nu67vutYZ2KRZ1EwTJtvaNHjuufYbobQ0GSJ6d2cGs86bRWEazgp1W1VHpnMecyWPCvOFN1_03_6Yfq0H-TfxoJ_wy2yYf40N6Ha0_ER6dya97b_Su_1YencD6W3_Se8HuC0pDfJqneDoWXxAbieQ4Cuc4DjE6YcxHtNT_k1zn__t5_O_G8x_vzR-db0KohjG6-tsCjh-OYEUrwz2O7hK1s-hg59_wAmGHC5hsUS2bdtIMVpD9_3DFURwv9_f79_f798Dk7XSDRW19mE2n3k-3MwWYMNscYv-DgAA__9yKP91 statement error pq: at or near "EOF": syntax error: the ENV flag can only be used with OPT @@ -54,7 +54,7 @@ EXPLAIN (ENV) SELECT * FROM x WHERE b = 3 query T EXPLAIN (OPT, ENV) SELECT * FROM x, y WHERE b = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0VFGO2zYQ_V6eYuAf24XplWwECGQsUMfhpmodeSEpaYLFgqAoqmEjkxuRcq0WBYKewZ-9Ri_Qo-xJCsob20WUBGkafxjg8M17M8-Pxhiei8pIrQJYaP660oy_evwIxFbwrJZlLiqwwljY7FEIYQwJSSFnlmXMCLiAvgP0Z6gtS2PNmxIuQBfFDABjyEXB6tLChpW1CIDVVrdQqXKxpZXger0WKmdWamWoUCwrRf4RAjeE618snyUpid00aRg9AfOmHPMqz6hUVlSKlWPrqGilf6HGMiuNldyMmaG6oFau29Gx__dfpt-pg33PfFDoHmvGx4X7uii6mQ4rdzG50czYQdbMSk65LkvBnRnjoxf9gpVGdLPbqhb_hX0tlfNl75BxIg-6BR543if4C10Jzow1_9_IpjFWrGn7ExrqFtjXP0MALWIyTwmk80dL0qZ4fFtnpeTjLQzQGYMwSh9CtEoherZcjtBZdl_ZnxarKEnjeRilsKW3r0UDV3H4dB6_hB_ISxgwmCeL4QidhdFj8gK2NKMy38Iga-toOENovnS7dcmH0fdkkUKSztMwScNFAv1rBADwW_vtPj22-Yka-avoBeCNjmWuy3qtTC-A60Nxj-8dzjen-EowK3LKbC-A3sTzH2LPx54Pnh94XuB5vROwS7NU3FKua-UafO9U-5U0VrsMUdvcusF6p80ydw0nBVWX5YHplMc9yYPCZOpPpu3d76Mv9SD7Kh60E36eDZMvsQHd9GcfSW_j0lu_l97Nh9LbdKS3fpfef-E2tHDIy1VMwifRHrkZQkwuSUyiBUngXYIH7Bh919dGf_Pp6Ded0W_3JS-ulvMwgsHqKh0BiZ4PISFLh_0GLuPVU9iOoIEfvyMxgQwuYDpDGGOMpFKiwj9rqWDAK23MEMHd7s-73du73VswnClo3qtsv71_sO7mD-f63W53D-BaGVsxqWwA55NzP4Dr8ylgOJ_eoBNYIUsrKgMD92czRP8EAAD__w3UIZ8= +https://cockroachdb.github.io/text/decode.html#eJy0VFGO2zYQ_V6eYuAf24XplWwECGQsUMfhpmodeSEpaYLFgqAoqmEjkxuRcq0WBYKewZ-9Ri_Qo-xJCspb20GUBGkafxjg8M17M8-Pxhiei8pIrQJYaP660oy_evwIxFbwrJZlLiqwwljY7FEIYQwJSSFnlmXMCLiAvgP0Z6gtS2PNmxIuQBfFDABjyEXB6tLChpW1CIDVVrdQqXKxpZXger0WKmdWamWoUCwrRf4RAjeE618snyUpid00aRg9AfOmHPMqz6hUVlSKlWPrqGilf6HGMiuNldyMmaG6oFau29Gx__dfpt-pg33PfFDoHmvGx4X7uii6mQ4rdzG50czYQdbMSk65LkvBnRnjoxf9gpVGdLPbqhb_hX0tlfNl75BxIg-6BR543if4C10Jzow1_9_IpjFWrGn7ExrqFtjXP0MALWIyTwmk80dL0qZ4fFtnpeTjLQzQGYMwSh9CtEoherZcjtBZdl_ZnxarKEnjeRilsKW3r0UDV3H4dB6_hB_ISxgwmCeL4QidhdFj8gK2NKMy38Iga-toOENovnS7dcmH0fdkkUKSztMwScNFAv1rBADwW_vtPj22-Yka-avoBeCNjmWuy3qtTC-A60Nxj-8dzjen-EowK3LKbC-A3sTzH2LPx54Pnh94XuB5vROwS7NU3FKua-UafO9U-5U0VrsMUdvcusF6p80ydw0nBVWX5YHplMc9yYPCZOpPpu3d76Mv9SD7Kh60E36eDZMvsQHd9GcfSW_j0lu_l97Nh9LbdKS3_je97-A2tHDIy1VMwifRHrkZQkwuSUyiBUnejfGAHfPvmtv8bz6d_6Yz_-3S5MXVch5GMFhdpSMg0fMhJGTpsN_AZbx6CtsRNPDjdyQmkMEFTGcIY4yRVEpU-GctFQx4pY0ZIrjb_Xm3e3u3ewuGMwXNe5Xtt_ev1t384ay_2-3uAVwrYysmlQ3gfHLuB3B9PgUM59MbdAIrZGlFZWDg_nGG6J8AAAD__wicI40= # # Same table twice should only show up once. @@ -63,7 +63,7 @@ https://cockroachdb.github.io/text/decode.html#eJy0VFGO2zYQ_V6eYuAf24XplWwECGQsU query T EXPLAIN (OPT, ENV) SELECT * FROM x one, x two ---- -https://cockroachdb.github.io/text/decode.html#eJy0VNFu2zYUfQ6_4kIvtgdLkFwUKGzkQVWZQpsrB5JatAgCgqKolatMpiLlyBsG9CP8uN_YD-xT8iUD5dT2MKVFl9UPhnXvuefce3xs14U3vNFCyTlEin1oFGXvXzwH3nFWtKIueQOGawObPQoh14UM51BSQwuqOZzDyAJGC9SXhTb6Yw3noKpqAeC6UPKKtrWBDa1bPgfaGtVDhSx5RxrO1HrNZUmNUFITLmlR8_ILBHYJOx8tX2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o7HjxSVTXMdDh5iMmupj0LWVMjGGGqrjmzZnhHL0YVrTUfZjdNy_8L-1pI68veIW1Fng4LPPX9r_BXquGMaqP_v5X1Vhu-Jv1XqIk9YF__BgEUpTjMMeTh8yXuU-zdtEUtmNfBGJ1RiJP8GSSrHJLXy-UUnRX3lf1TtEqyPA3jJIeO3HzgW7hM41dh-g5-wu9gTCHMoskUncXJC_wWOlIQUXYwLvo6miwQCpf2tiH5OPkRRzlkeZjHWR5HGYyuEADAb_27fTl08zPR4lfuzMGfHstM1e1aamcOV4fiHu8cnq9P8Q2nhpeEGmcOzswPnrl-4PoB-MHc9-e-75yAbZqFZIYw1Uo7EPin2u-FNspmiJjtjV3MOR0WpR04Kci2rg9Mpzz2J3lQmD0JZk_63u_Tx3pQfBcP-g2_zYbZY2xA16PFF9K7telt_5XezUPp3Q6kt_0nvZ_hNqSyyItViuOXyR65mUCKL3CKkwhnn8d4TI_5t8N9_jdfz_92MP_90fjt5TKMExivLvMp4OTNBDK8tNgf4CJdvYIOwgyU5NP9J3OrFsh1XRcJKXnj_qKEhDFrlNYTBHe7P-52n-52n0AzKqGDK6rPleTXD7TMrepbu_tWJWrDGw1j-38yQX8HAAD__0wmF_g= # # Set a relevant session variable to a non-default value and ensure it shows up @@ -76,7 +76,7 @@ SET reorder_joins_limit = 63 query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0U91u2zYUvg6f4sA3dgZLkWJ0CGTkQlWZTpsrB5LatQgCgqKolatEpiLlWRsG9CHyKnuBPUqeZKDc2h6mtui6-cKAjr-fcz5_chx4wVstlAwgUuxNqyh7_eQx8C1nRSfqkrdguDaw2aEQchzIcA4lNbSgmsMlTC1gukTDWGij39ZwCaqqlgCOAyWvaFcb2NC64wHQzqgBKmTJt6TlTDUNlyU1QklNuKRFzctPCCg50Fuu2pK35GclpCa1aISBS_h2Mcq5QAMnWj3PcpzaA_I4eQr6be2ytiyIkIa3ktause6kV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b9QbIW0uu4S0NXk0bvDI8z6jX6mWM6qN_u9W1r02vCHDX6iJPWA3_wIDFKU4zDHk4eMVHorv3nVFLZi7hRk6oRAn-QUk6xyS56vVHJ0U7ye7p2idZHkaxkkOW3L3hvdwncbPwvQV_IBfwYxCmEWnc3QSJ0_wS9iSgohyC7NimKPTJULhyt42Zh8n3-MohywP8zjL4yiD6Q0CAPht-LafCd38RLT4lU8C8OaHMVN110g9CeBmP9zhJ_vn22N8y6nhJaFmEsDk3PMvHM93PB88P_C8wPMmR2DbZiGZIUx10hJ879j7tdBG2Q4R09_ZxSbHZFFawtFAdnW9VzrWsa_k3uF84Z8vht9-n39tBsX_ksGw4ZfFcP41MaDb6fIT7e1te7t_tHfzsfb2I-3t_m7vB7gNqSzyap3i-GmyQ25OIcVXOMVJhLMPazyjh_5b8tD_zef734_2fzgav7xehXECs_V1PgecvDiFDK8s9hu4StfPoIcfv8Mphg4uYbFEjuM4SDMqoUfwcH__cP_u4f4dMCW1aamQJoAzP4CbswU4cLa4RX8FAAD__97TDLM= # Make sure it shows up correctly even if it matches the cluster setting. statement ok @@ -86,7 +86,7 @@ SET CLUSTER SETTING sql.defaults.reorder_joins_limit = 63 query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0U91u2zYUvg6f4sA3dgbLkWK0CGTkQlWZTpsrB5LatQgCgqKolatEpiLlWRsG9CHyKnuBPUqeZKDc2h6mpOiy-sKAjr4fnk8fHQde80YLJX0IFXvfKMrePX8GfMNZ3oqq4A0Yrg2styiEHAdSnEFBDc2p5nAOYwsYL1A_FtroDxWcgyrLBYDjQMFL2lYG1rRquQ-0NaqHClnwDWk4U3XNZUGNUFITLmle8eIBASV7esNVU_CG_KKE1KQStTBwDk_ng5wz1HPC5as0w4ldIIviF6A_VDPWFDkR0vBG0mpmrDtp1K9EG2qENoLpGdVElcSIut_W8f76U48HbRzP1fcafcLq2T6jsSrLYaVdSg8qDWcwfjofF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k3sAtv5VxigMMFBhiELni1xf5VmN21eCTbbwAQdUYji7AziVQbxq-Vyio7yT5PtU7iK0ywJojiDDbl5zzu4TKKXQfIWfsRvYUIhSMPjKTqK4uf4DWxITkSxgUnez9HxAqFgaXcbso_iH3CYQZoFWZRmUZjC-AoBAPze_9vfiK5_Jlr8xkc-uNP9mKmqraUe-XC1G27xo93z9SG-4dTwglAz8mF06npnjus5rgeu57uu77qjA7C9H0IyQ5hqpSV47qH3O6GNsh0ipruxBxsdkkVhCQcD2VbVTulQx17yncPp3Dud9-_-mD42g_ybZNCf8OtiOH1MDOh6vHigvZ1tb_uv9q7va2830N72n_Z-hluT0iIvVgmOXsRb5PoYEnyBExyHOP28xhO6778l9_1ff7n_3WD_-6Xxm8tlEMUwWV1mU8Dx62NI8dJiv4OLZPUSOvjpe5xgaOEc5gvkOI6DNKMSOgR3t7d3tx_vbj8CU1KbhgppfDjxfLg6mYMDJ_Nr9HcAAAD__0H9Jx0= statement ok SET enable_zigzag_join = true @@ -94,7 +94,7 @@ SET enable_zigzag_join = true query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0U91u2zYUvg6f4sA3dgbLkWK0CGTkwnWZTpsrB5LatQgCgqKolKtEpiLlWRkG9CHyKnuBPUqeZCDdOh6mpOi6-sKAjr4fnk8fPQ9e80YLJUNYKPa-UZS9e_4M-IazvBVVwRswXBtYb1EIeR6kOIOCGppTzeEUhhYwnCE3FtroDxWcgirLGYDnQcFL2lYG1rRqeQi0NcpBuaR5xcmNuLqhV-RXJaRlyV6SKkvHEbLgG9Jwpuqay4IaoaQmW6XiEVMlHb3hqil448w0qUQtDJzC02kv5wQ5zmL5Ks1wYpfOovgF6A_VhDVFToQ0vJG0mhi3R6N-I9pQI7QRTE-oJqokRtQuIS_460897LXxAl8_aPQJqyf3uQ5VWfYr7ZJ9VKk_g-HTab_oyYOKdlk9saY1NYIRpqqKM_tFJvcfZFjSSvN-adO0_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vCauFJoYhfYzr_CAC0SPM8wZPNnS-yu3-S6zSvBJhsYoQMKUZydQLzKIH61XI7RQf5psn1arOI0S-ZRnMGGXL_nHZwn0ct58hZ-xm9hRGGeLg7H6CCKn-M3sCE5EcUGRrmbo8MZQvOl3a3PPop_wosM0myeRWkWLVIYXiAAgN_dv_0N6PqKaHHDByH44_sxU1VbSz0I4WI33OIHu-fLfXzDqeEFoWYQwuDYD048P_D8APwg9P3Q9wd7YHs_hGSGMNVKSwj8fe93QhtlO0RMd20PNtgni8IS9gayraqd0r6OveQ7h-NpcDx17_4Yf2sG-XfJwJ3w62I4_pYY0OVw9kh7O9ve9l_tXT_U3q6nve0_7f0MtyalRZ6tEhy9iLfI9SEk-AwnOF7g9PMaj-h9_y3Z9X_95f53vf13S-M358t5FMNodZ6NAcevDyHFS4v9Ac6S1Uvo4JcfcYKhhVOYzpDneR7SjEroENzd3t7dfry7_QhMSW0aKqQJ4SgI4eJoCh4cTS_R3wEAAP__b-Y4mg== statement ok SET optimizer_use_histograms = false @@ -102,7 +102,7 @@ SET optimizer_use_histograms = false query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0VN1u2zYUvg6f4sA3cgbLkWK0CGTkwnWZTpsrB5LatQgCgpKolKtEpiLlWRkG9CHyKnuBPUqeZCDd2h6mJOiy-sKAjr8f8juf7LrwljWKSxHAXOYfG0nzDy9fAFuzPGt5VbAGNFMaVhsUQq4LCU6hoJpmVDE4BccAnCmyY660-lTBKciynAK4LhSspG2lYUWrlgVAWy0tlAmaVYzc8KsbekV-lVwYluglybK0HC4KtiYNy2VdM1FQzaVQZKNUPGAqhaXLa81rfsMa0ipGPnCl5VVDa_U4s2GyKVhjj6lIxWuu4RSeT3o5J8hy5os3SYpjE1caRq9AfarGeVNkhAvNGkGrsbYJNPI3ojTVXGmeqzFVRJZE89pm6_p__amcXhvX99S9Rl-warzbiCPLsl9pu5MHlfozcJ5P-kVP7lU0l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p6SVYv3SumnZf1GvuTBJbzI3W3ee9Rs887xH9EvZsJwqrf6_I6tOaVYTWwpFzAU2828wQPMYz1IM6ezFAtsXd3zdZhXPx2sYogMKYZSeQLRMIXqzWIzQQfZlsnmaL6MkjWdhlMKaXH9kHZzH4etZ_B5-xu9hSGGWzA9H6CCMXuJ3sCYZ4cUahpmdo8MpQrOFuVuffRj9hOcpJOksDZM0nCfgXCAAgN_tt_kM6OqKKH7DBgF4o904l1VbCzUI4GI73OAH2-fLfXzDqGYFoXoQwODY809cz3c9Hzw_8LzA8wZ7YPN-cJFrkstWGILv7XvbPwnTIaK7a3OwwT6ZF4awNxBtVW2V9nXMS751OJ74xxP72x-jp2aQfZcM7Am_LYbjp8SALp3pA-3tTHvbf7V3dV97u572tv-09yvcipQGebaMcfgq2iBXhxDjMxzjaI6Tr2s8pLv-G7Lt_-rx_ne9_beXxu_OF7MwguHyPB0Bjt4eQoIXBvsDnMXL19DBLz_iGEMLpzCZItd1XaRyKqBDcHd7e3f7-e72M-RSKN1QLnQAR34AF0cTcOFocon-DgAA__-zzEzl statement ok SET optimizer_use_multicol_stats = false @@ -110,7 +110,7 @@ SET optimizer_use_multicol_stats = false query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0VF9u2zYcfq5O8YNf5AyWI8VoEcjIg-synTZXDiS1axEEBEVRKVeKTEXKszMM6CFylV1gR8lJBtKt42FKuqybHwzw5-8P-fGjgwDesFZzJWOYK_qhVYS-f_Ec2JrRsuOiYi0Ypg2stijPCwLIUQEVMaQkmsEJ-BbgTz035trojwJOQNX1FCAIoGI16YSBFREdi4F0Rjkok6QUDF_zy2tyiX9WXFqW7CWpunYcLiu2xi2jqmmYrIjhSmq8VaoeMFXS0dWV4Q2_Zi3uNMPvuTbqsiWNfiyz6YThVAmsDTH_gN0y1VasdYfUWPCGGziBZ5NezrHnOPPF67xAmQ27SNKXoD-KMW2rEnNpWCuJGBuXX6t-cd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nCqx0RjVWPDG3czQfTH79rvtQmiUN9r9Bmrx3f36au67lfa3eiDSv0Z-M8m_aLH9yq6zMfWtCGGU0yVEIzaJozviuDXRGjWL23ajv0b9YZLm_Q2c3vr_tN-g6dh-BX9WrWMEm30f7dlvdGGNdiVQmN7gO38EQbePEOzAkExe75A7tmPr7pScDpew9B7QiBJi2NIlwWkrxeLkfek_DzZrubLNC-yWZIWsMZXH9gGzrLk1Sx7Bz-idzAkMMvnByPvSZK-QG9hjUvMqzUMSzf3DqaeN1vYs_XZJ-kPaF5AXsyKJC-SeQ7-uQcA8Kv7tp8BWV1iza_ZIIZwdDemSnSN1IMYznfDLX6wW1_s41tGDKswMYMYBkdhdByEURBGEEZxGMZhONgD2_fBJTWYqk5aQhTue7u_GNshbDZXdmODfTKvLGFvIDshdkr7OvaR7xyOJtHRxP322-hbMyj_lwzcDh8Xw9G3xOBd-NMH2rux7e3-1t7Vfe3d9LS3-6u9X-BWuLbI02WGkpfpFrk6gAydogylc5R_WeMhueu_Jbv-r77e_01v_92h0duzxSxJYbg8K0aA0jcHkKOFxX4Hp9nyFWzgp-9RhqCDE5hMvSAIAk9TImHjwe3Nze3Np9ubT0CV1KYlXJoYDqMYzg8nEMDh5ML7MwAA__8OimLm statement ok RESET reorder_joins_limit @@ -146,7 +146,7 @@ CREATE VIEW v AS SELECT a, b, u, v FROM x, y WHERE b = 3 query T EXPLAIN (OPT, ENV) SELECT * FROM v ---- -https://cockroachdb.github.io/text/decode.html#eJy0VNFu2zYUfQ6_4sIvtgfJkWy0CGQEmOoynTZXDiQ1bREEBCVRK1eZTEVKszcMKPYNftxv7Af2KfmSgXJiu6uSosvmBwO6Ovcc3cNzadtwwSrFpfBgJrP3laTZu-fPgK1Ylta8zFkFmikNzRaFkG1DjBPIqaYpVQxOoW8A_Slqy1xp9aGEU5BFMQWwbchZQetSQ0PLmnlAay1bKBc5W5GKZXK5ZCKnmkuhCBM0LVn-AIEUbXvFZJWzivwkuVCk5Euu4RSeTjp7T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5GKZXK5ZCKnmkuhCBM0LVn-AIEUbXvFZJWzivwkuVCk5Euu4RSeTjp7TlDbM5u_ihMcmQGSIHwB6kM5yqo8JVxoVglajrRRJ5X8mShNNVeaZ2pEFZEF0XzZTmu7f_2p-p0ytuuoe4V2WDW69agvi6Kbae_Sg0zdHvSfTrpJT-5lNMOqkRFdUs0zksmyZJn5IqPbD9IvaKlYN7WuavZv2JdcGKe3nisj8qRb4InjfIG_kBXLqNLqvzuyWivNlqQNhSJmgG39KwTQLMJ-giHxn81xu0qj6zoteTZawQAdUQjC5ATCRQLhq_ncQkfprrJ9mi3COIn8IExgRa7fszWcR8FLP3oLP-C3MKDgx7OhhY6C8Dl-AyuSEp6vYJC2dTScIuTPzWxd8kH4PZ4lECd-EsRJMIuhf4kAAH5t_82vR5sfieK_sJ4HjnVbzmRZL4XqeXC5L27xvf3z1SG-YlSznFDd86A3dtwT23FtxwXH9RzHc5zeAdjsBxeZJpmshWlwnUPtd1xpaTJE9PraHKx32Mxz03BQEHVZ7pkOecyS7xXGE3c8ad_9Zj3Wg_R_8aA94dfZMH6MDeiqP30gvWuT3vqz9Db3pXfdkd76U3rv4BpSGOTZIsLBi3CLbIYQ4TMc4XCG47sxHtDb_JvmNv_Nl_O_7sz_4dAXAX4NO3TTLqtZTwsd1WZQNAQ_hhjPDQe1ILWgtqCBs2jx8u4JrX_ovv4ORxhSOIXJFCH85nzuByEMFueJBTi8GH4i_WbL1UyRbds24kKwyjZXPQyySio1RHCz-eNm8_Fm8xFURgWsP6usvt3dCebN7-bD3mw2O0AmhdIV5UJ7cDw-dj24PJ6ADceTK3QAK3ipWaVgYO6zIfo7AAD__2nCaI8= # # Test tables in user-defined schemas. @@ -196,17 +196,17 @@ CREATE TABLE z ( query T EXPLAIN (OPT, ENV) SELECT * FROM z; ---- -https://cockroachdb.github.io/text/decode.html#eJy0U9GO2jgUfR5_xRUvMCuCwoxajUDzQKmnyi4NoyStWlWV5ThO68XYjO2whNV-1v7AftnKoQNUDVT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tyA49bBeodCKAggxRkU1NGcWg630PWA7hg1Y17SSjriDFWWMie0Ig8VlcLVRJfEcrMWzC8xI5xgVI4BguDrGqyprPgIDP9USWp2jMI6-yDhFnRZtqJp5XQDFargG2I408slVwX16pZwRXPJizMEWjXrhmtTcEN-10JZIsVSOLiF59etOzeo2ZnO3qQZTnwkWRS_AvsgB8wUORHKcaOoHDivToz-g1hHnbBOMDug1qfhxLLJLxj-87fttsoEw9CeFPqCtYNDRl1dlu1M-5TOMrVn0H1-3U56c5LRm7UDL7qkTjDCtJS86cPg8Id0Syotb6d2puL_hX0plE96l7n1Is_aBZ6F4Xf4S204o9bZ_-_KtraOL0lTCku8gd38BwTQNMGTDEM2eTHDzeMcrKpcCjbYQA9dUIji7AbieQbxm9msjy7yL5PdaTqP0yyZRHEGG7Ja8Bruk-j1JHkPv-H30KMwSaeXfXQRxS_xO9iQnIhiA728maPLMUKTmffWJh_Fv-JpBmk2yaI0i6YpdD8gAIA_m2__6dD1J2LFlndGEPYPY6ZltVS2M4IP--EO39mfPx7jDaeOF4S6zgg6V-HwJgiHQTiEcDgKw1EYdo7A_n0IxRxhulJ-YRgea38W1mnfIeLqlb9Y53hZFH7haKAqKfdMxzz-ke8Vrq6HV9fNb3_1n5pB_lMyaG74YzFcPSUG9LE7PtPe2re3-qa961PtrVvaW31t7yPcmpQeeTdPcPQq3iHXl5DgO5zgeIrTxzXu0UP__XLT__X3-1-39v-86a03vVp849rw8pTvbYvv1aLFeLl4bNnw8qTpuledN7c9bQ6_u59Nohh68_usDzh-ewkpnnnsL3CXzF_DdoyCIAiQZVTBFv0bAAD___rkcxA= query T EXPLAIN (OPT, ENV) SELECT * FROM y; ---- -https://cockroachdb.github.io/text/decode.html#eJy0U9GO2jgUfR5_xRUvMCuCwoxajUDzQKmnyi4NoyStWlWV5ThO68XYjO1kyaz2s_YH9stWDh2GqoGqO1sekHw59xyfw3EQwFturNBqAnPNVkZT9vnlC-BbzvJKyIIbcNw6qHcohIIAUpxBQR3N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WyopPwPBPlaRmxyiss3cSrkGXZSeaVk63UKEKXhPDmV6vuSqoV7eEK5pLXpwg0KpdN1ybghvyuxbKEinWwsE1PL_s3LlC7c588SbNcOIjyaL4Fdg7OWKmyIlQjhtF5ch5dWL0H8Q66oR1gtkRtT4NJ9ZtfsH4n79tv1MmGIf2qNAXrB09ZNTXZdnNtE_pJFN3Bv3nl92kV0cZvVk78qJr6gQjTEvJ2z6MHv6Qfkml5d3UzlT8v7CvhfJJ7zK3XuRZt8CzMPwOf6kNZ9Q6-_9d2TbW8TVpS2GJN7Cb_4AAmid4lmHIZi8WuH2co02VS8FGNQzQGYUozq4gXmYQv1kshugs_zLZnebLOM2SWRRnUJPNijdwm0SvZ8l7-A2_hwGFWTo_H6KzKH6J30FNciKKGgZ5O0fnU4RmC--tSz6Kf8XzDNJslkVpFs1T6H9AAAB_tt_-06PbT8SKe96bQDh8GDMtq7WyvQl82A93-N7-_PEQbzh1vCDU9SbQuwjHV0E4DsIxhONJGE7CsHcA9u9DKOYI05XyC-PwUPuzsE77DhHXbPzFeofLovALBwNVSblnOuTxj3yvcHE5vrhsf_tr-NQM8p-SQXvDH4vh4ikxoI_96Yn2Nr691Tft3R5rb9PR3uprex_htqT0yJtlgqNX8Q65PYcE3-AEx3OcPq7xgD703y-3_d9-v_9NZ_9Pm773pjerb1wbXh7zfd_he7PqMF6uHls2vDxquhlUp83dHzeH390uZlEMg-VtNgQcvz2HFC889he4SZavoZ6iIAgCZBlVUKN_AwAA___6wnMM # A foreign key cycle shouldn't cause infinite recursion. statement ok @@ -215,7 +215,7 @@ ALTER TABLE y ADD CONSTRAINT fk FOREIGN KEY (v) REFERENCES z (pk); query T EXPLAIN (OPT, ENV) SELECT * FROM y; ---- -https://cockroachdb.github.io/text/decode.html#eJy0VNGO2jgUfR5_xRUvMCuCwoxajUDzQKmnyi4NoyStWlWV5ThO68XYjO2whNV-1v7AftnKYQqsGhh1Z5cHpFzOPcfncOIggPfcWKHVCKaaLYym7OvrV8A3n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c6goI7m1HK4ha4HdMeoGfOSVtIRZ6iylDmhFXmoqBSuJroklpu1YH6JGeEEo3IMEARf12BNZcVHYPinSlKzYxTW2QcJt6DLshVNK6cbqFAF3xDDmV4uuSqoV7eEK5pLXpwh0KpZN1ybghvyuxbKEimWwsEtPL9u3blBzc509ibNcOIjyaL4FdgHOWCmyIlQjhtF5cB5dWL0H8Q66oR1gtkBtT4NJ5ZNfsHwn79tt1UmGIb2pNAXrB0cMurqsmxn2qd0lqk9g-7z63bSm5OM3qwdeNEldYIRpqXkTR8Ghz-kW1JpeTu1MxX_L-xLoXzSu8ytF3nWLvAsDB_hL7XhjFpn_78j29o6viRNKSzxBnbzHxBA0wRPMgzZ5MUMNy_nYFXlUrDBBnrogkIUZzcQzzOI38xmfXSRf5nsnqbzOM2SSRRnsCGrBa_hPoleT5L38Bt-Dz0Kk3R62UcXUfwSv4MNyYkoNtDLmzm6HCM0mXlvbfJR_CueZpBmkyxKs2iaQvcDAgD4s_n2nw5dfyJWbHlnBGH_MGZaVktlOyP4sB_u8J3988djvOHU8YJQ1xlB5yoc3gThMAiHEA5HYTgKw84R2L8fQjFHmK6UXxiGx9qfhXXad4i4euUP1jleFoVfOBqoSso90zGPf8n3ClfXw6vr5re_-k_NIP8pGTQn_LEYrp4SA_rYHZ9p79a3d7X4rr6Gl6cKvG0p8GrxtcFHwHIBd_MER6_iHcjw8hISfIcTHE9x-s056l51vufb1p6fN1d7c9V33tannNUtzqoWYzVZk9Ijv7G3Pmlu06OPRHN6d9tbLQ43g1dubob14zdDfTox_O5-Noli6M3vsz7g-O0lpHjmsb_AXTJ_DfUYBUEQIMuoghr9GwAA__8phYTA # Check that we remove histograms from statistics correctly. diff --git a/pkg/sql/parser/sql.y b/pkg/sql/parser/sql.y index b4974dff0c15..19293c80322a 100644 --- a/pkg/sql/parser/sql.y +++ b/pkg/sql/parser/sql.y @@ -904,8 +904,8 @@ func (u *sqlSymUnion) showTenantOpts() tree.ShowTenantOptions { func (u *sqlSymUnion) showLogicalReplicationJobsOpts() tree.ShowLogicalReplicationJobsOptions { return u.val.(tree.ShowLogicalReplicationJobsOptions) } -func (u *sqlSymUnion) showCreateFormatOption() tree.ShowCreateFormatOption { - return u.val.(tree.ShowCreateFormatOption) +func (u *sqlSymUnion) showCreateFormatOptions() tree.ShowCreateFormatOptions { + return u.val.(tree.ShowCreateFormatOptions) } func (u *sqlSymUnion) beginTransaction() *tree.BeginTransaction { return u.val.(*tree.BeginTransaction) @@ -988,7 +988,7 @@ func (u *sqlSymUnion) triggerForEach() tree.TriggerForEach { %token FILES FILTER %token FIRST FLOAT FLOAT4 FLOAT8 FLOORDIV FOLLOWING FOR FORCE FORCE_INDEX FORCE_INVERTED_INDEX %token FORCE_NOT_NULL FORCE_NULL FORCE_QUOTE FORCE_ZIGZAG -%token FOREIGN FORMAT FORWARD FREEZE FROM FULL FUNCTION FUNCTIONS +%token FOREIGN FORMAT FORWARD FREEZE FROM FULL FULLY_QUALIFIED FUNCTION FUNCTIONS %token GENERATED GEOGRAPHY GEOMETRY GEOMETRYM GEOMETRYZ GEOMETRYZM %token GEOMETRYCOLLECTION GEOMETRYCOLLECTIONM GEOMETRYCOLLECTIONZ GEOMETRYCOLLECTIONZM @@ -1341,7 +1341,7 @@ func (u *sqlSymUnion) triggerForEach() tree.TriggerForEach { %type show_constraints_stmt %type show_triggers_stmt %type show_create_stmt -%type opt_show_create_format_options +%type opt_show_create_format_options show_create_format_options opt_show_create_format_options_view %type show_create_schedules_stmt %type show_create_external_connections_stmt %type show_csettings_stmt show_local_or_virtual_cluster_csettings_stmt @@ -9482,7 +9482,7 @@ show_create_stmt: SHOW CREATE table_name opt_show_create_format_options { $$.val = &tree.ShowCreate{ - Name: $3.unresolvedObjectName(), FmtOpt: $4.showCreateFormatOption(), + Name: $3.unresolvedObjectName(), FmtOpt: $4.showCreateFormatOptions(), } } | SHOW CREATE TABLE table_name opt_show_create_format_options @@ -9491,16 +9491,16 @@ show_create_stmt: $$.val = &tree.ShowCreate{ Mode: tree.ShowCreateModeTable, Name: $4.unresolvedObjectName(), - FmtOpt: $5.showCreateFormatOption(), + FmtOpt: $5.showCreateFormatOptions(), } } -| SHOW CREATE VIEW table_name opt_show_create_format_options +| SHOW CREATE VIEW table_name opt_show_create_format_options_view { /* SKIP DOC */ $$.val = &tree.ShowCreate{ Mode: tree.ShowCreateModeView, Name: $4.unresolvedObjectName(), - FmtOpt: $5.showCreateFormatOption(), + FmtOpt: $5.showCreateFormatOptions(), } } | SHOW CREATE SEQUENCE sequence_name @@ -9567,11 +9567,46 @@ show_create_stmt: opt_show_create_format_options: /* EMPTY */ { - $$.val = tree.ShowCreateFormatOptionNone + $$.val = tree.ShowCreateFormatOptions{} + } +| WITH show_create_format_options + { + $$.val = $2.showCreateFormatOptions() + } + +show_create_format_options: +REDACT + { + $$.val = tree.ShowCreateFormatOptions{RedactedValues: true} + } +| FULLY_QUALIFIED + { + /* SKIP DOC */ + $$.val = tree.ShowCreateFormatOptions{FullyQualified: true} + } +| show_create_format_options ',' REDACT + { + /* SKIP DOC */ + o := $1.showCreateFormatOptions() + o.RedactedValues = true + $$.val = o + } +| show_create_format_options ',' FULLY_QUALIFIED + { + /* SKIP DOC */ + o := $1.showCreateFormatOptions() + o.FullyQualified = true + $$.val = o + } + +opt_show_create_format_options_view: + /* EMPTY */ + { + $$.val = tree.ShowCreateFormatOptions{} } | WITH REDACT { - $$.val = tree.ShowCreateFormatOptionRedactedValues + $$.val = tree.ShowCreateFormatOptions{RedactedValues: true} } // %Help: SHOW CREATE SCHEDULES - list CREATE statements for scheduled jobs @@ -17934,6 +17969,7 @@ unreserved_keyword: | FORCE_ZIGZAG | FORWARD | FREEZE +| FULLY_QUALIFIED | FUNCTION | FUNCTIONS | GENERATED @@ -18473,6 +18509,7 @@ bare_label_keywords: | FORWARD | FREEZE | FULL +| FULLY_QUALIFIED | FUNCTION | FUNCTIONS | GENERATED diff --git a/pkg/sql/parser/testdata/show b/pkg/sql/parser/testdata/show index 3f28f8e79fe3..1e827759361c 100644 --- a/pkg/sql/parser/testdata/show +++ b/pkg/sql/parser/testdata/show @@ -1972,6 +1972,30 @@ SHOW CREATE t WITH REDACT -- fully parenthesized SHOW CREATE t WITH REDACT -- literals removed SHOW CREATE _ WITH REDACT -- identifiers removed +parse +SHOW CREATE TABLE t WITH FULLY_QUALIFIED +---- +SHOW CREATE t WITH FULLY_QUALIFIED -- normalized! +SHOW CREATE t WITH FULLY_QUALIFIED -- fully parenthesized +SHOW CREATE t WITH FULLY_QUALIFIED -- literals removed +SHOW CREATE _ WITH FULLY_QUALIFIED -- identifiers removed + +parse +SHOW CREATE TABLE t WITH REDACT, FULLY_QUALIFIED +---- +SHOW CREATE t WITH REDACT, FULLY_QUALIFIED -- normalized! +SHOW CREATE t WITH REDACT, FULLY_QUALIFIED -- fully parenthesized +SHOW CREATE t WITH REDACT, FULLY_QUALIFIED -- literals removed +SHOW CREATE _ WITH REDACT, FULLY_QUALIFIED -- identifiers removed + +parse +SHOW CREATE TABLE t WITH FULLY_QUALIFIED, REDACT +---- +SHOW CREATE t WITH REDACT, FULLY_QUALIFIED -- normalized! +SHOW CREATE t WITH REDACT, FULLY_QUALIFIED -- fully parenthesized +SHOW CREATE t WITH REDACT, FULLY_QUALIFIED -- literals removed +SHOW CREATE _ WITH REDACT, FULLY_QUALIFIED -- identifiers removed + parse SHOW CREATE VIEW t ---- diff --git a/pkg/sql/sem/tree/show.go b/pkg/sql/sem/tree/show.go index 1bdc0ffb8c5b..9ece9273a8c2 100644 --- a/pkg/sql/sem/tree/show.go +++ b/pkg/sql/sem/tree/show.go @@ -821,18 +821,16 @@ const ( ShowCreateModeSecondaryIndexes ) -type ShowCreateFormatOption int - -const ( - ShowCreateFormatOptionNone ShowCreateFormatOption = iota - ShowCreateFormatOptionRedactedValues -) +type ShowCreateFormatOptions struct { + RedactedValues bool + FullyQualified bool +} // ShowCreate represents a SHOW CREATE statement. type ShowCreate struct { Mode ShowCreateMode Name *UnresolvedObjectName - FmtOpt ShowCreateFormatOption + FmtOpt ShowCreateFormatOptions } // Format implements the NodeFormatter interface. @@ -849,9 +847,13 @@ func (node *ShowCreate) Format(ctx *FmtCtx) { } ctx.FormatNode(node.Name) - switch node.FmtOpt { - case ShowCreateFormatOptionRedactedValues: + switch { + case node.FmtOpt.RedactedValues && !node.FmtOpt.FullyQualified: ctx.WriteString(" WITH REDACT") + case !node.FmtOpt.RedactedValues && node.FmtOpt.FullyQualified: + ctx.WriteString(" WITH FULLY_QUALIFIED") + case node.FmtOpt.RedactedValues && node.FmtOpt.FullyQualified: + ctx.WriteString(" WITH REDACT, FULLY_QUALIFIED") } } diff --git a/pkg/sql/show_create.go b/pkg/sql/show_create.go index 9a25b641cb7d..607d93ab939d 100644 --- a/pkg/sql/show_create.go +++ b/pkg/sql/show_create.go @@ -53,6 +53,10 @@ type ShowCreateDisplayOptions struct { // RedactableValues causes all constants, literals, and other user-provided // values to be surrounded with redaction markers. RedactableValues bool + // FullyQualifyUDTNames causes all names of user-defined types to be + // fully-qualified (i.e. use the 'db.schema.name' notation instead of the + // 'schema.name' notation). + FullyQualifyUDTNames bool } // ShowCreateTable returns a valid SQL representation of the CREATE @@ -96,7 +100,7 @@ func ShowCreateTable( f.WriteString("\n\t") colstr, err := schemaexpr.FormatColumnForDisplay( ctx, desc, col, p.EvalContext(), &p.semaCtx, p.SessionData(), - displayOptions.RedactableValues, + displayOptions.RedactableValues, displayOptions.FullyQualifyUDTNames, ) if err != nil { return "", err