diff options
author | Remi Collet <remi@php.net> | 2017-08-02 14:03:02 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2017-08-02 14:03:02 +0200 |
commit | 5f030924c19a39c09b57d40615f754cf80ae0e7d (patch) | |
tree | 24036c61f6f7302df57eb1d0975ffeaccc265d2b /ext/sqlite3/sqlite3.c | |
parent | 9c6262f39bbda2a3ca17662ad2704df3ff4374c6 (diff) | |
parent | 666cb6c80226467be262c088a26246c48cdef7e5 (diff) | |
download | php-git-5f030924c19a39c09b57d40615f754cf80ae0e7d.tar.gz |
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
fix build with old system libsqlite (sqlite3_errstr may be missing)
Diffstat (limited to 'ext/sqlite3/sqlite3.c')
-rw-r--r-- | ext/sqlite3/sqlite3.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 45a1b847bf..3cfdcab2e8 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -140,7 +140,11 @@ PHP_METHOD(sqlite3, open) #endif if (rc != SQLITE_OK) { zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s", +#ifdef HAVE_SQLITE3_ERRSTR db_obj->db ? sqlite3_errmsg(db_obj->db) : sqlite3_errstr(rc)); +#else + db_obj->db ? sqlite3_errmsg(db_obj->db) : ""); +#endif if (fullpath != filename) { efree(fullpath); } |