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 摘要。