Skip to content

Commit 41d273c

Browse files
authored
PHPC-2593: Update libmongoc to 1.30.5 (#1841)
* PHPC-2593: Update libmongoc to 1.30.5 * Update tests for new BSON validation logic
1 parent c20a691 commit 41d273c

File tree

10 files changed

+23
-43
lines changed

10 files changed

+23
-43
lines changed

.evergreen/config/generated/build/build-libmongoc.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/config/templates/build/build-libmongoc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- func: "compile driver"
1111
vars:
1212
PHP_VERSION: "%phpVersion%"
13-
LIBMONGOC_VERSION: "1.30.1"
13+
LIBMONGOC_VERSION: "1.30.5"
1414
- func: "upload build"
1515

1616
- name: "build-php-%phpVersion%-libmongoc-next-stable"

config.m4

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,26 +277,26 @@ if test "$PHP_MONGODB" != "no"; then
277277
PHP_MONGODB_MONGOCRYPT_VERSION_STRING="None"
278278

279279
if test "$PHP_MONGODB_SYSTEM_LIBS" != "no"; then
280-
PKG_CHECK_MODULES([PHP_MONGODB_BSON], [libbson-1.0 >= 1.30.3], [
280+
PKG_CHECK_MODULES([PHP_MONGODB_BSON], [libbson-1.0 >= 1.30.5], [
281281
PHP_MONGODB_BSON_VERSION=`$PKG_CONFIG libbson-1.0 --modversion`
282282
PHP_MONGODB_BSON_VERSION_STRING="System ($PHP_MONGODB_BSON_VERSION)"
283283
284284
PHP_MONGODB_CFLAGS="$PHP_MONGODB_CFLAGS $PHP_MONGODB_BSON_CFLAGS"
285285
PHP_EVAL_LIBLINE($PHP_MONGODB_BSON_LIBS, MONGODB_SHARED_LIBADD)
286286
AC_DEFINE(HAVE_SYSTEM_LIBBSON, 1, [Use system libbson])
287287
],[
288-
AC_MSG_ERROR([Could not find system library for libbson >= 1.30.3])
288+
AC_MSG_ERROR([Could not find system library for libbson >= 1.30.5])
289289
])
290290

291-
PKG_CHECK_MODULES([PHP_MONGODB_MONGOC], [libmongoc-1.0 >= 1.30.3], [
291+
PKG_CHECK_MODULES([PHP_MONGODB_MONGOC], [libmongoc-1.0 >= 1.30.5], [
292292
PHP_MONGODB_BSON_VERSION=`$PKG_CONFIG libbson-1.0 --modversion`
293293
PHP_MONGODB_BSON_VERSION_STRING="System ($PHP_MONGODB_BSON_VERSION)"
294294
295295
PHP_MONGODB_CFLAGS="$PHP_MONGODB_CFLAGS $PHP_MONGODB_MONGOC_CFLAGS"
296296
PHP_EVAL_LIBLINE($PHP_MONGODB_MONGOC_LIBS, MONGODB_SHARED_LIBADD)
297297
AC_DEFINE(HAVE_SYSTEM_LIBMONGOC, 1, [Use system libmongoc])
298298
],[
299-
AC_MSG_ERROR(Could not find system library for libmongoc >= 1.30.3)
299+
AC_MSG_ERROR(Could not find system library for libmongoc >= 1.30.5)
300300
])
301301

302302
if test "$PHP_MONGODB_CLIENT_SIDE_ENCRYPTION" != "no"; then
@@ -395,7 +395,7 @@ if test "$PHP_MONGODB" != "no"; then
395395
dnl Sources below are updated by scripts/update-submodule-sources.php
396396
PHP_MONGODB_COMMON_SOURCES="common-atomic.c common-b64.c common-json.c common-md5.c common-oid.c common-string.c common-thread.c"
397397
PHP_MONGODB_KMS_MESSAGE_SOURCES="hexlify.c kms_azure_request.c kms_b64.c kms_caller_identity_request.c kms_crypto_apple.c kms_crypto_libcrypto.c kms_crypto_none.c kms_crypto_windows.c kms_decrypt_request.c kms_encrypt_request.c kms_gcp_request.c kms_kmip_reader_writer.c kms_kmip_request.c kms_kmip_response.c kms_kmip_response_parser.c kms_kv_list.c kms_message.c kms_port.c kms_request.c kms_request_opt.c kms_request_str.c kms_response.c kms_response_parser.c sort.c"
398-
PHP_MONGODB_BSON_SOURCES="bcon.c bson-atomic.c bson.c bson-clock.c bson-context.c bson-decimal128.c bson-error.c bson-iso8601.c bson-iter.c bson-json.c bson-keys.c bson-md5.c bson-memory.c bson-oid.c bson-reader.c bson-string.c bson-timegm.c bson-utf8.c bson-value.c bson-version-functions.c bson-writer.c"
398+
PHP_MONGODB_BSON_SOURCES="bcon.c bson-atomic.c bson.c bson-clock.c bson-context.c bson-decimal128.c bson-error.c bson-iso8601.c bson-iter.c bson-json.c bson-keys.c bson-md5.c bson-memory.c bson-oid.c bson-reader.c bson-string.c bson-timegm.c bson-utf8.c bson-value.c bson-version-functions.c bson-writer.c validate.c"
399399
PHP_MONGODB_JSONSL_SOURCES="jsonsl.c"
400400
PHP_MONGODB_MONGOC_SOURCES="mcd-azure.c mcd-nsinfo.c mcd-rpc.c mongoc-aggregate.c mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-bulkwrite.c mongoc-change-stream.c mongoc-client.c mongoc-client-pool.c mongoc-client-session.c mongoc-client-side-encryption.c mongoc-cluster-aws.c mongoc-cluster.c mongoc-cluster-cyrus.c mongoc-cluster-sasl.c mongoc-cluster-sspi.c mongoc-cmd.c mongoc-collection.c mongoc-compression.c mongoc-counters.c mongoc-crypt.c mongoc-crypto.c mongoc-crypto-cng.c mongoc-crypto-common-crypto.c mongoc-crypto-openssl.c mongoc-cursor-array.c mongoc-cursor.c mongoc-cursor-change-stream.c mongoc-cursor-cmd.c mongoc-cursor-cmd-deprecated.c mongoc-cursor-find.c mongoc-cursor-find-cmd.c mongoc-cursor-find-opquery.c mongoc-cursor-legacy.c mongoc-cyrus.c mongoc-database.c mongoc-deprioritized-servers.c mongoc-error.c mongoc-find-and-modify.c mongoc-flags.c mongoc-generation-map.c mongoc-gridfs-bucket.c mongoc-gridfs-bucket-file.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-handshake.c mongoc-host-list.c mongoc-http.c mongoc-index.c mongoc-init.c mongoc-interrupt.c mongoc-libressl.c mongoc-linux-distro-scanner.c mongoc-list.c mongoc-log-and-monitor-private.c mongoc-log.c mongoc-matcher.c mongoc-matcher-op.c mongoc-memcmp.c mongoc-ocsp-cache.c mongoc-opcode.c mongoc-openssl.c mongoc-optional.c mongoc-opts.c mongoc-opts-helpers.c mongoc-queue.c mongoc-rand-cng.c mongoc-rand-common-crypto.c mongoc-rand-openssl.c mongoc-read-concern.c mongoc-read-prefs.c mongoc-rpc.c mongoc-sasl.c mongoc-scram.c mongoc-secure-channel.c mongoc-secure-transport.c mongoc-server-api.c mongoc-server-description.c mongoc-server-monitor.c mongoc-server-stream.c mongoc-set.c mongoc-shared.c mongoc-socket.c mongoc-ssl.c mongoc-sspi.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.c mongoc-stream-gridfs-download.c mongoc-stream-gridfs-upload.c mongoc-stream-socket.c mongoc-stream-tls.c mongoc-stream-tls-libressl.c mongoc-stream-tls-openssl-bio.c mongoc-stream-tls-openssl.c mongoc-stream-tls-secure-channel.c mongoc-stream-tls-secure-transport.c mongoc-structured-log.c mongoc-timeout.c mongoc-topology-background-monitoring.c mongoc-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-ts-pool.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-concern.c service-gcp.c"
401401
PHP_MONGODB_UTF8PROC_SOURCES="utf8proc.c"

config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ if (PHP_MONGODB != "no") {
108108
// Sources below are updated by scripts/update-submodule-sources.php
109109
var PHP_MONGODB_COMMON_SOURCES="common-atomic.c common-b64.c common-json.c common-md5.c common-oid.c common-string.c common-thread.c"
110110
var PHP_MONGODB_KMS_MESSAGE_SOURCES="hexlify.c kms_azure_request.c kms_b64.c kms_caller_identity_request.c kms_crypto_apple.c kms_crypto_libcrypto.c kms_crypto_none.c kms_crypto_windows.c kms_decrypt_request.c kms_encrypt_request.c kms_gcp_request.c kms_kmip_reader_writer.c kms_kmip_request.c kms_kmip_response.c kms_kmip_response_parser.c kms_kv_list.c kms_message.c kms_port.c kms_request.c kms_request_opt.c kms_request_str.c kms_response.c kms_response_parser.c sort.c";
111-
var PHP_MONGODB_BSON_SOURCES="bcon.c bson-atomic.c bson.c bson-clock.c bson-context.c bson-decimal128.c bson-error.c bson-iso8601.c bson-iter.c bson-json.c bson-keys.c bson-md5.c bson-memory.c bson-oid.c bson-reader.c bson-string.c bson-timegm.c bson-utf8.c bson-value.c bson-version-functions.c bson-writer.c";
111+
var PHP_MONGODB_BSON_SOURCES="bcon.c bson-atomic.c bson.c bson-clock.c bson-context.c bson-decimal128.c bson-error.c bson-iso8601.c bson-iter.c bson-json.c bson-keys.c bson-md5.c bson-memory.c bson-oid.c bson-reader.c bson-string.c bson-timegm.c bson-utf8.c bson-value.c bson-version-functions.c bson-writer.c validate.c";
112112
var PHP_MONGODB_JSONSL_SOURCES="jsonsl.c";
113113
var PHP_MONGODB_MONGOC_SOURCES="mcd-azure.c mcd-nsinfo.c mcd-rpc.c mongoc-aggregate.c mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-bulkwrite.c mongoc-change-stream.c mongoc-client.c mongoc-client-pool.c mongoc-client-session.c mongoc-client-side-encryption.c mongoc-cluster-aws.c mongoc-cluster.c mongoc-cluster-cyrus.c mongoc-cluster-sasl.c mongoc-cluster-sspi.c mongoc-cmd.c mongoc-collection.c mongoc-compression.c mongoc-counters.c mongoc-crypt.c mongoc-crypto.c mongoc-crypto-cng.c mongoc-crypto-common-crypto.c mongoc-crypto-openssl.c mongoc-cursor-array.c mongoc-cursor.c mongoc-cursor-change-stream.c mongoc-cursor-cmd.c mongoc-cursor-cmd-deprecated.c mongoc-cursor-find.c mongoc-cursor-find-cmd.c mongoc-cursor-find-opquery.c mongoc-cursor-legacy.c mongoc-cyrus.c mongoc-database.c mongoc-deprioritized-servers.c mongoc-error.c mongoc-find-and-modify.c mongoc-flags.c mongoc-generation-map.c mongoc-gridfs-bucket.c mongoc-gridfs-bucket-file.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-handshake.c mongoc-host-list.c mongoc-http.c mongoc-index.c mongoc-init.c mongoc-interrupt.c mongoc-libressl.c mongoc-linux-distro-scanner.c mongoc-list.c mongoc-log-and-monitor-private.c mongoc-log.c mongoc-matcher.c mongoc-matcher-op.c mongoc-memcmp.c mongoc-ocsp-cache.c mongoc-opcode.c mongoc-openssl.c mongoc-optional.c mongoc-opts.c mongoc-opts-helpers.c mongoc-queue.c mongoc-rand-cng.c mongoc-rand-common-crypto.c mongoc-rand-openssl.c mongoc-read-concern.c mongoc-read-prefs.c mongoc-rpc.c mongoc-sasl.c mongoc-scram.c mongoc-secure-channel.c mongoc-secure-transport.c mongoc-server-api.c mongoc-server-description.c mongoc-server-monitor.c mongoc-server-stream.c mongoc-set.c mongoc-shared.c mongoc-socket.c mongoc-ssl.c mongoc-sspi.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.c mongoc-stream-gridfs-download.c mongoc-stream-gridfs-upload.c mongoc-stream-socket.c mongoc-stream-tls.c mongoc-stream-tls-libressl.c mongoc-stream-tls-openssl-bio.c mongoc-stream-tls-openssl.c mongoc-stream-tls-secure-channel.c mongoc-stream-tls-secure-transport.c mongoc-structured-log.c mongoc-timeout.c mongoc-topology-background-monitoring.c mongoc-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-ts-pool.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-concern.c service-gcp.c";
114114
var PHP_MONGODB_UTF8PROC_SOURCES="utf8proc.c";

sbom.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,34 @@
1919
"version": "1.12.0"
2020
},
2121
{
22-
"bom-ref": "pkg:github/mongodb/[email protected].3",
22+
"bom-ref": "pkg:github/mongodb/[email protected].5",
2323
"externalReferences": [
2424
{
2525
"type": "distribution",
26-
"url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/1.30.3.tar.gz"
26+
"url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/1.30.5.tar.gz"
2727
},
2828
{
2929
"type": "website",
30-
"url": "https://github.com/mongodb/mongo-c-driver/tree/1.30.3"
30+
"url": "https://github.com/mongodb/mongo-c-driver/tree/1.30.5"
3131
}
3232
],
3333
"group": "mongodb",
3434
"name": "mongo-c-driver",
35-
"purl": "pkg:github/mongodb/[email protected].3",
35+
"purl": "pkg:github/mongodb/[email protected].5",
3636
"type": "library",
37-
"version": "1.30.3"
37+
"version": "1.30.5"
3838
}
3939
],
4040
"dependencies": [
4141
{
4242
"ref": "pkg:github/mongodb/[email protected]"
4343
},
4444
{
45-
"ref": "pkg:github/mongodb/[email protected].3"
45+
"ref": "pkg:github/mongodb/[email protected].5"
4646
}
4747
],
4848
"metadata": {
49-
"timestamp": "2025-04-09T07:40:24.233811+00:00",
49+
"timestamp": "2025-06-10T10:24:13.960044+00:00",
5050
"tools": [
5151
{
5252
"externalReferences": [
@@ -90,8 +90,9 @@
9090
]
9191
},
9292
"serialNumber": "urn:uuid:acb30d08-ee47-4ff0-b301-d66ef1f54082",
93-
"version": 11,
93+
"version": 12,
9494
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
9595
"bomFormat": "CycloneDX",
96-
"specVersion": "1.5"
96+
"specVersion": "1.5",
97+
"vulnerabilities": []
9798
}

src/LIBMONGOC_VERSION_CURRENT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.30.3
1+
1.30.5

src/libmongoc

Submodule libmongoc updated 58 files

tests/bulk/bulkwrite-insert_error-001.phpt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,12 @@ $bulk = new MongoDB\Driver\BulkWrite;
99

1010
echo throws(function() use ($bulk) {
1111
$bulk->insert(['' => 1]);
12-
}, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n\n";
13-
14-
echo throws(function() use ($bulk) {
15-
$bulk->insert(["\xc3\x28" => 1]);
1612
}, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n";
1713

1814
?>
1915
===DONE===
2016
<?php exit(0); ?>
2117
--EXPECT--
2218
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
23-
invalid document for insert: empty key
24-
25-
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
26-
invalid document for insert: corrupt BSON
19+
invalid document for insert: Element key cannot be an empty string
2720
===DONE===

tests/bulk/bulkwrite-update_error-001.phpt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,12 @@ $bulk = new MongoDB\Driver\BulkWrite;
99

1010
echo throws(function() use ($bulk) {
1111
$bulk->update(['x' => 1], ['' => 1]);
12-
}, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n\n";
13-
14-
echo throws(function() use ($bulk) {
15-
$bulk->update(['x' => 1], ["\xc3\x28" => 1]);
1612
}, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n";
1713

1814
?>
1915
===DONE===
2016
<?php exit(0); ?>
2117
--EXPECT--
2218
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
23-
invalid argument for replace: empty key
24-
25-
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
26-
invalid argument for replace: corrupt BSON
19+
invalid argument for replace: Element key cannot be an empty string
2720
===DONE===

tests/bulk/bulkwrite-update_error-002.phpt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ echo throws(function() use ($bulk) {
1111
$bulk->update(['x' => 1], ['$set' => ['x' => ['' => 1]]]);
1212
}, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n\n";
1313

14-
echo throws(function() use ($bulk) {
15-
$bulk->update(['x' => 1], ['$set' => ['x' => ["\xc3\x28" => 1]]]);
16-
}, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n\n";
17-
1814
/* This newObj argument mixes an update and replacement document, but
1915
* php_phongo_bulkwrite_update_has_operators() will categorize it as an update
2016
* due to the presence of an atomic operator. As such, _mongoc_validate_update()
@@ -28,10 +24,7 @@ echo throws(function() use ($bulk) {
2824
<?php exit(0); ?>
2925
--EXPECT--
3026
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
31-
invalid argument for update: empty key
32-
33-
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
34-
invalid argument for update: corrupt BSON
27+
invalid argument for update: Element key cannot be an empty string
3528

3629
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
3730
Invalid key 'z': update only works with $ operators and pipelines

0 commit comments

Comments
 (0)