phpmyadmin / phpmyadmin/sql-parser

Inline comments improperly removed during query

Open
#332 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
485
Forks
119
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

The query:
select * from /*!i*/nformation_schema.tables;

Executes as if it were:
select * from information_schema.tables;

This is improper.

Expected behavior

MySQL and MariaDB return an error message, this is probably the most expected result. Perhaps a syntax error should be generated from the parser.

Server configuration
  • Operating system: Debian
  • Web server: Apache
  • Database version: MariaDB 10.4.10
  • PHP version: 7.4
  • phpMyAdmin version: 5.0.0
Client configuration
  • Browser: Firefox
  • Operating system: MacOS

This was originally reported by email.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce select * from /*!i*/nformation_schema.tables; in the SQL lexer/parser and inspect how inline comments are handled. Compare the result with MySQL and MariaDB behavior; done means the malformed query is rejected, ideally with a regression test for this input.

Written by the indexing model from the issue text.

Assessment

Tech stack
mariadb, php, sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.