trino icon indicating copy to clipboard operation
trino copied to clipboard

DROP VIEW prepared statement fails when view qualified name requires quoting

Open lucasdlemos opened this issue 3 years ago • 3 comments

The parser is throwing ParsingException for valid DROP VIEW IF EXISTS query. Although properly quoted, it seems the quotes aren't being considered.

For example:

  • This statement throws ParsingException
PREPARE statement1 FROM DROP VIEW IF EXISTS "catalog-test"."schema"."table"
  • While the same statement for tables succeeds:
PREPARE statement1 FROM DROP TABLE IF EXISTS "catalog-test"."schema"."table"
  • If we replace dashes with underscores in the 1st statement it also succeeds:
PREPARE statement1 FROM DROP VIEW IF EXISTS "catalog_test"."schema"."table"

lucasdlemos avatar Sep 19 '22 18:09 lucasdlemos

cc: @kasiafi similar to https://github.com/trinodb/trino/pull/11171 but for a different visitor.

hashhar avatar Sep 19 '22 18:09 hashhar

@lucasdlemos do you plan to make a PR for this?

findepi avatar Sep 19 '22 19:09 findepi

Unfortunately I can't in the short term @findepi.

lucasdlemos avatar Sep 20 '22 16:09 lucasdlemos

@findepi @hashhar i could work on this issue. Thanks

albericgenius avatar Sep 24 '22 07:09 albericgenius