[PHP-CVS-DAILY] cvs: php-src / ChangeLog

2005-07-07 Thread changelog
changelog   Fri Jul  8 01:38:37 2005 EDT

  Modified files:  
/php-srcChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/diff.php/php-src/ChangeLog?r1=1.2035r2=1.2036ty=u
Index: php-src/ChangeLog
diff -u php-src/ChangeLog:1.2035 php-src/ChangeLog:1.2036
--- php-src/ChangeLog:1.2035Thu Jul  7 01:39:05 2005
+++ php-src/ChangeLog   Fri Jul  8 01:38:35 2005
@@ -1,3 +1,123 @@
+2005-07-07  Jani Taskinen  [EMAIL PROTECTED]
+
+* acinclude.m4:
+  - Fixed stupid bug in PHP_INSTALL_HEADERS() macro: foo bar != foo bar
+  - ext/date/lib/timelib_config.h is also installed now
+
+2005-07-07  Dmitry Stogov  [EMAIL PROTECTED]
+
+* tests/classes/array_access_001.phpt
+  tests/classes/array_access_002.phpt:
+  Fixed bug #33512 (Add missing support for isset()/unset() overloading to
+  complement the property get/set methods). Now empty($obj[...]) works
+  proper but in addition it may call offsetGet() method.
+
+* NEWS
+  ZendEngine2/zend.h
+  ZendEngine2/zend_API.c
+  ZendEngine2/zend_API.h
+  ZendEngine2/zend_compile.c
+  ZendEngine2/zend_compile.h
+  ZendEngine2/zend_object_handlers.c
+  ZendEngine2/zend_objects.c
+  ZendEngine2/zend_reflection_api.c:
+  Fixed bug #33512 (Add missing support for isset()/unset() overloading to
+  complement the property get/set methods)
+
+2005-07-07  Anantha Kesari H Y  [EMAIL PROTECTED]
+
+* ZendEngine2/zend_stream.c
+  ZendEngine2/zend_stream.c:
+  zend_stream_getc uses fread internally. NetWare LibC fread reads 4(Which 
I
+  believe EOT) for EOF(^D) character. This happens when fread is asked to
+  read one and only character as is the case with cl interactive mode.
+  -- Kamesh
+
+2005-07-07  Antony Dovgal  [EMAIL PROTECTED]
+
+* NEWS
+  ext/standard/string.c:
+  fix #33605 (substr_compare() crashes with negative offset  length)
+
+2005-07-07  Dmitry Stogov  [EMAIL PROTECTED]
+
+* NEWS
+  ZendEngine2/zend_execute_API.c
+  ZendEngine2/zend_hash.c
+  ZendEngine2/zend_hash.h
+  ZendEngine2/tests/bug28072.phpt:
+  Fixed bug #28072 (static array with some constant keys will be 
incorrectly
+  ordered).
+
+2005-07-07  Wez Furlong  [EMAIL PROTECTED]
+
+* run-tests.php:
+  sort redirected tests
+
+* run-tests.php:
+  Fix 2 bugs:
+  - summary is only displayed if 2 or more tests were detected
+  - error out of a bogus test name is passed in
+
+2005-07-07  Rob Richards  [EMAIL PROTECTED]
+
+* ext/dom/element.c:
+  Allow NULL namespaceURI for getAttributeNodeNS
+
+2005-07-07  Jani Taskinen  [EMAIL PROTECTED]
+
+* NEWS:
+  reorder. Also: Documentation belongs elsewhere :)
+
+2005-07-07  Anantha Kesari H Y  [EMAIL PROTECTED]
+
+* (PHP_5_0)
+  TSRM/tsrm_virtual_cwd.c:
+  1)gwtcwd of NetWare LibC gives a cwd with a volume information.
+  So using getcwdpath which gives with volume information.
+  getcwdpath gives with directory seperator as \ which is against our
+  DEFAULT_SLASH of /.
+  So finding and replacing \ with /
+  2)NetWare file path normalization code in virtual_file_ex.
+  -- Kamesh
+
+* TSRM/tsrm_virtual_cwd.h:
+  Reverting the DEFAULT_SLASH to / as it breaks the FreeBSD derived 
function
+  of NetWare LibC like glob.
+  -- Kamesh
+
+* TSRM/tsrm_virtual_cwd.c:
+  gwtcwd of NetWare LibC gives a cwd with a volume information.
+  So using getcwdpath which gives with volume information.
+  getcwdpath gives with directory seperator as \ which is against our
+  DEFAULT_SLASH of /. So finding and replacing \ with /
+  
+  -- Kamesh
+
+* TSRM/tsrm_virtual_cwd.h:
+  COPY_WHEN_ABSOLUTE is not needed for NetWare.
+  -- Kamesh
+
+* (PHP_5_0)
+  TSRM/tsrm_virtual_cwd.h:
+  COPY_WHEN_ABSOLUTE is not needed for NetWare.
+  NetWare can understand the file paths with volumnename with a colon,
+  starting with / or \\ as absolute paths.
+  -- Kamesh
+
+2005-07-07  Dmitry Stogov  [EMAIL PROTECTED]
+
+* NEWS
+  acinclude.m4
+  sapi/cgi/config9.m4
+  sapi/cli/config.m4:
+  Fixed support for shared extensions on AIX
+
+2005-07-07  Rasmus Lerdorf  [EMAIL PROTECTED]
+
+* ext/simplexml/simplexml.c:
+  Missing closing folding marker
+
 2005-07-06  Edin Kadribasic  [EMAIL PROTECTED]
 
 * ext/zlib/php_zlib.def:
@@ -5964,7 +6084,7 @@
 
 * (PHP_4_3)
   ext/standard/url_scanner_ex.re:
-  Missing $Id: ChangeLog,v 1.2035 2005/07/07 05:39:05 changelog Exp $ tag
+  Missing $Id: ChangeLog,v 1.2036 2005/07/08 05:38:35 changelog Exp $ tag
 
 * (PHP_5_0)
   ext/standard/url_scanner_ex.c:
@@ -9365,7 +9485,7 @@
   ext/session/mod_mm.h
   ext/session/mod_user.h
   ext/session/php_session.h:
-  - Missing $Id: ChangeLog,v 1.2035 2005/07/07 05:39:05 changelog Exp $ 
tags
+  - Missing $Id: ChangeLog,v 1.2036 2005/07/08 

[PHP-CVS-DAILY] cvs: ZendEngine2 / ChangeLog

2005-07-07 Thread changelog
changelog   Fri Jul  8 01:38:54 2005 EDT

  Modified files:  
/ZendEngine2ChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/diff.php/ZendEngine2/ChangeLog?r1=1.727r2=1.728ty=u
Index: ZendEngine2/ChangeLog
diff -u ZendEngine2/ChangeLog:1.727 ZendEngine2/ChangeLog:1.728
--- ZendEngine2/ChangeLog:1.727 Tue Jul  5 01:39:31 2005
+++ ZendEngine2/ChangeLog   Fri Jul  8 01:38:53 2005
@@ -1,3 +1,34 @@
+2005-07-07  Dmitry Stogov  [EMAIL PROTECTED]
+
+* zend.h
+  zend_API.c
+  zend_API.h
+  zend_compile.c
+  zend_compile.h
+  zend_object_handlers.c
+  zend_objects.c
+  zend_reflection_api.c:
+  Fixed bug #33512 (Add missing support for isset()/unset() overloading to
+  complement the property get/set methods)
+
+2005-07-07  Anantha Kesari H Y  [EMAIL PROTECTED]
+
+* zend_stream.c
+  zend_stream.c:
+  zend_stream_getc uses fread internally. NetWare LibC fread reads 4(Which 
I
+  believe EOT) for EOF(^D) character. This happens when fread is asked to
+  read one and only character as is the case with cl interactive mode.
+  -- Kamesh
+
+2005-07-07  Dmitry Stogov  [EMAIL PROTECTED]
+
+* zend_execute_API.c
+  zend_hash.c
+  zend_hash.h
+  tests/bug28072.phpt:
+  Fixed bug #28072 (static array with some constant keys will be 
incorrectly
+  ordered).
+
 2005-07-04  Dmitry Stogov  [EMAIL PROTECTED]
 
 * zend_compile.h
@@ -9058,7 +9089,7 @@
 2003-06-10  Jani Taskinen  [EMAIL PROTECTED]
 
 * zend_multiply.h:
-  - Missing $Id: ChangeLog,v 1.727 2005/07/05 05:39:31 changelog Exp $ tag
+  - Missing $Id: ChangeLog,v 1.728 2005/07/08 05:38:53 changelog Exp $ tag
 
 2003-06-10  James Cox  [EMAIL PROTECTED]
 
@@ -10782,7 +10813,7 @@
   zend_types.h
   zend_variables.c
   zend_variables.h:
-  - Added some missing CVS $Id: ChangeLog,v 1.727 2005/07/05 05:39:31 
changelog Exp $ tags, headers and footers.
+  - Added some missing CVS $Id: ChangeLog,v 1.728 2005/07/08 05:38:53 
changelog Exp $ tags, headers and footers.
 
 2003-01-30  Ilia Alshanetsky  [EMAIL PROTECTED]
 


Re: [PHP-CVS] cvs: php-src /ext/pdo_pgsql pgsql_driver.c

2005-07-07 Thread Edin Kadribasic
Hi Ilia,

Would you please revert this change?

Saving one malloc/free in a function that has to query DB server anyway is not 
going to give you much performance improvement, while other methods are not 
portable across different PostgreSQL versions.

Edin

On Thursday 07 July 2005 02:52, Ilia Alshanetsky wrote:
 iliaa  Wed Jul  6 20:52:20 2005 EDT

   Modified files:
 /php-src/ext/pdo_pgsql pgsql_driver.c
   Log:
   Faster sequence id retrieval.



 http://cvs.php.net/diff.php/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.46r2
=1.47ty=u Index: php-src/ext/pdo_pgsql/pgsql_driver.c
 diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.46
 php-src/ext/pdo_pgsql/pgsql_driver.c:1.47 ---
 php-src/ext/pdo_pgsql/pgsql_driver.c:1.46 Fri Jul  1 18:43:16 2005 +++
 php-src/ext/pdo_pgsql/pgsql_driver.c Wed Jul  6 20:52:19 2005
 @@ -16,7 +16,7 @@
+--+
  */

 -/* $Id: pgsql_driver.c,v 1.46 2005/07/01 22:43:16 edink Exp $ */
 +/* $Id: pgsql_driver.c,v 1.47 2005/07/07 00:52:19 iliaa Exp $ */

  #ifdef HAVE_CONFIG_H
  #include config.h
 @@ -210,15 +210,16 @@
   *len = spprintf(id, 0, %ld, (long) H-pgoid);
   } else {
   PGresult *res;
 - char *name_escaped, *q;
 - size_t l = strlen(name);
 + char *q;
   ExecStatusType status;

 - name_escaped = safe_emalloc(l, 2, 1);
 - PQescapeString(name_escaped, name, l);
 - spprintf(q, 0, SELECT CURRVAL('%s'), name_escaped);
 + /* SQL injection protection */
 + if (strchr(name, '\'')) {
 + return NULL;
 + }
 +
 + spprintf(q, sizeof(SELECT CURRVAL('')) + strlen(name), 
 SELECT
 CURRVAL('%s'), name); res = PQexec(H-server, q);
 - efree(name_escaped);
   efree(q);
   status = PQresultStatus(res);

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



[PHP-CVS] cvs: php-src / NEWS

2005-07-07 Thread Jani Taskinen
sniper  Thu Jul  7 04:42:57 2005 EDT

  Modified files:  
/php-srcNEWS 
  Log:
  reorder. Also: Documentation belongs elsewhere :)
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1983r2=1.1984ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1983 php-src/NEWS:1.1984
--- php-src/NEWS:1.1983 Thu Jul  7 01:54:36 2005
+++ php-src/NEWSThu Jul  7 04:42:53 2005
@@ -1,15 +1,12 @@
 PHPNEWS
 |||
 ?? ??? 2005, PHP 5.1 Beta 3
-- Fixed support for shared extensions on AIX. Now CLI/CGI PHP binaries are 
-  compiled with runtime linker. Shared extensions are compiled as .so (ready
-  for runtime linking). To support shared extensions Apache/Apache2 must be
-  linked with -brtl too. (Dmitry)
 - Upgraded bundled SQLite library for PDO:SQLite to 3.2.2 (Ilia)
 - Added PDO_MYSQL_ATTR_USE_BUFFERED_QUERY parameter for pdo_mysql. (Ilia)
 - Added date_timezone_set() function to set the timezone that the date
   functions will use. (Derick)
 - Implemented feature request #33452 (Year belonging to ISO week). (Derick)
+- Fixed support for shared extensions on AIX. (Dmitry)
 - Fixed memory corruption in pg_copy_from() in case the as_null parameter was
   passed. (Derick)
 - Fixed crash inside stream_get_line() when length parameter equals 0. (Ilia)

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



[PHP-CVS] cvs: php-src /ext/dom element.c

2005-07-07 Thread Rob Richards
rrichards   Thu Jul  7 06:36:09 2005 EDT

  Modified files:  
/php-src/ext/domelement.c 
  Log:
  Allow NULL namespaceURI for getAttributeNodeNS
  
http://cvs.php.net/diff.php/php-src/ext/dom/element.c?r1=1.34r2=1.35ty=u
Index: php-src/ext/dom/element.c
diff -u php-src/ext/dom/element.c:1.34 php-src/ext/dom/element.c:1.35
--- php-src/ext/dom/element.c:1.34  Fri May 20 11:01:38 2005
+++ php-src/ext/dom/element.c   Thu Jul  7 06:36:08 2005
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: element.c,v 1.34 2005/05/20 15:01:38 rrichards Exp $ */
+/* $Id: element.c,v 1.35 2005/07/07 10:36:08 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -671,7 +671,7 @@
int uri_len, name_len, ret;
char *uri, *name;
 
-   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
Oss, id, dom_element_class_entry, uri, uri_len, name, name_len) == 
FAILURE) {
+   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
Os!s, id, dom_element_class_entry, uri, uri_len, name, name_len) == 
FAILURE) {
return;
}
 

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



[PHP-CVS] cvs: php-src /ext/pdo pdo_dbh.c pdo_stmt.c

2005-07-07 Thread Dmitry Stogov
dmitry  Thu Jul  7 07:19:57 2005 EDT

  Modified files:  
/php-src/ext/pdopdo_dbh.c pdo_stmt.c 
  Log:
  Fixed memory leaks
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_dbh.c?r1=1.76r2=1.77ty=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.76 php-src/ext/pdo/pdo_dbh.c:1.77
--- php-src/ext/pdo/pdo_dbh.c:1.76  Sat Jun 11 08:36:12 2005
+++ php-src/ext/pdo/pdo_dbh.c   Thu Jul  7 07:19:56 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_dbh.c,v 1.76 2005/06/11 12:36:12 wez Exp $ */
+/* $Id: pdo_dbh.c,v 1.77 2005/07/07 11:19:56 dmitry Exp $ */
 
 /* The PDO Database Handle Class */
 
@@ -94,6 +94,7 @@

if (info) {
zend_update_property(pdo_ex, ex, errorInfo, 
sizeof(errorInfo)-1, info TSRMLS_CC);
+   zval_ptr_dtor(info);
}
 
zend_throw_exception_object(ex TSRMLS_CC);
@@ -162,7 +163,7 @@
if (info) {
zval_ptr_dtor(info);
}
-   } else {
+   } else if (EG(exception) == NULL) {
zval *ex;
zend_class_entry *def_ex = zend_exception_get_default(), 
*pdo_ex = php_pdo_get_exception();
 
@@ -174,6 +175,7 @@

if (info) {
zend_update_property(pdo_ex, ex, errorInfo, 
sizeof(errorInfo)-1, info TSRMLS_CC);
+   zval_ptr_dtor(info);
}
 
zend_throw_exception_object(ex TSRMLS_CC);
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_stmt.c?r1=1.101r2=1.102ty=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.101 php-src/ext/pdo/pdo_stmt.c:1.102
--- php-src/ext/pdo/pdo_stmt.c:1.101Sat Jul  2 23:49:44 2005
+++ php-src/ext/pdo/pdo_stmt.c  Thu Jul  7 07:19:56 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_stmt.c,v 1.101 2005/07/03 03:49:44 wez Exp $ */
+/* $Id: pdo_stmt.c,v 1.102 2005/07/07 11:19:56 dmitry Exp $ */
 
 /* The PDO Statement Handle Class */
 
@@ -690,7 +690,7 @@
stmt-fetch.cls.ctor_args = NULL;
stmt-fetch.cls.fci.param_count = 0;
}
-   if (stmt-fetch.func.values  free_ctor_agrs) {
+   if (stmt-fetch.func.values) {
FREE_ZVAL(stmt-fetch.func.values);
stmt-fetch.func.values = NULL;
}
@@ -897,6 +897,7 @@
zend_update_property(ce, 
return_value,
stmt-columns[i].name, 
stmt-columns[i].namelen,
val TSRMLS_CC);
+   zval_ptr_dtor(val);
} else {
 #ifdef MBO_0
php_unserialize_data_t var_hash;
@@ -911,13 +912,17 @@
 #endif
 #if PHP_MAJOR_VERSION  5 || PHP_MINOR_VERSION = 1
if (!ce-unserialize) {
+   zval_ptr_dtor(val);

pdo_raise_impl_error(stmt-dbh, stmt, HY000, cannot unserialize class 
TSRMLS_CC);
return 0;
} else if 
(ce-unserialize(return_value, ce, Z_TYPE_P(val) == IS_STRING ? 
Z_STRVAL_P(val) : , Z_TYPE_P(val) == IS_STRING ? Z_STRLEN_P(val) : 0, NULL 
TSRMLS_CC) == FAILURE) {
+   zval_ptr_dtor(val);

pdo_raise_impl_error(stmt-dbh, stmt, HY000, cannot unserialize class 
TSRMLS_CC);
zval_dtor(return_value);
ZVAL_NULL(return_value);
return 0;
+   } else {
+   zval_ptr_dtor(val);
}
 #endif
}
@@ -1902,7 +1907,7 @@
}

