Skip to content

Remove HAVE_SQLITE3_{CLOSE_V2,ERRSTR} #18963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions ext/pdo_sqlite/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ if test "$PHP_PDO_SQLITE" != "no"; then

PHP_SETUP_SQLITE([PDO_SQLITE_SHARED_LIBADD])

PHP_CHECK_LIBRARY([sqlite3], [sqlite3_close_v2],
[AC_DEFINE([HAVE_SQLITE3_CLOSE_V2], [1],
[Define to 1 if SQLite library has the 'sqlite3_close_v2' function.])],
[],
[$PDO_SQLITE_SHARED_LIBADD])

PHP_CHECK_LIBRARY([sqlite3], [sqlite3_column_table_name],
[AC_DEFINE([HAVE_SQLITE3_COLUMN_TABLE_NAME], [1],
[Define to 1 if SQLite library was compiled with the
Expand Down
1 change: 0 additions & 1 deletion ext/pdo_sqlite/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ if (PHP_PDO_SQLITE != "no") {

ADD_EXTENSION_DEP('pdo_sqlite', 'pdo');
AC_DEFINE("HAVE_SQLITE3_COLUMN_TABLE_NAME", 1, "Define to 1 if SQLite library was compiled with the SQLITE_ENABLE_COLUMN_METADATA and has the 'sqlite3_column_table_name' function.");
AC_DEFINE("HAVE_SQLITE3_CLOSE_V2", 1, "Define to 1 if SQLite library has the 'sqlite3_close_v2' function.");
ADD_MAKEFILE_FRAGMENT();
} else {
WARNING("pdo_sqlite not enabled; libraries and/or headers not found");
Expand Down
4 changes: 0 additions & 4 deletions ext/pdo_sqlite/sqlite_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,7 @@ static void sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */

pdo_sqlite_cleanup_callbacks(H);
if (H->db) {
#ifdef HAVE_SQLITE3_CLOSE_V2
sqlite3_close_v2(H->db);
#else
sqlite3_close(H->db);
#endif
H->db = NULL;
}
if (einfo->errmsg) {
Expand Down
1 change: 0 additions & 1 deletion ext/sqlite3/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ if (PHP_SQLITE3 != "no") {
EXTENSION("sqlite3", "sqlite3.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");

AC_DEFINE("HAVE_SQLITE3", 1, "Define to 1 if the PHP extension 'sqlite3' is available.");
AC_DEFINE("HAVE_SQLITE3_ERRSTR", 1, "Define to 1 if SQLite library has the 'sqlite3_errstr' function.");
AC_DEFINE("HAVE_SQLITE3_EXPANDED_SQL", 1, "Define to 1 if SQLite library has the 'sqlite3_expanded_sql' function.");
} else {
WARNING("sqlite3 not enabled; libraries and/or headers not found");
Expand Down
6 changes: 0 additions & 6 deletions ext/sqlite3/config0.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ if test $PHP_SQLITE3 != "no"; then
AC_DEFINE([HAVE_SQLITE3], [1],
[Define to 1 if the PHP extension 'sqlite3' is available.])

PHP_CHECK_LIBRARY([sqlite3], [sqlite3_errstr],
[AC_DEFINE([HAVE_SQLITE3_ERRSTR], [1],
[Define to 1 if SQLite library has the 'sqlite3_errstr' function.])],
[],
[$SQLITE3_SHARED_LIBADD])

PHP_CHECK_LIBRARY([sqlite3], [sqlite3_expanded_sql],
[AC_DEFINE([HAVE_SQLITE3_EXPANDED_SQL], [1],
[Define to 1 if SQLite library has the 'sqlite3_expanded_sql' function.])],
Expand Down
8 changes: 1 addition & 7 deletions ext/sqlite3/sqlite3.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,7 @@ PHP_METHOD(SQLite3, open)
rc = sqlite3_open_v2(fullpath, &(db_obj->db), flags, NULL);
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
db_obj->db ? sqlite3_errmsg(db_obj->db) : sqlite3_errstr(rc));
sqlite3_close(db_obj->db);
if (fullpath != filename) {
efree(fullpath);
Expand Down Expand Up @@ -1332,7 +1328,6 @@ PHP_METHOD(SQLite3, setAuthorizer)
/* }}} */


#if SQLITE_VERSION_NUMBER >= 3006011
/* {{{ Backups the current database to another one. */
PHP_METHOD(SQLite3, backup)
{
Expand Down Expand Up @@ -1386,7 +1381,6 @@ PHP_METHOD(SQLite3, backup)
RETURN_TRUE;
}
/* }}} */
#endif

/* {{{ Returns the number of parameters within the prepared statement. */
PHP_METHOD(SQLite3Stmt, paramCount)
Expand Down
2 changes: 0 additions & 2 deletions ext/sqlite3/sqlite3.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,8 @@ public function busyTimeout(int $milliseconds): bool {}
public function loadExtension(string $name): bool {}
#endif

#if SQLITE_VERSION_NUMBER >= 3006011
/** @tentative-return-type */
public function backup(SQLite3 $destination, string $sourceDatabase = "main", string $destinationDatabase = "main"): bool {}
#endif

/** @tentative-return-type */
public static function escapeString(string $string): string {}
Expand Down
8 changes: 1 addition & 7 deletions ext/sqlite3/sqlite3_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.