1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 10:12:18 +01:00

@- Implemented features/changes requested in Bug #16960 (Timm):

@  . Added a new function sybase_unbuffered_query()
@  . Added a new function sybase_fetch_assoc()
@  . Added sybase_set_message_handler() which enables users to handle
@    server messages in a callback function
@  . Added an ini entry for deadlock retries - retrying deadlocks
@    can cause transaction state to break (sybct.deadlock_retry_count,
@    defaults to -1 "forever").
@  . Fixed sybase_fetch_object() not to return objects with numeric
@    members
@  . Fixed issues with identical fieldnames
@  . Made sybase_fetch_*() functions return correct datatypes
@  . Made phpinfo() section more verbose
@  . Made sybase_query() error messages more verbose
This commit is contained in:
Timm Friebe
2002-11-05 08:29:57 +00:00
parent b899f9bf63
commit 514b69824e
2 changed files with 576 additions and 244 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Zeev Suraski <zeev@zend.com> |
| Authors: Zeev Suraski <zeev@zend.com> |
| Timm Friebe <php_sybase_ct@thekid.de> |
+----------------------------------------------------------------------+
*/
@@ -39,12 +40,14 @@ PHP_FUNCTION(sybase_pconnect);
PHP_FUNCTION(sybase_close);
PHP_FUNCTION(sybase_select_db);
PHP_FUNCTION(sybase_query);
PHP_FUNCTION(sybase_unbuffered_query);
PHP_FUNCTION(sybase_free_result);
PHP_FUNCTION(sybase_get_last_message);
PHP_FUNCTION(sybase_num_rows);
PHP_FUNCTION(sybase_num_fields);
PHP_FUNCTION(sybase_fetch_row);
PHP_FUNCTION(sybase_fetch_array);
PHP_FUNCTION(sybase_fetch_assoc);
PHP_FUNCTION(sybase_fetch_object);
PHP_FUNCTION(sybase_data_seek);
PHP_FUNCTION(sybase_result);
@@ -53,7 +56,8 @@ PHP_FUNCTION(sybase_field_seek);
PHP_FUNCTION(sybase_min_client_severity);
PHP_FUNCTION(sybase_min_server_severity);
PHP_FUNCTION(sybase_fetch_field);
PHP_FUNCTION(sybase_set_message_handler);
PHP_FUNCTION(sybase_deadlock_retry_count);
#include <ctpublic.h>
@@ -66,6 +70,8 @@ ZEND_BEGIN_MODULE_GLOBALS(sybase)
char *hostname;
char *server_message;
long min_server_severity, min_client_severity;
long deadlock_retry_count;
zval *callback_name;
CS_CONTEXT *context;
ZEND_END_MODULE_GLOBALS(sybase)
@@ -75,6 +81,7 @@ typedef struct {
int valid;
int deadlock;
int dead;
int active_result_index;
long affected_rows;
} sybase_link;
@@ -92,9 +99,19 @@ typedef struct {
sybase_link *sybase_ptr;
int cur_row,cur_field;
int num_rows,num_fields;
/* For unbuffered reads */
CS_INT *lengths;
CS_SMALLINT *indicators;
char **tmp_buffer;
unsigned char *numerics;
CS_INT *types;
CS_DATAFMT *datafmt;
int blocks_initialized;
CS_RETCODE last_retcode;
int store;
} sybase_result;
#ifdef ZTS
# define SybCtG(v) TSRMG(sybase_globals_id, zend_sybase_globals *, v)
#else