From 01fcdff3849c3691d9aaeaab735846ab6d8895ca Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Thu, 21 Oct 2010 08:52:46 +0200 Subject: Imported Upstream version 5.3.3 --- ext/sqlite/pdo_sqlite2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/sqlite/pdo_sqlite2.c') diff --git a/ext/sqlite/pdo_sqlite2.c b/ext/sqlite/pdo_sqlite2.c index 826a9fac6..8b7a93fd3 100644 --- a/ext/sqlite/pdo_sqlite2.c +++ b/ext/sqlite/pdo_sqlite2.c @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdo_sqlite2.c 293036 2010-01-03 09:23:27Z sebastian $ */ +/* $Id: pdo_sqlite2.c 300612 2010-06-20 14:12:06Z felipe $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -515,7 +515,7 @@ static struct pdo_dbh_methods sqlite2_methods = { static char *make_filename_safe(const char *filename TSRMLS_DC) { - if (strncmp(filename, ":memory:", sizeof(":memory:")-1)) { + if (*filename && strncmp(filename, ":memory:", sizeof(":memory:")-1)) { char *fullpath = expand_filepath(filename, NULL TSRMLS_CC); if (!fullpath) { @@ -594,6 +594,7 @@ static int pdo_sqlite2_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRML efree(filename); if (!H->db) { + H->einfo.errcode = SQLITE_ERROR; pdo_sqlite2_error(errmsg, dbh); goto cleanup; } -- cgit v1.2.3