[PHP-CVS] cvs: php4(PHP_4_3) /ext/pgsql pgsql.c php_pgsql.h /ext/pgsql/tests 01createdb.phpt 02connection.phpt 03sync_query.phpt 04async_query.phpt 05large_object.phpt 06copy.phpt 07optional.phpt 08escape.phpt 09notice.phpt 10pg_convert.phpt 11pg_meta_data.phpt 12pg_insert.phpt 13pg_select.phpt 14pg_update.phpt 15pg_delete.phpt 16pg_result_status.phpt 17result.phpt 18pg_escape_bytea.phpt 19pg_ping.phpt 20pg_get_pid.phpt 21pg_get_notify.phpt 98old_api.phpt 9999dropdb.phpt README async_query.inc connection.inc copy.inc createdb.inc dropdb.inc escape.inc informational.inc large_object.inc notice.inc old_api.inc optional.inc pg_convert.inc pg_delete.inc pg_escape_bytea.inc pg_get_notify.inc pg_get_pid.inc pg_insert.inc pg_meta_data.inc pg_ping.inc pg_result_status.inc pg_select.inc pg_update.inc result.inc sync_query.inc

2003-06-01 Thread Marcus Boerger
helly   Sat May 31 08:59:20 2003 EDT

  Removed files:   (Branch: PHP_4_3)
/php4/ext/pgsql/tests   async_query.inc connection.inc copy.inc 
createdb.inc dropdb.inc escape.inc 
informational.inc large_object.inc notice.inc 
old_api.inc optional.inc pg_convert.inc 
pg_delete.inc pg_escape_bytea.inc 
pg_get_notify.inc pg_get_pid.inc 
pg_insert.inc pg_meta_data.inc pg_ping.inc 
pg_result_status.inc pg_select.inc 
pg_update.inc result.inc sync_query.inc 

  Modified files:  
/php4/ext/pgsql pgsql.c php_pgsql.h 
/php4/ext/pgsql/tests   01createdb.phpt 02connection.phpt 
03sync_query.phpt 04async_query.phpt 
05large_object.phpt 06copy.phpt 
07optional.phpt 08escape.phpt 09notice.phpt 
10pg_convert.phpt 11pg_meta_data.phpt 
12pg_insert.phpt 13pg_select.phpt 
14pg_update.phpt 15pg_delete.phpt 
16pg_result_status.phpt 17result.phpt 
18pg_escape_bytea.phpt 19pg_ping.phpt 
20pg_get_pid.phpt 21pg_get_notify.phpt 
98old_api.phpt dropdb.phpt README 
  Log:
  MFH: Synch latest fixes
  Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244.2.17 php4/ext/pgsql/pgsql.c:1.244.2.18
--- php4/ext/pgsql/pgsql.c:1.244.2.17   Fri Apr 25 18:00:17 2003
+++ php4/ext/pgsql/pgsql.c  Sat May 31 08:59:19 2003
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.17 2003/04/25 22:00:17 iliaa Exp $ */
+/* $Id: pgsql.c,v 1.244.2.18 2003/05/31 12:59:19 helly Exp $ */
 
 #include stdlib.h
 
@@ -212,11 +212,7 @@
 
 static int le_link, le_plink, le_result, le_lofp, le_string;
 
-#ifdef ZTS
-int pgsql_globals_id;
-#else
-php_pgsql_globals pgsql_globals;
-#endif
+ZEND_DECLARE_MODULE_GLOBALS(pgsql);
 
 /* {{{ php_pgsql_set_default_link
  */
