phpmyadmin / phpmyadmin/phpmyadmin
ErrorException: Attempt to read property "keyword" on null
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 7.9k
- Forks
- 3.6k
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 36
Description
Describe the bug
When a table name contains dots, columns can't be sorted. The bug is in sql-parser it seems.
On 5.2.2-dev it gives the HTML code in modal, but on 6.0.0-dev I get this:
Internal error in ./vendor/phpmyadmin/sql-parser/src/Utils/Query.php#413
ErrorException: Attempt to read property "keyword" on null
To Reproduce
Steps to reproduce the behavior:
- Create table
CREATE TABLE `test.2024-11-01` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
INSERT INTO `test.2024-11-01` (`id`) VALUES
(1),
(2);
- Click on
id - See error
Expected behavior
There should be no error when sorting columns inside a table name that contains dots.
Screenshots
https://github.com/user-attachments/assets/623cbf70-f1f1-4c24-a0dc-6e2fbf01cfad
Server configuration
- PHP version: 8.4.0RC3
- phpMyAdmin version: 5.2.2-dev, 6.0.0-dev
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with vendor/phpmyadmin/sql-parser/src/Utils/Query.php around line 413 and reproduce the failure using the provided CREATE TABLE statement, then sort the id column in phpMyAdmin. Trace how the dotted table name is parsed and verify the completed change lets column sorting succeed without the null-property error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php, sql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100