diff --git a/driver/error.cc b/driver/error.cc index dce18ae47..5611561c8 100644 --- a/driver/error.cc +++ b/driver/error.cc @@ -488,7 +488,7 @@ MySQLGetDiagField(SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT record, if (!stmt->result) *(SQLLEN *)num_value= 0; else - *(SQLLEN *)num_value= (SQLLEN) dbc->connection_proxy->num_rows(stmt->result); + *(SQLLEN *)num_value= (SQLLEN) stmt->dbc->connection_proxy->num_rows(stmt->result); return SQL_SUCCESS; case SQL_DIAG_DYNAMIC_FUNCTION: