Commit 24ecc7b
authored
Fix incorrect column names for string literals without alias (#296)
It turns out that when selecting a string literal, the resulting column
name differs between MySQL and SQLite.
For example, with a query such as `SELECT 'abc'`:
- In MySQL, the returned column name is `abc` (the unquoted string
value).
- In SQLite, the returned column name is `'abc'` (the quoted string).
To address that, we need to use "SELECT 'abc' AS \`abc\`" in these
cases.File tree
3 files changed
+18
-2
lines changed- tests
- wp-includes/sqlite-ast
3 files changed
+18
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3738 | 3738 | | |
3739 | 3739 | | |
3740 | 3740 | | |
3741 | | - | |
| 3741 | + | |
3742 | 3742 | | |
3743 | 3743 | | |
3744 | 3744 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1680 | 1680 | | |
1681 | 1681 | | |
1682 | 1682 | | |
1683 | | - | |
| 1683 | + | |
1684 | 1684 | | |
1685 | 1685 | | |
1686 | 1686 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4246 | 4246 | | |
4247 | 4247 | | |
4248 | 4248 | | |
| 4249 | + | |
| 4250 | + | |
| 4251 | + | |
| 4252 | + | |
| 4253 | + | |
| 4254 | + | |
| 4255 | + | |
| 4256 | + | |
| 4257 | + | |
| 4258 | + | |
| 4259 | + | |
| 4260 | + | |
| 4261 | + | |
| 4262 | + | |
| 4263 | + | |
| 4264 | + | |
4249 | 4265 | | |
4250 | 4266 | | |
4251 | 4267 | | |
| |||
0 commit comments