phpmyadmin / phpmyadmin/sql-parser
phpMyAdmin 5.2.3 export fails with RuntimeException: No statement inside WITH for views containing nested CTEs
還沒有人認領這個 Issue。
- 主要語言
- PHP
- 星號
- 485
- 分支
- 119
- PR 合併指標
- 30 天內沒有已合併 PR
描述
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.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先,使用包含巢狀 CTE 的檢視和 MariaDB 結構描述 SQL 匯出重現此失敗,並以回報的 RuntimeException 作為切入點。追蹤 parser 對暫時替代檢視定義的處理;當匯出完成並包含完整的 CREATE VIEW 定義時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- mariadb, php, sql
- 領域
- databases, tooling
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100