From 3782f212224e166c8b03a1f8bd101e23f6a2bef2 Mon Sep 17 00:00:00 2001 From: foobar Date: Thu, 28 Aug 2003 16:16:59 +0000 Subject: [PATCH] - Fixed bug #23682 (sybase_query() and multiple result sets: not returning first row set) --- ext/sybase_ct/php_sybase_ct.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c index bbb6c1a313..276586826b 100644 --- a/ext/sybase_ct/php_sybase_ct.c +++ b/ext/sybase_ct/php_sybase_ct.c @@ -1386,8 +1386,21 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered) 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; -- 2.50.1