if (I-fetch_ahead) {
-   ZVAL_DELREF(I-fetch_ahead);
+   zval_ptr_dtor(I-fetch_ahead);
}
 
efree(I);
@@ -1918,7 +1923,6 @@
 static void pdo_stmt_iter_get_data(zend_object_iterator *iter, zval ***data 
TSRMLS_DC)
 {
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter-data;
-   zval **ptr_ptr;
 
/* sanity */
if (!I-fetch_ahead) {
@@ -1926,11 +1930,7 @@
return;
}
 
-   ptr_ptr = emalloc(sizeof(*ptr_ptr)); /* leaks somewhere */
-   *ptr_ptr = I-fetch_ahead;
-   

[PHP-CVS] cvs: php-src /ext/pdo/tests pdo_021.phpt

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 08:42:53 2005 EDT

  Modified files:  
/php-src/ext/pdo/tests  pdo_021.phpt 
  Log:
  It's not portable to expect any consistency between drivers in the return 
value
  of an exec() when running DDL; revise test.
  
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_021.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/pdo/tests/pdo_021.phpt
diff -u php-src/ext/pdo/tests/pdo_021.phpt:1.3 
php-src/ext/pdo/tests/pdo_021.phpt:1.4
--- php-src/ext/pdo/tests/pdo_021.phpt:1.3  Wed Jul  6 09:19:25 2005
+++ php-src/ext/pdo/tests/pdo_021.phpt  Thu Jul  7 08:42:52 2005
@@ -10,7 +10,7 @@
 require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
 $db = PDOTest::factory();
 
-var_dump($db-exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val 
VARCHAR(10), val2 VARCHAR(16))'));
+$db-exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), 
val2 VARCHAR(16))');
 
 $select = $db-prepare('SELECT COUNT(id) FROM test');
 
@@ -47,6 +47,5 @@
 
 ?
 --EXPECT--
-int(0)
 There are 6 rows in the table.
 There are 12 rows in the table.

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



[PHP-CVS] cvs: php-src /ext/pdo/tests pdo_016.phpt

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 08:44:45 2005 EDT

  Modified files:  
/php-src/ext/pdo/tests  pdo_016.phpt 
  Log:
  pedantic WS
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_016.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/pdo/tests/pdo_016.phpt
diff -u php-src/ext/pdo/tests/pdo_016.phpt:1.3 
php-src/ext/pdo/tests/pdo_016.phpt:1.4
--- php-src/ext/pdo/tests/pdo_016.phpt:1.3  Wed Jul  6 09:19:25 2005
+++ php-src/ext/pdo/tests/pdo_016.phpt  Thu Jul  7 08:44:44 2005
@@ -10,11 +10,11 @@
 $db = PDOTest::factory();
 
 $db-exec('CREATE TABLE test(idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))');
-$db-exec('INSERT INTO test VALUES(0, \'String0\')'); 
-$db-exec('INSERT INTO test VALUES(1, \'String1\')'); 
-$db-exec('INSERT INTO test VALUES(2, \'String2\')'); 
-$stmt1 = $db-prepare('SELECT COUNT(idx) FROM test'); 
-$stmt2 = $db-prepare('SELECT idx, txt FROM test ORDER by idx'); 
+$db-exec('INSERT INTO test VALUES(0, \'String0\')');
+$db-exec('INSERT INTO test VALUES(1, \'String1\')');
+$db-exec('INSERT INTO test VALUES(2, \'String2\')');
+$stmt1 = $db-prepare('SELECT COUNT(idx) FROM test');
+$stmt2 = $db-prepare('SELECT idx, txt FROM test ORDER by idx');
 
 $stmt1-execute();
 var_dump($stmt1-fetchColumn());

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



[PHP-CVS] cvs: php-src /ext/pdo pdo_stmt.c

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 08:45:41 2005 EDT

  Modified files:  
/php-src/ext/pdopdo_stmt.c 
  Log:
  Fix bug in bindColumn() for drivers that implement native prepared statements
  and that use the PDO rewriter to handle non-native parameter syntax.
  
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_stmt.c?r1=1.102r2=1.103ty=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.102 php-src/ext/pdo/pdo_stmt.c:1.103
--- php-src/ext/pdo/pdo_stmt.c:1.102Thu Jul  7 07:19:56 2005
+++ php-src/ext/pdo/pdo_stmt.c  Thu Jul  7 08:45:40 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_stmt.c,v 1.102 2005/07/07 11:19:56 dmitry Exp $ */
+/* $Id: pdo_stmt.c,v 1.103 2005/07/07 12:45:40 wez Exp $ */
 
 /* The PDO Statement Handle Class */
 
@@ -292,7 +292,7 @@
zend_hash_index_update(hash, param-paramno, param, 
sizeof(*param), (void**)pparam);
}
 
-   if (!rewrite_name_to_position(stmt, pparam TSRMLS_CC)) {
+   if (is_param  !rewrite_name_to_position(stmt, pparam TSRMLS_CC)) {
return 0;
}


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



[PHP-CVS] cvs: php-src /ext/pdo_odbc odbc_driver.c odbc_stmt.c pdo_odbc.c php_pdo_odbc.h php_pdo_odbc_int.h

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 08:49:23 2005 EDT

  Modified files:  
/php-src/ext/pdo_odbc   odbc_driver.c odbc_stmt.c pdo_odbc.c 
php_pdo_odbc.h php_pdo_odbc_int.h 
  Log:
  Fix handling of parameter binding.
  We need to guess at parameter sizing in some cases (eg: MS Access) as the
  SQLDescribeParam() API is an optional feature.
  Tidy up error handling.
  Add workaround for a shutdown bug that I see with MS ODBC implementation.
  (working to determine the precise cause of this).
  PDO core test suite now passes all tests.
  
  http://cvs.php.net/diff.php/php-src/ext/pdo_odbc/odbc_driver.c?r1=1.23r2=1.24ty=u
Index: php-src/ext/pdo_odbc/odbc_driver.c
diff -u php-src/ext/pdo_odbc/odbc_driver.c:1.23 
php-src/ext/pdo_odbc/odbc_driver.c:1.24
--- php-src/ext/pdo_odbc/odbc_driver.c:1.23 Sat Jun 11 10:48:06 2005
+++ php-src/ext/pdo_odbc/odbc_driver.c  Thu Jul  7 08:49:21 2005
@@ -2,7 +2,7 @@
   +--+
   | PHP Version 5|
   +--+
-  | Copyright (c) 1997-2004 The PHP Group|
+  | Copyright (c) 1997-2005 The PHP Group|
   +--+
   | This source file is subject to version 3.0 of the PHP license,   |
   | that is bundled with this package in the file LICENSE, and is|
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: odbc_driver.c,v 1.23 2005/06/11 14:48:06 wez Exp $ */
+/* $Id: odbc_driver.c,v 1.24 2005/07/07 12:49:21 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -85,7 +85,7 @@
einfo-what = what;
 
strcpy(*pdo_err, einfo-last_state);
-
+/* printf(@@ SQLSTATE[%s] %s\n, *pdo_err, einfo-last_err_msg); */
if (!dbh-methods) {
zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, 
SQLSTATE[%s] %s: %d %s,
*pdo_err, what, einfo-last_error, 
einfo-last_err_msg);
@@ -96,16 +96,18 @@
 static int odbc_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
 {
pdo_odbc_db_handle *H = (pdo_odbc_db_handle*)dbh-driver_data;
-   
if (H-dbc != SQL_NULL_HANDLE) {
SQLEndTran(SQL_HANDLE_DBC, H-dbc, SQL_ROLLBACK);
+#ifndef PHP_WIN32 /* avoiding a bug I've found on my XP box */
SQLDisconnect(H-dbc);
+#endif
SQLFreeHandle(SQL_HANDLE_DBC, H-dbc);
H-dbc = NULL;
}
SQLFreeHandle(SQL_HANDLE_ENV, H-env);
H-env = NULL;
pefree(H, dbh-is_persistent);
+   dbh-driver_data = NULL;
 
return 0;
 }
@@ -174,7 +176,7 @@
SQLFreeHandle(SQL_HANDLE_STMT, S-stmt);
return 0;
}
-   
+
stmt-driver_data = S;
stmt-methods = odbc_stmt_methods;

@@ -335,17 +337,15 @@
 
if (rc != SQL_SUCCESS  rc != SQL_SUCCESS_WITH_INFO) {
pdo_odbc_drv_error(SQLSetEnvAttr: ODBC3);
-   odbc_handle_closer(dbh TSRMLS_CC);
-   return 0;
+   goto fail;
}
 
-#ifdef SQL_ATTR_CONNECTION_POOLING
+#if 0 /* def SQL_ATTR_CONNECTION_POOLING */
if (pdo_odbc_pool_on != SQL_CP_OFF) {
rc = SQLSetEnvAttr(H-env, SQL_ATTR_CP_MATCH, 
(void*)pdo_odbc_pool_mode, 0);
if (rc != SQL_SUCCESS) {
pdo_odbc_drv_error(SQLSetEnvAttr: SQL_ATTR_CP_MATCH);
-   odbc_handle_closer(dbh TSRMLS_CC);
-   return 0;
+   goto fail;
}
}
 #endif
@@ -353,16 +353,14 @@
rc = SQLAllocHandle(SQL_HANDLE_DBC, H-env, H-dbc);
if (rc != SQL_SUCCESS  rc != SQL_SUCCESS_WITH_INFO) {
pdo_odbc_drv_error(SQLAllocHandle (DBC));
-   odbc_handle_closer(dbh TSRMLS_CC);
-   return 0;
+   goto fail;
}
 
rc = SQLSetConnectAttr(H-dbc, SQL_ATTR_AUTOCOMMIT,
(SQLPOINTER)(dbh-auto_commit ? SQL_AUTOCOMMIT_ON : 
SQL_AUTOCOMMIT_OFF), SQL_NTS);
if (rc != SQL_SUCCESS) {
pdo_odbc_drv_error(SQLSetConnectAttr AUTOCOMMIT);
-   odbc_handle_closer(dbh TSRMLS_CC);
-   return 0;
+   goto fail;
}
 
/* set up the cursor library, if needed, or if configured explicitly */
@@ -370,8 +368,7 @@
rc = SQLSetConnectAttr(H-dbc, SQL_ODBC_CURSORS, (void*)cursor_lib, 0);
if (rc != SQL_SUCCESS  cursor_lib != SQL_CUR_USE_IF_NEEDED) {
pdo_odbc_drv_error(SQLSetConnectAttr SQL_ODBC_CURSORS);
-   odbc_handle_closer(dbh TSRMLS_CC);
-   return 0;
+   goto fail;
}

 
@@ -399,8 +396,7 @@
 
