Index: php_sybase_ct.c
===================================================================
RCS file: /repository/php-src/ext/sybase_ct/php_sybase_ct.c,v
retrieving revision 1.92
diff -u -r1.92 php_sybase_ct.c
--- php_sybase_ct.c	15 Feb 2004 10:53:45 -0000	1.92
+++ php_sybase_ct.c	2 Mar 2004 23:15:20 -0000
@@ -337,6 +337,7 @@
 	STD_PHP_INI_ENTRY_EX("sybct.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_sybase_globals, sybase_globals, display_link_numbers)
 	STD_PHP_INI_ENTRY("sybct.min_server_severity", "10", PHP_INI_ALL, OnUpdateLong, min_server_severity, zend_sybase_globals, sybase_globals)
 	STD_PHP_INI_ENTRY("sybct.min_client_severity", "10", PHP_INI_ALL, OnUpdateLong, min_client_severity, zend_sybase_globals, sybase_globals)
+	STD_PHP_INI_ENTRY("sybct.allow_duplicate_keys", "0", PHP_INI_ALL, OnUpdateLong, allow_duplicate_keys, zend_sybase_globals, sybase_globals)
 	STD_PHP_INI_ENTRY("sybct.login_timeout", "-1", PHP_INI_ALL, OnUpdateLong, login_timeout, zend_sybase_globals, sybase_globals)
 	STD_PHP_INI_ENTRY("sybct.hostname", NULL, PHP_INI_ALL, OnUpdateString, hostname, zend_sybase_globals, sybase_globals)
 	STD_PHP_INI_ENTRY_EX("sybct.deadlock_retry_count", "-1", PHP_INI_ALL, OnUpdateLong, deadlock_retry_count, zend_sybase_globals, sybase_globals, display_link_numbers)
@@ -1731,11 +1732,14 @@
 			zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &tmp, sizeof(zval *), NULL);
 			tmp->refcount++;
 		}
-		
-		if (zend_hash_exists(Z_ARRVAL_P(return_value), result->fields[i].name, strlen(result->fields[i].name)+1)) {
-			snprintf(name, 32, "%s%d", result->fields[i].name, j);
-			result->fields[i].name= estrdup(name);
-			j++;
+
+		if (!SybCtG(allow_duplicate_keys)) {
+			if (zend_hash_exists(Z_ARRVAL_P(return_value), result->fields[i].name, strlen(result->fields[i].name)+1)) {
+				snprintf(name, 32, "%s%d", result->fields[i].name, j);
+				efree(result->fields[i].name);
+				result->fields[i].name= estrdup(name);
+				j++;
+			}
 		}
 		zend_hash_update(Z_ARRVAL_P(return_value), result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &tmp, sizeof(zval *), NULL);
 	}
@@ -2066,6 +2070,8 @@
 	php_info_print_table_row(2, "Min server severity", buf);
 	sprintf(buf, "%ld", SybCtG(min_client_severity));
 	php_info_print_table_row(2, "Min client severity", buf);	
+	sprintf(buf, "%ld", SybCtG(allow_duplicate_keys));
+	php_info_print_table_row(2, "Allow duplicate keys (BC mode)", buf);	
 	php_info_print_table_row(2, "Application Name", SybCtG(appname));
 	sprintf(buf, "%ld", SybCtG(deadlock_retry_count));
 	php_info_print_table_row(2, "Deadlock retry count", buf);
Index: php_sybase_ct.h
===================================================================
RCS file: /repository/php-src/ext/sybase_ct/php_sybase_ct.h,v
retrieving revision 1.18
diff -u -r1.18 php_sybase_ct.h
--- php_sybase_ct.h	25 Jan 2004 20:03:10 -0000	1.18
+++ php_sybase_ct.h	2 Mar 2004 23:15:20 -0000
@@ -72,6 +72,7 @@
 	char *server_message;
 	long min_server_severity, min_client_severity;
 	long deadlock_retry_count;
+	long allow_duplicate_keys;
 	zval *callback_name;
 	CS_CONTEXT *context;
 ZEND_END_MODULE_GLOBALS(sybase)
