WARNING:
fetch() does NOT adhere to SQL-92 SQLSTATE standard when dealing with empty datasets.
Instead of setting the errorcode class to 20 to indicate "no data found", it returns a class of 00 indicating success, and returns NULL to the caller.
This also prevents the exception mechainsm from firing.
Programmers will need to explicitly code tests for empty resultsets after any fetch*() instead of relying on the default behavior of the RDBMS.
I tried logging this as a bug, but it was dismissed as "working as intended". Just a head's up.