FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix #655 - Missing space before UNION when building CREATE VIEW by predictor2718 · Pull Request #656 · phpmyadmin/sql-parser · GitHub

Fix #655 - Missing space before UNION when building CREATE VIEW - #656

Open
predictor2718 wants to merge 1 commit into
phpmyadmin:5.11.xfrom
predictor2718:fix/19692-view-union-space
Open

Fix #655 - Missing space before UNION when building CREATE VIEW#656
predictor2718 wants to merge 1 commit into
phpmyadmin:5.11.xfrom
predictor2718:fix/19692-view-union-space

Conversation

Copy link
Copy Markdown
Contributor

Fixes #655.

CreateStatement::build() glued the built SELECT directly to the trailing body
tokens when rebuilding a CREATE VIEW ... AS SELECT ... UNION ..., producing
invalid SQL like ... WHERE 3 = 3union all (...).

Insert a single space between $builtStatement and the body tokens only when
both sides are non-empty and neither boundary character is whitespace, so the
paren-wrapped LHS case (AS (select ...) union all (...)) doesn't get a double
space.

Includes a regression test in tests/Builder/CreateStatementTest.php.

Also addresses phpMyAdmin reports:

Signed-off-by: predictor2718 245527909+predictor2718@users.noreply.github.com

…VIEW

Signed-off-by: predictor2718 <245527909+predictor2718@users.noreply.github.com>

codecov Bot commented Apr 24, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.93%. Comparing base (4c45eac) to head (ec19953).

Additional details and impacted files
@@            Coverage Diff            @@
##             5.11.x     #656   +/-   ##
=========================================
  Coverage     96.92%   96.93%           
- Complexity     2316     2320    +4     
=========================================
  Files            71       71           
  Lines          5110     5114    +4     
=========================================
+ Hits           4953     4957    +4     
  Misses          157      157           
Flag Coverage Δ
unit-7.2-ubuntu-latest 96.92% <100.00%> (+<0.01%) ⬆️
unit-7.3-ubuntu-latest 96.92% <100.00%> (+<0.01%) ⬆️
unit-7.4-ubuntu-latest 96.90% <100.00%> (+<0.01%) ⬆️
unit-8.0-ubuntu-latest 96.92% <100.00%> (+<0.01%) ⬆️
unit-8.1-ubuntu-latest 96.91% <100.00%> (+<0.01%) ⬆️
unit-8.2-ubuntu-latest 96.87% <100.00%> (+<0.01%) ⬆️
unit-8.3-ubuntu-latest 96.87% <100.00%> (+<0.01%) ⬆️
unit-8.4-ubuntu-latest 96.87% <100.00%> (+<0.01%) ⬆️
unit-8.5-ubuntu-latest 96.87% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

williamdes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL