Commit 9980510
authored
fix(query): AsyncFunctionCall::display_name should respect quota (#18412)
During the semantic analysis phase of the `nextval` function, the logic for generating `display_name` might not have fully considered SQL identifier quoting rules.
If the sequence name was a reserved keyword or contained special characters, the generated `display_name` might not conform to SQL syntax, leading to inaccurate display or potential issues.
This change constructs the `display_name` by leveraging the `to_string()` method of the `ident` object returned by `normalize_identifier`.
The `ident.to_string()` method already incorporates the logic for necessary identifier quoting according to SQL rules.
In main:
```
root@localhost:8000/default/default> create or replace table mytest (seq int default nextval(`测试`));
error: APIError: QueryFailed: [1001]fail to parse default expr `CAST(nextval(测试) AS Int32 NULL)` (string length = 35) of field seq, SyntaxException. Code: 1005, Text = unable to recognize the rest tokens.
```1 parent 367a17d commit 9980510
File tree
2 files changed
+7
-5
lines changed- src/query/sql/src/planner/semantic
- tests/sqllogictests/suites/stage
2 files changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5213 | 5213 | | |
5214 | 5214 | | |
5215 | 5215 | | |
5216 | | - | |
| 5216 | + | |
5217 | 5217 | | |
5218 | 5218 | | |
5219 | 5219 | | |
5220 | 5220 | | |
5221 | 5221 | | |
5222 | 5222 | | |
5223 | 5223 | | |
5224 | | - | |
| 5224 | + | |
| 5225 | + | |
| 5226 | + | |
| 5227 | + | |
5225 | 5228 | | |
5226 | 5229 | | |
5227 | 5230 | | |
| |||
5245 | 5248 | | |
5246 | 5249 | | |
5247 | 5250 | | |
5248 | | - | |
5249 | 5251 | | |
5250 | 5252 | | |
5251 | 5253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments