
return value of mysql_store_result is not checked before returning
Reported by asm | June 25th, 2010 @ 10:38 PM
I ran into an interesting issue. Take the following broken query:
SELECT MAX(
(
SELECT 1 FROM dual
UNION
SELECT 2 FROM dual
)
)
If you run this query using repository.adapter.select(...), you'll get an error akin to:
ERROR You have a nil object when you didn't expect it!
The error occurred while evaluating nil.fields
This happens because mysql doesn't return an error until after the mysql_store_result() call. This shameful SQL is exposed by the following patch: http://gist.github.com/453744
Comments and changes to this ticket
-
Martin Gamsjaeger (snusnu) June 27th, 2010 @ 10:19 AM
- Assigned user set to Dirkjan Bussink
- State changed from new to unconfirmed
- Milestone order changed from 0 to 0
-
Dirkjan Bussink July 15th, 2010 @ 03:27 PM
- State changed from unconfirmed to resolved
Fixed in f41f0f89c5e73edcd2cfb5b18cc577c7568d1a45
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »