Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/sqlite sqlite.c /ext/sqlite/tests bug48679.phpt

2009-06-25 Thread Hannes Magnusson
2009/6/25 Scott MacVicar :
> On 25 Jun 2009, at 10:40, Johannes Schlüter wrote:
>
>> Scott,
>>
>> On Thu, 2009-06-25 at 00:07 +, Scott MacVicar wrote:
>>>
>>> scottmac                Thu Jun 25 00:07:21 2009 UTC
>>>
>>>  Added files:                 (Branch: PHP_5_2)
>>
>> [...]
>>>
>>> --EXPECT--
>>> unicode(41) "Row count is not available for this query"
>>> Done
>>
>> I doubt that works in this branch, and I think this branch deserves a
>> NEWS entry.
>>
>
> The commit email is wrong, it definitely says string(41) in CVS and no one
> changed it.

Right, note the link in the mail "?view=markup&rev=1.1".
Its hardcoded in the commit script that a new file (in any branch)
will send out rev1.1 on that file.

-Hannes

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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/sqlite sqlite.c /ext/sqlite/tests bug48679.phpt

2009-06-25 Thread Scott MacVicar

On 25 Jun 2009, at 10:40, Johannes Schlüter wrote:


Scott,

On Thu, 2009-06-25 at 00:07 +, Scott MacVicar wrote:

scottmacThu Jun 25 00:07:21 2009 UTC

 Added files: (Branch: PHP_5_2)

[...]

--EXPECT--  
unicode(41) "Row count is not available for this query"
Done


I doubt that works in this branch, and I think this branch deserves a
NEWS entry.



The commit email is wrong, it definitely says string(41) in CVS and no  
one changed it.


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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/sqlite sqlite.c /ext/sqlite/tests bug48679.phpt

2009-06-25 Thread Johannes Schlüter
Scott,

On Thu, 2009-06-25 at 00:07 +, Scott MacVicar wrote:
> scottmac  Thu Jun 25 00:07:21 2009 UTC
> 
>   Added files: (Branch: PHP_5_2)
[...]
> --EXPECT--
> unicode(41) "Row count is not available for this query"
> Done

I doubt that works in this branch, and I think this branch deserves a
NEWS entry.

johanne


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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sqlite sqlite.c /ext/sqlite/tests bug48679.phpt

2009-06-24 Thread Scott MacVicar
scottmacThu Jun 25 00:07:21 2009 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/sqlite/tests   bug48679.phpt 

  Modified files:  
/php-src/ext/sqlite sqlite.c 
  Log:
  MFH Fix bug #48679 - Crash in SQLite with count on an unbuffered query set
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/sqlite.c?r1=1.166.2.13.2.12&r2=1.166.2.13.2.13&diff_format=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.166.2.13.2.12 
php-src/ext/sqlite/sqlite.c:1.166.2.13.2.13
--- php-src/ext/sqlite/sqlite.c:1.166.2.13.2.12 Wed Dec 31 11:17:44 2008
+++ php-src/ext/sqlite/sqlite.c Thu Jun 25 00:07:20 2009
@@ -17,7 +17,7 @@
|  Marcus Boerger   |
+--+
 
