Commit 17fe6ac
Handle trailing comma in IN expressions as single-element tuple
When an IN expression has a trailing comma like `IN (2,)`, it should be
represented as a Function tuple with one element, not as a plain literal.
- Add TrailingComma field to InExpr to track trailing comma presence
- Add parseInList helper to detect trailing commas during parsing
- Update explainInExpr and explainInExprWithAlias to wrap single elements
with trailing comma in Function tuple
Fixes stmt45 and stmt46 in 01756_optimize_skip_unused_shards_rewrite_in
and stmt5 in 01757_optimize_skip_unused_shards_limit.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 0855448 commit 17fe6ac
File tree
5 files changed
+58
-18
lines changed- ast
- internal/explain
- parser
- testdata
- 01756_optimize_skip_unused_shards_rewrite_in
- 01757_optimize_skip_unused_shards_limit
5 files changed
+58
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1717 | 1717 | | |
1718 | 1718 | | |
1719 | 1719 | | |
1720 | | - | |
1721 | | - | |
1722 | | - | |
1723 | | - | |
1724 | | - | |
1725 | | - | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
1726 | 1727 | | |
1727 | 1728 | | |
1728 | 1729 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1079 | 1079 | | |
1080 | 1080 | | |
1081 | 1081 | | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
1082 | 1085 | | |
1083 | 1086 | | |
1084 | 1087 | | |
| |||
1148 | 1151 | | |
1149 | 1152 | | |
1150 | 1153 | | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
1151 | 1159 | | |
1152 | 1160 | | |
1153 | 1161 | | |
| |||
1277 | 1285 | | |
1278 | 1286 | | |
1279 | 1287 | | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
1280 | 1291 | | |
1281 | 1292 | | |
1282 | 1293 | | |
| |||
1315 | 1326 | | |
1316 | 1327 | | |
1317 | 1328 | | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
1318 | 1334 | | |
1319 | 1335 | | |
1320 | 1336 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2110 | 2110 | | |
2111 | 2111 | | |
2112 | 2112 | | |
2113 | | - | |
| 2113 | + | |
| 2114 | + | |
2114 | 2115 | | |
2115 | 2116 | | |
2116 | 2117 | | |
| |||
2130 | 2131 | | |
2131 | 2132 | | |
2132 | 2133 | | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
2133 | 2165 | | |
2134 | 2166 | | |
2135 | 2167 | | |
| |||
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 1 | + | |
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
| 1 | + | |
0 commit comments