Commit 0316c6e
committed
MDEV-37435 Make new vcols created in vcol index substitution inherit name resolution from the select_lex
When a column or alias is the GROUP BY item, and a HAVING conjunct
depends on this column/alias only, the HAVING conjunct could contain
an Item_ref pointing to the GROUP BY Item_field.
If the column/alias happens to the be the expression of a vcol, the
GROUP BY item would be substituted with a newly created vcol
Item_field (MDEV-36132). This causes the Item_ref in HAVING to point
to the new vcol Item_field as well.
Subsequently in the HAVING to WHERE pushdown optimization, the
conjunct is moved to WHERE and fix_fields is called on it, where it
expects the vcol Item_field to have a name resolution context. So we
let the vcol Item_field inherit the context from the select_lex.1 parent d29fb34 commit 0316c6e
File tree
3 files changed
+52
-0
lines changed- mysql-test/suite/vcol
- r
- t
- sql
3 files changed
+52
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
293 | 295 | | |
294 | 296 | | |
295 | 297 | | |
| 298 | + | |
296 | 299 | | |
297 | 300 | | |
298 | 301 | | |
| |||
463 | 466 | | |
464 | 467 | | |
465 | 468 | | |
| 469 | + | |
466 | 470 | | |
467 | 471 | | |
468 | 472 | | |
| |||
0 commit comments