Index: driver/error.c =================================================================== --- driver/error.c (revision 1041) +++ driver/error.c (working copy) @@ -225,6 +225,9 @@ state= "3D000"; break; case ER_PARSE_ERROR: +#ifdef ER_SP_DOES_NOT_EXIST + case ER_SP_DOES_NOT_EXIST: +#endif state= myodbc3_errors[MYERR_42000].sqlstate; break; case ER_TABLE_EXISTS_ERROR: Index: test/my_error.c =================================================================== --- test/my_error.c (revision 1041) +++ test/my_error.c (working copy) @@ -313,6 +313,16 @@ } +/** + Bug #27158: MyODBC 3.51/ ADO cmd option adCmdUnknown won't work for tables - regression +*/ +DECLARE_TEST(t_bug27158) +{ + expect_sql(hstmt, "{ CALL test.does_not_exist }", SQL_ERROR); + return check_sqlstate(hstmt, "42000"); +} + + BEGIN_TESTS #ifndef NO_DRIVERMANAGER ADD_TEST(t_odbc2_error) @@ -326,6 +336,7 @@ ADD_TEST(t_bug16224) ADD_TEST(bind_invalidcol) ADD_TEST(getdata_need_nullind) + ADD_TEST(t_bug27158) END_TESTS RUN_TESTS Index: ChangeLog =================================================================== --- ChangeLog (revision 1041) +++ ChangeLog (working copy) @@ -13,6 +13,9 @@ * SSL connections could not be established properly. Added the server certificate verification flag. (Bug #29955) * Added deprecated SQLSetParam function. (Bug #29871) + * An SQLSTATE of HY000 was returned when a stored procedure was not found, + instead of 42000. This caused problems with ADO's adCmdUnknown option. + (Bug #27158) ----