case CS_CURSOR_RESULT:
case CS_PARAM_RESULT:
case CS_ROW_RESULT:
- /* Unexpected results, cancel them. */
+ if (status != Q_RESULT) {
+ result = php_sybase_fetch_result_set(sybase_ptr, buffered, store);
+ if (result == NULL) {
+ ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
+ sybase_ptr->dead = 1;
+ RETURN_FALSE;
+ }
+ status = Q_RESULT;
+ } else {
+ /* Unexpected results, cancel them. */
+ ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_CURRENT);
+ }
+ break;
case CS_STATUS_RESULT:
+ /* Unexpected results, cancel them. */
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_CURRENT);
break;