From 02472279a66a8ae401a4329cc547449ac2816478 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Tue, 16 Dec 2025 15:34:31 +0100 Subject: [PATCH] SERVER-115513: move bson_utf8 logic into validate (#45196) GitOrigin-RevId: 2c89f66e82680f6b45ad40886610eb72f6459e98 --- src/mongo/BUILD.bazel | 1 - src/mongo/bson/BUILD.bazel | 1 - src/mongo/crypto/fle_crypto.cpp | 1 - src/mongo/db/validate/BUILD.bazel | 2 ++ src/mongo/{bson => db/validate}/bson_utf8.cpp | 2 +- src/mongo/{bson => db/validate}/bson_utf8.h | 0 src/mongo/{bson => db/validate}/bson_utf8_test.cpp | 2 +- src/mongo/db/validate/validate_results.cpp | 2 +- 8 files changed, 5 insertions(+), 6 deletions(-) rename src/mongo/{bson => db/validate}/bson_utf8.cpp (99%) rename src/mongo/{bson => db/validate}/bson_utf8.h (100%) rename src/mongo/{bson => db/validate}/bson_utf8_test.cpp (99%) diff --git a/src/mongo/BUILD.bazel b/src/mongo/BUILD.bazel index 17b7ab5669d..318f3c3c7ca 100644 --- a/src/mongo/BUILD.bazel +++ b/src/mongo/BUILD.bazel @@ -123,7 +123,6 @@ mongo_cc_library( "//src/mongo/base:validate_locale.cpp", "//src/mongo/bson:bson_comparator_interface_base.cpp", "//src/mongo/bson:bson_depth.cpp", - "//src/mongo/bson:bson_utf8.cpp", "//src/mongo/bson:bsonelement.cpp", "//src/mongo/bson:bsonelementvalue.cpp", "//src/mongo/bson:bsonmisc.cpp", diff --git a/src/mongo/bson/BUILD.bazel b/src/mongo/bson/BUILD.bazel index fd32e35a7e7..4e1c7338155 100644 --- a/src/mongo/bson/BUILD.bazel +++ b/src/mongo/bson/BUILD.bazel @@ -38,7 +38,6 @@ mongo_cc_unit_test( "bson_iterator_test.cpp", "bson_obj_data_type_test.cpp", "bson_obj_test.cpp", - "bson_utf8_test.cpp", "bson_validate_test.cpp", "bsonelement_test.cpp", "bsonobjbuilder_test.cpp", diff --git a/src/mongo/crypto/fle_crypto.cpp b/src/mongo/crypto/fle_crypto.cpp index b673465a256..b95e6c87e4c 100644 --- a/src/mongo/crypto/fle_crypto.cpp +++ b/src/mongo/crypto/fle_crypto.cpp @@ -80,7 +80,6 @@ extern "C" { #include "mongo/base/error_codes.h" #include "mongo/base/status.h" #include "mongo/bson/bson_depth.h" -#include "mongo/bson/bson_utf8.h" #include "mongo/bson/bsonmisc.h" #include "mongo/bson/bsonobj.h" #include "mongo/bson/bsonobjbuilder.h" diff --git a/src/mongo/db/validate/BUILD.bazel b/src/mongo/db/validate/BUILD.bazel index 57726e5ee4a..94f798dacc4 100644 --- a/src/mongo/db/validate/BUILD.bazel +++ b/src/mongo/db/validate/BUILD.bazel @@ -32,6 +32,7 @@ mongo_cc_library( mongo_cc_library( name = "validate_results", srcs = [ + "bson_utf8.cpp", "validate_results.cpp", ], deps = [ @@ -103,6 +104,7 @@ mongo_cc_library( mongo_cc_unit_test( name = "db_validate_test", srcs = [ + "bson_utf8_test.cpp", "collection_validation_test.cpp", "index_consistency_test.cpp", "validate_results_test.cpp", diff --git a/src/mongo/bson/bson_utf8.cpp b/src/mongo/db/validate/bson_utf8.cpp similarity index 99% rename from src/mongo/bson/bson_utf8.cpp rename to src/mongo/db/validate/bson_utf8.cpp index 9944ec95f98..18e8899f21e 100644 --- a/src/mongo/bson/bson_utf8.cpp +++ b/src/mongo/db/validate/bson_utf8.cpp @@ -27,7 +27,7 @@ * it in the license file. */ -#include "mongo/bson/bson_utf8.h" +#include "mongo/db/validate/bson_utf8.h" #include "mongo/base/string_data.h" #include "mongo/bson/bsonelement.h" diff --git a/src/mongo/bson/bson_utf8.h b/src/mongo/db/validate/bson_utf8.h similarity index 100% rename from src/mongo/bson/bson_utf8.h rename to src/mongo/db/validate/bson_utf8.h diff --git a/src/mongo/bson/bson_utf8_test.cpp b/src/mongo/db/validate/bson_utf8_test.cpp similarity index 99% rename from src/mongo/bson/bson_utf8_test.cpp rename to src/mongo/db/validate/bson_utf8_test.cpp index d69c48316be..4e10969a1eb 100644 --- a/src/mongo/bson/bson_utf8_test.cpp +++ b/src/mongo/db/validate/bson_utf8_test.cpp @@ -27,7 +27,7 @@ * it in the license file. */ -#include "mongo/bson/bson_utf8.h" +#include "mongo/db/validate/bson_utf8.h" #include "mongo/base/string_data.h" #include "mongo/bson/bsonmisc.h" diff --git a/src/mongo/db/validate/validate_results.cpp b/src/mongo/db/validate/validate_results.cpp index 85045fdf0fe..f8fb1d77e61 100644 --- a/src/mongo/db/validate/validate_results.cpp +++ b/src/mongo/db/validate/validate_results.cpp @@ -30,9 +30,9 @@ #include "mongo/db/validate/validate_results.h" #include "mongo/base/string_data.h" -#include "mongo/bson/bson_utf8.h" #include "mongo/bson/bsonobj.h" #include "mongo/bson/bsonobjbuilder.h" +#include "mongo/db/validate/bson_utf8.h" #include "mongo/db/validate/validate_options.h" #include "mongo/util/namespace_string_util.h"