Skip to content

Ignore user exception when RejectReadOnly #1320

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

Conversation

thopos
Copy link
Contributor

@thopos thopos commented Apr 6, 2022

SQLSTATE '45000' is for user-defined exceptions.
Their errno can collide with system exceptions however.
Don't close the connection on user exceptions.

Description

The connection would wrongly be closed when the config option RejectReadOnly is true and the following stored procedure is called:

DELIMITER $$

CREATE PROCEDURE `CloseConnection`()
BEGIN
    SIGNAL SQLSTATE '45000' 
        SET MYSQL_ERRNO = 1792, MESSAGE_TEXT ='no connection for you';
END$$

DELIMITER ;

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

thopos added 2 commits April 6, 2022 11:24
SQLSTATE '45000' is for user-defined exceptions.
Their errno can collide with system exceptions however.
Don't close the connection on user exceptions.
@thopos
Copy link
Contributor Author

thopos commented Apr 11, 2022

Abandoned.

Current implementations is in line with similar libraries.

@thopos thopos closed this Apr 11, 2022
@thopos thopos deleted the ignore-user-exception-when-rejectreadonly branch April 11, 2022 11:27
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.

1 participant