iliaa Wed Dec 10 13:56:06 2003 EDT
Added files:
/php-src/ext/sqlite/tests sqlite_oo_027.phpt
Modified files:
/php-src/ext/sqlite sqlite.c
Log:
The changes() method should be that of the database object not that of
a result.
Added a test case for this bug.
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.102 php-src/ext/sqlite/sqlite.c:1.103
--- php-src/ext/sqlite/sqlite.c:1.102 Tue Dec 9 20:02:19 2003
+++ php-src/ext/sqlite/sqlite.c Wed Dec 10 13:56:04 2003
@@ -17,7 +17,7 @@
| Marcus Boerger <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
- $Id: sqlite.c,v 1.102 2003/12/10 01:02:19 iliaa Exp $
+ $Id: sqlite.c,v 1.103 2003/12/10 18:56:04 iliaa Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -206,6 +206,7 @@
PHP_ME_MAPPING(single_query, sqlite_single_query, NULL)
PHP_ME_MAPPING(unbuffered_query, sqlite_unbuffered_query, NULL)
PHP_ME_MAPPING(last_insert_rowid, sqlite_last_insert_rowid, NULL)
+ PHP_ME_MAPPING(changes, sqlite_changes, NULL)
PHP_ME_MAPPING(create_aggregate, sqlite_create_aggregate, NULL)
PHP_ME_MAPPING(create_function, sqlite_create_function, NULL)
PHP_ME_MAPPING(busy_timeout, sqlite_busy_timeout, NULL)
@@ -221,7 +222,6 @@
PHP_ME_MAPPING(fetch_single, sqlite_fetch_single, NULL)
PHP_ME_MAPPING(fetch_all, sqlite_fetch_all, NULL)
PHP_ME_MAPPING(column, sqlite_column, NULL)
- PHP_ME_MAPPING(changes, sqlite_changes, NULL)
PHP_ME_MAPPING(num_fields, sqlite_num_fields, NULL)
PHP_ME_MAPPING(field_name, sqlite_field_name, NULL)
/* spl_forward */
@@ -244,7 +244,6 @@
PHP_ME_MAPPING(fetch_single, sqlite_fetch_single, NULL)
PHP_ME_MAPPING(fetch_all, sqlite_fetch_all, NULL)
PHP_ME_MAPPING(column, sqlite_column, NULL)
- PHP_ME_MAPPING(changes, sqlite_changes, NULL)
PHP_ME_MAPPING(num_fields, sqlite_num_fields, NULL)
PHP_ME_MAPPING(field_name, sqlite_field_name, NULL)
/* spl_forward */
@@ -1072,7 +1071,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.102 2003/12/10 01:02:19 iliaa Exp $");
+ php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION "
$Id: sqlite.c,v 1.103 2003/12/10 18:56:04 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();
Index: php-src/ext/sqlite/tests/sqlite_oo_027.phpt
+++ php-src/ext/sqlite/tests/sqlite_oo_027.phpt
--TEST--
sqlite-oo: changes
--INI--
sqlite.assoc_case=0
--SKIPIF--
<?php # vim:ft=php
if (!extension_loaded("sqlite")) print "skip";
?>
--FILE--
<?php
include "blankdb_oo.inc";
$data = array("one", "two", "three");
$db->query("CREATE TABLE strings(a VARCHAR)");
foreach ($data as $str) {
$db->query("INSERT INTO strings VALUES('$str')");
echo $db->changes() . "\n";
}
$db->query("UPDATE strings SET a='foo' WHERE a!='two'");
echo $db->changes() . "\n";
$db->query("DELETE FROM strings WHERE 1");
echo $db->changes() . "\n";
$str = '';
foreach ($data as $s) {
$str .= "INSERT INTO strings VALUES('".$s."');";
}
$db->query($str);
echo $db->changes() . "\n";
?>
--EXPECT--
1
1
1
2
3
3
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php