Skip to content

Fix #627 - Accept ON as value in SET statements - #652

Open
predictor2718 wants to merge 3 commits into
phpmyadmin:5.11.xfrom
predictor2718:fix/627-set-variable-on
Open

predictor2718 wants to merge 3 commits into
phpmyadmin:5.11.xfrom
predictor2718:fix/627-set-variable-on

Conversation

@predictor2718

Copy link
Copy Markdown
Contributor

Summary

  • SET @@variable = ON failed with "Missing expression" because ON is a reserved keyword that
    Expression::parse() rejected
  • OFF worked because it is not a reserved keyword
  • Fix: in SetOperation::parse(), after Expression::parse() returns null, accept ON as a literal value since
    it is valid in SET statements

Fixes #627

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

codecov Bot commented Apr 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.51%. Comparing base (4c45eac) to head (a204ecd).
⚠️ Report is 38 commits behind head on 5.11.x.

Additional details and impacted files
@@             Coverage Diff              @@
##             5.11.x     #652      +/-   ##
============================================
- Coverage     96.92%   96.51%   -0.42%     
- Complexity     2316     2355      +39     
============================================
  Files            71       71              
  Lines          5110     5189      +79     
============================================
+ Hits           4953     5008      +55     
- Misses          157      181      +24     
Flag Coverage Δ
unit-7.2-ubuntu-latest 96.48% <100.00%> (-0.44%) ⬇️
unit-7.3-ubuntu-latest 96.50% <100.00%> (-0.42%) ⬇️
unit-7.4-ubuntu-latest 96.48% <100.00%> (-0.42%) ⬇️
unit-8.0-ubuntu-latest 96.50% <100.00%> (-0.42%) ⬇️
unit-8.1-ubuntu-latest 96.47% <100.00%> (-0.44%) ⬇️
unit-8.2-ubuntu-latest 96.43% <100.00%> (-0.44%) ⬇️
unit-8.3-ubuntu-latest 96.43% <100.00%> (-0.44%) ⬇️
unit-8.4-ubuntu-latest 96.43% <100.00%> (-0.44%) ⬇️
unit-8.5-ubuntu-latest 96.43% <100.00%> (-0.44%) ⬇️
unit-8.6-ubuntu-latest 96.43% <100.00%> (?)

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

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

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

@williamdes 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.

Thank you, can you add a test case please ?

@predictor2718
predictor2718 force-pushed the fix/627-set-variable-on branch from f97a3a3 to a204ecd Compare October 13, 2026 18:31
@predictor2718

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I added a test case: parseSetVariableOn covers SET @@sql_log_bin = ON, autocommit = OFF. It fails without the fix and passes with it, so it also covers the line Codecov flagged.

@predictor2718 predictor2718 changed the title Simplify ON keyword check to only needed case Fix #627 - Accept ON as value in SET statements Oct 13, 2026
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