if (rc != SQL_SUCCESS  rc 

[PHP-CVS] cvs: php-src / run-tests.php

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 08:58:49 2005 EDT

  Modified files:  
/php-srcrun-tests.php 
  Log:
  Fix 2 bugs:
  - summary is only displayed if 2 or more tests were detected
  - error out of a bogus test name is passed in
  
  
http://cvs.php.net/diff.php/php-src/run-tests.php?r1=1.217r2=1.218ty=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.217 php-src/run-tests.php:1.218
--- php-src/run-tests.php:1.217 Wed Jul  6 02:06:23 2005
+++ php-src/run-tests.php   Thu Jul  7 08:58:47 2005
@@ -305,6 +305,8 @@
find_files($testfile);
} else if (preg_match(/\.phpt$/, $testfile)) {
$test_files[] = $testfile;
+   } else {
+   die(bogus test name  . $argv[$i] . \n);
}
}
}
@@ -331,7 +333,7 @@
fclose($failed_tests_file);
}
$end_time = time();
-   if (count($test_files)  1) {
+   if (count($test_files)) {
echo 
 =;
compute_summary();
@@ -1236,7 +1238,6 @@
 
$n_total = count($test_results);
$n_total += $ignored_by_ext;
-   
$sum_results = array('PASSED'=0, 'WARNED'=0, 'SKIPPED'=0, 
'FAILED'=0, 'BORKED'=0);
foreach ($test_results as $v) {
$sum_results[$v]++;

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



[PHP-CVS] cvs: php-src /ext/sqlite/tests/pdo common.phpt connection.inc pdo_001.phpt pdo_002.phpt pdo_003.phpt pdo_004.phpt pdo_005.phpt pdo_006.phpt pdo_007.phpt pdo_008.phpt pdo_009.phpt pdo_010.php

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 09:04:26 2005 EDT

  Added files: 
/php-src/ext/sqlite/tests/pdo   common.phpt 

  Removed files:   
/php-src/ext/sqlite/tests/pdo   connection.inc pdo_001.phpt 
pdo_002.phpt pdo_003.phpt 
pdo_004.phpt pdo_005.phpt 
pdo_006.phpt pdo_007.phpt 
pdo_008.phpt pdo_009.phpt 
pdo_010.phpt pdo_011.phpt 
pdo_012.phpt pdo_013.phpt 
pdo_014.phpt pdo_015.phpt 
pdo_016.phpt pdo_017.phpt 
pdo_018.phpt pdo_019.phpt 
pdo_020.phpt pdo_021.phpt 
pdo_022.phpt pdo_023.phpt 
pdo_024.phpt pdo_025.phpt 
pdo_026.phpt prepare.inc skipif.inc 
  Log:
  adopt generic PDO test suite
  
  

http://cvs.php.net/co.php/php-src/ext/sqlite/tests/pdo/common.phpt?r=1.1p=1
Index: php-src/ext/sqlite/tests/pdo/common.phpt
+++ php-src/ext/sqlite/tests/pdo/common.phpt
--TEST--
SQLite2
--SKIPIF--
?php # vim:ft=php
if (!extension_loaded('pdo') || !extension_loaded('sqlite')) print 'skip'; ?
--REDIRECTTEST--
return array(
'ENV' = array(
'PDOTEST_DSN' = 'sqlite2::memory:'
),
'TESTS' = 'ext/pdo/tests'
);

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



Re: [PHP-CVS] cvs: php-src /ext/pdo_pgsql pgsql_driver.c

2005-07-07 Thread Ilia Alshanetsky

Edink,

It is malloc + PQescapeString + free, which in most cases are completely 
unnecessary. While as Christopher demonstrates sequence name could 
contain special chars, I'd wager that is a VERY uncommon situation.


Ilia

Edin Kadribasic wrote:

Hi Ilia,

Would you please revert this change?

Saving one malloc/free in a function that has to query DB server anyway is not 
going to give you much performance improvement, while other methods are not 
portable across different PostgreSQL versions.


Edin

On Thursday 07 July 2005 02:52, Ilia Alshanetsky wrote:


iliaa  Wed Jul  6 20:52:20 2005 EDT

 Modified files:
   /php-src/ext/pdo_pgsql pgsql_driver.c
 Log:
 Faster sequence id retrieval.



http://cvs.php.net/diff.php/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.46r2
=1.47ty=u Index: php-src/ext/pdo_pgsql/pgsql_driver.c
diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.46
php-src/ext/pdo_pgsql/pgsql_driver.c:1.47 ---
php-src/ext/pdo_pgsql/pgsql_driver.c:1.46 Fri Jul  1 18:43:16 2005 +++
php-src/ext/pdo_pgsql/pgsql_driver.c Wed Jul  6 20:52:19 2005
@@ -16,7 +16,7 @@
  +--+
*/

-/* $Id: pgsql_driver.c,v 1.46 2005/07/01 22:43:16 edink Exp $ */
+/* $Id: pgsql_driver.c,v 1.47 2005/07/07 00:52:19 iliaa Exp $ */

#ifdef HAVE_CONFIG_H
#include config.h
@@ -210,15 +210,16 @@
*len = spprintf(id, 0, %ld, (long) H-pgoid);
} else {
PGresult *res;
-   char *name_escaped, *q;
-   size_t l = strlen(name);
+   char *q;
ExecStatusType status;

-   name_escaped = safe_emalloc(l, 2, 1);
-   PQescapeString(name_escaped, name, l);
-   spprintf(q, 0, SELECT CURRVAL('%s'), name_escaped);
+   /* SQL injection protection */
+   if (strchr(name, '\'')) {
+   return NULL;
+   }
+
+   spprintf(q, sizeof(SELECT CURRVAL('')) + strlen(name), 
SELECT
CURRVAL('%s'), name); res = PQexec(H-server, q);
-   efree(name_escaped);
efree(q);
status = PQresultStatus(res);






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



[PHP-CVS] cvs: php-src /win32/build confutils.js

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 09:22:39 2005 EDT

  Modified files:  
/php-src/win32/buildconfutils.js 
  Log:
  If asked to populate a set of cflags for a header check, only populate the
  flags and don't fill in an entry into config.w32.h, UNLESS explicitly told
  what to do.
  
  This prevents leakage of things like HAVE_SQLCLI1_H from one pecl into another
  (or the core) and confusing the build (as has happened with ibm_db2 and
  pdo_odbc).
  
  
  
http://cvs.php.net/diff.php/php-src/win32/build/confutils.js?r1=1.57r2=1.58ty=u
Index: php-src/win32/build/confutils.js
diff -u php-src/win32/build/confutils.js:1.57 
php-src/win32/build/confutils.js:1.58
--- php-src/win32/build/confutils.js:1.57   Thu Jun  9 09:09:04 2005
+++ php-src/win32/build/confutils.jsThu Jul  7 09:22:38 2005
@@ -17,7 +17,7 @@
   +--+
 */
 
-// $Id: confutils.js,v 1.57 2005/06/09 13:09:04 wez Exp $
+// $Id: confutils.js,v 1.58 2005/07/07 13:22:38 wez Exp $
 
 var STDOUT = WScript.StdOut;
 var STDERR = WScript.StdErr;
@@ -815,10 +815,15 @@
sym = header_name.toUpperCase();
sym = sym.replace(new RegExp([/\.-], g), _);
 
+   if (typeof(add_to_flag_only) == undefined 
+   flag_name.match(new RegExp(^CFLAGS_(.*)$))) {
+   add_to_flag_only = true;
+   }
+
if (typeof(add_to_flag_only) != undefined) {
ADD_FLAG(flag_name, /DHAVE_ + sym + = + have);
} else {
-   AC_DEFINE(HAVE_ + sym, have);
+   AC_DEFINE(HAVE_ + sym, have, have the  + header_name +  
header file);
}
 
return p;

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



Re: [PHP-CVS] cvs: php-src /ext/pdo_pgsql pgsql_driver.c

2005-07-07 Thread Wez Furlong
How about using a stack variable for this temporary allocation?

On 7/7/05, Ilia Alshanetsky [EMAIL PROTECTED] wrote:
 Edink,
 
 It is malloc + PQescapeString + free, which in most cases are completely
 unnecessary. While as Christopher demonstrates sequence name could
 contain special chars, I'd wager that is a VERY uncommon situation.
 
 Ilia
 
 Edin Kadribasic wrote:
  Hi Ilia,
 
  Would you please revert this change?
 
  Saving one malloc/free in a function that has to query DB server anyway is 
  not
  going to give you much performance improvement, while other methods are not
  portable across different PostgreSQL versions.
 
  Edin
 
  On Thursday 07 July 2005 02:52, Ilia Alshanetsky wrote:
 
 iliaa  Wed Jul  6 20:52:20 2005 EDT
 
   Modified files:
 /php-src/ext/pdo_pgsql pgsql_driver.c
   Log:
   Faster sequence id retrieval.
 
 
 
 http://cvs.php.net/diff.php/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.46r2
 =1.47ty=u Index: php-src/ext/pdo_pgsql/pgsql_driver.c
 diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.46
 php-src/ext/pdo_pgsql/pgsql_driver.c:1.47 ---
 php-src/ext/pdo_pgsql/pgsql_driver.c:1.46 Fri Jul  1 18:43:16 2005 +++
 php-src/ext/pdo_pgsql/pgsql_driver.c Wed Jul  6 20:52:19 2005
 @@ -16,7 +16,7 @@
+--+
  */
 
 -/* $Id: pgsql_driver.c,v 1.46 2005/07/01 22:43:16 edink Exp $ */
 +/* $Id: pgsql_driver.c,v 1.47 2005/07/07 00:52:19 iliaa Exp $ */
 
  #ifdef HAVE_CONFIG_H
  #include config.h
 @@ -210,15 +210,16 @@
   *len = spprintf(id, 0, %ld, (long) H-pgoid);
   } else {
   PGresult *res;
 - char *name_escaped, *q;
 - size_t l = strlen(name);
 + char *q;
   ExecStatusType status;
 
 - name_escaped = safe_emalloc(l, 2, 1);
 - PQescapeString(name_escaped, name, l);
 - spprintf(q, 0, SELECT CURRVAL('%s'), name_escaped);
 + /* SQL injection protection */
 + if (strchr(name, '\'')) {
 + return NULL;
 + }
 +
 + spprintf(q, sizeof(SELECT CURRVAL('')) + strlen(name), 
 SELECT
 CURRVAL('%s'), name); res = PQexec(H-server, q);
 - efree(name_escaped);
   efree(q);
   status = PQresultStatus(res);
 
 
 
 
 --
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



[PHP-CVS] cvs: php-src /ext/pdo_pgsql config.m4 pgsql_driver.c

2005-07-07 Thread Ilia Alshanetsky
iliaa   Thu Jul  7 09:35:41 2005 EDT

  Modified files:  
/php-src/ext/pdo_pgsql  config.m4 pgsql_driver.c 
  Log:
  Use PQexecParams() when available, use original case in all other instances.
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo_pgsql/config.m4?r1=1.10r2=1.11ty=u
Index: php-src/ext/pdo_pgsql/config.m4
diff -u php-src/ext/pdo_pgsql/config.m4:1.10 
php-src/ext/pdo_pgsql/config.m4:1.11
--- php-src/ext/pdo_pgsql/config.m4:1.10Mon Jun 13 20:00:53 2005
+++ php-src/ext/pdo_pgsql/config.m4 Thu Jul  7 09:35:39 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.10 2005/06/14 00:00:53 sniper Exp $
+dnl $Id: config.m4,v 1.11 2005/07/07 13:35:39 iliaa Exp $
 dnl
 
 if test $PHP_PDO != no; then
@@ -90,6 +90,7 @@
   AC_CHECK_LIB(pq, 
PQprotocolVersion,AC_DEFINE(HAVE_PQPROTOCOLVERSION,1,[PostgreSQL 7.4 or later]))
   AC_CHECK_LIB(pq, 
PQtransactionStatus,AC_DEFINE(HAVE_PGTRANSACTIONSTATUS,1,[PostgreSQL 7.4 or 
later]))
   AC_CHECK_LIB(pq, 
PQunescapeBytea,AC_DEFINE(HAVE_PQUNESCAPEBYTEA,1,[PostgreSQL 7.4 or later]))
+  AC_CHECK_LIB(pq, PQExecParams,AC_DEFINE(HAVE_PQEXECPARAMS,1,[PostgreSQL 7.4 
or later]))
   AC_CHECK_LIB(pq, 
PQresultErrorField,AC_DEFINE(HAVE_PQRESULTERRORFIELD,1,[PostgreSQL 7.4 or 
later]))
   AC_CHECK_LIB(pq, 
pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether 
libpq is compiled with --enable-multibyte]))
   LIBS=$old_LIBS
http://cvs.php.net/diff.php/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.48r2=1.49ty=u
Index: php-src/ext/pdo_pgsql/pgsql_driver.c
diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.48 
php-src/ext/pdo_pgsql/pgsql_driver.c:1.49
--- php-src/ext/pdo_pgsql/pgsql_driver.c:1.48   Wed Jul  6 22:17:20 2005
+++ php-src/ext/pdo_pgsql/pgsql_driver.cThu Jul  7 09:35:39 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: pgsql_driver.c,v 1.48 2005/07/07 02:17:20 iliaa Exp $ */
+/* $Id: pgsql_driver.c,v 1.49 2005/07/07 13:35:39 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -210,12 +210,22 @@
*len = spprintf(id, 0, %ld, (long) H-pgoid);
} else {
PGresult *res;
-   char *q;
ExecStatusType status;
-
-   spprintf(q, sizeof(SELECT CURRVAL('')) + strlen(name), 
SELECT CURRVAL('%s'), name);
+#ifdef HAVE_PQEXECPARAMS
+   const char *q[1];
+   q[0] = name;
+   res = PQexecParams(H-server, SELECT CURRVAL($1), 1, NULL, q, 
NULL, NULL, 0);
+#else
+   char *name_escaped, *q;
+   size_t l = strlen(name);
+
+   name_escaped = safe_emalloc(l, 2, 1);
+   PQescapeString(name_escaped, name, l);
+   spprintf(q, 0, SELECT CURRVAL('%s'), name_escaped);
res = PQexec(H-server, q);
+   efree(name_escaped); 
efree(q);
+#endif
status = PQresultStatus(res);
 
if (res  (status == PGRES_TUPLES_OK)) {

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



[PHP-CVS] cvs: php-src /ext/pdo_odbc config.m4

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 09:42:13 2005 EDT

  Modified files:  
/php-src/ext/pdo_odbc   config.m4 
  Log:
  Hmm, these ldflags went AWOL.
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo_odbc/config.m4?r1=1.20r2=1.21ty=u
Index: php-src/ext/pdo_odbc/config.m4
diff -u php-src/ext/pdo_odbc/config.m4:1.20 php-src/ext/pdo_odbc/config.m4:1.21
--- php-src/ext/pdo_odbc/config.m4:1.20 Mon Jun 13 22:18:18 2005
+++ php-src/ext/pdo_odbc/config.m4  Thu Jul  7 09:42:12 2005
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.20 2005/06/14 02:18:18 sniper Exp $
+dnl $Id: config.m4,v 1.21 2005/07/07 13:42:12 wez Exp $
 dnl config.m4 for extension pdo_odbc
 dnl vim:et:sw=2:ts=2:
 
@@ -129,10 +129,10 @@
 You should consider using unixODBC instead, and loading your
 libraries as a driver in that environment; it will emulate the
 functions required for PDO support.
-])])
+])], $PDO_ODBC_LDFLAGS)
   ],[
 AC_MSG_ERROR([Your ODBC library does not exist or there was an error. 
Check config.log for more information])
-  ])
+  ], $PDO_ODBC_LDFLAGS)
 
   PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, 
$ext_shared,,-I$pdo_inc_path $PDO_ODBC_INCLUDE)
   PHP_SUBST(PDO_ODBC_SHARED_LIBADD)

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



[PHP-CVS] cvs: php-src /ext/pdo/tests pdo_test.inc

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 09:56:11 2005 EDT

  Modified files:  
/php-src/ext/pdo/tests  pdo_test.inc 
  Log:
  extra paranoia about the attribute param
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_test.inc?r1=1.1r2=1.2ty=u
Index: php-src/ext/pdo/tests/pdo_test.inc
diff -u php-src/ext/pdo/tests/pdo_test.inc:1.1 
php-src/ext/pdo/tests/pdo_test.inc:1.2
--- php-src/ext/pdo/tests/pdo_test.inc:1.1  Wed Jul  6 09:19:25 2005
+++ php-src/ext/pdo/tests/pdo_test.inc  Thu Jul  7 09:56:09 2005
@@ -9,12 +9,12 @@
$user = getenv('PDOTEST_USER');
$pass = getenv('PDOTEST_PASS');
$attr = getenv('PDOTEST_ATTR');
-   if (is_string($attr)) {
+   if (is_string($attr)  strlen($attr)) {
$attr = unserialize($attr);
} else {
$attr = null;
}
-
+   
$db = new $classname($dsn, $user, $pass, $attr);
 
// clean up any crufty test tables we might have left behind

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



[PHP-CVS] cvs: php-src /ext/pdo_odbc/tests common.phpt

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 09:56:40 2005 EDT

  Modified files:  
/php-src/ext/pdo_odbc/tests common.phpt 
  Log:
  more paranoia about the attribute param here too
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo_odbc/tests/common.phpt?r1=1.1r2=1.2ty=u
Index: php-src/ext/pdo_odbc/tests/common.phpt
diff -u php-src/ext/pdo_odbc/tests/common.phpt:1.1 
php-src/ext/pdo_odbc/tests/common.phpt:1.2
--- php-src/ext/pdo_odbc/tests/common.phpt:1.1  Wed Jul  6 02:10:52 2005
+++ php-src/ext/pdo_odbc/tests/common.phpt  Thu Jul  7 09:56:39 2005
@@ -16,7 +16,9 @@
$config['ENV']['PDOTEST_DSN'] = getenv('PDO_ODBC_TEST_DSN');
$config['ENV']['PDOTEST_USER'] = getenv('PDO_ODBC_TEST_USER');
$config['ENV']['PDOTEST_PASS'] = getenv('PDO_ODBC_TEST_PASS');
-   $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_ODBC_TEST_ATTR');
+   if (false !== getenv('PDO_ODBC_TEST_ATTR')) {
+   $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_ODBC_TEST_ATTR');
+   }
 } elseif (preg_match('/^WIN/i', PHP_OS)) {
# on windows, try to create a temporary MS access database
$path = realpath(dirname(__FILE__)) . '\pdo_odbc.mdb';

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



[PHP-CVS] cvs: php-src / run-tests.php

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 09:58:03 2005 EDT

  Modified files:  
/php-srcrun-tests.php 
  Log:
  sort redirected tests
  
  
http://cvs.php.net/diff.php/php-src/run-tests.php?r1=1.218r2=1.219ty=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.218 php-src/run-tests.php:1.219
--- php-src/run-tests.php:1.218 Thu Jul  7 08:58:47 2005
+++ php-src/run-tests.php   Thu Jul  7 09:58:02 2005
@@ -888,6 +888,7 @@
}
putenv(REDIR_TEST_DIR= . realpath($IN_REDIRECT['TESTS']) . 
DIRECTORY_SEPARATOR);
 
+   usort($test_files, test_sort);
foreach ($test_files as $name) {
$result = run_test($php, $name, $test_cnt, ++$test_idx);
$test_results[$tested . ': ' . $name] = $result;

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



[PHP-CVS] cvs: php-src /ext/pdo_oci/tests common.phpt connection.inc pdo_001.phpt pdo_002.phpt pdo_003.phpt pdo_004.phpt pdo_005.phpt pdo_006.phpt pdo_007.phpt pdo_008.phpt pdo_009.phpt pdo_010.phpt p

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 09:58:35 2005 EDT

  Added files: 
/php-src/ext/pdo_oci/tests  common.phpt 

  Removed files:   
/php-src/ext/pdo_oci/tests  connection.inc pdo_001.phpt pdo_002.phpt 
pdo_003.phpt pdo_004.phpt pdo_005.phpt 
pdo_006.phpt pdo_007.phpt pdo_008.phpt 
pdo_009.phpt pdo_010.phpt pdo_011.phpt 
pdo_012.phpt pdo_013.phpt pdo_014.phpt 
pdo_015.phpt pdo_016.phpt pdo_017.phpt 
pdo_018.phpt pdo_019.phpt pdo_020.phpt 
pdo_021.phpt prepare.inc skipif.inc 
  Log:
  adopt common tests
  
  

http://cvs.php.net/co.php/php-src/ext/pdo_oci/tests/common.phpt?r=1.1p=1
Index: php-src/ext/pdo_oci/tests/common.phpt
+++ php-src/ext/pdo_oci/tests/common.phpt
--TEST--
OCI
--SKIPIF--
?php # vim:ft=php
if (!extension_loaded('pdo_oci')) print 'skip'; ?
--REDIRECTTEST--
# magic auto-configuration

$config = array(
'TESTS' = 'ext/pdo/tests'
);


if (false !== getenv('PDO_OCI_TEST_DSN')) {
# user set them from their shell
$config['ENV']['PDOTEST_DSN'] = getenv('PDO_OCI_TEST_DSN');
$config['ENV']['PDOTEST_USER'] = getenv('PDO_OCI_TEST_USER');
$config['ENV']['PDOTEST_PASS'] = getenv('PDO_OCI_TEST_PASS');
$config['ENV']['PDOTEST_ATTR'] = getenv('PDO_OCI_TEST_ATTR');
} else {
$config['ENV']['PDOTEST_DSN'] = 'oci:dbname=test';
$config['ENV']['PDOTEST_USER'] = 'SYSTEM';
$config['ENV']['PDOTEST_PASS'] = 'PASSWORD';
}

return $config;

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



[PHP-CVS] cvs: php-src /ext/pdo/tests pdo_test.inc

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 09:59:34 2005 EDT

  Modified files:  
/php-src/ext/pdo/tests  pdo_test.inc 
  Log:
  make column names lower case
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_test.inc?r1=1.2r2=1.3ty=u
Index: php-src/ext/pdo/tests/pdo_test.inc
diff -u php-src/ext/pdo/tests/pdo_test.inc:1.2 
php-src/ext/pdo/tests/pdo_test.inc:1.3
--- php-src/ext/pdo/tests/pdo_test.inc:1.2  Thu Jul  7 09:56:09 2005
+++ php-src/ext/pdo/tests/pdo_test.inc  Thu Jul  7 09:59:34 2005
@@ -28,6 +28,7 @@
}

$db-setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_WARNING);
+   $db-setAttribute(PDO_ATTR_CASE, PDO_CASE_LOWER);
return $db;
}
 }

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



[PHP-CVS] cvs: php-src /ext/pdo/tests pdo_009.phpt pdo_010.phpt pdo_018.phpt

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 10:10:00 2005 EDT

  Modified files:  
/php-src/ext/pdo/tests  pdo_009.phpt pdo_010.phpt pdo_018.phpt 
  Log:
  Need to state NOT NULL here, as DB2 won't allow the UNIQUE constraint without 
it.
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_009.phpt?r1=1.2r2=1.3ty=u
Index: php-src/ext/pdo/tests/pdo_009.phpt
diff -u php-src/ext/pdo/tests/pdo_009.phpt:1.2 
php-src/ext/pdo/tests/pdo_009.phpt:1.3
--- php-src/ext/pdo/tests/pdo_009.phpt:1.2  Wed Jul  6 09:19:25 2005
+++ php-src/ext/pdo/tests/pdo_009.phpt  Thu Jul  7 10:09:58 2005
@@ -9,7 +9,7 @@
 require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
 $db = PDOTest::factory();
 
-$db-exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name 
VARCHAR(10) UNIQUE)');
+$db-exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name 
VARCHAR(10) NOT NULL UNIQUE)');
 $db-exec('INSERT INTO classtypes VALUES(0, \'stdClass\')'); 
 $db-exec('INSERT INTO classtypes VALUES(1, \'Test1\')'); 
 $db-exec('INSERT INTO classtypes VALUES(2, \'Test2\')'); 
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_010.phpt?r1=1.2r2=1.3ty=u
Index: php-src/ext/pdo/tests/pdo_010.phpt
diff -u php-src/ext/pdo/tests/pdo_010.phpt:1.2 
php-src/ext/pdo/tests/pdo_010.phpt:1.3
--- php-src/ext/pdo/tests/pdo_010.phpt:1.2  Wed Jul  6 09:19:25 2005
+++ php-src/ext/pdo/tests/pdo_010.phpt  Thu Jul  7 10:09:58 2005
@@ -9,7 +9,7 @@
 require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
 $db = PDOTest::factory();
 
-$db-exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name 
VARCHAR(10) UNIQUE)');
+$db-exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name 
VARCHAR(10) NOT NULL UNIQUE)');
 $db-exec('INSERT INTO classtypes VALUES(0, \'stdClass\')'); 
 $db-exec('INSERT INTO classtypes VALUES(1, \'Test1\')'); 
 $db-exec('INSERT INTO classtypes VALUES(2, \'Test2\')'); 
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_018.phpt?r1=1.2r2=1.3ty=u
Index: php-src/ext/pdo/tests/pdo_018.phpt
diff -u php-src/ext/pdo/tests/pdo_018.phpt:1.2 
php-src/ext/pdo/tests/pdo_018.phpt:1.3
--- php-src/ext/pdo/tests/pdo_018.phpt:1.2  Wed Jul  6 09:19:25 2005
+++ php-src/ext/pdo/tests/pdo_018.phpt  Thu Jul  7 10:09:58 2005
@@ -63,7 +63,7 @@
 {
 }
 
-$db-exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name 
VARCHAR(20) UNIQUE)');
+$db-exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name 
VARCHAR(20) NOT NULL UNIQUE)');
 $db-exec('INSERT INTO classtypes VALUES(0, \'stdClass\')'); 
 $db-exec('INSERT INTO classtypes VALUES(1, \'TestBase\')'); 
 $db-exec('INSERT INTO classtypes VALUES(2, \'TestDerived\')'); 

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



[PHP-CVS] cvs: php-src /ext/pdo_odbc odbc_stmt.c

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 10:20:05 2005 EDT

  Modified files:  
/php-src/ext/pdo_odbc   odbc_stmt.c 
  Log:
  DB2 wants us to use the proper ODBC 3 function for closing a cursor.
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo_odbc/odbc_stmt.c?r1=1.21r2=1.22ty=u
Index: php-src/ext/pdo_odbc/odbc_stmt.c
diff -u php-src/ext/pdo_odbc/odbc_stmt.c:1.21 
php-src/ext/pdo_odbc/odbc_stmt.c:1.22
--- php-src/ext/pdo_odbc/odbc_stmt.c:1.21   Thu Jul  7 08:49:21 2005
+++ php-src/ext/pdo_odbc/odbc_stmt.cThu Jul  7 10:20:04 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: odbc_stmt.c,v 1.21 2005/07/07 12:49:21 wez Exp $ */
+/* $Id: odbc_stmt.c,v 1.22 2005/07/07 14:20:04 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -51,7 +51,7 @@
 
if (S-stmt != SQL_NULL_HANDLE) {
if (stmt-executed) {
-   SQLCancel(S-stmt);
+   SQLCloseCursor(S-stmt);
}
SQLFreeHandle(SQL_HANDLE_STMT, S-stmt);
S-stmt = SQL_NULL_HANDLE;
@@ -71,7 +71,7 @@
char *buf = NULL;
 
if (stmt-executed) {
-   SQLCancel(S-stmt);
+   SQLCloseCursor(S-stmt);
}

rc = SQLExecute(S-stmt);   
@@ -93,7 +93,7 @@
if (!stm) {
/* shouldn't happen either */
pdo_odbc_stmt_error(input LOB is no longer a 
stream);
-   SQLCancel(S-stmt);
+   SQLCloseCursor(S-stmt);
if (buf) {
efree(buf);
}
@@ -359,7 +359,7 @@
}
 