@@ -268,15 +264,21 @@
 static void _php_pgsql_notice_handler(void *resource_id, const char *message)
 {
php_pgsql_notice *notice;
+   int i;

TSRMLS_FETCH();
if (! PGG(ignore_notices)) {
+   notice = (php_pgsql_notice *)emalloc(sizeof(php_pgsql_notice));
+   i = strlen(message)-1;
+   while (i  (message[i] == '\r' || message[i] == '\n')) {
+   i--;
+   }
+   i++;
+   notice-message = estrndup(message, i);
+   notice-len = i;
if (PGG(log_notices)) {
-   php_log_err((char *) message TSRMLS_CC);
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, %s, 
notice-message);
}
-   notice = (php_pgsql_notice *)emalloc(sizeof(php_pgsql_notice));
-   notice-len = strlen(message);
-   notice-message = estrndup(message, notice-len);
zend_hash_index_update(PGG(notices), *(int *)resource_id, (void 
**)notice, sizeof(php_pgsql_notice *), NULL);
}
 }
@@ -348,22 +350,22 @@
 /* {{{ PHP_INI
  */
 PHP_INI_BEGIN()
-STD_PHP_INI_BOOLEAN(pgsql.allow_persistent,  1,PHP_INI_SYSTEM, 
OnUpdateBool,   allow_persistent,   php_pgsql_globals,  
pgsql_globals)
-STD_PHP_INI_ENTRY_EX(pgsql.max_persistent,   -1,   PHP_INI_SYSTEM, 
OnUpdateInt,max_persistent, php_pgsql_globals,  
pgsql_globals,  display_link_numbers)
-STD_PHP_INI_ENTRY_EX(pgsql.max_links,-1,   PHP_INI_SYSTEM,
 OnUpdateInt,max_links,  php_pgsql_globals,
  pgsql_globals,  display_link_numbers)
