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

sqlsmith: bring back hide_sql_constants #97831

Merged
merged 1 commit into from
Mar 3, 2023
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
3 changes: 0 additions & 3 deletions pkg/internal/sqlsmith/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,6 @@ var functions = func() map[tree.FunctionClass]map[oid.Oid][]function {
"crdb_internal.revalidate_unique_constraint",
"crdb_internal.request_statement_bundle",
"crdb_internal.set_compaction_concurrency",
// TODO(96555): Temporarily disable crdb_internal.hide_sql_constants,
// which produces internal errors for some valid inputs.
"crdb_internal.hide_sql_constants",
// TODO(#97097): Temporarily disable crdb_internal.fingerprint
// which produces internal errors for some valid inputs.
"crdb_internal.fingerprint",
Expand Down
5 changes: 5 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/builtin_function
Original file line number Diff line number Diff line change
Expand Up @@ -3736,6 +3736,11 @@ SELECT crdb_internal.hide_sql_constants(ARRAY('select 1', NULL, 'select ''hello'
----
{"SELECT _",NULL,"SELECT '_'","",""}

query T
SELECT crdb_internal.hide_sql_constants(ARRAY['banana'])
----
{""}

query T
SELECT crdb_internal.hide_sql_constants('SELECT ''yes'' IN (''no'', ''maybe'', ''yes'')')
----
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/sem/builtins/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -7683,7 +7683,7 @@ expires until the statement bundle is collected`,
return tree.NewDString(sqlNoConstants), nil
},
types.String,
"Removes constants from a SQL statement. String provided must contain at most"+
"Removes constants from a SQL statement. String provided must contain at most "+
"1 statement.",
volatility.Immutable,
),
Expand Down Expand Up @@ -7720,7 +7720,7 @@ expires until the statement bundle is collected`,

return result, nil
},
Info: "Hide constants for each element in an array of SQL statements." +
Info: "Hide constants for each element in an array of SQL statements. " +
"Note that maximum 1 statement is permitted per string element.",
Volatility: volatility.Immutable,
},
Expand Down