Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: udf logic tests not to skip dropping databases #86278

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions pkg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ ALL_TESTS = [
"//pkg/sql/logictest/tests/fakedist:fakedist_test",
"//pkg/sql/logictest/tests/local-mixed-21.2-22.1:local-mixed-21_2-22_1_test",
"//pkg/sql/logictest/tests/local-mixed-22.1-22.2:local-mixed-22_1-22_2_test",
"//pkg/sql/logictest/tests/local-udf:local-udf_test",
"//pkg/sql/logictest/tests/local-v1.1-at-v1.0-noupgrade:local-v1_1-at-v1_0-noupgrade_test",
"//pkg/sql/logictest/tests/local-vec-off:local-vec-off_test",
"//pkg/sql/logictest/tests/local:local_test",
Expand All @@ -376,7 +375,6 @@ ALL_TESTS = [
"//pkg/sql/opt/exec/execbuilder/tests/fakedist-disk:fakedist-disk_test",
"//pkg/sql/opt/exec/execbuilder/tests/fakedist-vec-off:fakedist-vec-off_test",
"//pkg/sql/opt/exec/execbuilder/tests/fakedist:fakedist_test",
"//pkg/sql/opt/exec/execbuilder/tests/local-udf:local-udf_test",
"//pkg/sql/opt/exec/execbuilder/tests/local-vec-off:local-vec-off_test",
"//pkg/sql/opt/exec/execbuilder/tests/local:local_test",
"//pkg/sql/opt/exec/execbuilder:execbuilder_test",
Expand Down Expand Up @@ -1450,7 +1448,6 @@ GO_TARGETS = [
"//pkg/sql/logictest/tests/fakedist:fakedist_test",
"//pkg/sql/logictest/tests/local-mixed-21.2-22.1:local-mixed-21_2-22_1_test",
"//pkg/sql/logictest/tests/local-mixed-22.1-22.2:local-mixed-22_1-22_2_test",
"//pkg/sql/logictest/tests/local-udf:local-udf_test",
"//pkg/sql/logictest/tests/local-v1.1-at-v1.0-noupgrade:local-v1_1-at-v1_0-noupgrade_test",
"//pkg/sql/logictest/tests/local-vec-off:local-vec-off_test",
"//pkg/sql/logictest/tests/local:local_test",
Expand All @@ -1476,7 +1473,6 @@ GO_TARGETS = [
"//pkg/sql/opt/exec/execbuilder/tests/fakedist-disk:fakedist-disk_test",
"//pkg/sql/opt/exec/execbuilder/tests/fakedist-vec-off:fakedist-vec-off_test",
"//pkg/sql/opt/exec/execbuilder/tests/fakedist:fakedist_test",
"//pkg/sql/opt/exec/execbuilder/tests/local-udf:local-udf_test",
"//pkg/sql/opt/exec/execbuilder/tests/local-vec-off:local-vec-off_test",
"//pkg/sql/opt/exec/execbuilder/tests/local:local_test",
"//pkg/sql/opt/exec/execbuilder:execbuilder",
Expand Down Expand Up @@ -2565,7 +2561,6 @@ GET_X_DATA_TARGETS = [
"//pkg/sql/logictest/tests/local:get_x_data",
"//pkg/sql/logictest/tests/local-mixed-21.2-22.1:get_x_data",
"//pkg/sql/logictest/tests/local-mixed-22.1-22.2:get_x_data",
"//pkg/sql/logictest/tests/local-udf:get_x_data",
"//pkg/sql/logictest/tests/local-v1.1-at-v1.0-noupgrade:get_x_data",
"//pkg/sql/logictest/tests/local-vec-off:get_x_data",
"//pkg/sql/logictest/tests/multiregion-9node-3region-3azs:get_x_data",
Expand All @@ -2586,7 +2581,6 @@ GET_X_DATA_TARGETS = [
"//pkg/sql/opt/exec/execbuilder/tests/fakedist-disk:get_x_data",
"//pkg/sql/opt/exec/execbuilder/tests/fakedist-vec-off:get_x_data",
"//pkg/sql/opt/exec/execbuilder/tests/local:get_x_data",
"//pkg/sql/opt/exec/execbuilder/tests/local-udf:get_x_data",
"//pkg/sql/opt/exec/execbuilder/tests/local-vec-off:get_x_data",
"//pkg/sql/opt/exec/explain:get_x_data",
"//pkg/sql/opt/idxconstraint:get_x_data",
Expand Down
7 changes: 7 additions & 0 deletions pkg/ccl/logictestccl/tests/3node-tenant/generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/sql/distsql_physical_planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ func (v *distSQLExprCheckVisitor) VisitPre(expr tree.Expr) (recurse bool, newExp
v.err = newQueryNotSupportedErrorf("function %s cannot be executed with distsql", t)
return false, expr
}
case *tree.RoutineExpr:
// TODO(86310): enable UDFs in DistSQL.
v.err = newQueryNotSupportedErrorf("user-defined routine %s cannot be executed with distsql", t)
return false, expr
case *tree.DOid:
v.err = newQueryNotSupportedError("OID expressions are not supported by distsql")
return false, expr
Expand Down
3 changes: 0 additions & 3 deletions pkg/sql/logictest/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -3644,9 +3644,6 @@ SELECT encode(descriptor, 'hex') AS descriptor
}

func (t *logicTest) maybeDropDatabases() error {
if t.cfg.SkipDropDatabases {
return nil
}
var dbNames pq.StringArray
if err := t.db.QueryRow(
`SELECT array_agg(database_name) FROM [SHOW DATABASES] WHERE database_name NOT IN ('system', 'postgres')`,
Expand Down
16 changes: 0 additions & 16 deletions pkg/sql/logictest/logictestbase/logictestbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ type TestClusterConfig struct {
// disableLocalityOptimizedSearch disables the cluster setting
// locality_optimized_partitioned_index_scan, which is enabled by default.
DisableLocalityOptimizedSearch bool
// SkipDropDatabases allows a configuration to skip dropping of the database.
// This exists to enable development while DROP DATABASE for a feature is
// broken.
//
// TODO(ajwerner,chengxiong-ruan): Remove this before 22.2 is released.
SkipDropDatabases bool
// DeclarativeCorpusCollection enables support for collecting corpuses
// for the declarative schema changer.
DeclarativeCorpusCollection bool
Expand Down Expand Up @@ -468,16 +462,6 @@ var LogicTestConfigs = []TestClusterConfig{
DisableUpgrade: true,
DeclarativeCorpusCollection: true,
},
{
Name: "local-udf",
NumNodes: 1,
// local is the configuration where we run all tests which have bad
// interactions with the default test tenant.
DisableDefaultTestTenant: true,
// Set SkipDropDatabases to true for now to enable development on UDFs.
// TODO(ajwerner,chengxiong-ruan): Remove this before the 22.2 release.
SkipDropDatabases: true,
},
}

// ConfigIdx is an index in the above slice.
Expand Down
17 changes: 9 additions & 8 deletions pkg/sql/logictest/testdata/logic_test/udf
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# LogicTest: local-udf

statement ok
CREATE TABLE ab (
a INT PRIMARY KEY,
Expand Down Expand Up @@ -1222,8 +1220,9 @@ query TT
$test_alter_sc_f_test_sc
)
)
SELECT fn->'id', fn->'parentSchemaId'
FROM fns;
SELECT fn->>'id' AS id, fn->'parentSchemaId'
FROM fns
ORDER BY id;
----
170 105
171 105
Expand Down Expand Up @@ -1254,8 +1253,9 @@ query TT
$test_alter_sc_f_test_sc
)
)
SELECT fn->'id', fn->'parentSchemaId'
FROM fns;
SELECT fn->>'id' AS id, fn->'parentSchemaId'
FROM fns
ORDER BY id;
----
170 105
171 105
Expand Down Expand Up @@ -1303,8 +1303,9 @@ query TT
$test_alter_sc_f_test_sc
)
)
SELECT fn->'id', fn->'parentSchemaId'
FROM fns;
SELECT fn->>'id' AS id, fn->'parentSchemaId'
FROM fns
ORDER BY id;
----
170 105
171 172
Expand Down
7 changes: 7 additions & 0 deletions pkg/sql/logictest/tests/fakedist-disk/generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkg/sql/logictest/tests/fakedist-vec-off/generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkg/sql/logictest/tests/fakedist/generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 0 additions & 28 deletions pkg/sql/logictest/tests/local-udf/BUILD.bazel

This file was deleted.

80 changes: 0 additions & 80 deletions pkg/sql/logictest/tests/local-udf/generated_test.go

This file was deleted.

7 changes: 7 additions & 0 deletions pkg/sql/logictest/tests/local-vec-off/generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkg/sql/logictest/tests/local/generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/sql/opt/exec/execbuilder/testdata/udf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: local-udf
# LogicTest: local

statement ok
CREATE TABLE t (
Expand Down
29 changes: 0 additions & 29 deletions pkg/sql/opt/exec/execbuilder/tests/local-udf/BUILD.bazel

This file was deleted.

Loading