phpmyadmin / phpmyadmin/sql-parser
phpMyAdmin 5.2.3 export fails with RuntimeException: No statement inside WITH for views containing nested CTEs
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- PHP
- Sterne
- 485
- Forks
- 119
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
When exporting a database/schema from phpMyAdmin 5.2.3, the export fails if a view contains a nested CTE (WITH inside another WITH).
The view itself is valid in MariaDB and can be created, queried, and retrieved successfully using SHOW CREATE VIEW. However, during phpMyAdmin export, phpMyAdmin creates the temporary stand-in definition for the view and then terminates with:
RuntimeException: No statement inside WITH
Because the export terminates at this point, the final CREATE VIEW definitions that phpMyAdmin normally writes near the end of the export are missing from the generated SQL file.
Simple reproduction steps: (MariaDB 10.11.16)
DROP VIEW IF EXISTS test_nested_cte_view;
CREATE VIEW test_nested_cte_view AS
WITH outer_cte AS
(
WITH inner_cte AS
(
SELECT 1 AS id, 'test' AS name
)
SELECT id, name
FROM inner_cte
)
SELECT id, name
FROM outer_cte;
Then perform a SQL export of the database/schema through phpMyAdmin.
The export then terminates with:
RuntimeException: No statement inside WITH
Expected result
phpMyAdmin should successfully export a valid MariaDB view containing nested CTEs and include its complete CREATE VIEW definition in the SQL export.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den Fehler mit der View mit verschachteltem CTE und einem MariaDB-Schema-SQL-Export zu reproduzieren, wobei die gemeldete RuntimeException als Ausgangspunkt dient. Verfolge die Verarbeitung der temporären Platzhalter-View-Definition durch den Parser; abgeschlossen ist die Arbeit, wenn der Export erfolgreich abgeschlossen wird und die vollständige CREATE VIEW-Definition enthält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- mariadb, php, sql
- Bereich
- databases, tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 55/100