-   $Id: sqlite.c,v 1.166.2.13.2.12 2008/12/31 11:17:44 sebastian Exp $
+   $Id: sqlite.c,v 1.166.2.13.2.13 2009/06/25 00:07:20 scottmac Exp $
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1128,7 +1128,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, "SQLite support", "enabled");
-   php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.12 2008/12/31 11:17:44 
sebastian Exp $");
+   php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.13 2009/06/25 00:07:20 
scottmac Exp $");
php_info_print_table_row(2, "SQLite Library", sqlite_libversion());
php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding());
php_info_print_table_end();
@@ -2481,6 +2481,11 @@
 {
sqlite_object *obj = (sqlite_object*) 
zend_object_store_get_object(object TSRMLS_CC);
 
+   if (obj->u.res == NULL) {
+   zend_throw_exception(sqlite_ce_exception, "Row count is not 
available for this query", 0 TSRMLS_CC);
+   return FAILURE;
+   }
+
if (obj->u.res->buffered) {
* count = obj->u.res->nrows;
return SUCCESS;

http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/tests/bug48679.phpt?view=markup&rev=1.1
Index: php-src/ext/sqlite/tests/bug48679.phpt
+++ php-src/ext/sqlite/tests/bug48679.phpt
--TEST--
Bug #48679 (sqlite2 count on unbuffered query causes segfault)
--SKIPIF--

--FILE--
getMessage());
}
echo "Done\n";
?>
--EXPECT--  
unicode(41) "Row count is not available for this query"
Done



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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sqlite sqlite.c

2008-12-01 Thread Felipe Pena
felipe  Mon Dec  1 12:28:27 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/sqlite sqlite.c 
  Log:
  - MFH: Fixed memory leak
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/sqlite.c?r1=1.166.2.13.2.10&r2=1.166.2.13.2.11&diff_format=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.166.2.13.2.10 
php-src/ext/sqlite/sqlite.c:1.166.2.13.2.11
--- php-src/ext/sqlite/sqlite.c:1.166.2.13.2.10 Mon Dec 31 07:20:11 2007
+++ php-src/ext/sqlite/sqlite.c Mon Dec  1 12:28:27 2008
@@ -17,7 +17,7 @@
|  Marcus Boerger <[EMAIL PROTECTED]>  |
+--+
 
-   $Id: sqlite.c,v 1.166.2.13.2.10 2007/12/31 07:20:11 sebastian Exp $
+   $Id: sqlite.c,v 1.166.2.13.2.11 2008/12/01 12:28:27 felipe Exp $
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1128,7 +1128,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, "SQLite support", "enabled");
-   php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.10 2007/12/31 07:20:11 
sebastian Exp $");
+   php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.11 2008/12/01 12:28:27 
felipe Exp $");
php_info_print_table_row(2, "SQLite Library", sqlite_libversion());
php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding());
php_info_print_table_end();
@@ -2917,11 +2917,13 @@
MAKE_STD_ZVAL(alloc_funcs->step);
*(alloc_funcs->step)  = *step;
zval_copy_ctor(alloc_funcs->step);
+   INIT_PZVAL(alloc_funcs->step);
 
if (is_agg) {
MAKE_STD_ZVAL(alloc_funcs->fini);
*(alloc_funcs->fini) = *fini;
zval_copy_ctor(alloc_funcs->fini);
+   INIT_PZVAL(alloc_funcs->fini);
} else {
alloc_funcs->fini = NULL;
}



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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sqlite sqlite.c

2007-03-05 Thread Stanislav Malyshev
stasTue Mar  6 02:17:13 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/sqlite sqlite.c 
  Log:
  use safe_realloc
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/sqlite.c?r1=1.166.2.13.2.6&r2=1.166.2.13.2.7&diff_format=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.166.2.13.2.6 
php-src/ext/sqlite/sqlite.c:1.166.2.13.2.7
--- php-src/ext/sqlite/sqlite.c:1.166.2.13.2.6  Mon Jan  1 09:36:07 2007
+++ php-src/ext/sqlite/sqlite.c Tue Mar  6 02:17:13 2007
@@ -17,7 +17,7 @@
|  Marcus Boerger <[EMAIL PROTECTED]>  |
+--+
 
-   $Id: sqlite.c,v 1.166.2.13.2.6 2007/01/01 09:36:07 sebastian Exp $
+   $Id: sqlite.c,v 1.166.2.13.2.7 2007/03/06 02:17:13 stas Exp $
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1133,7 +1133,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, "SQLite support", "enabled");
-   php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.6 2007/01/01 09:36:07 
sebastian Exp $");
+   php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.7 2007/03/06 02:17:13 
stas Exp $");
php_info_print_table_row(2, "SQLite Library", sqlite_libversion());
php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding());
php_info_print_table_end();
@@ -1465,7 +1465,7 @@
/* add the row to our collection */
if (rres->nrows + 1 >= rres->alloc_rows) {
rres->alloc_rows = rres->alloc_rows ? 
rres->alloc_rows * 2 : 16;
-   rres->table = erealloc(rres->table, 
rres->alloc_rows * rres->ncolumns * sizeof(char *));
+   rres->table = 
safe_erealloc(rres->table, rres->alloc_rows, rres->ncolumns*sizeof(char *), 0);
}
base = rres->nrows * rres->ncolumns;
for (i = 0; i < rres->ncolumns; i++) {

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sqlite sqlite.c

2006-10-20 Thread Antony Dovgal
tony2001Fri Oct 20 21:28:32 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/sqlite sqlite.c 
  Log:
  fix ZTS build without SPL enabled
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/sqlite.c?r1=1.166.2.13.2.4&r2=1.166.2.13.2.5&diff_format=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.166.2.13.2.4 
php-src/ext/sqlite/sqlite.c:1.166.2.13.2.5
--- php-src/ext/sqlite/sqlite.c:1.166.2.13.2.4  Sat Sep 16 18:10:32 2006
+++ php-src/ext/sqlite/sqlite.c Fri Oct 20 21:28:31 2006
@@ -17,7 +17,7 @@
|  Marcus Boerger <[EMAIL PROTECTED]>  |
+--+
 
-   $Id: sqlite.c,v 1.166.2.13.2.4 2006/09/16 18:10:32 iliaa Exp $
+   $Id: sqlite.c,v 1.166.2.13.2.5 2006/10/20 21:28:31 tony2001 Exp $
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1038,7 +1038,7 @@
 #if defined(HAVE_SPL) && ((PHP_MAJOR_VERSION > 5) || (PHP_MAJOR_VERSION == 5 
&& PHP_MINOR_VERSION >= 1))
REGISTER_SQLITE_CLASS(Exception,  exception, spl_ce_RuntimeException);
 #else
-   REGISTER_SQLITE_CLASS(Exception,  exception, 
zend_exception_get_default());
+   REGISTER_SQLITE_CLASS(Exception,  exception, 
zend_exception_get_default(TSRMLS_C));
 #endif
 
sqlite_ce_db->ce_flags &= ~ZEND_ACC_FINAL_CLASS;
@@ -1133,7 +1133,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, "SQLite support", "enabled");
-   php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.4 2006/09/16 18:10:32 
iliaa Exp $");
+   php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.5 2006/10/20 21:28:31 
tony2001 Exp $");
php_info_print_table_row(2, "SQLite Library", sqlite_libversion());
php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding());
php_info_print_table_end();

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sqlite sqlite.c

2006-06-14 Thread Ilia Alshanetsky
iliaa   Wed Jun 14 16:04:13 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/sqlite sqlite.c 
  Log:
  E_ERROR -> E_RECOVERABLE_ERROR
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/sqlite/sqlite.c?r1=1.166.2.13.2.1&r2=1.166.2.13.2.2&diff_format=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.166.2.13.2.1 
php-src/ext/sqlite/sqlite.c:1.166.2.13.2.2
--- php-src/ext/sqlite/sqlite.c:1.166.2.13.2.1  Tue May  9 23:54:15 2006
+++ php-src/ext/sqlite/sqlite.c Wed Jun 14 16:04:13 2006
@@ -17,7 +17,7 @@
|  Marcus Boerger <[EMAIL PROTECTED]>  |
+--+
 
-   $Id: sqlite.c,v 1.166.2.13.2.1 2006/05/09 23:54:15 helly Exp $
+   $Id: sqlite.c,v 1.166.2.13.2.2 2006/06/14 16:04:13 iliaa Exp $
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1005,7 +1005,7 @@
sqlite_object *obj = (sqlite_object*) 
zend_object_store_get_object(object TSRMLS_CC);
 
