com php-src: fix resetting cursor data if dba_firstkey fail ed: ext/dba/config.m4 ext/dba/dba_lmdb.c
| From: | Anatol Belski | Date: | Sun, 28 May 2017 17:30:29 +0000 |
| Subject: | com php-src: fix resetting cursor data if dba_firstkey fail ed: ext/dba/config.m4 ext/dba/dba_lmdb.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-97920@lists.php.net to get a copy of this message | ||
Commit: fe86268336513ebabfd5ec85b3dd4832c0bb4deb
Author: Anatol Belski <ab@php.net> Sun, 28 May 2017 18:59:15 +0200
Parents: 9964721a177f1e577867fd2e2720ba6fdfaa748d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fe86268336513ebabfd5ec85b3dd4832c0bb4deb
Log:
fix resetting cursor data if dba_firstkey failed
better symbol check
fix config.m4
Changed paths:
M ext/dba/config.m4
M ext/dba/dba_lmdb.c
Diff:
diff --git a/ext/dba/config.m4 b/ext/dba/config.m4
index a8bd561..2a99c2a 100644
--- a/ext/dba/config.m4
+++ b/ext/dba/config.m4
@@ -245,7 +245,7 @@ if test "$PHP_LMDB" != "no"; then
if test -n "$THIS_INCLUDE"; then
for LIB in lmdb; do
- PHP_CHECK_LIBRARY($LIB, mdb_open, [
+ PHP_CHECK_LIBRARY($LIB, mdb_env_open, [
AC_DEFINE_UNQUOTED(LMDB_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_LMDB, 1, [ ])
THIS_LIBS=$LIB
@@ -663,7 +663,7 @@ if test "$HAVE_DBA" = "1"; then
AC_MSG_RESULT([yes])
fi
AC_DEFINE(HAVE_DBA, 1, [ ])
- PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c
dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c dba_tcadb.c $cdb_sources $flat_sources
$ini_sources, $ext_shared)
+ PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c
dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c dba_tcadb.c dba_lmdb.c $cdb_sources
$flat_sources $ini_sources, $ext_shared)
PHP_ADD_BUILD_DIR($ext_builddir/libinifile)
PHP_ADD_BUILD_DIR($ext_builddir/libcdb)
PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
diff --git a/ext/dba/dba_lmdb.c b/ext/dba/dba_lmdb.c
index 91f42e1..6f7d2da 100644
--- a/ext/dba/dba_lmdb.c
+++ b/ext/dba/dba_lmdb.c
@@ -269,6 +269,7 @@ DBA_FIRSTKEY_FUNC(lmdb)
if (rc) {
mdb_txn_abort(LMDB_IT(txn));
mdb_cursor_close(LMDB_IT(cur));
+ LMDB_IT(cur) = NULL;
if (MDB_NOTFOUND != rc) {
php_error_docref0(NULL, E_WARNING, "%s", mdb_strerror(rc));
}