Commit Graph

637 Commits

Author SHA1 Message Date
Michael Orlitzky
4140394642
ext/dba/tests/dba_tcadb.phpt: support pthreadless tokyocabinet (#11648)
Several of our DBA tests (based on setup/setup_dba_tests.inc) have a
"no lock" version whose expected output is:

  SAME OUTPUT AS PREVIOUS RUN (modulo read during write due to no lock)

This tokyocabinet test, however, is missing the "modulo" bit, because
it is not output when tokyocabinet is built with pthreads support, as
is the case on at least Fedora and the GitHub CI.

To additionally support systems where tokyocabinet is built WITHOUT
pthreads support, this commit adds a wildcard at the end of the
expected output to catch the " (modulo..." string.
2023-08-02 16:50:02 +01:00
Máté Kocsis
134441efa9 Deprecate calling dba_fetch() with $dba at the 3rd parameter 2023-07-18 12:59:21 +02:00
George Peter Banyard
421c56dda2
Use zend_string for DBA path (#10698) 2023-04-08 17:03:28 +01:00
George Peter Banyard
648e896d0e
Fix [-Wstrict-prototypes] in DBA
I've missed this case while doing all the other ones.
2023-03-06 17:03:41 +00:00
George Peter Banyard
f13d541ca6
Fix GCC 12 compiler warnings (#10713)
* Fix -Wunused-but-set-variable compiler warning in ext/mysqli

* Fix -Wstrict-prototypes compiler warning in ext/mysqlnd

* Fix -Wstrict-prototypes compiler warning in ext/soap

* Fix -Wunused-but-set-variable compiler warning in ext/exif

However, this code looks really sketchy...

* Fix -Wstrict-prototypes compiler warning in ext/openssl

* Fix -Wstrict-prototypes compiler warning in ext/dba

Add void to our bundled libraries

* Refactor bundled BCMath library

Fix -Wdeprecated-non-prototype compiler warnings
Use bool instead of char/int
Cleanup some useless header includes
2023-02-28 14:21:01 +00:00
Max Kellermann
1287747a9a
ext: make various internal functions static (#10650)
Namely in:
* ext/date
* ext/libxml
* ext/dba
* ext/curl
2023-02-21 15:51:41 +00:00
Max Kellermann
263b22f374
Make lots of string pointers const (#10646)
This allows using string literals without implicitly casting away the
`const`.
2023-02-21 14:01:37 +00:00
Max Kellermann
d3facbe283
Mark globals as const (#10303)
This moves them from ``.data`` to ``.rodata`` and allows more compiler optimizations.

* ext/opcache/zend_accelerator_hash: make prime_numbers const

* Zend/zend_signal: make zend_sigs const

* ext/dba: make dba_handler pointers const

* ext/exif: make php_tiff_bytes_per_format and other globals const

* ext/intl/grapheme: make grapheme_extract_iters const

* ext/mstring: make rare_codepoint_bitvec const

* ext/snmp: make objid_mib const

* ext/opcache: make all zend_shared_memory_handlers const
2023-01-23 13:46:58 +00:00
Máté Kocsis
b4ec3e9bc0
Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
Christoph M. Becker
f11228cdbe
Add conflict markers for dba tests
These tests use the same filename, and as such must not be run in
parallel.
2022-08-04 16:23:26 +02:00
George Peter Banyard
eddab74021
Improve DBA test suite (#8904)
Generalises tests for all the different drivers.
Run the general test for the various drivers.

This allows support for parallel testing as the tests now do not rely on the same DB file.
2022-07-28 19:36:04 +01:00
Christoph M. Becker
89216b23dd
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9155: dba_open("non-existing", "c-", "flatfile") segfaults
2022-07-27 12:16:25 +02:00
Christoph M. Becker
cf1664e91d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9155: dba_open("non-existing", "c-", "flatfile") segfaults
2022-07-27 12:13:32 +02:00
Christoph M. Becker
a442e29485
Fix GH-9155: dba_open("non-existing", "c-", "flatfile") segfaults
We must not assume that the lock file has been opened.

Closes GH-9156.
2022-07-27 12:08:36 +02:00
George Peter Banyard
04f6fe4b25
Ammend DBA error message to use standard messaging 2022-07-26 00:25:39 +01:00
George Peter Banyard
3c372901bd Add support to pass driver flags to DBA handlers
Currently only LMDB with DBA_LMDB_USE_SUB_DIR/DBA_LMDB_NO_SUB_DIR are supported
2022-07-23 18:38:27 +01:00
George Peter Banyard
79d831ff9f Pass MDB_RDONLY to the LMDB environment for readonly DBs 2022-07-23 18:38:27 +01:00
George Peter Banyard
0887a1d7ab Remove personalisation from write on readonly db DBA error message 2022-07-23 18:38:27 +01:00
George Peter Banyard
c8ba00f627 Add comment in GDBM informing to what param the 0 org corresponds to 2022-07-23 18:38:27 +01:00
George Peter Banyard
cd640778f7
[skip ci] Add comment about LMDB env_close function call 2022-07-21 14:48:25 +01:00
George Peter Banyard
d0542a6b5c
Merge branch 'PHP-8.1'
* PHP-8.1:
  Update NEWS
  Fix memory leak in LMDB driver
2022-07-21 14:10:01 +01:00
George Peter Banyard
c7a0439d60
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix memory leak in LMDB driver
2022-07-21 14:08:40 +01:00
George Peter Banyard
5b83b3a933
Fix memory leak in LMDB driver 2022-07-21 14:05:48 +01:00
Derick Rethans
d8ebfdc506 Merge branch 'PHP-8.0' into PHP-8.1 2022-07-04 10:50:32 +01:00
George Peter Banyard
1d0c287b90
Abort LMDB transaction whe trying to delete non-existing key 2022-07-01 17:28:36 +01:00
George Peter Banyard
8fce70ae7b
Abort LMDB transaction whe trying to delete non-existing key 2022-07-01 17:26:27 +01:00
Yurun
5cf2659fa5
Replace the use of ZVAL_BOOL() with ZVAL_TRUE() or ZVAL_FALSE() where the value is fixed (#8815) 2022-06-20 13:34:44 +01:00
George Peter Banyard
738adce79f Fix [-Wundef] warnings in DBA extension 2022-04-01 14:38:44 +01:00
George Peter Banyard
d71d0cf0bb Use zend_string for DBA first/next key handlers 2021-11-11 11:12:41 +00:00
George Peter Banyard
96ff88ec38 Use zend_string for DBA delete handler 2021-11-11 11:12:41 +00:00
George Peter Banyard
cd98e46583 Use zend_string for DBA exist handler 2021-11-11 11:12:41 +00:00
George Peter Banyard
0eb0f64455 Use zend_string for DBA update handler 2021-11-11 11:12:41 +00:00
George Peter Banyard
f8e15f1ed6 Use zend_string for DBA fetch handler 2021-11-11 11:12:41 +00:00
George Peter Banyard
c42336b8b8 Drop dba_lock.name element
This is unused
2021-11-11 11:12:41 +00:00
Máté Kocsis
fdf63bfef3
Merge branch 'PHP-8.1'
* PHP-8.1:
  Add more specific array return type hints for various extensions - part 1
2021-11-07 08:48:49 +01:00
Máté Kocsis
d02b9b953d
Add more specific array return type hints for various extensions - part 1
ext/bz2, ext/calendar, ext/dba, ext/enchant

Closes GH-7432
2021-11-07 08:46:25 +01:00
George Peter Banyard
7db32add9b
Refactor dba_(p)open() to be more sensible (#7610)
Actually use ZPP
Throw ValueErrors for invalid values
Use dedicated struc members for file permission and map size instead of a zval stack
2021-11-06 23:09:40 +00:00
George Peter Banyard
a6cc76eeb8
Remove XFAIL
This was fixed in PHP 7 according to https://bugs.php.net/bug.php?id=61390 (which the linked commit points to)
2021-11-06 20:50:07 +00:00
George Peter Banyard
8ca7220bc9
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix Bug #81588 TokyoCabinet driver leaks memory
2021-11-03 15:02:12 +00:00
George Peter Banyard
5a3774cac5
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix Bug #81588 TokyoCabinet driver leaks memory
2021-11-03 15:01:56 +00:00
George Peter Banyard
84524afb9e
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix Bug #81588 TokyoCabinet driver leaks memory
2021-11-03 15:01:41 +00:00
George Peter Banyard
9f77373b4e
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix Bug #81588 TokyoCabinet driver leaks memory
2021-11-03 14:58:11 +00:00
George Peter Banyard
96dd310c54
Fix Bug #81588 TokyoCabinet driver leaks memory 2021-11-03 14:57:47 +00:00
George Peter Banyard
927cdd0a39
Inline "helper" macros
They just make refactoring harder
2021-10-25 22:49:37 +01:00
George Peter Banyard
1086b22608
Use zend_result as return value for DBA handler 2021-10-25 22:49:37 +01:00
George Peter Banyard
8db5e70866
DBA should not convert elements in-place if the key param is an array
Also check that the value can actually be converted to string
2021-10-24 22:41:22 +01:00
George Peter Banyard
b50dc1e3a6
Fix DBA on MacOS (#7611)
The name zend_string* must be copied instead of returned directly in case the group part of the array is empty.
2021-10-23 20:53:11 +01:00
George Peter Banyard
e56c506020
Refactor DBA
Use proper ZPP union types
Use standard function signature semantics for dba_fetch()
Re-ordering of checks
2021-10-23 12:04:23 +01:00
George Peter Banyard
e21d02a62a
Drop confusing ac local variable for ZEND_NUM_ARGS() 2021-10-23 10:30:34 +01:00
George Peter Banyard
c6862d0ed5
Inline DBA_GET2 macro
It was used only twice
2021-10-23 10:30:34 +01:00