com php-src: Switch to the v2 version of these functions. The sqlite3 docs suggest always using prepare_v2 and the close_v2 could potentially help
with an fd leak we ha ve been seeing: NEWS UPGRADING ext/pdo_sqlite/sql ite_driver.c
| From: | Rasmus Lerdorf | Date: | Sun, 22 Jan 2017 15:26:07 +0000 |
| Subject: | com php-src: Switch to the v2 version of these functions. The sqlite3 docs suggest always using prepare_v2 and the close_v2 could potentially help with an fd leak we ha ve been seeing: NEWS UPGRADING ext/pdo_sqlite/sql ite_driver.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96838@lists.php.net to get a copy of this message | ||
Commit: 7b8b2e50f6efacb52aed4fa500a16638c56c8ca4
Author: Rasmus Lerdorf <rasmus@lerdorf.com> Sun, 22 Jan 2017 07:26:07 -0800
Parents: 5d0048cd753ee7ae575b590c31bd18e95f7a4339
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7b8b2e50f6efacb52aed4fa500a16638c56c8ca4
Log:
Switch to the v2 version of these functions.
The sqlite3 docs suggest always using prepare_v2 and the close_v2
could potentially help with an fd leak we have been seeing
Changed paths:
M NEWS
M UPGRADING
M ext/pdo_sqlite/sqlite_driver.c
Diff:
diff --git a/NEWS b/NEWS
index cb835f4..45d6df5 100644
--- a/NEWS
+++ b/NEWS
@@ -99,6 +99,9 @@ PHP NEWS
. Fixed bug #73959 (lastInsertId fails to throw an exception for wrong
sequence name).. (andrewnester)
+- PDO_Sqlite
+ . Switch to sqlite3_prepare_v2() and sqlite3_close_v2() functions (rasmus)
+
- posix:
. Fixed bug #71219 (configure script incorrectly checks for ttyname_r). (atoh)
diff --git a/UPGRADING b/UPGRADING
index 6b429da..af739b8 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -189,6 +189,10 @@ PHP 7.2 UPGRADE NOTES
. mb_convert_encoding() accepts array parameter. Only value encodings
are converted recursively.
+- pdo_sqlite
+ . Use sqlite3_prepare_v2() and sqlite3_close_v2() functions instead of their
+ legacy counterparts.
+
========================================
10. New Global Constants
========================================
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c
index 80b52d5..c5fd54c 100644
--- a/ext/pdo_sqlite/sqlite_driver.c
+++ b/ext/pdo_sqlite/sqlite_driver.c
@@ -161,7 +161,7 @@ static int sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */
pdo_sqlite_cleanup_callbacks(H);
if (H->db) {
- sqlite3_close(H->db);
+ sqlite3_close_v2(H->db);
H->db = NULL;
}
if (einfo->errmsg) {
@@ -193,7 +193,7 @@ static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_le
return 0;
}
- i = sqlite3_prepare(H->db, sql, sql_len, &S->stmt, &tail);
+ i = sqlite3_prepare_v2(H->db, sql, sql_len, &S->stmt, &tail);
if (i == SQLITE_OK) {
return 1;
}