phpmyadmin / phpmyadmin/sql-parser

SQL Editor unexpected token with numeric db suffix and table name prefix

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

还没有人认领这个 Issue。

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

描述

Describe the bug

A numeric database suffix combined with a numeric table name prefix causes a false positive SQL editor error.

To Reproduce

Steps to reproduce the behavior:

  1. Go to any SQL Editor page
  2. Enter
    INSERT INTO foo_1.2_bar SELECT * FROM foo;
    or
    UPDATE foo_1.2_bar SET a = 1;
  3. See error

Unexpected token (near .2)

Expected behavior

Neither of these should flag as syntax errors

The bug does not affect SELECTs e.g.
SELECT * FROM foo_1.2_bar;

Screenshots

image

Server configuration
  • Operating system: el8
  • Database version: 10.11.7-MariaDB
  • PHP version: 8.3.6
  • phpMyAdmin version: 5.2.1-1
Client configuration
  • Browser: Chrome
  • Operating system: Win 10

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 SQL Editor 页面开始,使用 foo_1.2_bar 通过 INSERT 和 UPDATE 示例重现错误。将这些结果与正常工作的 SELECT 示例进行比较,然后跟踪 SQL 解析器对这些语句的处理过程。当这两个非 SELECT 示例不再报告 unexpected token near .2 时,即表示完成。

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

评估

技术栈
mariadb, php, sql
领域
databases
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
48/100

把新 issue 发到你的邮箱

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