Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove nullability from IndexHint #616

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kamil-tekiela
Copy link
Contributor

This confused me but I checked the documentation and it turns out that neither $type nor $indexOrKey can be null. https://dev.mysql.com/doc/refman/8.4/en/index-hints.html

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Copy link

codecov bot commented Feb 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.26%. Comparing base (32c6769) to head (aec2309).
Report is 396 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #616      +/-   ##
============================================
- Coverage     96.81%   96.26%   -0.56%     
+ Complexity     2303     2254      -49     
============================================
  Files            71       89      +18     
  Lines          5250     5091     -159     
============================================
- Hits           5083     4901     -182     
- Misses          167      190      +23     

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

@@ -252,7 +252,7 @@
{
"@type": "PhpMyAdmin\\SqlParser\\Components\\IndexHint",
"type": "FORCE",
"indexOrKey": null,
"indexOrKey": "",
Copy link
Member

Choose a reason for hiding this comment

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

I guess that's a bit less intuitive for developers

Copy link
Contributor Author

@kamil-tekiela kamil-tekiela Feb 9, 2025

Choose a reason for hiding this comment

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

How so? Either way, it's an invalid value. The developer should check the parser errors. The only valid values for this are INDEX or KEY.

Copy link
Member

Choose a reason for hiding this comment

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

Oh okay, it's empty but the parser would have errors

Copy link
Member

@williamdes williamdes left a comment

Choose a reason for hiding this comment

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

But all okay

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