-STD_PHP_INI_BOOLEAN(pgsql.auto_reset_persistent, 0,PHP_INI_SYSTEM,
 OnUpdateBool,   auto_reset_persistent,  php_pgsql_globals,  
pgsql_globals)
-STD_PHP_INI_BOOLEAN(pgsql.ignore_notice, 0,PHP_INI_ALL,
OnUpdateBool,   ignore_notices, php_pgsql_globals,  pgsql_globals)
-STD_PHP_INI_BOOLEAN(pgsql.log_notice,0,PHP_INI_ALL,
OnUpdateBool,   log_notices,php_pgsql_globals,  pgsql_globals)
+STD_PHP_INI_BOOLEAN( pgsql.allow_persistent,  1,  PHP_INI_SYSTEM, 
OnUpdateBool, allow_persistent,  zend_pgsql_globals, pgsql_globals)
+STD_PHP_INI_ENTRY_EX(pgsql.max_persistent,   -1,  PHP_INI_SYSTEM, 
OnUpdateInt,  max_persistent,zend_pgsql_globals, pgsql_globals, 
display_link_numbers)
+STD_PHP_INI_ENTRY_EX(pgsql.max_links,-1,  

[PHP-CVS] cvs: php4(PHP_4_3) /ext/pgsql pgsql.c

2003-04-01 Thread Jay Smith
jay Tue Apr  1 18:28:19 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/pgsql pgsql.c 
  Log:
  MFH
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244.2.13 php4/ext/pgsql/pgsql.c:1.244.2.14
--- php4/ext/pgsql/pgsql.c:1.244.2.13   Mon Mar 10 18:13:03 2003
+++ php4/ext/pgsql/pgsql.c  Tue Apr  1 18:28:18 2003
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.13 2003/03/10 23:13:03 sniper Exp $ */
+/* $Id: pgsql.c,v 1.244.2.14 2003/04/01 23:28:18 jay Exp $ */
 
 #include stdlib.h
 
@@ -3205,7 +3205,7 @@
return PG_TIME;
if (!strcmp(type_name, timestamp) || !strcmp(type_name, time with time 
zone))
return PG_TIME_WITH_TIMEZONE;
-   if (!strcmp(type_name, timestamp with time zone))
+   if (!strcmp(type_name, timestamp with time zone) || !strcmp(type_name, 
timestamptz))
return PG_TIMESTAMP_WITH_TIMEZONE;
if (!strcmp(type_name, interval))
return PG_INTERVAL;
@@ -3665,7 +3665,7 @@
}
else {
/* FIXME: better regex must be 
used */
-   if 
(php_pgsql_convert_match(Z_STRVAL_PP(val), ^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ 
\\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1})){0,1}$, 1 TSRMLS_CC) == FAILURE) {
+   if 
(php_pgsql_convert_match(Z_STRVAL_PP(val), ^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ 
\\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\\.[0-9]+){0,1}([ 
\\t]*([+-][0-9]{1,2}(:[0-9]{1,2}){0,1}|[a-zA-Z]{1,5})){0,1})){0,1}$, 1 TSRMLS_CC) == 
FAILURE) {
err = 1;
}
else {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php4(PHP_4_3) /ext/pgsql pgsql.c php_pgsql.h

2003-04-01 Thread Jay Smith
jay Tue Apr  1 19:00:10 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/pgsql pgsql.c php_pgsql.h 
  Log:
  @- Fixed bug #23009 (pg_select with timestamp). (Marcus, Jay)
  MFH
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244.2.14 php4/ext/pgsql/pgsql.c:1.244.2.15
--- php4/ext/pgsql/pgsql.c:1.244.2.14   Tue Apr  1 18:28:18 2003
+++ php4/ext/pgsql/pgsql.c  Tue Apr  1 19:00:09 2003
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.14 2003/04/01 23:28:18 jay Exp $ */
+/* $Id: pgsql.c,v 1.244.2.15 2003/04/02 00:00:09 jay Exp $ */
 
 #include stdlib.h
 
@@ -3203,8 +3203,10 @@
return PG_DATE;
if (!strcmp(type_name, time))
return PG_TIME;
-   if (!strcmp(type_name, timestamp) || !strcmp(type_name, time with time 
zone))
+   if (!strcmp(type_name, time with time zone) || !strcmp(type_name, timetz))
return PG_TIME_WITH_TIMEZONE;
+   if (!strcmp(type_name, timestamp without time zone) || !strcmp(type_name, 
timestamp))
+   return PG_TIMESTAMP;
if (!strcmp(type_name, timestamp with time zone) || !strcmp(type_name, 
timestamptz))
return PG_TIMESTAMP_WITH_TIMEZONE;
if (!strcmp(type_name, interval))
@@ -3657,6 +3659,7 @@
break;

case PG_TIME_WITH_TIMEZONE:
+   case PG_TIMESTAMP:
case PG_TIMESTAMP_WITH_TIMEZONE:
switch(Z_TYPE_PP(val)) {
case IS_STRING:
Index: php4/ext/pgsql/php_pgsql.h
diff -u php4/ext/pgsql/php_pgsql.h:1.56.2.1 php4/ext/pgsql/php_pgsql.h:1.56.2.2
--- php4/ext/pgsql/php_pgsql.h:1.56.2.1 Tue Dec 31 11:35:13 2002
+++ php4/ext/pgsql/php_pgsql.h  Tue Apr  1 19:00:09 2003
@@ -17,7 +17,7 @@
+--+
  */
  
-/* $Id: php_pgsql.h,v 1.56.2.1 2002/12/31 16:35:13 sebastian Exp $ */
+/* $Id: php_pgsql.h,v 1.56.2.2 2003/04/02 00:00:09 jay Exp $ */
 
 #ifndef PHP_PGSQL_H
 #define PHP_PGSQL_H
@@ -196,6 +196,7 @@
PG_DATE,
PG_TIME,
PG_TIME_WITH_TIMEZONE,
+   PG_TIMESTAMP,
PG_TIMESTAMP_WITH_TIMEZONE,
PG_INTERVAL,
/* binary */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php4(PHP_4_3) /ext/pgsql pgsql.c

2003-03-10 Thread Jani Taskinen
sniper  Mon Mar 10 18:13:03 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/pgsql pgsql.c 
  Log:
  MFH
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244.2.12 php4/ext/pgsql/pgsql.c:1.244.2.13
--- php4/ext/pgsql/pgsql.c:1.244.2.12   Sun Mar  9 14:15:16 2003
+++ php4/ext/pgsql/pgsql.c  Mon Mar 10 18:13:03 2003
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.12 2003/03/09 19:15:16 derick Exp $ */
+/* $Id: pgsql.c,v 1.244.2.13 2003/03/10 23:13:03 sniper Exp $ */
 
 #include stdlib.h
 
@@ -997,7 +997,7 @@
 #if HAVE_PQCMDTUPLES
Z_LVAL_P(return_value) = atoi(PQcmdTuples(pgsql_result));
 #else
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Not supportted 
under this build.);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Not supported 
under this build.);
Z_LVAL_P(return_value) = 0;
 #endif