if (rc == SQL_NO_DATA) {
-   pdo_odbc_stmt_error(SQLFetchScroll);
+   /* pdo_odbc_stmt_error(SQLFetchScroll); */
return 0;
}
 

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



[PHP-CVS] cvs: php-src /ext/pdo_mysql/tests common.phpt connection.inc pdo_001.phpt pdo_002.phpt pdo_003.phpt pdo_004.phpt pdo_005.phpt pdo_006.phpt pdo_007.phpt pdo_008.phpt pdo_009.phpt pdo_010.phpt

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 11:04:47 2005 EDT

  Added files: 
/php-src/ext/pdo_mysql/testscommon.phpt 

  Removed files:   
/php-src/ext/pdo_mysql/testsconnection.inc pdo_001.phpt 
pdo_002.phpt pdo_003.phpt pdo_004.phpt 
pdo_005.phpt pdo_006.phpt pdo_007.phpt 
pdo_008.phpt pdo_009.phpt pdo_010.phpt 
pdo_011.phpt pdo_012.phpt pdo_013.phpt 
pdo_014.phpt pdo_015.phpt pdo_016.phpt 
pdo_017.phpt pdo_018.phpt pdo_019.phpt 
pdo_020.phpt pdo_023.phpt pdo_024.phpt 
pdo_025.phpt pdo_026.phpt prepare.inc 
skipif.inc 
  Log:
  adopt new tests
  
  

http://cvs.php.net/co.php/php-src/ext/pdo_mysql/tests/common.phpt?r=1.1p=1
Index: php-src/ext/pdo_mysql/tests/common.phpt
+++ php-src/ext/pdo_mysql/tests/common.phpt
--TEST--
MySQL
--SKIPIF--
?php # vim:ft=php
if (!extension_loaded('pdo_mysql')) print 'skip'; ?
--REDIRECTTEST--
# magic auto-configuration

$config = array(
'TESTS' = 'ext/pdo/tests'
);

if (false !== getenv('PDO_MYSQL_TEST_DSN')) {
# user set them from their shell
$config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN');
$config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER');
$config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS');
if (false !== getenv('PDO_MYSQL_TEST_ATTR')) {
$config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR');
}
} else {
$config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test';
$config['ENV']['PDOTEST_USER'] = 'root';
$config['ENV']['PDOTEST_PASS'] = '';
}

return $config;

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



[PHP-CVS] cvs: php-src /ext/pdo_sqlite sqlite_statement.c

2005-07-07 Thread Ilia Alshanetsky
iliaa   Thu Jul  7 11:13:29 2005 EDT

  Modified files:  
/php-src/ext/pdo_sqlite sqlite_statement.c 
  Log:
  Fixed memory leak, after SQLITE_DONE sqlite3_data_count() always returns 0.
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo_sqlite/sqlite_statement.c?r1=1.14r2=1.15ty=u
Index: php-src/ext/pdo_sqlite/sqlite_statement.c
diff -u php-src/ext/pdo_sqlite/sqlite_statement.c:1.14 
php-src/ext/pdo_sqlite/sqlite_statement.c:1.15
--- php-src/ext/pdo_sqlite/sqlite_statement.c:1.14  Sun Feb 27 20:30:14 2005
+++ php-src/ext/pdo_sqlite/sqlite_statement.c   Thu Jul  7 11:13:28 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: sqlite_statement.c,v 1.14 2005/02/28 01:30:14 wez Exp $ */
+/* $Id: sqlite_statement.c,v 1.15 2005/07/07 15:13:28 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -59,7 +59,7 @@
return 1;
 
case SQLITE_DONE:
-   stmt-column_count = sqlite3_data_count(S-stmt);
+   stmt-column_count = sqlite3_column_count(S-stmt);
sqlite3_reset(S-stmt);
S-done = 1;
return 1;

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



[PHP-CVS] cvs: php-src /ext/pdo pdo_stmt.c

2005-07-07 Thread Ilia Alshanetsky
iliaa   Thu Jul  7 11:14:12 2005 EDT

  Modified files:  
/php-src/ext/pdopdo_stmt.c 
  Log:
  Return an empty array rather then FALSE in fetchAll() on no results.
  
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_stmt.c?r1=1.103r2=1.104ty=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.103 php-src/ext/pdo/pdo_stmt.c:1.104
--- php-src/ext/pdo/pdo_stmt.c:1.103Thu Jul  7 08:45:40 2005
+++ php-src/ext/pdo/pdo_stmt.c  Thu Jul  7 11:14:10 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_stmt.c,v 1.103 2005/07/07 12:45:40 wez Exp $ */
+/* $Id: pdo_stmt.c,v 1.104 2005/07/07 15:14:10 iliaa Exp $ */
 
 /* The PDO Statement Handle Class */
 
@@ -1293,8 +1293,7 @@
}
if (!do_fetch(stmt, TRUE, data, how, PDO_FETCH_ORI_NEXT, 0, 
return_all TSRMLS_CC)) {
FREE_ZVAL(data);
-   zval_dtor(return_value);
-   error = 1;
+   error = 2;
}
}
if (!error) {
@@ -1320,7 +1319,12 @@

if (error) {
PDO_HANDLE_STMT_ERR();
-   RETURN_FALSE;
+   if (error != 2) {
+   RETURN_FALSE;
+   } else { /* on no results, return an empty array */
+   array_init(return_value);
+   return;
+   }
}
 }
 /* }}} */

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



[PHP-CVS] cvs: php-src /ext/pdo/tests pdo_001.phpt pdo_002.phpt pdo_003.phpt pdo_004.phpt pdo_005.phpt pdo_006.phpt pdo_007.phpt pdo_008.phpt pdo_009.phpt pdo_010.phpt pdo_011.phpt pdo_012.phpt pdo_01

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 11:15:02 2005 EDT

  Modified files:  
/php-src/ext/pdo/tests  pdo_001.phpt pdo_002.phpt pdo_003.phpt 
pdo_004.phpt pdo_005.phpt pdo_006.phpt 
pdo_007.phpt pdo_008.phpt pdo_009.phpt 
pdo_010.phpt pdo_011.phpt pdo_012.phpt 
pdo_013.phpt pdo_014.phpt pdo_015.phpt 
pdo_016.phpt pdo_017.phpt pdo_018.phpt 
pdo_019.phpt pdo_020.phpt pdo_021.phpt 
pdo_022.phpt pdo_023.phpt pdo_024.phpt 
pdo_025.phpt pdo_026.phpt pdo_test.inc 
  Log:
  skip if we can't connect (include reason in skip output)
  
  http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_001.phpt?r1=1.2r2=1.3ty=u
Index: php-src/ext/pdo/tests/pdo_001.phpt
diff -u php-src/ext/pdo/tests/pdo_001.phpt:1.2 
php-src/ext/pdo/tests/pdo_001.phpt:1.3
--- php-src/ext/pdo/tests/pdo_001.phpt:1.2  Wed Jul  6 09:19:25 2005
+++ php-src/ext/pdo/tests/pdo_001.phpt  Thu Jul  7 11:15:01 2005
@@ -3,7 +3,11 @@
 --SKIPIF--
 ?php # vim:ft=php
 if (!extension_loaded('pdo')) print 'skip';
-if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) print 'skip no driver';
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?
 --FILE--
 ?php
 require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_002.phpt?r1=1.2r2=1.3ty=u
Index: php-src/ext/pdo/tests/pdo_002.phpt
diff -u php-src/ext/pdo/tests/pdo_002.phpt:1.2 
php-src/ext/pdo/tests/pdo_002.phpt:1.3
--- php-src/ext/pdo/tests/pdo_002.phpt:1.2  Wed Jul  6 09:19:25 2005
+++ php-src/ext/pdo/tests/pdo_002.phpt  Thu Jul  7 11:15:01 2005
@@ -3,7 +3,11 @@
 --SKIPIF--
 ?php # vim:ft=php
 if (!extension_loaded('pdo')) print 'skip';
-if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) print 'skip no driver';
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?
 --FILE--
 ?php
 require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_003.phpt?r1=1.2r2=1.3ty=u
Index: php-src/ext/pdo/tests/pdo_003.phpt
diff -u php-src/ext/pdo/tests/pdo_003.phpt:1.2 
php-src/ext/pdo/tests/pdo_003.phpt:1.3
--- php-src/ext/pdo/tests/pdo_003.phpt:1.2  Wed Jul  6 09:19:25 2005
+++ php-src/ext/pdo/tests/pdo_003.phpt  Thu Jul  7 11:15:01 2005
@@ -3,7 +3,11 @@
 --SKIPIF--
 ?php # vim:ft=php
 if (!extension_loaded('pdo')) print 'skip';
-if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) print 'skip no driver';
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?
 --FILE--
 ?php
 require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_004.phpt?r1=1.2r2=1.3ty=u
Index: php-src/ext/pdo/tests/pdo_004.phpt
diff -u php-src/ext/pdo/tests/pdo_004.phpt:1.2 
php-src/ext/pdo/tests/pdo_004.phpt:1.3
--- php-src/ext/pdo/tests/pdo_004.phpt:1.2  Wed Jul  6 09:19:25 2005
+++ php-src/ext/pdo/tests/pdo_004.phpt  Thu Jul  7 11:15:01 2005
@@ -3,7 +3,11 @@
 --SKIPIF--
 ?php # vim:ft=php
 if (!extension_loaded('pdo')) print 'skip';
-if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) print 'skip no driver';
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?
 --FILE--
 ?php
 require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_005.phpt?r1=1.2r2=1.3ty=u
Index: php-src/ext/pdo/tests/pdo_005.phpt
diff -u php-src/ext/pdo/tests/pdo_005.phpt:1.2 
php-src/ext/pdo/tests/pdo_005.phpt:1.3
--- php-src/ext/pdo/tests/pdo_005.phpt:1.2  Wed Jul  6 09:19:25 2005
+++ php-src/ext/pdo/tests/pdo_005.phpt  Thu Jul  7 11:15:01 2005
@@ -3,7 +3,11 @@
 --SKIPIF--
 ?php # vim:ft=php
 if (!extension_loaded('pdo')) print 'skip';
-if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) print 'skip no driver';
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?
 --FILE--
 ?php
 require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_006.phpt?r1=1.2r2=1.3ty=u
Index: php-src/ext/pdo/tests/pdo_006.phpt
diff -u php-src/ext/pdo/tests/pdo_006.phpt:1.2 
php-src/ext/pdo/tests/pdo_006.phpt:1.3
--- php-src/ext/pdo/tests/pdo_006.phpt:1.2  Wed Jul  6 09:19:25 2005
+++ php-src/ext/pdo/tests/pdo_006.phpt  Thu Jul  7 11:15:01 2005
@@ -3,7 +3,11 @@
 --SKIPIF--
 ?php # vim:ft=php
 if (!extension_loaded('pdo')) print 'skip';
-if (false == getenv('REDIR_TEST_DIR')) print 'skip no driver'; ?
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) print 'skip no driver';
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?
 --FILE--

[PHP-CVS] cvs: php-src / NEWS /ext/standard string.c

2005-07-07 Thread Antony Dovgal
tony2001Thu Jul  7 11:19:41 2005 EDT

  Modified files:  
/php-srcNEWS 
/php-src/ext/standard   string.c 
  Log:
  fix #33605 (substr_compare() crashes with negative offset  length)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1985r2=1.1986ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1985 php-src/NEWS:1.1986
--- php-src/NEWS:1.1985 Thu Jul  7 11:16:56 2005
+++ php-src/NEWSThu Jul  7 11:19:40 2005
@@ -10,6 +10,8 @@
 - Fixed memory corruption in pg_copy_from() in case the as_null parameter was
   passed. (Derick)
 - Fixed crash inside stream_get_line() when length parameter equals 0. (Ilia)
+- Fixed bug #33605 (substr_compare() crashes with negative offset and length). 
+  (Tony)
 - Fixed bug #33578 (strtotime() doesn't understand 11 Oct format). (Derick)
 - Fixed bug #33562 (date() crashes). (Derick)
 - Fixed bug #33536 (strtotime() defaults to now even on non time string).
http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.441r2=1.442ty=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.441 php-src/ext/standard/string.c:1.442
--- php-src/ext/standard/string.c:1.441 Sun Jun 19 12:31:51 2005
+++ php-src/ext/standard/string.c   Thu Jul  7 11:19:40 2005
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.441 2005/06/19 16:31:51 iliaa Exp $ */
+/* $Id: string.c,v 1.442 2005/07/07 15:19:40 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -4446,6 +4446,10 @@

if (ac  2) {
convert_to_long_ex(offset);
+   if (Z_LVAL_PP(offset)  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Offset 
should be greater then or equal to 0.);
+   RETURN_FALSE;   
+   }
p += Z_LVAL_PP(offset);
if (p  endp) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Offset 
value %ld exceeds string length., Z_LVAL_PP(offset));
@@ -4453,6 +4457,10 @@
}
if (ac == 4) {
convert_to_long_ex(length);
+   if (Z_LVAL_PP(length) = 0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Length should be greater than 0.);
+   RETURN_FALSE;   
+   }
if ((p + Z_LVAL_PP(length))  endp) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Length value %ld exceeds string length., Z_LVAL_PP(length));
RETURN_FALSE;

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



[PHP-CVS] cvs: php-src /ext/pdo_pgsql/tests common.phpt

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 11:20:06 2005 EDT

  Added files: 
/php-src/ext/pdo_pgsql/testscommon.phpt 
  Log:
  adopt new tests
  
  

http://cvs.php.net/co.php/php-src/ext/pdo_pgsql/tests/common.phpt?r=1.1p=1
Index: php-src/ext/pdo_pgsql/tests/common.phpt
+++ php-src/ext/pdo_pgsql/tests/common.phpt
--TEST--
Postgres
--SKIPIF--
?php # vim:ft=php
if (!extension_loaded('pdo_pgsql')) print 'skip'; ?
--REDIRECTTEST--
# magic auto-configuration

$config = array(
'TESTS' = 'ext/pdo/tests'
);

if (false !== getenv('PDO_PGSQL_TEST_DSN')) {
# user set them from their shell
$config['ENV']['PDOTEST_DSN'] = getenv('PDO_PGSQL_TEST_DSN');
if (false !== getenv('PDO_PGSQL_TEST_ATTR')) {
$config['ENV']['PDOTEST_ATTR'] = getenv('PDO_PGSQL_TEST_ATTR');
}
} else {
$config['ENV']['PDOTEST_DSN'] = 'pgsql:host=localhost port=5432 
dbname=test user=root password=';
}

return $config;

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



[PHP-CVS] cvs: php-src /ext/pdo/tests pdo_001.phpt pdo_002.phpt pdo_003.phpt pdo_004.phpt pdo_005.phpt pdo_006.phpt pdo_007.phpt pdo_008.phpt pdo_009.phpt pdo_010.phpt pdo_011.phpt pdo_012.phpt pdo_01

2005-07-07 Thread Ilia Alshanetsky
iliaa   Thu Jul  7 11:32:33 2005 EDT

  Modified files:  
/php-src/ext/pdo/tests  pdo_001.phpt pdo_002.phpt pdo_003.phpt 
pdo_004.phpt pdo_005.phpt pdo_006.phpt 
pdo_007.phpt pdo_008.phpt pdo_009.phpt 
pdo_010.phpt pdo_011.phpt pdo_012.phpt 
pdo_013.phpt pdo_014.phpt pdo_015.phpt 
pdo_016.phpt pdo_017.phpt pdo_018.phpt 
pdo_019.phpt pdo_020.phpt pdo_021.phpt 
pdo_022.phpt pdo_023.phpt pdo_024.phpt 
pdo_025.phpt pdo_026.phpt pdo_test.inc 
  Log:
  Stop on the 1st skip.
  
  http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_001.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/pdo/tests/pdo_001.phpt
diff -u php-src/ext/pdo/tests/pdo_001.phpt:1.3 
php-src/ext/pdo/tests/pdo_001.phpt:1.4
--- php-src/ext/pdo/tests/pdo_001.phpt:1.3  Thu Jul  7 11:15:01 2005
+++ php-src/ext/pdo/tests/pdo_001.phpt  Thu Jul  7 11:32:31 2005
@@ -2,9 +2,9 @@
 PDO Common: PDO_FETCH_ASSOC
 --SKIPIF--
 ?php # vim:ft=php
-if (!extension_loaded('pdo')) print 'skip';
+if (!extension_loaded('pdo')) die('skip');
 $dir = getenv('REDIR_TEST_DIR');
-if (false == $dir) print 'skip no driver';
+if (false == $dir) die('skip no driver');
 require_once $dir . 'pdo_test.inc';
 PDOTest::skip();
 ?
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_002.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/pdo/tests/pdo_002.phpt
diff -u php-src/ext/pdo/tests/pdo_002.phpt:1.3 
php-src/ext/pdo/tests/pdo_002.phpt:1.4
--- php-src/ext/pdo/tests/pdo_002.phpt:1.3  Thu Jul  7 11:15:01 2005
+++ php-src/ext/pdo/tests/pdo_002.phpt  Thu Jul  7 11:32:31 2005
@@ -2,9 +2,9 @@
 PDO Common: PDO_FETCH_NUM
 --SKIPIF--
 ?php # vim:ft=php
-if (!extension_loaded('pdo')) print 'skip';
+if (!extension_loaded('pdo')) die('skip');
 $dir = getenv('REDIR_TEST_DIR');
-if (false == $dir) print 'skip no driver';
+if (false == $dir) die('skip no driver');
 require_once $dir . 'pdo_test.inc';
 PDOTest::skip();
 ?
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_003.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/pdo/tests/pdo_003.phpt
diff -u php-src/ext/pdo/tests/pdo_003.phpt:1.3 
php-src/ext/pdo/tests/pdo_003.phpt:1.4
--- php-src/ext/pdo/tests/pdo_003.phpt:1.3  Thu Jul  7 11:15:01 2005
+++ php-src/ext/pdo/tests/pdo_003.phpt  Thu Jul  7 11:32:31 2005
@@ -2,9 +2,9 @@
 PDO Common: PDO_FETCH_BOTH
 --SKIPIF--
 ?php # vim:ft=php
-if (!extension_loaded('pdo')) print 'skip';
+if (!extension_loaded('pdo')) die('skip');
 $dir = getenv('REDIR_TEST_DIR');
-if (false == $dir) print 'skip no driver';
+if (false == $dir) die('skip no driver');
 require_once $dir . 'pdo_test.inc';
 PDOTest::skip();
 ?
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_004.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/pdo/tests/pdo_004.phpt
diff -u php-src/ext/pdo/tests/pdo_004.phpt:1.3 
php-src/ext/pdo/tests/pdo_004.phpt:1.4
--- php-src/ext/pdo/tests/pdo_004.phpt:1.3  Thu Jul  7 11:15:01 2005
+++ php-src/ext/pdo/tests/pdo_004.phpt  Thu Jul  7 11:32:31 2005
@@ -2,9 +2,9 @@
 PDO Common: PDO_FETCH_OBJ
 --SKIPIF--
 ?php # vim:ft=php
-if (!extension_loaded('pdo')) print 'skip';
+if (!extension_loaded('pdo')) die('skip');
 $dir = getenv('REDIR_TEST_DIR');
-if (false == $dir) print 'skip no driver';
+if (false == $dir) die('skip no driver');
 require_once $dir . 'pdo_test.inc';
 PDOTest::skip();
 ?
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_005.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/pdo/tests/pdo_005.phpt
diff -u php-src/ext/pdo/tests/pdo_005.phpt:1.3 
php-src/ext/pdo/tests/pdo_005.phpt:1.4
--- php-src/ext/pdo/tests/pdo_005.phpt:1.3  Thu Jul  7 11:15:01 2005
+++ php-src/ext/pdo/tests/pdo_005.phpt  Thu Jul  7 11:32:31 2005
@@ -2,9 +2,9 @@
 PDO Common: PDO_FETCH_CLASS
 --SKIPIF--
 ?php # vim:ft=php
-if (!extension_loaded('pdo')) print 'skip';
+if (!extension_loaded('pdo')) die('skip');
 $dir = getenv('REDIR_TEST_DIR');
-if (false == $dir) print 'skip no driver';
+if (false == $dir) die('skip no driver');
 require_once $dir . 'pdo_test.inc';
 PDOTest::skip();
 ?
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_006.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/pdo/tests/pdo_006.phpt
diff -u php-src/ext/pdo/tests/pdo_006.phpt:1.3 
php-src/ext/pdo/tests/pdo_006.phpt:1.4
--- php-src/ext/pdo/tests/pdo_006.phpt:1.3  Thu Jul  7 11:15:01 2005
+++ php-src/ext/pdo/tests/pdo_006.phpt  Thu Jul  7 11:32:31 2005
@@ -2,9 +2,9 @@
 PDO Common: PDO_FETCH_GROUP
 --SKIPIF--
 ?php # vim:ft=php
-if (!extension_loaded('pdo')) print 'skip';
+if (!extension_loaded('pdo')) die('skip');
 $dir = getenv('REDIR_TEST_DIR');
-if (false == $dir) print 'skip no driver';
+if (false == $dir) die('skip no driver');
 require_once $dir . 'pdo_test.inc';
 PDOTest::skip();
 ?
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_007.phpt?r1=1.3r2=1.4ty=u
Index: 

[PHP-CVS] cvs: php-src /ext/pdo_firebird/tests common.phpt connection.inc pdo_001.phpt pdo_002.phpt pdo_003.phpt pdo_004.phpt pdo_005.phpt pdo_006.phpt pdo_007.phpt pdo_008.phpt pdo_009.phpt pdo_010.p

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 11:33:07 2005 EDT

  Added files: 
/php-src/ext/pdo_firebird/tests common.phpt 

  Removed files:   
/php-src/ext/pdo_firebird/tests connection.inc pdo_001.phpt 
pdo_002.phpt pdo_003.phpt 
pdo_004.phpt pdo_005.phpt 
pdo_006.phpt pdo_007.phpt 
pdo_008.phpt pdo_009.phpt 
pdo_010.phpt pdo_011.phpt 
pdo_012.phpt pdo_013.phpt 
pdo_014.phpt pdo_015.phpt 
pdo_019.phpt pdo_020.phpt 
pdo_021.phpt prepare.inc 
  Log:
  use new tests
  
  

http://cvs.php.net/co.php/php-src/ext/pdo_firebird/tests/common.phpt?r=1.1p=1
Index: php-src/ext/pdo_firebird/tests/common.phpt
+++ php-src/ext/pdo_firebird/tests/common.phpt
--TEST--
FIREBIRD
--SKIPIF--
?php # vim:ft=php
if (!extension_loaded('pdo_odbc')) print 'skip'; ?
--REDIRECTTEST--
# magic auto-configuration

$config = array(
'TESTS' = 'ext/pdo/tests'
);


if (false !== getenv('PDO_FIREBIRD_TEST_DSN')) {
# user set them from their shell
$config['ENV']['PDOTEST_DSN'] = getenv('PDO_FIREBIRD_TEST_DSN');
$config['ENV']['PDOTEST_USER'] = getenv('PDO_FIREBIRD_TEST_USER');
$config['ENV']['PDOTEST_PASS'] = getenv('PDO_FIREBIRD_TEST_PASS');
if (false !== getenv('PDO_FIREBIRD_TEST_ATTR')) {
$config['ENV']['PDOTEST_ATTR'] = 
getenv('PDO_FIREBIRD_TEST_ATTR');
}
} else {
$config['ENV']['PDOTEST_DSN'] = 
'firebird:dbname=/opt/firebird/test.gdb';
$config['ENV']['PDOTEST_USER'] = 'SYSDBA';
$config['ENV']['PDOTEST_PASS'] = 'password';
}
return $config;

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



[PHP-CVS] cvs: php-src /ext/pdo_pgsql/tests connection.inc pdo_001.phpt pdo_002.phpt pdo_003.phpt pdo_004.phpt pdo_005.phpt pdo_006.phpt pdo_007.phpt pdo_008.phpt pdo_009.phpt pdo_010.phpt pdo_011.php

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 11:34:46 2005 EDT

  Removed files:   
/php-src/ext/pdo_pgsql/testsconnection.inc pdo_001.phpt 
pdo_002.phpt pdo_003.phpt pdo_004.phpt 
pdo_005.phpt pdo_006.phpt pdo_007.phpt 
pdo_008.phpt pdo_009.phpt pdo_010.phpt 
pdo_011.phpt pdo_012.phpt pdo_013.phpt 
pdo_014.phpt pdo_015.phpt pdo_016.phpt 
pdo_017.phpt pdo_018.phpt pdo_019.phpt 
pdo_020.phpt pdo_021.phpt pdo_022.phpt 
pdo_023.phpt pdo_024.phpt pdo_025.phpt 
pdo_026.phpt prepare.inc skipif.inc 
  Log:
  using new tests
  
  

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



[PHP-CVS] cvs: php-src /ext/pdo/tests pdo_001.inc pdo_002.inc pdo_003.inc pdo_004.inc pdo_005.inc pdo_006.inc pdo_007.inc pdo_008.inc pdo_009.inc pdo_010.inc pdo_011.inc pdo_012.inc pdo_013.inc pdo_01

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 11:36:00 2005 EDT

  Removed files:   
/php-src/ext/pdo/tests  pdo_001.inc pdo_002.inc pdo_003.inc 
pdo_004.inc pdo_005.inc pdo_006.inc 
pdo_007.inc pdo_008.inc pdo_009.inc 
pdo_010.inc pdo_011.inc pdo_012.inc 
pdo_013.inc pdo_014.inc pdo_015.inc 
pdo_016.inc pdo_017.inc pdo_018.inc 
pdo_019.inc pdo_020.inc pdo_021.inc 
pdo_022.inc pdo_023.inc pdo_023_def.inc 
pdo_024.inc pdo_025.inc pdo_026.inc 
  Log:
  remove old test files
  
  

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



[PHP-CVS] cvs: CVSROOT / avail

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 11:47:35 2005 EDT

  Modified files:  
/CVSROOTavail 
  Log:
  Karma for fastcgi
  
  
http://cvs.php.net/diff.php/CVSROOT/avail?r1=1.992r2=1.993ty=u
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.992 CVSROOT/avail:1.993
--- CVSROOT/avail:1.992 Wed Jul  6 12:30:41 2005
+++ CVSROOT/avail   Thu Jul  7 11:47:34 2005
@@ -19,6 +19,9 @@
 
 
avail|msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,mlwmohawk,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru|phpfi,php3,php-src,pecl,non-pecl,pear,peardoc,spl,phpdoc,ZendAPI,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa_IR,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca
 
+# fastcgi implementation for IIS
+avail|shane,wez,edink|fastcgi-isapi
+
 # The Livedocs developers
 
 avail|iliaa,goba,wez,derick,sfox,alan_k,jacques,edink|livedocs

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



[PHP-CVS] cvs: CVSROOT / loginfo

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 11:49:15 2005 EDT

  Modified files:  
/CVSROOTloginfo 
  Log:
  commit messages to people that are most interested right now.
  Can explore setting up a mailing list later.
  
  
http://cvs.php.net/diff.php/CVSROOT/loginfo?r1=1.114r2=1.115ty=u
Index: CVSROOT/loginfo
diff -u CVSROOT/loginfo:1.114 CVSROOT/loginfo:1.115
--- CVSROOT/loginfo:1.114   Sun Jun 19 18:31:45 2005
+++ CVSROOT/loginfo Thu Jul  7 11:49:15 2005
@@ -1,5 +1,5 @@
 #
-#ident @(#)cvs/examples:$Name:  $:$Id: loginfo,v 1.114 2005/06/19 22:31:45 
wez Exp $
+#ident @(#)cvs/examples:$Name:  $:$Id: loginfo,v 1.115 2005/07/07 15:49:15 
wez Exp $
 #
 # The loginfo file is used to control where cvs commit log information
 # is sent.  The first entry on a line is a regular expression which is tested
@@ -36,6 +36,8 @@
 # without perl you could do this:
 #
 
+^fastcgi-isapi $CVSROOT/CVSROOT/loginfo.pl [EMAIL PROTECTED],[EMAIL 
PROTECTED],[EMAIL PROTECTED] $USER %{sVv}
+
 # PHP-GTK stuff
 ^php-gtk-web $CVSROOT/CVSROOT/loginfo.pl [EMAIL PROTECTED] $USER %{sVv}
 ^php-gtk-doc $CVSROOT/CVSROOT/loginfo.pl [EMAIL PROTECTED] $USER %{sVv}

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



[PHP-CVS] cvs: php-src /ext/pdo_mysql mysql_statement.c

2005-07-07 Thread Ilia Alshanetsky
iliaa   Thu Jul  7 11:54:00 2005 EDT

  Modified files:  
/php-src/ext/pdo_mysql  mysql_statement.c 
  Log:
  Fixed memory leak.
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo_mysql/mysql_statement.c?r1=1.28r2=1.29ty=u
Index: php-src/ext/pdo_mysql/mysql_statement.c
diff -u php-src/ext/pdo_mysql/mysql_statement.c:1.28 
php-src/ext/pdo_mysql/mysql_statement.c:1.29
--- php-src/ext/pdo_mysql/mysql_statement.c:1.28Sat Jul  2 22:20:08 2005
+++ php-src/ext/pdo_mysql/mysql_statement.c Thu Jul  7 11:54:00 2005
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: mysql_statement.c,v 1.28 2005/07/03 02:20:08 wez Exp $ */
+/* $Id: mysql_statement.c,v 1.29 2005/07/07 15:54:00 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -55,7 +55,13 @@
efree(S-in_null);
efree(S-in_length);
}
-   if (S-bound_result) {
+   if (S-bound_result) 
+   {
+   int i;
+   for (i = 0; i  stmt-column_count; i++) {
+   efree(S-bound_result[i].buffer);
+   }
+   
efree(S-bound_result);
efree(S-out_null);
efree(S-out_length);

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



[PHP-CVS] cvs: php-src /tests/classes array_access_001.phpt array_access_002.phpt

2005-07-07 Thread Dmitry Stogov
dmitry  Thu Jul  7 12:09:57 2005 EDT

  Modified files:  
/php-src/tests/classes  array_access_001.phpt array_access_002.phpt 
  Log:
  Fixed bug #33512 (Add missing support for isset()/unset() overloading to 
complement the property get/set methods). Now empty($obj[...]) works proper but 
in addition it may call offsetGet() method.
  
  
http://cvs.php.net/diff.php/php-src/tests/classes/array_access_001.phpt?r1=1.3r2=1.4ty=u
Index: php-src/tests/classes/array_access_001.phpt
diff -u php-src/tests/classes/array_access_001.phpt:1.3 
php-src/tests/classes/array_access_001.phpt:1.4
--- php-src/tests/classes/array_access_001.phpt:1.3 Wed Sep 29 05:36:56 2004
+++ php-src/tests/classes/array_access_001.phpt Thu Jul  7 12:09:55 2005
@@ -96,12 +96,16 @@
 }
 ===EMPTY===
 object::offsetExists(0)
+object::offsetGet(0)
 bool(false)
 object::offsetExists(1)
+object::offsetGet(1)
 bool(false)
 object::offsetExists(2)
+object::offsetGet(2)
 bool(false)
 object::offsetExists(4th)
+object::offsetGet(4th)
 bool(false)
 object::offsetExists(5th)
 bool(true)
http://cvs.php.net/diff.php/php-src/tests/classes/array_access_002.phpt?r1=1.3r2=1.4ty=u
Index: php-src/tests/classes/array_access_002.phpt
diff -u php-src/tests/classes/array_access_002.phpt:1.3 
php-src/tests/classes/array_access_002.phpt:1.4
--- php-src/tests/classes/array_access_002.phpt:1.3 Wed Sep 29 05:36:56 2004
+++ php-src/tests/classes/array_access_002.phpt Thu Jul  7 12:09:55 2005
@@ -96,12 +96,16 @@
 }
 ===EMPTY===
 object::offsetExists(0)
+object::offsetGet(0)
 bool(false)
 object::offsetExists(1)
+object::offsetGet(1)
 bool(false)
 object::offsetExists(2)
+object::offsetGet(2)
 bool(false)
 object::offsetExists(4th)
+object::offsetGet(4th)
 bool(false)
 object::offsetExists(5th)
 bool(true)

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



[PHP-CVS] cvs: php-src /ext/pdo php_pdo_driver.h

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 12:24:52 2005 EDT

  Modified files:  
/php-src/ext/pdophp_pdo_driver.h 
  Log:
  add an attribute for returning the driver name
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/php_pdo_driver.h?r1=1.59r2=1.60ty=u
Index: php-src/ext/pdo/php_pdo_driver.h
diff -u php-src/ext/pdo/php_pdo_driver.h:1.59 
php-src/ext/pdo/php_pdo_driver.h:1.60
--- php-src/ext/pdo/php_pdo_driver.h:1.59   Sat Jul  2 23:49:44 2005
+++ php-src/ext/pdo/php_pdo_driver.hThu Jul  7 12:24:51 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_pdo_driver.h,v 1.59 2005/07/03 03:49:44 wez Exp $ */
+/* $Id: php_pdo_driver.h,v 1.60 2005/07/07 16:24:51 wez Exp $ */
 
 #ifndef PHP_PDO_DRIVER_H
 #define PHP_PDO_DRIVER_H
