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

Many error symbols not included #1924

Closed
njbotkin opened this issue Mar 29, 2023 · 6 comments
Closed

Many error symbols not included #1924

njbotkin opened this issue Mar 29, 2023 · 6 comments

Comments

@njbotkin
Copy link

We noticed that a 3140: ER_INVALID_JSON_TEXT isn't included in https://github.com/sidorares/node-mysql2/blob/master/lib/constants/errors.js. Then we noticed a lot more error symbols aren't included. Is there a reason for this? Would you like a PR that includes the rest of the codes and symbols in https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html?

@sidorares
Copy link
Owner

Would you like a PR that includes the rest of the codes and symbols in https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html?

Yes please. No specific reason, just not in sync with newer error codes added recentlyю First commit to errors.js is from 2013.

@elimelt
Copy link
Contributor

elimelt commented Apr 30, 2023

Is anyone currently working on this issue? I'd be happy to help!

@sidorares
Copy link
Owner

@elimelt nothing in progress afaik, happy to review your PR

@elimelt
Copy link
Contributor

elimelt commented May 3, 2023

I've thus far been able to update generate-error-constants.js (found in node mysql module) to work with the source code for MySQL 8.0, but a lot of the codes have either been marked as OBSOLETE, or have been changed entirely. It seems like it was already the approach to just remove the OBSOLETE tags on the error codes, so I went ahead and did that, but I am a little more reluctant to push changes that overwrite/change codes entirely.

Although, since errors.js basically just serves as a lookup table, I doubt this will introduce any compatability issues accross the codebase. For now I will just include the most up-to-date error codes from the MySQL 8.0 source, and if the maintainers want to go a different direction then I'm happy to find an alternative solution upon review of my PR. Perhaps this would be maintaining a different verion of error.js depending on the version of MySQL one is using?

@elimelt
Copy link
Contributor

elimelt commented May 3, 2023

@sidorares PR has been submitted!

sidorares pushed a commit that referenced this issue May 6, 2023
…de (#1990)

* added new codes generated by MySQL 8.0 source

* wrote integration test for new error code mentioned in issue #1924
@wellwelwel
Copy link
Sponsor Collaborator

wellwelwel commented Jun 26, 2023

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

No branches or pull requests

4 participants