GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix #655 - Missing space before UNION when building CREATE VIEW by predictor2718 · Pull Request #656 · phpmyadmin/sql-parser

Conversation

@predictor2718

@predictor2718 predictor2718 commented Apr 24, 2026

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:

  • [Bug]: Exporting views with union does not put a space before the keyword union phpmyadmin#19692
  • View export missing when contain union statement phpmyadmin#18515

Signed-off-by: predictor2718 [email protected]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

williamdes reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@predictor2718
Fix phpmyadmin#655 - Missing space before UNION when building CREATE …
ec19953
…VIEW

Signed-off-by: predictor2718 <[email protected]>
@codecov

codecov Bot commented Apr 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

williamdes
williamdes approved these changes Apr 25, 2026
View reviewed changes

@williamdes williamdes left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@williamdes williamdes williamdes approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@predictor2718 @williamdes
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.