diff options
Diffstat (limited to 'ext/pdo_sqlite')
-rw-r--r-- | ext/pdo_sqlite/sqlite_statement.c | 20 | ||||
-rw-r--r-- | ext/pdo_sqlite/tests/bug43831.phpt | 2 | ||||
-rw-r--r-- | ext/pdo_sqlite/tests/bug46542.phpt | 6 | ||||
-rw-r--r-- | ext/pdo_sqlite/tests/pdo_sqlite_createaggregate.phpt | 2 | ||||
-rw-r--r-- | ext/pdo_sqlite/tests/pdo_sqlite_createfunction.phpt | 2 | ||||
-rw-r--r-- | ext/pdo_sqlite/tests/pdo_sqlite_lastinsertid.phpt | 2 | ||||
-rw-r--r-- | ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt | 2 |
7 files changed, 20 insertions, 16 deletions
diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c index 34f370985..54579e827 100644 --- a/ext/pdo_sqlite/sqlite_statement.c +++ b/ext/pdo_sqlite/sqlite_statement.c @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sqlite_statement.c,v 1.18.2.4.2.3.2.4 2009/01/13 02:50:54 scottmac Exp $ */ +/* $Id: sqlite_statement.c,v 1.18.2.4.2.3.2.10 2009/05/20 15:05:36 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -262,16 +262,6 @@ static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsi *len = sqlite3_column_bytes(S->stmt, colno); return 1; - case SQLITE3_TEXT: - *ptr = (char*)sqlite3_column_text(S->stmt, colno); - *len = sqlite3_column_bytes(S->stmt, colno); - if (*len) { - /* sqlite3.h says "the NUL terminator is included in the byte count - * for TEXT values" */ - *len--; - } - return 1; - default: *ptr = (char*)sqlite3_column_text(S->stmt, colno); *len = sqlite3_column_bytes(S->stmt, colno); @@ -282,7 +272,7 @@ static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsi static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC) { pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; - char *str; + const char *str; zval *flags; if (!S->stmt) { @@ -318,15 +308,15 @@ static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, long colno, zval *return_v break; } - str = (char*)sqlite3_column_decltype(S->stmt, colno); + str = sqlite3_column_decltype(S->stmt, colno); if (str) { - add_assoc_string(return_value, "sqlite:decl_type", str, 1); + add_assoc_string(return_value, "sqlite:decl_type", (char *)str, 1); } #ifdef SQLITE_ENABLE_COLUMN_METADATA str = sqlite3_column_table_name(S->stmt, colno); if (str) { - add_assoc_string(return_value, "table", str, 1); + add_assoc_string(return_value, "table", (char *)str, 1); } #endif diff --git a/ext/pdo_sqlite/tests/bug43831.phpt b/ext/pdo_sqlite/tests/bug43831.phpt index 1132e9b76..2746e7c17 100644 --- a/ext/pdo_sqlite/tests/bug43831.phpt +++ b/ext/pdo_sqlite/tests/bug43831.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #43831 ($this gets mangled when extending PDO with persistent connection) +--SKIPIF-- +<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?> --FILE-- <?php diff --git a/ext/pdo_sqlite/tests/bug46542.phpt b/ext/pdo_sqlite/tests/bug46542.phpt index ccde633dc..2de0c0519 100644 --- a/ext/pdo_sqlite/tests/bug46542.phpt +++ b/ext/pdo_sqlite/tests/bug46542.phpt @@ -9,12 +9,16 @@ if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; class A extends PDO { function __call($m, $p) {print __CLASS__."::$m\n";} } -$a = new A('sqlite:dummy.db'); +$a = new A('sqlite:' . __DIR__ . '/dummy.db'); $a->truc(); $a->TRUC(); ?> +--CLEAN-- +<?php +unlink(__DIR__ . '/dummy.db'); +?> --EXPECT-- A::truc A::TRUC diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate.phpt index 9596aea30..975dcd96b 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate.phpt @@ -1,5 +1,7 @@ --TEST-- PDO_sqlite: Testing sqliteCreateAggregate() +--SKIPIF-- +<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?> --FILE-- <?php diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createfunction.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction.phpt index c742c0a9e..b67587998 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_createfunction.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction.phpt @@ -1,5 +1,7 @@ --TEST-- PDO_sqlite: Testing sqliteCreateFunction() +--SKIPIF-- +<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?> --FILE-- <?php diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_lastinsertid.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_lastinsertid.phpt index a4ed2b535..2ff0acd77 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_lastinsertid.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_lastinsertid.phpt @@ -1,5 +1,7 @@ --TEST-- PDO_sqlite: Testing lastInsertId() +--SKIPIF-- +<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?> --FILE-- <?php diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt index 524744051..101cc73cb 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt @@ -1,5 +1,7 @@ --TEST-- PDO_sqlite: Testing transaction +--SKIPIF-- +<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?> --FILE-- <?php |