#1338 ✓resolved
asm

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

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Pages