summaryrefslogtreecommitdiff
path: root/ext/sqlite
diff options
context:
space:
mode:
Diffstat (limited to 'ext/sqlite')
-rw-r--r--ext/sqlite/config.m44
-rw-r--r--ext/sqlite/libsqlite/src/date.c9
-rw-r--r--ext/sqlite/libsqlite/src/encode.c7
-rw-r--r--ext/sqlite/pdo_sqlite2.c4
-rw-r--r--ext/sqlite/php_sqlite.h4
-rw-r--r--ext/sqlite/sess_sqlite.c4
-rw-r--r--ext/sqlite/sqlite.c8
7 files changed, 23 insertions, 17 deletions
diff --git a/ext/sqlite/config.m4 b/ext/sqlite/config.m4
index e296c954c..26182f7b2 100644
--- a/ext/sqlite/config.m4
+++ b/ext/sqlite/config.m4
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.41.2.1 2005/11/30 04:50:03 wez Exp $
+dnl $Id: config.m4,v 1.41.2.1.2.1 2007/04/19 06:42:28 sas Exp $
dnl config.m4 for extension sqlite
dnl vim:et:ts=2:sw=2
@@ -91,7 +91,7 @@ if test "$PHP_SQLITE" != "no"; then
# use bundled library
PHP_PROG_LEMON
SQLITE_MODULE_TYPE=builtin
- PHP_SQLITE_CFLAGS="-I@ext_builddir@/libsqlite/src $pdo_inc_path"
+ PHP_SQLITE_CFLAGS="-I@ext_srcdir@/libsqlite/src -I@ext_builddir@/libsqlite/src $pdo_inc_path"
sqlite_extra_sources="libsqlite/src/opcodes.c \
libsqlite/src/parse.c libsqlite/src/encode.c \
libsqlite/src/auth.c libsqlite/src/btree.c libsqlite/src/build.c \
diff --git a/ext/sqlite/libsqlite/src/date.c b/ext/sqlite/libsqlite/src/date.c
index 233aa7bb3..d1d7ddb5f 100644
--- a/ext/sqlite/libsqlite/src/date.c
+++ b/ext/sqlite/libsqlite/src/date.c
@@ -16,7 +16,7 @@
** sqliteRegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
-** $Id: date.c,v 1.3.4.1 2005/09/07 15:11:32 iliaa Exp $
+** $Id: date.c,v 1.3.4.1.2.2 2006/12/01 20:24:58 fmk Exp $
**
** NOTES:
**
@@ -53,6 +53,9 @@
#include <stdlib.h>
#include <assert.h>
#include <time.h>
+#ifndef PHP_WIN32
+#include "main/php_reentrancy.h"
+#endif
#ifndef SQLITE_OMIT_DATETIME_FUNCS
@@ -397,7 +400,7 @@ static void clearYMD_HMS_TZ(DateTime *p){
static double localtimeOffset(DateTime *p){
DateTime x, y;
time_t t;
- struct tm *pTm;
+ struct tm *pTm, tmbuf;
x = *p;
computeYMD_HMS(&x);
if( x.Y<1971 || x.Y>=2038 ){
@@ -416,7 +419,7 @@ static double localtimeOffset(DateTime *p){
computeJD(&x);
t = (x.rJD-2440587.5)*86400.0 + 0.5;
sqliteOsEnterMutex();
- pTm = localtime(&t);
+ pTm = php_localtime_r(&t, &tmbuf);
y.Y = pTm->tm_year + 1900;
y.M = pTm->tm_mon + 1;
y.D = pTm->tm_mday;
diff --git a/ext/sqlite/libsqlite/src/encode.c b/ext/sqlite/libsqlite/src/encode.c
index 86e33a750..956d7d128 100644
--- a/ext/sqlite/libsqlite/src/encode.c
+++ b/ext/sqlite/libsqlite/src/encode.c
@@ -15,7 +15,7 @@
** data in an SQLite database. The code in this file is not used by any other
** part of the SQLite library.
**
-** $Id: encode.c,v 1.5.4.1 2005/09/07 15:11:32 iliaa Exp $
+** $Id: encode.c,v 1.5.4.1.2.1 2006/12/24 20:50:02 iliaa Exp $
*/
#include <string.h>
#include <assert.h>
@@ -176,9 +176,12 @@ int sqlite_decode_binary(const unsigned char *in, unsigned char *out){
int i, e;
unsigned char c;
e = *(in++);
+ if (e == 0) {
+ return 0;
+ }
i = 0;
while( (c = *(in++))!=0 ){
- if( c==1 ){
+ if (c == 1) {
c = *(in++) - 1;
}
out[i++] = c + e;
diff --git a/ext/sqlite/pdo_sqlite2.c b/ext/sqlite/pdo_sqlite2.c
index ac5d10ebd..2064e2d70 100644
--- a/ext/sqlite/pdo_sqlite2.c
+++ b/ext/sqlite/pdo_sqlite2.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_sqlite2.c,v 1.6.2.3.2.1 2006/09/16 18:10:32 iliaa Exp $ */
+/* $Id: pdo_sqlite2.c,v 1.6.2.3.2.2 2007/01/01 09:36:07 sebastian Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
diff --git a/ext/sqlite/php_sqlite.h b/ext/sqlite/php_sqlite.h
index 0d27dc38e..5d3dea1ac 100644
--- a/ext/sqlite/php_sqlite.h
+++ b/ext/sqlite/php_sqlite.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Marcus Boerger <helly@php.net> |
+----------------------------------------------------------------------+
- $Id: php_sqlite.h,v 1.32.2.2 2006/01/01 12:50:14 sniper Exp $
+ $Id: php_sqlite.h,v 1.32.2.2.2.1 2007/01/01 09:36:07 sebastian Exp $
*/
#ifndef PHP_SQLITE_H
diff --git a/ext/sqlite/sess_sqlite.c b/ext/sqlite/sess_sqlite.c
index 95c462d48..807e5c2fe 100644
--- a/ext/sqlite/sess_sqlite.c
+++ b/ext/sqlite/sess_sqlite.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sess_sqlite.c,v 1.18.2.1 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: sess_sqlite.c,v 1.18.2.1.2.1 2007/01/01 09:36:07 sebastian Exp $ */
#include "php.h"
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index f5731ded8..51736e9b2 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Marcus Boerger <helly@php.net> |
+----------------------------------------------------------------------+
- $Id: sqlite.c,v 1.166.2.13.2.5 2006/10/20 21:28:31 tony2001 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_MINFO_FUNCTION(sqlite)
{
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.5 2006/10/20 21:28:31 tony2001 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 @@ next_row:
/* 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++) {