Tighten allowed characters for non-delimited identifiers#6380
Tighten allowed characters for non-delimited identifiers#6380martint merged 1 commit intotrinodb:masterfrom
Conversation
Identifiers with characters such as @ or : are not being treated as
delimited identifiers, which causes issues when the planner creates
synthetic identifiers as part of the plan IR expressions. When
the IR expressions are serialized, they are not being properly
quoted, which causes failures when parsing the plan on the work side.
For example, for a query such as:
SELECT try("a@b") FROM t
The planner creates an expression of the form:
"$internal$try"("$INTERNAL$BIND"("a@b", (a@b_0) -> "a@b_0"))
The argument to the lambda expression is not properly quoted.
Would be great to have a test for that, as we may be mistreating these identifiers in some other place as well |
|
Yes, unfortunately it can only be reproduced with actual tables that contain column names with those characters. We don't have any tables like that, and the engine testing framework has no provision for creating tables in tests. |
You can use |
|
As far as I can tell, MockConnector only supports metadata operations. We'd need to implement the SplitManager, Page sources, etc. to be able to use it for a test like this. |
That is the current state, but nothing prevents us to extend to support SplitManager, Page sources, etc. The biggest challenge is that it has to be able to serializable whereas it is difficult to serialize functional entities. |
|
I was able to reproduce the problem with a test. #6385 |
Cherry-pick of trinodb/trino#6380: Identifiers with characters such as @ or : are not being treated as delimited identifiers, which causes issues when the planner creates synthetic identifiers as part of the plan IR expressions. When the IR expressions are serialized, they are not being properly quoted, which causes failures when parsing the plan on the work side. For example, for a query such as: SELECT try("a@b") FROM t The planner creates an expression of the form: "$internal$try"("$INTERNAL$BIND"("a@b", (a@b_0) -> "a@b_0")) The argument to the lambda expression is not properly quoted. Co-authored-by: Martin Traverso <mtraverso@gmail.com>
Cherry-pick of trinodb/trino#6380: Identifiers with characters such as @ or : are not being treated as delimited identifiers, which causes issues when the planner creates synthetic identifiers as part of the plan IR expressions. When the IR expressions are serialized, they are not being properly quoted, which causes failures when parsing the plan on the work side. For example, for a query such as: SELECT try("a@b") FROM t The planner creates an expression of the form: "$internal$try"("$INTERNAL$BIND"("a@b", (a@b_0) -> "a@b_0")) The argument to the lambda expression is not properly quoted. Co-authored-by: Martin Traverso <mtraverso@gmail.com>
Identifiers with characters such as @ or : are not being treated as
delimited identifiers, which causes issues when the planner creates
synthetic identifiers as part of the plan IR expressions. When
the IR expressions are serialized, they are not being properly
quoted, which causes failures when parsing the plan on the work side.
For example, for a query such as:
The planner creates an expression of the form:
The argument to the lambda expression is not properly quoted.
Fixes #6375