Skip to content

QA: crdb_internal.redactable_sql_constants syntax error on query #99132

@rharding6373

Description

@rharding6373

When trying to pass the following query through crdb_internal.redactable_sql_constants verbatim, I encounter a syntax error. \hf crdb_internal.redactable_sql_constants is not immediately helpful in figuring out what the issue is.

CREATE TABLE t1 (id INT, colJSON JSON);

SELECT id, colJSON FROM t1 WHERE colJSON?'should_be_redacted';
  id | coljson
-----+----------
(0 rows)

SELECT crdb_internal.redactable_sql_constants('SELECT id, colJSON FROM t1 WHERE colJSON?'should_be_redacted'');
invalid syntax: statement ignored: at or near "should_be_redacted": syntax error
SQLSTATE: 42601
DETAIL: source SQL:
SELECT crdb_internal.redactable_sql_constants('SELECT id, colJSON FROM t1 WHERE colJSON?'should_be_redacted'')
                                                                                         ^
HINT: try \hf crdb_internal.redactable_sql_constants

There is probably an obvious way to format the query so that it can work as an input. However, it would be nice if there was a way putting queries could be streamlined or some documentation.

Jira issue: CRDB-25716

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.O-qaT-sql-queriesSQL Queries Team

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions