[eluser]gwelter[/eluser]
I think that would have to do with a problem connecting to your database and not the query itself. I'm surprised that line reported an error, as it has the @ error suppression symbol preceding the call to mysql_query().
I don't think there's a way to tell in the logs where in your own code the query call is originating other than to put an error_log($sql); just before the return statement you mention (it's never a good idea to modify CI's core, but if you're desperate enough and change it back, it might help).