break;
@@ -1727,7 +1727,7 @@
zval *pgsql_link = NULL;
long oid_long;
char *oid_string, *end_ptr;
-   size_t oid_strlen;
+   int oid_strlen;
PGconn *pgsql;
Oid oid;
int id = -1;
@@ -1794,7 +1794,7 @@
zval *pgsql_link = NULL;
long oid_long;
char *oid_string, *end_ptr, *mode_string;
-   size_t oid_strlen, mode_strlen;
+   int oid_strlen, mode_strlen;
PGconn *pgsql;
Oid oid;
int id = -1, pgsql_mode=0, pgsql_lofd;
@@ -2099,7 +2099,7 @@
 {
zval *pgsql_link = NULL;
char *file_out, *oid_string, *end_ptr;
-   size_t oid_strlen;
+   int oid_strlen;
int id = -1, name_len;
long oid_long;
Oid oid;
@@ -2442,9 +2442,7 @@
case PGRES_COPY_OUT:
if (pgsql_result) {
PQclear(pgsql_result);
-   if (array_init(return_value) == FAILURE) {
-   RETURN_FALSE;
-   }
+   array_init(return_value);
while (!copydone)
{
if ((ret = PQgetline(pgsql, copybuf, 
COPYBUFSIZ))) {
@@ -2601,8 +2599,8 @@
 PHP_FUNCTION(pg_escape_string)
 {
char *from = NULL, *to = NULL;
-   size_t to_len;
-   long from_len;
+   int to_len;
+   int from_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s,
  from, from_len) == 
FAILURE) {
return;
@@ -2620,7 +2618,7 @@
 {
char *from = NULL, *to = NULL;
size_t to_len;
-   long from_len;
+   int from_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s,
  from, from_len) == 
FAILURE) {
return;
@@ -2668,8 +2666,6 @@
buflen = strlen(strtext);   /* will shrink, also we discover if
 * strtext */
buffer = (unsigned char *) emalloc(buflen); /* isn't NULL terminated */
-   if (buffer == NULL)
-   return NULL;
for (bp = buffer, sp = strtext; *sp != '\0'; bp++, sp++)
{
switch (state)
@@ -2744,7 +2740,7 @@
 {
char *from = NULL, *to = NULL;
size_t to_len;
-   long from_len;
+   int from_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s,
  from, from_len) == 
FAILURE) {
return;
@@ -2957,7 +2953,7 @@
 /* }}} */
 
 
-/* {{{ proto resource pg_get_result([resource connection])
+/* {{{ proto resource pg_get_result(resource connection)
Get asynchronous query result */
 PHP_FUNCTION(pg_get_result)
 {
@@ -3081,7 +3077,7 @@
PGresult *pg_result;
char *tmp_name;
smart_str querystr = {0};
-   size_t new_len;
+   int new_len;
int i, num_rows;
zval *elem;

@@ -3269,11 +3265,7 @@
return FAILURE;
}
subs = (regmatch_t *)ecalloc(sizeof(regmatch_t), re.re_nsub+1);
-   if (!subs) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot allocate memory.);
-   regfree(re);
-   return FAILURE;
-   }
+
regerr = regexec(re, str, re.re_nsub+1, subs, 0);
if (regerr == REG_NOMATCH) {
 #ifdef PHP_DEBUG   
@@ -3353,11 +3345,7 @@
return FAILURE;
}
MAKE_STD_ZVAL(meta);
-   if (array_init(meta) == FAILURE) {
-   zval_dtor(meta);
-   FREE_ZVAL(meta);
-   return FAILURE;
-   }
+   array_init(meta);
if (php_pgsql_meta_data(pg_link, table_name, meta TSRMLS_CC) == FAILURE) {
 

[PHP-CVS] cvs: php4(PHP_4_3) /ext/pgsql pgsql.c

2003-03-09 Thread Derick Rethans
derick  Sun Mar  9 14:15:19 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/pgsql pgsql.c 
  Log:
  - No C++ comments! (Patch by Magnus)
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244.2.11 php4/ext/pgsql/pgsql.c:1.244.2.12
--- php4/ext/pgsql/pgsql.c:1.244.2.11   Fri Mar  7 08:42:16 2003
+++ php4/ext/pgsql/pgsql.c  Sun Mar  9 14:15:16 2003
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.11 2003/03/07 13:42:16 ddhill Exp $ */
+/* $Id: pgsql.c,v 1.244.2.12 2003/03/09 19:15:16 derick Exp $ */
 
 #include stdlib.h
 
@@ -606,7 +606,7 @@
pgsql = (PGconn *) le-ptr;
}
ZEND_REGISTER_RESOURCE(return_value, pgsql, le_plink);
-   } else { // Non persistent connection
+   } else { /* Non persistent connection */
list_entry *index_ptr,new_index_ptr;

/* first we check the hash for the hashed_details key.  if it exists,



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php4(PHP_4_3) /ext/pgsql pgsql.c

2003-02-19 Thread Jani Taskinen
sniper  Thu Feb 20 02:10:49 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/pgsql pgsql.c 
  Log:
  MFH: Fixed bug: #22306 (pg_lo_seek($h, 0, PGSQL_SEEK_SET) succeeds but returns false)
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244.2.9 php4/ext/pgsql/pgsql.c:1.244.2.10
--- php4/ext/pgsql/pgsql.c:1.244.2.9Sun Feb  9 02:50:31 2003
+++ php4/ext/pgsql/pgsql.c  Thu Feb 20 02:10:48 2003
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.9 2003/02/09 07:50:31 yohgaki Exp $ */
+/* $Id: pgsql.c,v 1.244.2.10 2003/02/20 07:10:48 sniper Exp $ */
 
 #include stdlib.h
 
@@ -2204,7 +2204,7 @@
 
ZEND_FETCH_RESOURCE(pgsql, pgLofp *, pgsql_id, -1, PostgreSQL large object, 
le_lofp);
 
-   if (lo_lseek((PGconn *)pgsql-conn, pgsql-lofd, offset, whence )) {
+   if (lo_lseek((PGconn *)pgsql-conn, pgsql-lofd, offset, whence)  -1) {
RETURN_TRUE;
} else {
RETURN_FALSE;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /ext/pgsql pgsql.c

2003-02-08 Thread Yasuo Ohgaki
yohgaki Sun Feb  9 02:24:37 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/pgsql pgsql.c 
  Log:
  MFH
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244.2.7 php4/ext/pgsql/pgsql.c:1.244.2.8
--- php4/ext/pgsql/pgsql.c:1.244.2.7Tue Feb  4 13:34:10 2003
+++ php4/ext/pgsql/pgsql.c  Sun Feb  9 02:24:36 2003
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.7 2003/02/04 18:34:10 iliaa Exp $ */
+/* $Id: pgsql.c,v 1.244.2.8 2003/02/09 07:24:36 yohgaki Exp $ */
 
 #include stdlib.h
 
@@ -579,7 +579,7 @@
RETURN_FALSE;
}
/* ensure that the link did not die */
-   if (PGG(auto_reset_persistent)) {
+   if (PGG(auto_reset_persistent)  1) {
/* need to send  get something from backend to
   make sure we catch CONNECTION_BAD everytime */
PGresult *pg_result;
@@ -930,7 +930,12 @@
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Found results on this 
connection. Use pg_get_result() to get these results first.);
}
pgsql_result = PQexec(pgsql, Z_STRVAL_PP(query));
-   
+   if ((PGG(auto_reset_persistent)  2)  PQstatus(pgsql) != CONNECTION_OK) {
+   PQclear(pgsql_result);
+   PQreset(pgsql);
+   pgsql_result = PQexec(pgsql, Z_STRVAL_PP(query));
+   }
+
if (pgsql_result) {
status = PQresultStatus(pgsql_result);
} else {
@@ -951,7 +956,7 @@
pg_result = (pgsql_result_handle *) 
emalloc(sizeof(pgsql_result_handle));
pg_result-conn = pgsql;
pg_result-result = pgsql_result;
-   pg_result-row = -1;
+   pg_result-row = 0;
ZEND_REGISTER_RESOURCE(return_value, pg_result, 
le_result);
} else {
RETURN_FALSE;
@@ -1301,11 +1306,11 @@
pgsql_result = pg_result-result;
 
if (ZEND_NUM_ARGS() == 1) {
-   pg_result-row++;
pgsql_row = pg_result-row;
if (pgsql_row  0 || pgsql_row = PQntuples(pgsql_result)) {
RETURN_FALSE;
}
+   pg_result-row++;
} else {
if (Z_TYPE_PP(row) != IS_NULL) { 
convert_to_long_ex(row);
@@ -1317,11 +1322,11 @@
}
} else {
/* If 2nd param is NULL, use internal row counter to access 
next row */
-   pg_result-row++;
pgsql_row = pg_result-row;
if (pgsql_row  0 || pgsql_row = PQntuples(pgsql_result)) {
RETURN_FALSE;
}
+   pg_result-row++;
}
}
array_init(return_value);
@@ -1448,7 +1453,7 @@
}

/* seek to offset */
-   pg_result-row = row - 1;
+   pg_result-row = row;
RETURN_TRUE;
 }
 /* }}} */
@@ -2934,7 +2939,12 @@
php_error_docref(NULL TSRMLS_CC, E_NOTICE, There are results on this 
connection. Call pg_get_result() until it returns FALSE.);
}
if (!PQsendQuery(pgsql, query)) {
-   RETURN_FALSE;
+   if ((PGG(auto_reset_persistent)  2)  PQstatus(pgsql) != 
+CONNECTION_OK) {
+   PQreset(pgsql);
+   }
+   if (!PQsendQuery(pgsql, query)) {
+   RETURN_FALSE;
+   }
}
if (PQ_SETNONBLOCKING(pgsql, 0)) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Cannot set connection to 
blocking mode.);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /ext/pgsql pgsql.c

