6 Commits
Author SHA1 Message Date
dualfroz 9bd93037fa fix: group dotted identifiers split by interleaved comments (issue712)
Identifiers may carry comments between their tokens (e.g. name -- c\n . -- c\n obj). _group only skipped whitespace when locating the tokens around a joining token, so an interleaved comment defeated the prev/next checks and the identifier was never formed.

Add an opt-in skip_comments flag to _group and enable it for group_period and group_as; the comments stay inside the resulting group. Also skip comments in get_parent_name and avoid a redundant separating space in StripCommentsFilter for the newly reachable interleaved-comment identifiers.
2026-09-02 12:14:20 +02:00
upstream 40155f3cf6 Upstream andialbrecht/sqlparse state of the touched files before f47b549867 2026-09-02 12:14:20 +02:00
dualfroz f0a09a4a1b fix: group dotted identifiers split by interleaved comments (issue712)
Identifiers may carry comments between their tokens (e.g. name -- c\n . -- c\n obj). _group only skipped whitespace when locating the tokens around a joining token, so an interleaved comment defeated the prev/next checks and the identifier was never formed.

Add an opt-in skip_comments flag to _group and enable it for group_period and group_as; the comments stay inside the resulting group. Also skip comments in get_parent_name and avoid a redundant separating space in StripCommentsFilter for the newly reachable interleaved-comment identifiers.
2026-09-04 22:24:36 +02:00
upstream 46e6a17daf Upstream andialbrecht/sqlparse state of the touched files before 730ddba559 2026-09-02 12:14:20 +02:00
dualfroz 241869a841 fix: keep RENAME TABLE clauses as separate identifiers (issue779)
RENAME TABLE a TO b, c TO d grouped the target of the first clause and
the source of the second into a single IdentifierList, because the comma
between the two clauses was treated as an identifier-list separator.

Detect the rename layout by the TO keywords flanking both sides of the
comma and leave such a comma ungrouped, so each renamed table stays a
separate Identifier. Genuine target lists such as GRANT ... TO a, b are
left untouched.
2026-09-02 11:37:41 +02:00
upstream 95c0c262cf Upstream andialbrecht/sqlparse state of the touched files before 9e625ff289 2026-09-02 11:37:41 +02:00