MariaDB: Parser fails on derived table with FOR SYSTEM_TIME clause
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 15
- Forks
- 7
- Avg merge
- 13h 2m
- Merged PRs (30d)
- 23
Description
Summary
The MariaDB dialect parser fails to parse a valid MariaDB query when a FOR SYSTEM_TIME clause is applied to a derived table in the FROM clause.
MariaDB allows FOR SYSTEM_TIME to be used not only on base tables but also on derived tables (subqueries).
Reproduction
CREATE TABLE employees (
id INT NOT NULL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
salary DECIMAL(10,2) NOT NULL
) WITH SYSTEM VERSIONING;
SELECT * FROM (SELECT * FROM employees) FOR SYSTEM_TIME AS OF NOW() AS drv;
got parser failed error
expected UPDATE or SHARE after FOR (line 1, column 45)
related text: SELECT * FROM (SELECT * FROM employees) FOR SYSTEM_TIME AS OF NOW() AS drv;
Contributor guide
No contributing guide indexed for this repository
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
No file or test is named. Start by reproducing the MariaDB dialect parser failure with the provided CREATE TABLE and SELECT query, then locate the parser entry point for FOR SYSTEM_TIME on a derived table; done means the query parses successfully without the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mariadb, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100