2003-02-08 Thread Yasuo Ohgaki
yohgaki Sun Feb  9 02:50:31 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/pgsql pgsql.c 
  Log:
  MFH
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244.2.8 php4/ext/pgsql/pgsql.c:1.244.2.9
--- php4/ext/pgsql/pgsql.c:1.244.2.8Sun Feb  9 02:24:36 2003
+++ php4/ext/pgsql/pgsql.c  Sun Feb  9 02:50:31 2003
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.8 2003/02/09 07:24:36 yohgaki Exp $ */
+/* $Id: pgsql.c,v 1.244.2.9 2003/02/09 07:50:31 yohgaki Exp $ */
 
 #include stdlib.h
 
@@ -2979,7 +2979,7 @@
pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle));
pg_result-conn = pgsql;
pg_result-result = pgsql_result;
-   pg_result-row = -1;
+   pg_result-row = 0;
ZEND_REGISTER_RESOURCE(return_value, pg_result, le_result);
 }
 /* }}} */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /ext/pgsql pgsql.c

2003-02-04 Thread Ilia Alshanetsky
iliaa   Tue Feb  4 13:34:11 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/pgsql pgsql.c 
  Log:
  MFH
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244.2.6 php4/ext/pgsql/pgsql.c:1.244.2.7
--- php4/ext/pgsql/pgsql.c:1.244.2.6Sat Jan  4 07:34:27 2003
+++ php4/ext/pgsql/pgsql.c  Tue Feb  4 13:34:10 2003
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.6 2003/01/04 12:34:27 derick Exp $ */
+/* $Id: pgsql.c,v 1.244.2.7 2003/02/04 18:34:10 iliaa Exp $ */
 
 #include stdlib.h
 
