From 764a95f6f315016b10c2a2fb7aafb7f4eadfce47 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Sat, 12 Jun 2010 22:04:48 +0000 Subject: [PATCH] - Fixed bug #49320 (PDO returns null when SQLite connection fails) --- NEWS | 1 + ext/sqlite/pdo_sqlite2.c | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS b/NEWS index f9a3b797fc..e2c8a35c66 100644 --- a/NEWS +++ b/NEWS @@ -201,6 +201,7 @@ PHP NEWS - Fixed bug #49576 (FILTER_VALIDATE_EMAIL filter needs updating) (Rasmus) - Fixed bug #49490 (XPath namespace prefix conflict). (Rob) - Fixed bug #49429 (odbc_autocommit doesn't work). (Felipe) +- Fixed bug #49320 (PDO returns null when SQLite connection fails). (Felipe) - Fixed bug #49234 (mysqli_ssl_set not found). (Andrey) - Fixed bug #49192 (PHP crashes when GC invoked on COM object). (Stas) - Fixed bug #49081 (DateTime::diff() mistake if start in January and interval > diff --git a/ext/sqlite/pdo_sqlite2.c b/ext/sqlite/pdo_sqlite2.c index 89f0520cd9..3e8d2f8f2b 100644 --- a/ext/sqlite/pdo_sqlite2.c +++ b/ext/sqlite/pdo_sqlite2.c @@ -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; } -- 2.40.0