You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
107567: sql: fix CREATE AS [SHOW CREATE FUNCTION] job failure r=rafiss a=ecwall
Fixescockroachdb#106268
Previously `CREATE TABLE AS`/`CREATE MATERIALIZED VIEW AS` sourcing from `SHOW CREATE FUNCTION <function>` generated a failing schema change job with a `unknown function: f(): function undefined` error because the job runs in the system database and functions cannot be referenced cross database.
This PR fixes this by using the original user session (which includes the database) in the schema change job.
Release note (bug fix): Fixes the schema changer job when CREATE AS sources from SHOW CREATE FUNCTION:
CREATE TABLE t AS SELECT * FROM [SHOW CREATE FUNCTION f];
Co-authored-by: Evan Wall <[email protected]>
Copy file name to clipboardExpand all lines: pkg/sql/colexec/colbuilder/execplan.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -257,7 +257,7 @@ var (
257
257
errExporterWrap=errors.New("core.Exporter is not supported (not an execinfra.RowSource)")
258
258
errSamplerWrap=errors.New("core.Sampler is not supported (not an execinfra.RowSource)")
259
259
errSampleAggregatorWrap=errors.New("core.SampleAggregator is not supported (not an execinfra.RowSource)")
260
-
errExperimentalWrappingProhibited=errors.New("wrapping for non-JoinReader and non-LocalPlanNode cores is prohibited in vectorize=experimental_always")
260
+
errExperimentalWrappingProhibited=errors.Newf("wrapping for non-JoinReader and non-LocalPlanNode cores is prohibited in vectorize=%s", sessiondatapb.VectorizeExperimentalAlways)
261
261
errWrappedCast=errors.New("mismatched types in NewColOperator and unsupported casts")
262
262
errLookupJoinUnsupported=errors.New("lookup join reader is unsupported in vectorized")
263
263
errFilteringAggregation=errors.New("filtering aggregation not supported")
query error pq: crdb_internal.json_to_pb\(\): invalid proto JSON: unmarshaling json to cockroach.sql.sqlbase.Descriptor: unknown field "__redacted__" in descpb.Descriptor
2992
+
query error pq: crdb_internal.json_to_pb\(\): invalid proto JSON: unmarshaling to cockroach.sql.sqlbase.Descriptor json: .+ unknown field "__redacted__" in descpb.Descriptor
2993
2993
select crdb_internal.json_to_pb('cockroach.sql.sqlbase.Descriptor', crdb_internal.pb_to_json('cockroach.sql.sqlbase.Descriptor', descriptor, true, true)) = descriptor from system.descriptor where id = 1
0 commit comments