@@ -44,7 +44,7 @@
 # define FALSE 0
 #endif
 
-#define PDO_DRIVER_API 20050702
+#define PDO_DRIVER_API 20050707
 
 enum pdo_param_type {
PDO_PARAM_NULL,
@@ -126,6 +126,7 @@
PDO_ATTR_STATEMENT_CLASS,   /* array(classname, array(ctor_args)) 
to specify the class of the constructed statement */
PDO_ATTR_FETCH_TABLE_NAMES, /* include table names in the column names, 
where available */
PDO_ATTR_FETCH_CATALOG_NAMES, /* include the catalog/db name names in 
the column names, where available */
+   PDO_ATTR_DRIVER_NAME, /* name of the driver (as used in the 
constructor) */
 
/* this defines the start of the range for driver specific options.
 * Drivers should define their own attribute constants beginning with 
this
@@ -453,6 +454,8 @@
 
/* driver specific class methods for the dbh and stmt */
HashTable *cls_methods[PDO_DBH_DRIVER_METHOD_KIND__MAX];
+
+   pdo_driver_t *driver;
 };
 
 /* describes a column */

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



[PHP-CVS] cvs: php-src /ext/pdo_mysql mysql_driver.c

2005-07-07 Thread Ilia Alshanetsky
iliaa   Thu Jul  7 12:27:47 2005 EDT

  Modified files:  
/php-src/ext/pdo_mysql  mysql_driver.c 
  Log:
  Fixed memory leak
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo_mysql/mysql_driver.c?r1=1.51r2=1.52ty=u
Index: php-src/ext/pdo_mysql/mysql_driver.c
diff -u php-src/ext/pdo_mysql/mysql_driver.c:1.51 
php-src/ext/pdo_mysql/mysql_driver.c:1.52
--- php-src/ext/pdo_mysql/mysql_driver.c:1.51   Sat Jul  2 22:20:08 2005
+++ php-src/ext/pdo_mysql/mysql_driver.cThu Jul  7 12:27:46 2005
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: mysql_driver.c,v 1.51 2005/07/03 02:20:08 wez Exp $ */
+/* $Id: mysql_driver.c,v 1.52 2005/07/07 16:27:46 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -194,6 +194,9 @@
}
return 0;
}
+   if (nsql) {
+   efree(nsql);
+   }
 
S-num_params = mysql_stmt_param_count(S-stmt);
 

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



[PHP-CVS] cvs: php-src /ext/pdo pdo.c pdo_dbh.c

2005-07-07 Thread Wez Furlong
wez Thu Jul  7 13:08:03 2005 EDT

  Modified files:  
/php-src/ext/pdopdo.c pdo_dbh.c 
  Log:
  populate the new dbh-driver field.
  Implement PDO_ATTR_DRIVER_NAME.
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo.c?r1=1.52r2=1.53ty=u
Index: php-src/ext/pdo/pdo.c
diff -u php-src/ext/pdo/pdo.c:1.52 php-src/ext/pdo/pdo.c:1.53
--- php-src/ext/pdo/pdo.c:1.52  Sat Jul  2 23:49:44 2005
+++ php-src/ext/pdo/pdo.c   Thu Jul  7 13:08:01 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo.c,v 1.52 2005/07/03 03:49:44 wez Exp $ */
+/* $Id: pdo.c,v 1.53 2005/07/07 17:08:01 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -336,6 +336,7 @@
REGISTER_LONG_CONSTANT(PDO_ATTR_STATEMENT_CLASS,  
(long)PDO_ATTR_STATEMENT_CLASS, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(PDO_ATTR_FETCH_TABLE_NAMES,
(long)PDO_ATTR_FETCH_TABLE_NAMES,   
CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(PDO_ATTR_FETCH_CATALOG_NAMES,  
(long)PDO_ATTR_FETCH_CATALOG_NAMES, 
CONST_CS|CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(PDO_ATTR_DRIVER_NAME,  
(long)PDO_ATTR_DRIVER_NAME, CONST_CS|CONST_PERSISTENT);

REGISTER_LONG_CONSTANT(PDO_ERRMODE_SILENT,
(long)PDO_ERRMODE_SILENT,   CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(PDO_ERRMODE_WARNING,   
(long)PDO_ERRMODE_WARNING,  CONST_CS|CONST_PERSISTENT);
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_dbh.c?r1=1.77r2=1.78ty=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.77 php-src/ext/pdo/pdo_dbh.c:1.78
--- php-src/ext/pdo/pdo_dbh.c:1.77  Thu Jul  7 07:19:56 2005
+++ php-src/ext/pdo/pdo_dbh.c   Thu Jul  7 13:08:01 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_dbh.c,v 1.77 2005/07/07 11:19:56 dmitry Exp $ */
+/* $Id: pdo_dbh.c,v 1.78 2005/07/07 17:08:01 wez Exp $ */
 
 /* The PDO Database Handle Class */
 
@@ -390,6 +390,8 @@
php_error_docref(NULL TSRMLS_CC, E_ERROR, 
Failed to register persistent entry);
}
}
+
+   dbh-driver = driver;
return; 
}
 
@@ -744,6 +746,8 @@
case PDO_ATTR_ERRMODE:
RETURN_LONG(dbh-error_mode);
 
+   case PDO_ATTR_DRIVER_NAME:
+   RETURN_STRINGL(dbh-driver-driver_name, 
dbh-driver-driver_name_len, 1);
}

if (!dbh-methods-get_attribute) {

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



[PHP-CVS] cvs: php-src /ext/soap php_encoding.c

2005-07-07 Thread Dmitry Stogov
dmitry  Thu Jul  7 13:29:26 2005 EDT

  Modified files:  
/php-src/ext/soap   php_encoding.c 
  Log:
  Fixed SIGSEGV on decoding any elements
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.98r2=1.99ty=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.98 
php-src/ext/soap/php_encoding.c:1.99
--- php-src/ext/soap/php_encoding.c:1.98Wed Jul  6 10:15:51 2005
+++ php-src/ext/soap/php_encoding.c Thu Jul  7 13:29:25 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_encoding.c,v 1.98 2005/07/06 14:15:51 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.99 2005/07/07 17:29:25 dmitry Exp $ */
 
 #include time.h
 
@@ -993,9 +993,12 @@
while (node != NULL) {
if (get_zval_property(ret, 
(char*)node-name TSRMLS_CC) == NULL) {
zval* val = 
master_to_zval(get_conversion(XSD_ANYXML), node);
-   while (node-next != NULL 
+   while (Z_TYPE_P(val) == 
IS_STRING  node-next != NULL 
get_zval_property(ret, 
(char*)node-next-name TSRMLS_CC) == NULL) {
zval* val2 = 
master_to_zval(get_conversion(XSD_ANYXML), node-next);
+   if (Z_TYPE_P(val2) != 
IS_STRING) {
+   break;
+   }

add_string_to_string(val, val, val2);
zval_ptr_dtor(val2);
  node = node-next;

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/soap php_encoding.c

2005-07-07 Thread Dmitry Stogov
dmitry  Thu Jul  7 13:29:39 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/soap   php_encoding.c 
  Log:
  Fixed SIGSEGV on decoding any elements
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.71.2.22r2=1.71.2.23ty=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.71.2.22 
php-src/ext/soap/php_encoding.c:1.71.2.23
--- php-src/ext/soap/php_encoding.c:1.71.2.22   Wed Jul  6 10:16:03 2005
+++ php-src/ext/soap/php_encoding.c Thu Jul  7 13:29:39 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_encoding.c,v 1.71.2.22 2005/07/06 14:16:03 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.71.2.23 2005/07/07 17:29:39 dmitry Exp $ */
 
 #include time.h
 
@@ -993,9 +993,12 @@
while (node != NULL) {
if (get_zval_property(ret, 
(char*)node-name TSRMLS_CC) == NULL) {
zval* val = 
master_to_zval(get_conversion(XSD_ANYXML), node);
-   while (node-next != NULL 
+   while (Z_TYPE_P(val) == 
IS_STRING  node-next != NULL 
get_zval_property(ret, 
(char*)node-next-name TSRMLS_CC) == NULL) {
zval* val2 = 
master_to_zval(get_conversion(XSD_ANYXML), node-next);
+   if (Z_TYPE_P(val2) != 
IS_STRING) {
+   break;
+   }

add_string_to_string(val, val, val2);
zval_ptr_dtor(val2);
  node = node-next;

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



[PHP-CVS] cvs: php-src /ext/pdo_mysql mysql_statement.c

2005-07-07 Thread Ilia Alshanetsky
iliaa   Thu Jul  7 13:53:39 2005 EDT

  Modified files:  
/php-src/ext/pdo_mysql  mysql_statement.c 
  Log:
  Make prepared statements obey buffering flag in MySQL.
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo_mysql/mysql_statement.c?r1=1.29r2=1.30ty=u
Index: php-src/ext/pdo_mysql/mysql_statement.c
diff -u php-src/ext/pdo_mysql/mysql_statement.c:1.29 
php-src/ext/pdo_mysql/mysql_statement.c:1.30
--- php-src/ext/pdo_mysql/mysql_statement.c:1.29Thu Jul  7 11:54:00 2005
+++ php-src/ext/pdo_mysql/mysql_statement.c Thu Jul  7 13:53:34 2005
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: mysql_statement.c,v 1.29 2005/07/07 15:54:00 iliaa Exp $ */
+/* $Id: mysql_statement.c,v 1.30 2005/07/07 17:53:34 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -98,6 +98,10 @@
S-fields = mysql_fetch_fields(S-result);
stmt-column_count = 
(int)mysql_num_fields(S-result);
 
+   if (H-buffered) {
+   mysql_stmt_store_result(S-stmt);
+   }
+
S-bound_result = ecalloc(stmt-column_count, 
sizeof(MYSQL_BIND));
S-out_null = ecalloc(stmt-column_count, 
sizeof(my_bool));
S-out_length = ecalloc(stmt-column_count, 
sizeof(unsigned long));
@@ -185,7 +189,11 @@
return 0;
} else {
row_count = mysql_affected_rows(H-server);
-   S-result = mysql_use_result(H-server);
+   if (!H-buffered) {
+   S-result = mysql_use_result(H-server);
+   } else {
+   S-result = mysql_store_result(H-server);
+   }
 
if (NULL == S-result) {
return 0;

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



Re: [PHP-CVS] cvs: php-src /ext/pdo_pgsql pgsql_driver.c

2005-07-07 Thread Andi Gutmans

Oh, that's a different story then...

At 01:54 PM 7/7/2005 +0800, Christopher Kings-Lynne wrote:

It does impose a v7.4 and above libpq requirement, however.

Chris

Andi Gutmans wrote:
Yeah, definitely seems like PQexecParams is the safest and easiest way of 
doing so.
In general, I'm always in favor of using bound parameters exactly for 
this reason.

Andi
At 10:44 AM 7/7/2005 +0800, Christopher Kings-Lynne wrote:

By the way, using PQexecParams is by far the easiest fastest and safest 
way of doing this...


Chris

Ilia Alshanetsky wrote:


iliaa   Wed Jul  6 22:17:21 2005 EDT
  Modified files:
/php-src/ext/pdo_pgsql  pgsql_driver.c   Log:
  Leave it up to the user to decide if to escape the sequence name or not.


http://cvs.php.net/diff.php/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.47r2=1.48ty=u 


Index: php-src/ext/pdo_pgsql/pgsql_driver.c
diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.47 
php-src/ext/pdo_pgsql/pgsql_driver.c:1.48

--- php-src/ext/pdo_pgsql/pgsql_driver.c:1.47   Wed Jul  6 20:52:19 2005
+++ php-src/ext/pdo_pgsql/pgsql_driver.cWed Jul  6 22:17:20 2005
@@ -16,7 +16,7 @@

+--+
 */

-/* $Id: pgsql_driver.c,v 1.47 2005/07/07 00:52:19 iliaa Exp $ */
+/* $Id: pgsql_driver.c,v 1.48 2005/07/07 02:17:20 iliaa Exp $ */

 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -213,11 +213,6 @@
char *q;
ExecStatusType status;

-   /* SQL injection protection */
-   if (strchr(name, '\'')) {
-   return NULL;
-   }
-
spprintf(q, sizeof(SELECT CURRVAL('')) + 
strlen(name), SELECT CURRVAL('%s'), name);

res = PQexec(H-server, q);
efree(q);



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


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


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



[PHP-CVS] cvs: php-src /ext/pdo/tests pdo_012.phpt pdo_013.phpt pdo_016.phpt pdo_017.phpt pdo_018.phpt pdo_021.phpt pdo_026.phpt

2005-07-07 Thread Ilia Alshanetsky
iliaa   Thu Jul  7 14:50:01 2005 EDT

  Modified files:  
/php-src/ext/pdo/tests  pdo_012.phpt pdo_013.phpt pdo_016.phpt 
pdo_017.phpt pdo_018.phpt pdo_021.phpt 
pdo_026.phpt 
  Log:
  1st set of fixes to make tests work with MySQL
  
  # Additional changes pending
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_012.phpt?r1=1.4r2=1.5ty=u
Index: php-src/ext/pdo/tests/pdo_012.phpt
diff -u php-src/ext/pdo/tests/pdo_012.phpt:1.4 
php-src/ext/pdo/tests/pdo_012.phpt:1.5
--- php-src/ext/pdo/tests/pdo_012.phpt:1.4  Thu Jul  7 11:32:31 2005
+++ php-src/ext/pdo/tests/pdo_012.phpt  Thu Jul  7 14:49:58 2005
@@ -30,9 +30,13 @@
}
 }
 
+unset($stmt);
+
 $stmt = $db-query($SELECT, PDO_FETCH_CLASS, 'Test');
 var_dump($stmt-fetchAll());
 
+unset($stmt);
+
 $stmt = $db-query($SELECT, PDO_FETCH_NUM);
 $stmt-setFetchMode(PDO_FETCH_CLASS, 'Test', array('Changed'));
 var_dump($stmt-fetchAll());
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_013.phpt?r1=1.4r2=1.5ty=u
Index: php-src/ext/pdo/tests/pdo_013.phpt
diff -u php-src/ext/pdo/tests/pdo_013.phpt:1.4 
php-src/ext/pdo/tests/pdo_013.phpt:1.5
--- php-src/ext/pdo/tests/pdo_013.phpt:1.4  Thu Jul  7 11:32:31 2005
+++ php-src/ext/pdo/tests/pdo_013.phpt  Thu Jul  7 14:49:58 2005
@@ -36,11 +36,15 @@
}
 }
 
+unset($stmt);
+
 foreach ($db-query($SELECT, PDO_FETCH_CLASS, 'Test') as $data)
 {
var_dump($data);
 }
 
+unset($stmt);
+
 $stmt = $db-query($SELECT, PDO_FETCH_CLASS, 'Test', array('WOW'));
 
 foreach($stmt as $data)
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_016.phpt?r1=1.6r2=1.7ty=u
Index: php-src/ext/pdo/tests/pdo_016.phpt
diff -u php-src/ext/pdo/tests/pdo_016.phpt:1.6 
php-src/ext/pdo/tests/pdo_016.phpt:1.7
--- php-src/ext/pdo/tests/pdo_016.phpt:1.6  Thu Jul  7 11:32:31 2005
+++ php-src/ext/pdo/tests/pdo_016.phpt  Thu Jul  7 14:49:58 2005
@@ -17,6 +17,11 @@
 $db-exec('INSERT INTO test VALUES(0, \'String0\')');
 $db-exec('INSERT INTO test VALUES(1, \'String1\')');
 $db-exec('INSERT INTO test VALUES(2, \'String2\')');
+
+if ($db-getAttribute(PDO_ATTR_DRIVER_NAME) == 'mysql') {
+   $db-setAttribute(PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 1);
+}
+
 $stmt1 = $db-prepare('SELECT COUNT(idx) FROM test');
 $stmt2 = $db-prepare('SELECT idx, txt FROM test ORDER by idx');
 
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_017.phpt?r1=1.4r2=1.5ty=u
Index: php-src/ext/pdo/tests/pdo_017.phpt
diff -u php-src/ext/pdo/tests/pdo_017.phpt:1.4 
php-src/ext/pdo/tests/pdo_017.phpt:1.5
--- php-src/ext/pdo/tests/pdo_017.phpt:1.4  Thu Jul  7 11:32:31 2005
+++ php-src/ext/pdo/tests/pdo_017.phpt  Thu Jul  7 14:49:58 2005
@@ -22,7 +22,13 @@
 require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
 $db = PDOTest::factory();
 
-$db-exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10))');
+if ($db-getAttribute(PDO_ATTR_DRIVER_NAME) == 'mysql') {
+   $suf = ' Type=InnoDB';
+} else {
+   $suf = '';
+}
+
+$db-exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val 
VARCHAR(10))'.$suf);
 $db-exec(INSERT INTO test VALUES(1, 'A')); 
 $db-exec(INSERT INTO test VALUES(2, 'B')); 
 $db-exec(INSERT INTO test VALUES(3, 'C'));
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_018.phpt?r1=1.5r2=1.6ty=u
Index: php-src/ext/pdo/tests/pdo_018.phpt
diff -u php-src/ext/pdo/tests/pdo_018.phpt:1.5 
php-src/ext/pdo/tests/pdo_018.phpt:1.6
--- php-src/ext/pdo/tests/pdo_018.phpt:1.5  Thu Jul  7 11:32:31 2005
+++ php-src/ext/pdo/tests/pdo_018.phpt  Thu Jul  7 14:49:58 2005
@@ -77,6 +77,10 @@
 var_dump($db-query('SELECT COUNT(*) FROM classtypes')-fetchColumn());
 var_dump($db-query('SELECT id, name FROM classtypes ORDER by 
id')-fetchAll(PDO_FETCH_COLUMN|PDO_FETCH_UNIQUE));
 
+if ($db-getAttribute(PDO_ATTR_DRIVER_NAME) == 'mysql') {
+   $db-setAttribute(PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 1);
+}
+
 $objs = array();
 $objs[0] = new stdClass;
 $objs[1] = new TestBase;
@@ -101,6 +105,8 @@
 echo ===TYPES===\n;
 var_dump($ctypes);
 
+unset($stmt);
+
 echo ===INSERT===\n;
 $stmt = $db-prepare('INSERT INTO test VALUES(:id, :classtype, :val)');
 $stmt-bindParam(':id', $idx);
@@ -121,6 +127,8 @@
$stmt-execute();   
 }
 
+unset($stmt);
+
 echo ===DATA===\n;
 var_dump($db-query('SELECT test.val FROM test')-fetchAll(PDO_FETCH_COLUMN));
 
http://cvs.php.net/diff.php/php-src/ext/pdo/tests/pdo_021.phpt?r1=1.6r2=1.7ty=u
Index: php-src/ext/pdo/tests/pdo_021.phpt
diff -u php-src/ext/pdo/tests/pdo_021.phpt:1.6 
php-src/ext/pdo/tests/pdo_021.phpt:1.7
--- php-src/ext/pdo/tests/pdo_021.phpt:1.6  Thu Jul  7 11:32:32 2005
+++ php-src/ext/pdo/tests/pdo_021.phpt  Thu Jul  7 14:49:58 2005
@@ -36,6 +36,8 @@
 $num = $select-fetchColumn();
 echo 'There are ' . $num .  rows in the table.\n;
 
+unset($stmt);
+
 // Insert using named parameters
 $stmt2 = $db-prepare(INSERT INTO test VALUES(:first, :second, :third));
 foreach ($data as $row) {

Re: [PHP-CVS] cvs: php-src /ext/standard incomplete_class.c php_incomplete_class.h

2005-07-07 Thread Marcus Boerger
Hello Jani,

  consistency is good. So if ever we run into a related problem we'd only
need to care for that single typedef. Thanks Jani.

marcus

Wednesday, July 6, 2005, 2:58:25 PM, you wrote:


  What difference does it make as long as it works? GCC 4 it is. =)
  Anyways, the other functions related to where this stuff is used
  all use zend_uint. Is it bad to be consistent? :)

  --Jani

 On Wed, 6 Jul 2005, Marcus Boerger wrote:

 Hello Jani,

  which compiler is this? According to my knowledge size_t is the type that
 can hold any allocatable size. Or can it be the problem is somewhere else?

 marcus

 Wednesday, July 6, 2005, 1:48:47 AM, you wrote:

 sniper  Tue Jul  5 19:48:47 2005 EDT

   Modified files:
 /php-src/ext/standard   incomplete_class.c php_incomplete_class.h
   Log:
   - Fixed crash in serialize() + classes. (64bit only)


 http://cvs.php.net/diff.php/php-src/ext/standard/incomplete_class.c?r1=1.26r2=1.27ty=u
 Index: php-src/ext/standard/incomplete_class.c
 diff -u php-src/ext/standard/incomplete_class.c:1.26
 php-src/ext/standard/incomplete_class.c:1.27
 --- php-src/ext/standard/incomplete_class.c:1.26Sat Oct 30 15:14:05 
 2004
 +++ php-src/ext/standard/incomplete_class.c Tue Jul  5 19:48:44 2005
 @@ -17,7 +17,7 @@
   */


 -/* $Id: incomplete_class.c,v 1.26 2004/10/30 19:14:05 helly Exp $ */
 +/* $Id: incomplete_class.c,v 1.27 2005/07/05 23:48:44 sniper Exp $ */

  #include php.h
  #include basic_functions.h
 @@ -122,7 +122,7 @@

  /* {{{ php_lookup_class_name
   */
 -char *php_lookup_class_name(zval *object, size_t *nlen)
 +char *php_lookup_class_name(zval *object, zend_uint *nlen)
  {
 zval **val;
 char *retval = NULL;
 @@ -144,7 +144,7 @@

  /* {{{ php_store_class_name
   */
 -void php_store_class_name(zval *object, const char *name, size_t len)
 +void php_store_class_name(zval *object, const char *name, zend_uint len)
  {
 zval *val;
 TSRMLS_FETCH();
 http://cvs.php.net/diff.php/php-src/ext/standard/php_incomplete_class.h?r1=1.15r2=1.16ty=u
 Index: php-src/ext/standard/php_incomplete_class.h
 diff -u php-src/ext/standard/php_incomplete_class.h:1.15
 php-src/ext/standard/php_incomplete_class.h:1.16
 --- php-src/ext/standard/php_incomplete_class.h:1.15Wed Jun 29 05:28:44 
 2005
 +++ php-src/ext/standard/php_incomplete_class.h Tue Jul  5 19:48:44 2005
 @@ -16,7 +16,7 @@

 +--+
  */

 -/* $Id: php_incomplete_class.h,v 1.15 2005/06/29 09:28:44 johannes Exp $ */
 +/* $Id: php_incomplete_class.h,v 1.16 2005/07/05 23:48:44 sniper Exp $ */

  #ifndef PHP_INCOMPLETE_CLASS_H
  #define PHP_INCOMPLETE_CLASS_H
 @@ -42,7 +42,7 @@

  #define PHP_CLASS_ATTRIBUTES
 char *class_name;
 -   size_t name_len;
 +   zend_uint name_len;
 zend_bool free_class_name = 0;
 zend_bool incomplete_class = 0

 @@ -55,8 +55,8 @@

  zend_class_entry *php_create_incomplete_class(TSRMLS_D);

 -char *php_lookup_class_name(zval *object, size_t *nlen);
 -void  php_store_class_name(zval *object, const char *name, size_t len);
 +char *php_lookup_class_name(zval *object, zend_uint *nlen);
 +void  php_store_class_name(zval *object, const char *name, zend_uint len);

  #ifdef __cplusplus
  };









-- 
Best regards,
 Marcusmailto:[EMAIL PROTECTED]

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



Re: [PHP-CVS] cvs: php-src /ext/pdo_odbc config.m4

2005-07-07 Thread Jani Taskinen


Did you get a specific problem without those?
Or did you just blindly add those and didn't notice
the line with PHP_EVAL_LIBLINE() just before those tests?

--Jani

On Thu, 7 Jul 2005, Wez Furlong wrote:


wez Thu Jul  7 09:42:13 2005 EDT

 Modified files:
   /php-src/ext/pdo_odbcconfig.m4
 Log:
 Hmm, these ldflags went AWOL.


http://cvs.php.net/diff.php/php-src/ext/pdo_odbc/config.m4?r1=1.20r2=1.21ty=u
Index: php-src/ext/pdo_odbc/config.m4
diff -u php-src/ext/pdo_odbc/config.m4:1.20 php-src/ext/pdo_odbc/config.m4:1.21
--- php-src/ext/pdo_odbc/config.m4:1.20 Mon Jun 13 22:18:18 2005
+++ php-src/ext/pdo_odbc/config.m4  Thu Jul  7 09:42:12 2005
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.20 2005/06/14 02:18:18 sniper Exp $
+dnl $Id: config.m4,v 1.21 2005/07/07 13:42:12 wez Exp $
dnl config.m4 for extension pdo_odbc
dnl vim:et:sw=2:ts=2:

@@ -129,10 +129,10 @@
You should consider using unixODBC instead, and loading your
libraries as a driver in that environment; it will emulate the
functions required for PDO support.
-])])
+])], $PDO_ODBC_LDFLAGS)
  ],[
AC_MSG_ERROR([Your ODBC library does not exist or there was an error. Check 
config.log for more information])
-  ])
+  ], $PDO_ODBC_LDFLAGS)

  PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, 