@@ -1437,23 +1437,18 @@
int row;
pgsql_result_handle *pg_result;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|l,
- result, row) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl, result, row) == 
+FAILURE) {
return;
}
 
ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, PostgreSQL 
result, le_result);
 
-   /* Let see if we are better to have another function for this */
-   /* if offset is omitted, return current position */
-/* if (ZEND_NUM_ARGS() == 1) */
-/* RETURN_LONG(pg_result-row); */
-
-   if (row  0 || row = PQntuples(pg_result-result))
+   if (row  0 || row = PQntuples(pg_result-result)) {
RETURN_FALSE;
+   }

/* seek to offset */
-   pg_result-row = row;
+   pg_result-row = row - 1;
RETURN_TRUE;
 }
 /* }}} */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /ext/pgsql pgsql.c

2002-12-21 Thread Derick Rethans
derick  Sat Dec 21 12:46:32 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/pgsql pgsql.c 
  Log:
  - Fix typo
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244.2.3 php4/ext/pgsql/pgsql.c:1.244.2.4
--- php4/ext/pgsql/pgsql.c:1.244.2.3Mon Dec 16 10:30:51 2002
+++ php4/ext/pgsql/pgsql.c  Sat Dec 21 12:46:32 2002
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.3 2002/12/16 15:30:51 iliaa Exp $ */
+/* $Id: pgsql.c,v 1.244.2.4 2002/12/21 17:46:32 derick Exp $ */
 
 #include stdlib.h
 