if (by_ref) {
-   zend_error(E_ERROR, "An iterator cannot be used with foreach by 
reference");
+   zend_error(E_RECOVERABLE_ERROR, "An iterator cannot be used 
with foreach by reference");
}
object->refcount++;
iterator->it.data = (void*)object;
@@ -1127,7 +1127,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, "SQLite support", "enabled");
-   php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.1 2006/05/09 23:54:15 
helly Exp $");
+   php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.2 2006/06/14 16:04:13 
iliaa Exp $");
php_info_print_table_row(2, "SQLite Library", sqlite_libversion());
php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding());
php_info_print_table_end();

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sqlite sqlite.c

2006-05-09 Thread Marcus Boerger
helly   Tue May  9 23:54:15 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/sqlite sqlite.c 
  Log:
  - Update after api changes
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/sqlite/sqlite.c?r1=1.166.2.13&r2=1.166.2.13.2.1&diff_format=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.166.2.13 
php-src/ext/sqlite/sqlite.c:1.166.2.13.2.1
--- php-src/ext/sqlite/sqlite.c:1.166.2.13  Tue Apr 18 14:30:15 2006
+++ php-src/ext/sqlite/sqlite.c Tue May  9 23:54:15 2006
@@ -17,7 +17,7 @@
|  Marcus Boerger <[EMAIL PROTECTED]>  |
+--+
 
-   $Id: sqlite.c,v 1.166.2.13 2006/04/18 14:30:15 iliaa Exp $
+   $Id: sqlite.c,v 1.166.2.13.2.1 2006/05/09 23:54:15 helly Exp $
 */
 
 #ifdef HAVE_CONFIG_H
