[Query] Attempt to read property "keyword" on null
This error appears when I want to access a table that has a column with a backtick on its name ( `col_one in my case ).
[!NOTE] The table must contain at least two records.
Internal error in .\vendor\phpmyadmin\sql-parser\src\Utils\Query.php#413
ErrorException: Attempt to read property "keyword" on null
Backtrace
https://github.com/phpmyadmin/sql-parser/blob/00c8e55cacae20d24fdf74fa0cb54d4aabfe3df9/src/Utils/Query.php#L413
Reproduce
- Run
CREATE TABLE `table` (
`id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
```col_one` int NOT NULL
);
INSERT INTO `table` (```col_one`) VALUES(1), (2);
- Try to access the table.
Cross-duplicate of https://github.com/phpmyadmin/phpmyadmin/issues/19349
If my PR gets merged it should fix the issue in PMA. I don't know how we can prevent this problem from occurring in sql-server though.
I don't know how we can prevent this problem from occurring in sql-server though.
sql-parser
I think it will be worth investigating