- Added ReflectionClass::newInstanceArgs($args). (Marcus)
- Added imap_savebody() that allows message body to be written to a file.
(Mike)
+- Fixed bug #36436 (DBA problem with Berkeley DB4). (Marcus)
- Fixed bug #36420 (segfault when access result->num_rows after calling
result->close()). (Ilia)
- Fixed bug #36403 (oci_execute() no longer supports OCI_DESCRIBE_ONLY).
DB4_GKEY;
memset(&gval, 0, sizeof(gval));
+ if (info->flags & DBA_PERSISTENT) {
+ gval.flags |= DB_DBT_MALLOC;
+ }
if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) {
if (newlen) *newlen = gval.size;
new = estrndup(gval.data, gval.size);
+ if (info->flags & DBA_PERSISTENT) {
+ free(gval.data);
+ }
}
return new;
}
memset(&gkey, 0, sizeof(gkey));
memset(&gval, 0, sizeof(gval));
+ if (info->flags & DBA_PERSISTENT) {
+ gkey.flags |= DB_DBT_MALLOC;
+ gval.flags |= DB_DBT_MALLOC;
+ }
if (dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT) == 0) {
if (gkey.data) {
nkey = estrndup(gkey.data, gkey.size);
if (newlen) *newlen = gkey.size;
}
+ if (info->flags & DBA_PERSISTENT) {
+ if (gkey.data) {
+ free(gkey.data);
+ }
+ if (gval.data) {
+ free(gval.data);
+ }
+ }
}
return nkey;
--- /dev/null
+--TEST--
+Bug #36436 DBA problem with Berkeley DB4
+--SKIPIF--
+<?php
+ $handler = 'db4';
+ require_once('skipif.inc');
+?>
+--FILE--
+<?php
+
+$handler = 'db4';
+require_once('test.inc');
+
+$db = dba_popen($db_filename, 'c', 'db4');
+
+dba_insert('X', 'XYZ', $db);
+dba_insert('Y', '123', $db);
+
+var_dump($db, dba_fetch('X', $db));
+
+var_dump(dba_firstkey($db));
+var_dump(dba_nextkey($db));
+
+dba_close($db);
+unlink($db_filename);
+
+?>
+===DONE===
+--EXPECTF--
+resource(%d) of type (dba persistent)
+string(3) "XYZ"
+string(1) "X"
+string(1) "Y"
+===DONE===