@@ -207,61 +207,61 @@
 };
 
 zend_function_entry sqlite_funcs_db[] = {
-   PHP_ME_MAPPING(__construct, sqlite_open, third_arg_force_ref)
-/* PHP_ME_MAPPING(close, sqlite_close, NULL)*/
-   PHP_ME_MAPPING(query, sqlite_query, third_arg_force_ref)
-   PHP_ME_MAPPING(queryExec, sqlite_exec, second_arg_force_ref)
-   PHP_ME_MAPPING(arrayQuery, sqlite_array_query, NULL)
-   PHP_ME_MAPPING(singleQuery, sqlite_single_query, NULL)
-   PHP_ME_MAPPING(unbufferedQuery, sqlite_unbuffered_query, 
third_arg_force_ref)
-   PHP_ME_MAPPING(lastInsertRowid, sqlite_last_insert_rowid, NULL)
-   PHP_ME_MAPPING(changes, sqlite_changes, NULL)
-   PHP_ME_MAPPING(createAggregate, sqlite_create_aggregate, NULL)
-   PHP_ME_MAPPING(createFunction, sqlite_create_function, NULL)
-   PHP_ME_MAPPING(busyTimeout, sqlite_busy_timeout, NULL)
-   PHP_ME_MAPPING(lastError, sqlite_last_error, NULL)
-   PHP_ME_MAPPING(fetchColumnTypes, sqlite_fetch_column_types, NULL)
-/* PHP_ME_MAPPING(error_string, sqlite_error_string, NULL) static */
-/* PHP_ME_MAPPING(escape_string, sqlite_escape_string, NULL) static */
+   PHP_ME_MAPPING(__construct, sqlite_open, third_arg_force_ref, 0)
+/* PHP_ME_MAPPING(close, sqlite_close, NULL, 0)*/
+   PHP_ME_MAPPING(query, sqlite_query, third_arg_force_ref, 0)
+   PHP_ME_MAPPING(queryExec, sqlite_exec, second_arg_force_ref, 0)
+   PHP_ME_MAPPING(arrayQuery, sqlite_array_query, NULL, 0)
+   PHP_ME_MAPPING(singleQuery, sqlite_single_query, NULL, 0)
+   PHP_ME_MAPPING(unbufferedQuery, sqlite_unbuffered_query, 
third_arg_force_ref, 0)
+   PHP_ME_MAPPING(lastInsertRowid, sqlite_last_insert_rowid, NULL, 0)
+   PHP_ME_MAPPING(changes, sqlite_changes, NULL, 0)
+   PHP_ME_MAPPING(createAggregate, sqlite_create_aggregate, NULL, 0)
+   PHP_ME_MAPPING(createFunction, sqlite_create_function, NULL, 0)
+   PHP_ME_MAPPING(busyTimeout, sqlite_busy_timeout, NULL, 0)
+   PHP_ME_MAPPING(lastError, sqlite_last_error, NULL, 0)
+   PHP_ME_MAPPING(fetchColumnTypes, sqlite_fetch_column_types, NULL, 0)
+/* PHP_ME_MAPPING(error_string, sqlite_error_string, NULL, 0) static */
+/* PHP_ME_MAPPING(escape_string, sqlite_escape_string, NULL, 0) static */
{NULL, NULL, NULL}
 };
 
 zend_function_entry sqlite_funcs_query[] = {
-   PHP_ME_MAPPING(fetch, sqlite_fetch_array, NULL)
-   PHP_ME_MAPPING(fetchObject, sqlite_fetch_object, NULL)
-   PHP_ME_MAPPING(fetchSingle, sqlite_fetch_single, NULL)
-   PHP_ME_MAPPING(fetchAll, sqlite_fetch_all, NULL)
-   PHP_ME_MAPPING(column, sqlite_column, NULL)
-   PHP_ME_MAPPING(numFields, sqlite_num_fields, NULL)
-   PHP_ME_MAPPING(fieldName, sqlite_field_name, NULL)
+   PHP_ME_MAPPING(fetch, sqlite_fetch_array, NULL, 0)
+   PHP_ME_MAPPING(fetchObject, sqlite_fetch_object, NULL, 0)
+   PHP_ME_MAPPING(fetchSingle, sqlite_fetch_single, NULL, 0)
+   PHP_ME_MAPPING(fetchAll, sqlite_fetch_all, NULL, 0)
+   PHP_ME_MAPPING(column, sqlite_column, NULL, 0)
+   PHP_ME_MAPPING(numFields, sqlite_num_fields, NULL, 0)
+   PHP_ME_MAPPING(fieldName, sqlite_field_name, NULL, 0)
/* iterator */
-   PHP_ME_MAPPING(current, sqlite_current, NULL)
-   PHP_ME_MAPPING(key, sqlite_key, NULL)
-   PHP_ME_MAPPING(next, sqlite_next, NULL)
-   PHP_ME_MAPPING(valid, sqlite_valid, NULL)
-   PHP_ME_MAPPING(rewind, sqlite_rewind, NULL)
+   PHP_ME_MAPPING(current, sqlite_current, NULL, 0)
+   PHP_ME_MAPPING(key, sqlite_key, NULL, 0)
+   PHP_ME_MAPPING(next, sqlite_next, NULL, 0)
+   PHP_ME_MAPPING(valid, sqlite_valid, NULL, 0)
+   PHP_ME_MAPPING(rewind, sqlite_rewind, NULL, 0)
/* countable */
-   PHP_ME_MAPPING(count, sqlite_num_rows, NULL)
+   PHP_ME_MAPPING(count, sqlite_num_rows, NULL, 0)
/* additional */
-   PHP_ME_MAPPING(prev, sqlite_prev, NULL)
-   PHP_ME_MAPPING(hasPrev, sqlite_has_prev, NULL)
-   PHP_ME_MAPPING(numRows, sqlite_num_rows, NULL)
-   PHP_ME_MAPPING(seek, sqlite_seek, NULL)
+   PHP_ME_MAPPING(prev, sqlite_p