No you cannot assume this. SQLState HY000
is simply a generic CLI SQL error (as defined by the SQL CLI standard), and errorcode 0 means 'no specific error code was set'. Usually drivers use HY000
as the SQLState when nothing more specific is available, or if the developer didn't bother the specify anything else.
And even in general a single SQLState can cover a very broad range of errors, and whether a single error code (other than 0) is used for one error or a group of errors might depend on the database and on the context of the error.