diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2009-05-19 19:15:18 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2009-05-19 19:15:18 +0000 |
commit | 5ec5e3b5f2a11508a183986497c809bebbb58bf7 (patch) | |
tree | 3d8f87db691a1096d91f11682ec765eb9f52b642 /ext/pdo_sqlite | |
parent | 37609844de8da82b6f5becc1173302ea03efe05a (diff) | |
download | php-git-5ec5e3b5f2a11508a183986497c809bebbb58bf7.tar.gz |
The \0 removal is only needed prior to 3.4.0
Diffstat (limited to 'ext/pdo_sqlite')
-rw-r--r-- | ext/pdo_sqlite/sqlite_statement.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c index 82e4cb8f6c..2d32a0bf1f 100644 --- a/ext/pdo_sqlite/sqlite_statement.c +++ b/ext/pdo_sqlite/sqlite_statement.c @@ -265,12 +265,13 @@ static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsi case SQLITE3_TEXT: *ptr = (char*)sqlite3_column_text(S->stmt, colno); *len = sqlite3_column_bytes(S->stmt, colno); +#if SQLITE_VERSION_NUMBER < 3004000 if (*len) { /* sqlite3.h says "the NUL terminator is included in the byte count for TEXT values" */ - *len--; /* do not remove this, even though it generates a warning */ + (*len)--; } +#endif return 1; - default: *ptr = (char*)sqlite3_column_text(S->stmt, colno); *len = sqlite3_column_bytes(S->stmt, colno); |