@@ -466,9 +466,9 @@
 #if HAVE_PG_CONFIG_H
php_info_print_table_row(2, PostgreSQL(libpq) Version, PG_VERSION);
 #ifdef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT
-   php_info_print_table_row(2, Multibyte charater support, enabled);
+   php_info_print_table_row(2, Multibyte character support, enabled);
 #else
-   php_info_print_table_row(2, Multibyte charater support, disabled);
+   php_info_print_table_row(2, Multibyte character support, disabled);
 #endif
 #ifdef USE_SSL
php_info_print_table_row(2, SSL support, enabled);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /ext/pgsql pgsql.c

2002-11-25 Thread Yasuo Ohgaki
yohgaki Mon Nov 25 21:15:59 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/pgsql pgsql.c 
  Log:
  MFH
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244 php4/ext/pgsql/pgsql.c:1.244.2.1
--- php4/ext/pgsql/pgsql.c:1.244Tue Nov 12 04:07:36 2002
+++ php4/ext/pgsql/pgsql.c  Mon Nov 25 21:15:58 2002
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244 2002/11/12 09:07:36 yohgaki Exp $ */
+/* $Id: pgsql.c,v 1.244.2.1 2002/11/26 02:15:58 yohgaki Exp $ */
 
 #include stdlib.h
 
@@ -2710,15 +2710,13 @@
case 3:
if (isdigit(*sp))   /* state=4 */
{
-   unsigned int  v,i;
-   unsigned char buf[4]; /* 000 + '\0' */
-
+   unsigned char *start, *end, buf[4]; /* 000 + 
+'\0' */
+   
bp -= 3;
-   for (i = 0; i  3; i++)
-   buf[i] = *((sp-2)+i);
-   buf[i] = '\0';
-   sscanf(buf, %03o, v);
-   *bp = v;
+   memcpy(buf, sp-2, 3);
+   buf[3] = '\0';
+   start = buf;
+   *bp = (unsigned char)strtoul(start, (char 
+**)end, 8);
buflen -= 3;
state = 0;
}
@@ -2730,9 +2728,8 @@
break;
}
}
-   buffer = erealloc(buffer, buflen);
-   if (buffer == NULL)
-   return NULL;
+   buffer = erealloc(buffer, buflen+1);
+   buffer[buflen] = '\0';
 
*retbuflen = buflen;
return buffer;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php