phpmyadmin / phpmyadmin/sql-parser

UPDATE with SELECT not supported

未关闭
#159 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug
主要语言
PHP
星标
485
派生
119
PR 合并指标
30 天内没有已合并 PR

描述

Was using the php-sqllint package (says to report errors here) and got these errors on valid MySQL syntax:

Line 1, col 45 at "(": An expression was expected.
Line 1, col 45 at "(": Unexpected token.
Line 1, col 46 at "SELECT": A new statement was found, but no delimiter between it and the previous one.
Line 1, col 106 at ")": Unexpected token.
Line 1, col 108 at "src": Unexpected token.
Line 2, col 5 at "SET": A new statement was found, but no delimiter between it and the previous one.

The SQL to generate these errors is similar to this (table, column names and values are different):

UPDATE table1 t1, (SELECT `id` FROM table2 WHERE `unique_val` = 1) src
    SET t1.ref_to_t2 = src.id
    WHERE t1.unique_val = 'unique';

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

未指定任何仓库文件或测试。通过 php-sqllint 重现报告的查询,然后跟踪带括号的 SELECT 周围的 UPDATE 解析,并验证这种有效的 MySQL 语法能够在不出现所报告错误的情况下被接受。

由索引模型根据 Issue 内容生成。

评估

技术栈
mysql, php
领域
databases
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。