CVS update: php3/functions
| From: | shane | Date: | Mon, 07 Dec 1998 17:27:46 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2702@lists.php.net to get a copy of this message | ||
Date: Monday December 7, 1998 @ 12:27
Author: shane
Update of /repository/php3/functions
In directory asf:/u/temp/cvs-serv23264/functions
Modified Files:
php3_unified_odbc.h unified_odbc.c
Log Message:
fix for bug #964
should look more at connect and close functions to see if this can be
optimized.
Index: php3/functions/php3_unified_odbc.h
diff -c php3/functions/php3_unified_odbc.h:1.40 php3/functions/php3_unified_odbc.h:1.41
*** php3/functions/php3_unified_odbc.h:1.40 Wed Nov 11 07:27:13 1998
--- php3/functions/php3_unified_odbc.h Mon Dec 7 12:27:41 1998
***************
*** 29,35 ****
+----------------------------------------------------------------------+
*/
! /* $Id: php3_unified_odbc.h,v 1.40 1998/11/11 12:27:13 kara Exp $ */
#ifndef _UNIFIED_ODBC_H
#define _UNIFIED_ODBC_H
--- 29,35 ----
+----------------------------------------------------------------------+
*/
! /* $Id: php3_unified_odbc.h,v 1.41 1998/12/07 17:27:41 shane Exp $ */
#ifndef _UNIFIED_ODBC_H
#define _UNIFIED_ODBC_H
***************
*** 64,69 ****
--- 64,70 ----
extern void php3_solid_fetch_prev(INTERNAL_FUNCTION_PARAMETERS);
# if defined(UODBC_UNIQUE_NAMES)
# define UODBC_TYPE solid
+ # define UODBC_NAME "solid"
# define UODBC_FE(name, arg_types) UODBC_NAMED_FE(solid_##name, php3_solid_##name, arg_types)
# define UODBC_FE_ALIAS(php_name, name, arg_types) UODBC_NAMED_FE(solid_##php_name,
php3_solid_##name, arg_types)
# define UODBC_FUNCTION(name) UODBC_NAMED_FUNCTION(php3_solid_##name)
***************
*** 84,89 ****
--- 85,91 ----
# define HAVE_SQL_EXTENDED_FETCH 1
# if defined(UODBC_UNIQUE_NAMES)
# define UODBC_TYPE adabas
+ # define UODBC_NAME "adabas"
# define UODBC_FE(name, arg_types) UODBC_NAMED_FE(ada_##name, php3_ada_##name, arg_types)
# define UODBC_FE_ALIAS(php_name, name, arg_types) UODBC_NAMED_FE(ada_##php_name,
php3_ada_##name, arg_types)
# define UODBC_FUNCTION(name) UODBC_NAMED_FUNCTION(php3_ada_##name)
***************
*** 111,116 ****
--- 113,119 ----
# define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET)
# if defined(UODBC_UNIQUE_NAMES)
# define UODBC_TYPE iodbc
+ # define UODBC_NAME "iodbc"
# define UODBC_FE(name, arg_types) UODBC_NAMED_FE(iodbc_##name, php3_iodbc_##name, arg_types)
# define UODBC_FE_ALIAS(php_name, name, arg_types) UODBC_NAMED_FE(iodbc_##php_name,
php3_iodbc_##name, arg_types)
# define UODBC_FUNCTION(name) UODBC_NAMED_FUNCTION(php3_iodbc_##name)
***************
*** 133,138 ****
--- 136,142 ----
# define HAVE_SQL_EXTENDED_FETCH 1
# if defined(UODBC_UNIQUE_NAMES)
# define UODBC_TYPE opnlnk
+ # define UODBC_NAME "opnlnk"
# define UODBC_FE(name, arg_types) UODBC_NAMED_FE(opnlnk_##name, php3_opnlnk_##name, arg_types)
# define UODBC_FE_ALIAS(php_name, name, arg_types) UODBC_NAMED_FE(opnlnk_##php_name,
php3_opnlnk_##name, arg_types)
# define UODBC_FUNCTION(name) UODBC_NAMED_FUNCTION(php3_opnlnk_##name)
***************
*** 154,159 ****
--- 158,164 ----
# include <sqlext.h>
# if defined(UODBC_UNIQUE_NAMES)
# define UODBC_TYPE velocis
+ # define UODBC_NAME "velocis"
# define UODBC_FE(name, arg_types) UODBC_NAMED_FE(velocis_##name, php3_velocis_##name,
arg_types)
# define UODBC_FE_ALIAS(php_name, name, arg_types) UODBC_NAMED_FE(velocis_##php_name,
php3_velocis_##name, arg_types)
# define UODBC_FUNCTION(name) UODBC_NAMED_FUNCTION(php3_velocis_##name)
***************
*** 172,177 ****
--- 177,183 ----
# include <odbc.h>
# if defined(UODBC_UNIQUE_NAMES)
# define UODBC_TYPE codbc
+ # define UODBC_NAME "codbc"
# define UODBC_FE(name, arg_types) UODBC_NAMED_FE(codbc_##name, php3_codbc_##name, arg_types)
# define UODBC_FE_ALIAS(php_name, name, arg_types) UODBC_NAMED_FE(codbc_##php_name,
php3_codbc_##name, arg_types)
# define UODBC_FUNCTION(name) UODBC_NAMED_FUNCTION(php3_codbc_##name)
***************
*** 194,199 ****
--- 200,206 ----
# endif
# if defined(UODBC_UNIQUE_NAMES)
# define UODBC_TYPE db2
+ # define UODBC_NAME "db2"
# define UODBC_FE(name, arg_types) UODBC_NAMED_FE(db2_##name, php3_db2_##name, arg_types)
# define UODBC_FE_ALIAS(php_name, name, arg_types) UODBC_NAMED_FE(db2_##php_name,
php3_db2_##name, arg_types)
# define UODBC_FUNCTION(name) UODBC_NAMED_FUNCTION(php3_db2_##name)
***************
*** 214,219 ****
--- 221,227 ----
# include <sqlext.h>
# if defined(UODBC_UNIQUE_NAMES)
# define UODBC_TYPE wodbc
+ # define UODBC_NAME "wodbc"
# define UODBC_FE(name, arg_types) UODBC_NAMED_FE(wodbc_##name, php3_wodbc_##name, arg_types)
# define UODBC_FE_ALIAS(php_name, name, arg_types) UODBC_NAMED_FE(wodbc_##php_name,
php3_wodbc_##name, arg_types)
# define UODBC_FUNCTION(name) UODBC_NAMED_FUNCTION(php3_wodbc_##name)
***************
*** 231,236 ****
--- 239,245 ----
#if !defined(UODBC_UNIQUE_NAMES)
#define UODBC_TYPE odbc
+ #define UODBC_NAME "odbc"
#define UODBC_FE(name, arg_types) UODBC_NAMED_FE(odbc_##name, php3_odbc_##name, arg_types)
#define UODBC_FE_ALIAS(php_name, name, arg_types) UODBC_NAMED_FE(odbc_##php_name,
php3_odbc_##name, arg_types)
#define UODBC_FUNCTION(name) UODBC_NAMED_FUNCTION(php3_odbc_##name)
Index: php3/functions/unified_odbc.c
diff -c php3/functions/unified_odbc.c:1.90 php3/functions/unified_odbc.c:1.91
*** php3/functions/unified_odbc.c:1.90 Fri Nov 27 09:57:09 1998
--- php3/functions/unified_odbc.c Mon Dec 7 12:27:42 1998
***************
*** 29,35 ****
+----------------------------------------------------------------------+
*/
! /* $Id: unified_odbc.c,v 1.90 1998/11/27 14:57:09 rasmus Exp $ */
/* This file is based on the Adabas D extension.
* Adabas D will no longer be supported as separate module.
--- 29,35 ----
+----------------------------------------------------------------------+
*/
! /* $Id: unified_odbc.c,v 1.91 1998/12/07 17:27:42 shane Exp $ */
/* This file is based on the Adabas D extension.
* Adabas D will no longer be supported as separate module.
***************
*** 1689,1694 ****
--- 1689,1695 ----
list_entry *index_ptr;
char *hashed_details;
int hashed_len, len, id, cur_opt;
+ int type;
UODBC_TLS_VARS;
UODBC_GLOBAL(PHP3_UODBC_MODULE).resource_list = list;
***************
*** 1756,1762 ****
RETURN_FALSE;
}
! len = strlen(db) + strlen(uid) + strlen(pwd) + 9;
hashed_details = emalloc(len);
if (hashed_details == NULL) {
--- 1757,1763 ----
RETURN_FALSE;
}
! len = strlen(db) + strlen(uid) + strlen(pwd) + strlen(UODBC_NAME) + 4;
hashed_details = emalloc(len);
if (hashed_details == NULL) {
***************
*** 1764,1770 ****
RETURN_FALSE;
}
! hashed_len = _php3_sprintf(hashed_details, "uodbc_%s_%s_%s_%d", db, uid, pwd, cur_opt);
/* FIXME the idea of checking to see if our connection is already persistent
is good, but it adds a lot of overhead to non-persistent connections. We
--- 1765,1771 ----
RETURN_FALSE;
}
! hashed_len = _php3_sprintf(hashed_details, "%s_%s_%s_%s_%d", UODBC_NAME, db, uid, pwd,
cur_opt);
/* FIXME the idea of checking to see if our connection is already persistent
is good, but it adds a lot of overhead to non-persistent connections. We
***************
*** 1773,1780 ****
* no matter if it is to be persistent or not
*/
! if ((persistent || _php3_hash_find(list, hashed_details, hashed_len + 1,
! (void **) &index_ptr) == FAILURE) &&
_php3_hash_find(plist, hashed_details, hashed_len + 1,
(void **) &index_ptr) == FAILURE) {
/* the link is not in the persistent list */
--- 1774,1781 ----
* no matter if it is to be persistent or not
*/
! if ((persistent || (_php3_hash_find(list, hashed_details, hashed_len + 1,
! (void **) &index_ptr) == FAILURE || !php3_list_find((int) index_ptr->ptr, &type)))
&&
_php3_hash_find(plist, hashed_details, hashed_len + 1,
(void **) &index_ptr) == FAILURE) {
/* the link is not in the persistent list */
***************
*** 1871,1883 ****
UODBC_GLOBAL(PHP3_UODBC_MODULE).num_links++;
} else {
- int type;
-
/* we are already connected */
#ifdef THREAD_SAFE
! if (index_ptr->type != _php3_le_index_ptr()) {
#else
! if (index_ptr->type != le_index_ptr) {
#endif
efree(hashed_details);
RETURN_FALSE;
--- 1872,1882 ----
UODBC_GLOBAL(PHP3_UODBC_MODULE).num_links++;
} else {
/* we are already connected */
#ifdef THREAD_SAFE
! if (index_ptr->type != _php3_le_index_ptr()) {
#else
! if (index_ptr->type != le_index_ptr) {
#endif
efree(hashed_details);
RETURN_FALSE;
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net