$ext_shared,,-I$pdo_inc_path $PDO_ODBC_INCLUDE)
  PHP_SUBST(PDO_ODBC_SHARED_LIBADD)




--
Donate @ http://pecl.php.net/wishlist.php/sniper

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



Re: [PHP-CVS] cvs: php-src /ext/pdo_odbc config.m4

2005-07-07 Thread Wez Furlong

yes, no, yes.

configure was generated without the required -L path to the libs.
This was a shared build from under HEAD.


--Wez.

Jani Taskinen wrote:


Did you get a specific problem without those?
Or did you just blindly add those and didn't notice
the line with PHP_EVAL_LIBLINE() just before those tests?

--Jani

On Thu, 7 Jul 2005, Wez Furlong wrote:


wezThu Jul  7 09:42:13 2005 EDT

 Modified files:
   /php-src/ext/pdo_odbcconfig.m4
 Log:
 Hmm, these ldflags went AWOL.


http://cvs.php.net/diff.php/php-src/ext/pdo_odbc/config.m4?r1=1.20r2=1.21ty=u 


Index: php-src/ext/pdo_odbc/config.m4
diff -u php-src/ext/pdo_odbc/config.m4:1.20 
php-src/ext/pdo_odbc/config.m4:1.21

--- php-src/ext/pdo_odbc/config.m4:1.20Mon Jun 13 22:18:18 2005
+++ php-src/ext/pdo_odbc/config.m4Thu Jul  7 09:42:12 2005
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.20 2005/06/14 02:18:18 sniper Exp $
+dnl $Id: config.m4,v 1.21 2005/07/07 13:42:12 wez Exp $
dnl config.m4 for extension pdo_odbc
dnl vim:et:sw=2:ts=2:

@@ -129,10 +129,10 @@
You should consider using unixODBC instead, and loading your
libraries as a driver in that environment; it will emulate the
functions required for PDO support.
-])])
+])], $PDO_ODBC_LDFLAGS)
  ],[
AC_MSG_ERROR([Your ODBC library does not exist or there was an 
error. Check config.log for more information])

-  ])
+  ], $PDO_ODBC_LDFLAGS)

  PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, 
$ext_shared,,-I$pdo_inc_path $PDO_ODBC_INCLUDE)

  PHP_SUBST(PDO_ODBC_SHARED_LIBADD)






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



[PHP-CVS] cvs: php-src /ext/pdo_oci oci_statement.c

2005-07-07 Thread Antony Dovgal
tony2001Thu Jul  7 19:02:23 2005 EDT

  Modified files:  
/php-src/ext/pdo_ocioci_statement.c 
  Log:
  free parameter when requested to do so
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo_oci/oci_statement.c?r1=1.14r2=1.15ty=u
Index: php-src/ext/pdo_oci/oci_statement.c
diff -u php-src/ext/pdo_oci/oci_statement.c:1.14 
php-src/ext/pdo_oci/oci_statement.c:1.15
--- php-src/ext/pdo_oci/oci_statement.c:1.14Mon Feb 14 08:38:09 2005
+++ php-src/ext/pdo_oci/oci_statement.c Thu Jul  7 19:02:22 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: oci_statement.c,v 1.14 2005/02/14 13:38:09 tony2001 Exp $ */
+/* $Id: oci_statement.c,v 1.15 2005/07/07 23:02:22 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -226,6 +226,13 @@
P = (pdo_oci_bound_param*)param-driver_data;
 
switch (event_type) {
+   case PDO_PARAM_EVT_FREE:
+   P = param-driver_data;
+   if (P) {
+   efree(P);
+   }
+   break;
+
case PDO_PARAM_EVT_ALLOC:
P = (pdo_oci_bound_param*)ecalloc(1, 
sizeof(pdo_oci_bound_param));
param-driver_data = P;

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



[PHP-CVS] cvs: php-src /ext/pdo_oci oci_driver.c

2005-07-07 Thread Antony Dovgal
tony2001Thu Jul  7 19:03:22 2005 EDT

  Modified files:  
/php-src/ext/pdo_ocioci_driver.c 
  Log:
  do not set error_code to HY000 when there was NO error
  reset both handle  statement error codes to 0
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo_oci/oci_driver.c?r1=1.22r2=1.23ty=u
Index: php-src/ext/pdo_oci/oci_driver.c
diff -u php-src/ext/pdo_oci/oci_driver.c:1.22 
php-src/ext/pdo_oci/oci_driver.c:1.23
--- php-src/ext/pdo_oci/oci_driver.c:1.22   Tue Mar  8 21:13:06 2005
+++ php-src/ext/pdo_oci/oci_driver.cThu Jul  7 19:03:22 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: oci_driver.c,v 1.22 2005/03/09 02:13:06 wez Exp $ */
+/* $Id: oci_driver.c,v 1.23 2005/07/07 23:03:22 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -63,26 +63,25 @@
pdo_oci_stmt *S = NULL;
pdo_error_type *pdo_err = dbh-error_code;

-   einfo = H-einfo;
-
-   if (einfo-errmsg) {
-   pefree(einfo-errmsg, dbh-is_persistent);
-   einfo-errmsg = NULL;
-   }
-
if (stmt) {
S = (pdo_oci_stmt*)stmt-driver_data;
einfo = S-einfo;
pdo_err = stmt-error_code;
+   if (einfo-errmsg) {
+   efree(einfo-errmsg);
+   }
+   }
+   else {
+   einfo = H-einfo;
+   if (einfo-errmsg) {
+   pefree(einfo-errmsg, dbh-is_persistent);
+   }
}
-   
+   
+   einfo-errmsg = NULL;
einfo-errcode = 0;
einfo-file = file;
einfo-line = line;
-   if (einfo-errmsg) {
-   efree(einfo-errmsg);
-   einfo-errmsg = NULL;
-   }

switch (status) {
case OCI_SUCCESS:
@@ -113,34 +112,36 @@
break;
}
 
-   switch (einfo-errcode) {
-   case 1013:  /* user requested cancel of current operation */
-   zend_bailout();
-   break;
+   if (einfo-errcode) {
+   switch (einfo-errcode) {
+   case 1013:  /* user requested cancel of current 
operation */
+   zend_bailout();
+   break;
 
 #if 0
-   case 955:   /* ORA-00955: name is already used by an 
existing object */
-   *pdo_err = PDO_ERR_ALREADY_EXISTS;
-   break;
+   case 955:   /* ORA-00955: name is already used by 
an existing object */
+   *pdo_err = PDO_ERR_ALREADY_EXISTS;
+   break;
 #endif
 
-   case 12154: /* ORA-12154: TNS:could not resolve service 
name */
-   strcpy(*pdo_err, 42S02);
-   break;
-   
-   case 22:/* ORA-00022: invalid session id */
-   case 1012:  /* ORA-01012: */
-   case 3113:  /* ORA-03133: end of file on communication 
channel */
-   case 604:
-   case 1041:
-   /* consider the connection closed */
-   dbh-is_closed = 1;
-   H-attached = 0;
-   strcpy(*pdo_err, 01002); /* FIXME */
-   break;
+   case 12154: /* ORA-12154: TNS:could not resolve 
service name */
+   strcpy(*pdo_err, 42S02);
+   break;
+   
+   case 22:/* ORA-00022: invalid session id */
+   case 1012:  /* ORA-01012: */
+   case 3113:  /* ORA-03133: end of file on 
communication channel */
+   case 604:
+   case 1041:
+   /* consider the connection closed */
+   dbh-is_closed = 1;
+   H-attached = 0;
+   strcpy(*pdo_err, 01002); /* FIXME */
+   break;
 
-   default:
-   strcpy(*pdo_err, HY000);
+   default:
+   strcpy(*pdo_err, HY000);
+   }
}
 
/* little mini hack so that we can use this code from the dbh ctor */

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



[PHP-CVS] cvs: php-src / acinclude.m4 /ext/date config.m4

2005-07-07 Thread Jani Taskinen
sniper  Thu Jul  7 19:18:22 2005 EDT

  Modified files:  
/php-srcacinclude.m4 
/php-src/ext/date   config.m4 
  Log:
  - Fixed stupid bug in PHP_INSTALL_HEADERS() macro: foo bar != foo bar
  - ext/date/lib/timelib_config.h is also installed now
  
  
http://cvs.php.net/diff.php/php-src/acinclude.m4?r1=1.326r2=1.327ty=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.326 php-src/acinclude.m4:1.327
--- php-src/acinclude.m4:1.326  Thu Jul  7 01:54:42 2005
+++ php-src/acinclude.m4Thu Jul  7 19:18:21 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: acinclude.m4,v 1.326 2005/07/07 05:54:42 dmitry Exp $
+dnl $Id: acinclude.m4,v 1.327 2005/07/07 23:18:21 sniper Exp $
 dnl
 dnl This file contains local autoconf functions.
 dnl
@@ -2366,21 +2366,21 @@
 dnl PHP header files to be installed
 dnl
 AC_DEFUN([PHP_INSTALL_HEADERS],[
-  if test -z $2; then
-for header_file in $1; do
+  ifelse([$2],[],[
+for header_file in $1; do
   PHP_RUN_ONCE(INSTALLHEADERS, $header_file, [
 INSTALL_EXT_HEADERS=$INSTALL_EXT_HEADERS $header_file
   ])
 done 
-  else
+  ], [
 header_path=$1
-for header_file in $2; do
+for header_file in $2; do
   hp_hf=$header_path/$header_file
   PHP_RUN_ONCE(INSTALLHEADERS, $hp_hf, [
-INSTALL_EXT_HEADERS=$INSTALL_EXT_HEADERS $header_path/$header_file
+INSTALL_EXT_HEADERS=$INSTALL_EXT_HEADERS $hp_hf
   ])
 done 
-  fi
+  ])
 ])
 
 dnl
http://cvs.php.net/diff.php/php-src/ext/date/config.m4?r1=1.9r2=1.10ty=u
Index: php-src/ext/date/config.m4
diff -u php-src/ext/date/config.m4:1.9 php-src/ext/date/config.m4:1.10
--- php-src/ext/date/config.m4:1.9  Thu Jun 30 02:40:57 2005
+++ php-src/ext/date/config.m4  Thu Jul  7 19:18:22 2005
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.9 2005/06/30 06:40:57 derick Exp $
+dnl $Id: config.m4,v 1.10 2005/07/07 23:18:22 sniper Exp $
 dnl config.m4 for date extension
 
 sinclude(ext/date/lib/timelib.m4)
@@ -10,10 +10,10 @@
 
 PHP_NEW_EXTENSION(date, php_date.c $timelib_sources, no,, $PHP_DATE_CFLAGS)
 PHP_ADD_BUILD_DIR([$ext_builddir/lib], 1)
