Skip to content

Remove php_pdo_mysql_sqlstate.h #10363

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

Closed
wants to merge 37 commits into from
Closed

Remove php_pdo_mysql_sqlstate.h #10363

wants to merge 37 commits into from

Conversation

marcosmarcolin
Copy link
Contributor

No description provided.

@marcosmarcolin marcosmarcolin changed the title Remove use of ereg() function Remove use of ereg() function and unnecessary spaces Jan 17, 2023
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@marcosmarcolin marcosmarcolin changed the title Remove use of ereg() function and unnecessary spaces Remove use of ereg() function Jan 17, 2023
@kamil-tekiela
Copy link
Member

I have absolutely no idea what this file was for. I can't find the history in Git now. Maybe the original authors would know. The file is pretty ancient but it was modified 11 years ago.
I'd suggest removing both files and seeing if anyone complains. My guess is that they are not used by PHP anymore. If we learn about where they are used, then we can leave a proper comment in the header file to explain what it's for.

@marcosmarcolin
Copy link
Contributor Author

@cmb69 @kamil-tekiela

As I understand it: get_error_codes.php is just a script to generate php_pdo_mysql_sqlstate.h with all MySQL error codes. From Git history, this was done for PHP 5.

I looked in the project and found no use for php_pdo_mysql_sqlstate.h, it doesn't call anywhere.

What do you think we remove it and see if it implies anything?

@cmb69
Copy link
Member

cmb69 commented Jan 18, 2023

As I understand it: get_error_codes.php is just a script to generate php_pdo_mysql_sqlstate.h with all MySQL error codes.

Indeed. And it does so from sql_state.h, and it needs to be run manually. It actually might make sense to keep and use that file to check for potential compatibility issues with different MySQL version, and particularly with the different forks we're supporting.

On the other hand, it seems that php_pdo_mysqlstate.h is unused, so it should be removed as well (plus its mention in CONTRIBUTING.md).

@kamil-tekiela
Copy link
Member

Also, no idea how to get sql_state.h as this file doesn't seem to be available anymore and I could not find any trace of it online.

@cmb69
Copy link
Member

cmb69 commented Jan 18, 2023

I found it here; but like I said, if php_pdo_mysqlstate.h is unused, we don't need a script to keep it up to date.

@marcosmarcolin
Copy link
Contributor Author

@cmb69 I removed the files and updated CONTRIBUTING.md.

Check if it's what you want.

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

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

Yes, that looks good to me. Thank you!

Is this fine for you, too, @kamil-tekiela?

@kamil-tekiela kamil-tekiela changed the title Remove use of ereg() function Remove php_pdo_mysql_sqlstate.h Jan 18, 2023
Copy link
Member

@kamil-tekiela kamil-tekiela left a comment

Choose a reason for hiding this comment

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

Yes, it looks good.

@cmb69 cmb69 closed this in cfa2311 Jan 18, 2023
@marcosmarcolin
Copy link
Contributor Author

Thanks for the direction! @cmb69 @kamil-tekiela

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants