Parser fails for updates that include subqueries for source tables
还没有人认领这个 Issue。
评估
调研方向
首先,通过 SQL 解析器运行提供的 UPDATE 查询,并将其输出与 issue 中所示的预期 table、subquery、SET 和 WHERE 结构进行比较。跟踪包含 subquery 的 UPDATE 表引用是如何进行词法分析和解析的,然后为此查询添加或更新回归测试,并验证解析后的结构。
由索引模型根据 Issue 内容生成。
描述
The SQL Parser fails to parse the following query:
update `table1` as e, (select * from table2) e2
set
e.`id` = e2.id,
where e.id=e2.id
It returns the output below. This appears to always be an issue when using subqueries in the table references.
[
{
"tables": [
{
"database": null,
"table": "table1",
"column": null,
"expr": "`table1`",
"alias": "e",
"function": null,
"subquery": null
}
],
"set": null,
"where": null,
"order": null,
"limit": null,
"options": {
"options": []
},
"first": 0,
"last": 10
},
{
"expr": [
{
"database": null,
"table": null,
"column": null,
"expr": "*",
"alias": null,
"function": null,
"subquery": null
}
],
"from": [
{
"database": null,
"table": "table2",
"column": null,
"expr": "table2",
"alias": null,
"function": null,
"subquery": null
}
],
"index_hints": null,
"partition": null,
"where": null,
"group": null,
"having": null,
"order": null,
"limit": null,
"procedure": null,
"into": null,
"join": null,
"union": [],
"end_options": null,
"options": {
"options": []
},
"first": 11,
"last": 21
},
{
"options": {
"options": []
},
"end_options": null,
"set": [
{
"column": "e.`id`",
"value": "e2.id"
}
],
"first": 22,
"last": 44,
"where": [
{
"identifiers": [
"e",
"id",
"e2"
],
"isOperator": false,
"expr": "e.id=e2.id"
}
]
}
]
- 主要语言
- PHP
- 星标
- 485
- 派生
- 119
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
phpmyadmin/sql-parser 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
phpmyadmin/sql-parser#655 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 55/100
phpmyadmin/sql-parser#666 ·
-
难度 3/5 1-2 天 新手友好度 65/100
phpmyadmin/sql-parser#662 · 2 个 reaction ·
-
kind/support
难度 3/5 1-2 天 新手友好度 45/100
phpmyadmin/sql-parser#653 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 70/100
phpmyadmin/sql-parser#649 ·
查看 phpmyadmin/sql-parser 的全部 Issue
相似的 Issue
-
status/awaiting_triage
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 1/5 1 小时以内 新手友好度 90/100
WordPress/plugin-check#1486 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 88/100
az-digital/az_quickstart#6019 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
grokability/snipe-it#19688 ·
-
难度 2/5 1-3 小时 新手友好度 85/100