-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Connection pool ignores SIGNALs after a successful query #639
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
Comments
I got the 'okay' for a $40+ bounty on this bad boy. Willing to discuss further if anyone can get this fixed before next weds. |
Your function returns a string, if DROP FUNCTION IF EXISTS `udf_uuidInternal`;
delimiter ;;
CREATE FUNCTION `udf_uuidInternal`(xid char(40)) RETURNS bigint(20) unsigned
DETERMINISTIC
BEGIN
DECLARE my_error CONDITION FOR SQLSTATE '45000';
DECLARE result BIGINT UNSIGNED;
SELECT `uuid` FROM registry WHERE `guid` = xid INTO result;
IF result IS NULL THEN
SIGNAL my_error SET MESSAGE_TEXT = 'Record not found';
END IF;
RETURN result;
END
;;
delimiter ; |
That's for logging purposes, and has no impact on the query because it doesn't run due to the SIGNAL from the UDF. Sample usage:
The driver bug shows itself by sending the rowpackets for the last query, because the 'invalid' ones never run. |
Most forks won't be in goveralls and so this command in travis.yml was, previously, failing and causing the build to fail. Now, it doesn't!
Hi,
I noticed this today while a co-worker couldn't trigger an expected error case from our connection pool.
I use a UDF called "udf_uuidInternal()" to verify a record is valid, and it works fantastic in the DB, and from an sproc, but the dynamic SQL in place now returns the data for the last successful query even if a SIGNAL is sent saying the record is invalid.
If I start the API, and make a query with a known invalid UUID, I get the expected error and it's handled properly. If I then make a query with a valid UUID, I get the expected data. If I then re-use the first invalid UUID, get the data for the last successful query, without an error.
This is the UDF, it's pretty basic:
The text was updated successfully, but these errors were encountered: