Skip to content

Commit b611068

Browse files
gkodinovdahlerlend
authored andcommitted
Bug #37073516: firewall tests fail post-V$option push on MacOSX aarch
Used an alternative RapidJSON sequence that doesn't cause the macosx dyld to keep the shared obbject around post- dlclose(). Also stabilized the firewall.firewall-binlog-entries test by excluding the autoinc id that is non-consequential for the test Change-Id: Iaf1df12540f6a61a3827a6d293940bf93a068dd6
1 parent 1cb0112 commit b611068

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

components/library_mysys/option_usage_data.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,25 @@ bool Option_usage_data::set(bool is_used) {
6060
// make sure it's an object
6161
if (!doc.IsObject()) doc.SetObject();
6262

63+
auto it = doc.FindMember("used");
6364
// set the new values
64-
if (!doc.HasMember("used"))
65-
doc.AddMember("used", true, doc.GetAllocator());
65+
if (it == doc.MemberEnd())
66+
doc.AddMember("used", is_used, doc.GetAllocator());
6667
else
67-
doc["used"].SetBool(is_used);
68+
it->value.SetBool(is_used);
6869

6970
time_t now;
7071
time(&now);
7172
char curent_iso8601_datetime[sizeof("2011-10-08T07:07:09Z")];
7273
strftime(curent_iso8601_datetime, sizeof curent_iso8601_datetime, "%FT%TZ",
7374
gmtime(&now));
7475

75-
if (!doc.HasMember("usedDate"))
76+
it = doc.FindMember("usedDate");
77+
if (it == doc.MemberEnd())
7678
doc.AddMember("usedDate", rapidjson::StringRef(curent_iso8601_datetime),
7779
doc.GetAllocator());
7880
else
79-
doc["usedDate"].SetString(curent_iso8601_datetime, doc.GetAllocator());
81+
it->value.SetString(curent_iso8601_datetime, doc.GetAllocator());
8082

8183
// serialize and store
8284
rapidjson::StringBuffer upated_json;

0 commit comments

Comments
 (0)