-PHP_INSTALL_HEADERS([ext/date], [php_date.h lib/timelib.h 
lib/timelib_structs.h])
+PHP_INSTALL_HEADERS([ext/date], [php_date.h lib/timelib.h 
lib/timelib_structs.h lib/timelib_config.h])
 
-cat  $ext_builddir/lib/timelib_config.h EOF
-#if PHP_WIN32
+cat  $ext_builddir/lib/timelib_config.h EOF
+#ifdef PHP_WIN32
 # include config.w32.h
 #else
 # include php_config.h

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



[PHP-CVS] cvs: php-src / NEWS /ext/pgsql pgsql.c php_pgsql.h

2005-07-07 Thread Ilia Alshanetsky
iliaa   Thu Jul  7 20:40:33 2005 EDT

  Modified files:  
/php-srcNEWS 
/php-src/ext/pgsql  pgsql.c php_pgsql.h 
  Log:
  Added pg_fetch_all_columns() function to fetch all values of a column from
  a result cursor.
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1987r2=1.1988ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1987 php-src/NEWS:1.1988
--- php-src/NEWS:1.1987 Thu Jul  7 12:07:08 2005
+++ php-src/NEWSThu Jul  7 20:40:32 2005
@@ -5,6 +5,8 @@
 - Added PDO_MYSQL_ATTR_USE_BUFFERED_QUERY parameter for pdo_mysql. (Ilia)
 - Added date_timezone_set() function to set the timezone that the date
   functions will use. (Derick)
+- Added pg_fetch_all_columns() function to fetch all values of a column from
+  a result cursor. (Ilia)
 - Implemented feature request #33452 (Year belonging to ISO week). (Derick)
 - Fixed support for shared extensions on AIX. (Dmitry)
 - Fixed memory corruption in pg_copy_from() in case the as_null parameter was
http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.329r2=1.330ty=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.329 php-src/ext/pgsql/pgsql.c:1.330
--- php-src/ext/pgsql/pgsql.c:1.329 Tue Jul  5 10:49:22 2005
+++ php-src/ext/pgsql/pgsql.c   Thu Jul  7 20:40:32 2005
@@ -20,7 +20,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.329 2005/07/05 14:49:22 edink Exp $ */
+/* $Id: pgsql.c,v 1.330 2005/07/08 00:40:32 iliaa Exp $ */
 
 #include stdlib.h
 
@@ -127,6 +127,7 @@
PHP_FE(pg_fetch_array,  NULL)
PHP_FE(pg_fetch_object, NULL)
PHP_FE(pg_fetch_all,NULL)
+   PHP_FE(pg_fetch_all_columns,NULL)
 #if HAVE_PQCMDTUPLES
PHP_FE(pg_affected_rows,NULL)
 #endif
@@ -2101,6 +2102,47 @@
 }
 /* }}} */
 
+/* {{{ proto array pg_fetch_all_columns(resource result [, int column_number])
+   Fetch all rows into array */
+PHP_FUNCTION(pg_fetch_all_columns)
+{
+   zval *result;
+   PGresult *pgsql_result;
+   pgsql_result_handle *pg_result;
+   long colno=0;
+   int pg_numrows, pg_row;
+   size_t num_fields;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|l, result, 
colno) == FAILURE) {
+   RETURN_FALSE;
+   }
+
+   ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, 
PostgreSQL result, le_result);
+
+   pgsql_result = pg_result-result;
+
+   num_fields = PQnfields(pgsql_result);
+   if (colno = num_fields || colno  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid column 
number '%ld', colno);
+   RETURN_FALSE;
+   }
+
+   array_init(return_value);
+
+if ((pg_numrows = PQntuples(pgsql_result)) = 0) {
+   return;
+   }
+
+   for (pg_row = 0; pg_row  pg_numrows; pg_row++) {
+   if (PQgetisnull(pgsql_result, pg_row, colno)) {
+   add_next_index_null(return_value);
+   } else {
+   add_next_index_string(return_value, 
PQgetvalue(pgsql_result, pg_row, colno), 1); 
+   }   
+   }
+}
+/* }}} */
+
 /* {{{ proto bool pg_result_seek(resource result, int offset)
Set internal row offset */
 PHP_FUNCTION(pg_result_seek)
http://cvs.php.net/diff.php/php-src/ext/pgsql/php_pgsql.h?r1=1.71r2=1.72ty=u
Index: php-src/ext/pgsql/php_pgsql.h
diff -u php-src/ext/pgsql/php_pgsql.h:1.71 php-src/ext/pgsql/php_pgsql.h:1.72
--- php-src/ext/pgsql/php_pgsql.h:1.71  Wed Apr 13 17:48:33 2005
+++ php-src/ext/pgsql/php_pgsql.h   Thu Jul  7 20:40:32 2005
@@ -17,7 +17,7 @@
+--+
  */
  
-/* $Id: php_pgsql.h,v 1.71 2005/04/13 21:48:33 derick Exp $ */
+/* $Id: php_pgsql.h,v 1.72 2005/07/08 00:40:32 iliaa Exp $ */
 
 #ifndef PHP_PGSQL_H
 #define PHP_PGSQL_H
@@ -107,6 +107,7 @@
 PHP_FUNCTION(pg_fetch_result);
 PHP_FUNCTION(pg_fetch_row);
 PHP_FUNCTION(pg_fetch_all);
+PHP_FUNCTION(pg_fetch_all_columns);
 #if HAVE_PQCMDTUPLES
 PHP_FUNCTION(pg_affected_rows);
 #endif

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



Re: [PHP-CVS] cvs: php-src /ext/pdo_pgsql pgsql_driver.c

2005-07-07 Thread Christopher Kings-Lynne
It is malloc + PQescapeString + free, which in most cases are completely 
unnecessary. While as Christopher demonstrates sequence name could 
contain special chars, I'd wager that is a VERY uncommon situation.


Uncommon is totally irrelevant.  Stable, robust code is what is.  What 
is this - the Cross your fingers and hope it works programming language??


Chris

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



Re: [PHP-CVS] cvs: php-src /ext/pdo_pgsql config.m4 pgsql_driver.c

2005-07-07 Thread Christopher Kings-Lynne

Thanks - I think that's the best solution.

Chris

Ilia Alshanetsky wrote:

iliaa   Thu Jul  7 09:35:41 2005 EDT

  Modified files:  
/php-src/ext/pdo_pgsql	config.m4 pgsql_driver.c 
  Log:

  Use PQexecParams() when available, use original case in all other instances.
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo_pgsql/config.m4?r1=1.10r2=1.11ty=u

Index: php-src/ext/pdo_pgsql/config.m4
diff -u php-src/ext/pdo_pgsql/config.m4:1.10 
php-src/ext/pdo_pgsql/config.m4:1.11
--- php-src/ext/pdo_pgsql/config.m4:1.10Mon Jun 13 20:00:53 2005
+++ php-src/ext/pdo_pgsql/config.m4 Thu Jul  7 09:35:39 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.10 2005/06/14 00:00:53 sniper Exp $
+dnl $Id: config.m4,v 1.11 2005/07/07 13:35:39 iliaa Exp $
 dnl
 
 if test $PHP_PDO != no; then

@@ -90,6 +90,7 @@
   AC_CHECK_LIB(pq, 
PQprotocolVersion,AC_DEFINE(HAVE_PQPROTOCOLVERSION,1,[PostgreSQL 7.4 or later]))
   AC_CHECK_LIB(pq, 
PQtransactionStatus,AC_DEFINE(HAVE_PGTRANSACTIONSTATUS,1,[PostgreSQL 7.4 or 
later]))
   AC_CHECK_LIB(pq, 
PQunescapeBytea,AC_DEFINE(HAVE_PQUNESCAPEBYTEA,1,[PostgreSQL 7.4 or later]))
+  AC_CHECK_LIB(pq, PQExecParams,AC_DEFINE(HAVE_PQEXECPARAMS,1,[PostgreSQL 7.4 
or later]))
   AC_CHECK_LIB(pq, 
PQresultErrorField,AC_DEFINE(HAVE_PQRESULTERRORFIELD,1,[PostgreSQL 7.4 or 
later]))
   AC_CHECK_LIB(pq, 
pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether 
libpq is compiled with --enable-multibyte]))
   LIBS=$old_LIBS
http://cvs.php.net/diff.php/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.48r2=1.49ty=u
Index: php-src/ext/pdo_pgsql/pgsql_driver.c
diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.48 
php-src/ext/pdo_pgsql/pgsql_driver.c:1.49
--- php-src/ext/pdo_pgsql/pgsql_driver.c:1.48   Wed Jul  6 22:17:20 2005
+++ php-src/ext/pdo_pgsql/pgsql_driver.cThu Jul  7 09:35:39 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: pgsql_driver.c,v 1.48 2005/07/07 02:17:20 iliaa Exp $ */

+/* $Id: pgsql_driver.c,v 1.49 2005/07/07 13:35:39 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H

 #include config.h
@@ -210,12 +210,22 @@
*len = spprintf(id, 0, %ld, (long) H-pgoid);
} else {
PGresult *res;
-   char *q;
ExecStatusType status;
-
-   spprintf(q, sizeof(SELECT CURRVAL('')) + strlen(name), SELECT 
CURRVAL('%s'), name);
+#ifdef HAVE_PQEXECPARAMS
+   const char *q[1];
+   q[0] = name;
+   res = PQexecParams(H-server, SELECT CURRVAL($1), 1, NULL, q, 
NULL, NULL, 0);
+#else
+   char *name_escaped, *q;
+   size_t l = strlen(name);
+
+		name_escaped = safe_emalloc(l, 2, 1);

+   PQescapeString(name_escaped, name, l);
+   spprintf(q, 0, SELECT CURRVAL('%s'), name_escaped);
res = PQexec(H-server, q);
+		efree(name_escaped); 
 		efree(q);

+#endif
status = PQresultStatus(res);
 
 		if (res  (status == PGRES_TUPLES_OK)) {




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



Re: [PHP-CVS] cvs: php-src /ext/pdo pdo_stmt.c

2005-07-07 Thread Christopher Kings-Lynne



Wez Furlong wrote:

wez Thu Jul  7 08:45:41 2005 EDT

  Modified files:  
/php-src/ext/pdo	pdo_stmt.c 
  Log:

  Fix bug in bindColumn() for drivers that implement native prepared statements
  and that use the PDO rewriter to handle non-native parameter syntax.


Is there any chance we can get native prepared statements in pdo_pgsql? 
 What's involved?


Chris

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



Re: [PHP-CVS] cvs: php-src /ext/pdo pdo_stmt.c

2005-07-07 Thread Wez Furlong
Pointing me at some good documentation for it would help; I find the 
postgres site really difficult to extract information from.  I've looked 
on two occasions but got fed up with lack of info.


If you can show me some C code that does it, I'll install postgres and 
hack up something to make it work.


--Wez.

Christopher Kings-Lynne wrote:



Wez Furlong wrote:


wezThu Jul  7 08:45:41 2005 EDT

  Modified files:  /php-src/ext/pdopdo_stmt.c   Log:
  Fix bug in bindColumn() for drivers that implement native prepared 
statements

  and that use the PDO rewriter to handle non-native parameter syntax.



Is there any chance we can get native prepared statements in pdo_pgsql? 
 What's involved?


Chris



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



Re: [PHP-CVS] cvs: php-src /ext/pdo pdo_stmt.c

2005-07-07 Thread Christopher Kings-Lynne
Pointing me at some good documentation for it would help; I find the 
postgres site really difficult to extract information from.  I've looked 
on two occasions but got fed up with lack of info.


Interesting.  I find the PostgreSQL manual elegant, simple and 
orthogonal and I find the MySQL one a total cross-version jumbled mess :)


This is the URL you want:

http://www.postgresql.org/docs/8.0/interactive/libpq-exec.html#LIBPQ-EXEC-MAIN

You can use the PQprepare/PQexecPrepared combo to have separated prepare 
and execute steps.  Or, you can use PQexecParams to simple execute a 
statement with separate parameters.


If you can show me some C code that does it, I'll install postgres and 
hack up something to make it work.


Just look at php-src/ext/pgsql/pgsql.c.  Find the pg_prepare, pg_execute 
and pg_query_params function implementations.


The basic thing in PostgreSQL is that it uses positional parameters: $1, 
$2, $3 instead of ?, ?, ? or :var1, :var2, :var3.


Chris

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



[PHP-CVS] cvs: php-src /ext/pdo pdo.c pdo_dbh.c pdo_stmt.c php_pdo_driver.h /ext/pdo/tests pdo_test.inc

2005-07-07 Thread Wez Furlong
wez Fri Jul  8 00:13:01 2005 EDT

  Modified files:  
/php-src/ext/pdopdo.c pdo_dbh.c pdo_stmt.c php_pdo_driver.h 
/php-src/ext/pdo/tests  pdo_test.inc 
  Log:
  Add a PDO_ATTR_STRINGIFY_FETCHES attribute, which is used to convert integer 
or
  floating point values into strings during fetch.  This is a compatibility hack
  for drivers that return native types rather than string representations.
  
  We use this flag in the test suite to persuade postgres tests to pass.
  
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo.c?r1=1.53r2=1.54ty=u
Index: php-src/ext/pdo/pdo.c
diff -u php-src/ext/pdo/pdo.c:1.53 php-src/ext/pdo/pdo.c:1.54
--- php-src/ext/pdo/pdo.c:1.53  Thu Jul  7 13:08:01 2005
+++ php-src/ext/pdo/pdo.c   Fri Jul  8 00:12:57 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo.c,v 1.53 2005/07/07 17:08:01 wez Exp $ */
+/* $Id: pdo.c,v 1.54 2005/07/08 04:12:57 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -337,6 +337,7 @@
REGISTER_LONG_CONSTANT(PDO_ATTR_FETCH_TABLE_NAMES,
(long)PDO_ATTR_FETCH_TABLE_NAMES,   
CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(PDO_ATTR_FETCH_CATALOG_NAMES,  
(long)PDO_ATTR_FETCH_CATALOG_NAMES, 
CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(PDO_ATTR_DRIVER_NAME,  
(long)PDO_ATTR_DRIVER_NAME, CONST_CS|CONST_PERSISTENT);
+   
REGISTER_LONG_CONSTANT(PDO_ATTR_STRINGIFY_FETCHES,(long)PDO_ATTR_STRINGIFY_FETCHES,
   CONST_CS|CONST_PERSISTENT);

REGISTER_LONG_CONSTANT(PDO_ERRMODE_SILENT,
(long)PDO_ERRMODE_SILENT,   CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(PDO_ERRMODE_WARNING,   
(long)PDO_ERRMODE_WARNING,  CONST_CS|CONST_PERSISTENT);
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_dbh.c?r1=1.78r2=1.79ty=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.78 php-src/ext/pdo/pdo_dbh.c:1.79
--- php-src/ext/pdo/pdo_dbh.c:1.78  Thu Jul  7 13:08:01 2005
+++ php-src/ext/pdo/pdo_dbh.c   Fri Jul  8 00:12:58 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_dbh.c,v 1.78 2005/07/07 17:08:01 wez Exp $ */
+/* $Id: pdo_dbh.c,v 1.79 2005/07/08 04:12:58 wez Exp $ */
 
 /* The PDO Database Handle Class */
 
@@ -693,6 +693,11 @@
convert_to_long(value);
dbh-oracle_nulls = Z_LVAL_P(value) ? 1 : 0;
RETURN_TRUE;
+
+   case PDO_ATTR_STRINGIFY_FETCHES:
+   convert_to_long(value);
+   dbh-stringify = Z_LVAL_P(value) ? 1 : 0;
+   RETURN_TRUE;

default:
;
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_stmt.c?r1=1.104r2=1.105ty=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.104 php-src/ext/pdo/pdo_stmt.c:1.105
--- php-src/ext/pdo/pdo_stmt.c:1.104Thu Jul  7 11:14:10 2005
+++ php-src/ext/pdo/pdo_stmt.c  Fri Jul  8 00:12:58 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_stmt.c,v 1.104 2005/07/07 15:14:10 iliaa Exp $ */
+/* $Id: pdo_stmt.c,v 1.105 2005/07/08 04:12:58 wez Exp $ */
 
 /* The PDO Statement Handle Class */
 
@@ -481,6 +481,15 @@
if (caller_frees  value) {
efree(value);
}
+
+   if (stmt-dbh-stringify) {
+   switch (Z_TYPE_P(dest)) {
+   case IS_LONG:
+   case IS_DOUBLE:
+   convert_to_string(dest);
+   break;
+   }
+   }
 }
 /* }}} */
 
http://cvs.php.net/diff.php/php-src/ext/pdo/php_pdo_driver.h?r1=1.60r2=1.61ty=u
Index: php-src/ext/pdo/php_pdo_driver.h
diff -u php-src/ext/pdo/php_pdo_driver.h:1.60 
php-src/ext/pdo/php_pdo_driver.h:1.61
--- php-src/ext/pdo/php_pdo_driver.h:1.60   Thu Jul  7 12:24:51 2005
+++ php-src/ext/pdo/php_pdo_driver.hFri Jul  8 00:12:58 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_pdo_driver.h,v 1.60 2005/07/07 16:24:51 wez Exp $ */
+/* $Id: php_pdo_driver.h,v 1.61 2005/07/08 04:12:58 wez Exp $ */
 
 #ifndef PHP_PDO_DRIVER_H
 #define PHP_PDO_DRIVER_H
@@ -44,7 +44,7 @@
 # define FALSE 0
 #endif
 
-#define PDO_DRIVER_API 20050707
+#define PDO_DRIVER_API 20050708
 
 enum pdo_param_type {
PDO_PARAM_NULL,
@@ -127,6 +127,7 @@
PDO_ATTR_FETCH_TABLE_NAMES, /* include table names in the column names, 
where available */
PDO_ATTR_FETCH_CATALOG_NAMES, /* include the catalog/db name names in 
the column names, where available */
PDO_ATTR_DRIVER_NAME, /* name of the driver (as used in the 
constructor