Skip to content

Commit 8f61df9

Browse files
bjorihanumantmk
authored andcommitted
missing trace macros
Closes #173
1 parent 7d8cd73 commit 8f61df9

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

src/mongoc/mongoc-bulk-operation.c

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,12 @@ mongoc_bulk_operation_remove (mongoc_bulk_operation_t *bulk, /* IN */
119119
bson_return_if_fail (bulk);
120120
bson_return_if_fail (selector);
121121

122+
ENTRY;
123+
122124
_mongoc_write_command_init_delete (&command, selector, true, bulk->ordered);
123125
_mongoc_array_append_val (&bulk->commands, command);
126+
127+
EXIT;
124128
}
125129

126130

@@ -133,24 +137,36 @@ mongoc_bulk_operation_remove_one (mongoc_bulk_operation_t *bulk, /* IN */
133137
bson_return_if_fail (bulk);
134138
bson_return_if_fail (selector);
135139

140+
ENTRY;
141+
136142
_mongoc_write_command_init_delete (&command, selector, false, bulk->ordered);
137143
_mongoc_array_append_val (&bulk->commands, command);
144+
145+
EXIT;
138146
}
139147

140148

141149
void
142150
mongoc_bulk_operation_delete (mongoc_bulk_operation_t *bulk,
143151
const bson_t *selector)
144152
{
153+
ENTRY;
154+
145155
mongoc_bulk_operation_remove (bulk, selector);
156+
157+
EXIT;
146158
}
147159

148160

149161
void
150162
mongoc_bulk_operation_delete_one (mongoc_bulk_operation_t *bulk,
151163
const bson_t *selector)
152164
{
165+
ENTRY;
166+
153167
mongoc_bulk_operation_remove_one (bulk, selector);
168+
169+
EXIT;
154170
}
155171

156172

@@ -198,18 +214,23 @@ mongoc_bulk_operation_replace_one (mongoc_bulk_operation_t *bulk,
198214
bson_return_if_fail (selector);
199215
bson_return_if_fail (document);
200216

217+
ENTRY;
218+
201219
if (!bson_validate (document,
202220
(BSON_VALIDATE_DOT_KEYS | BSON_VALIDATE_DOLLAR_KEYS),
203221
&err_off)) {
204222
MONGOC_WARNING ("%s(): replacement document may not contain "
205223
"$ or . in keys. Ingoring document.",
206224
__FUNCTION__);
225+
EXIT;
207226
return;
208227
}
209228

210229
_mongoc_write_command_init_update (&command, selector, document, upsert,
211230
false, bulk->ordered);
212231
_mongoc_array_append_val (&bulk->commands, command);
232+
233+
EXIT;
213234
}
214235

215236

@@ -226,11 +247,14 @@ mongoc_bulk_operation_update (mongoc_bulk_operation_t *bulk,
226247
bson_return_if_fail (selector);
227248
bson_return_if_fail (document);
228249

250+
ENTRY;
251+
229252
if (bson_iter_init (&iter, document)) {
230253
while (bson_iter_next (&iter)) {
231254
if (!strchr (bson_iter_key (&iter), '$')) {
232255
MONGOC_WARNING ("%s(): update only works with $ operators.",
233256
__FUNCTION__);
257+
EXIT;
234258
return;
235259
}
236260
}
@@ -239,6 +263,7 @@ mongoc_bulk_operation_update (mongoc_bulk_operation_t *bulk,
239263
_mongoc_write_command_init_update (&command, selector, document, upsert,
240264
true, bulk->ordered);
241265
_mongoc_array_append_val (&bulk->commands, command);
266+
EXIT;
242267
}
243268

244269

@@ -255,11 +280,14 @@ mongoc_bulk_operation_update_one (mongoc_bulk_operation_t *bulk,
255280
bson_return_if_fail (selector);
256281
bson_return_if_fail (document);
257282

283+
ENTRY;
284+
258285
if (bson_iter_init (&iter, document)) {
259286
while (bson_iter_next (&iter)) {
260287
if (!strchr (bson_iter_key (&iter), '$')) {
261288
MONGOC_WARNING ("%s(): update_one only works with $ operators.",
262289
__FUNCTION__);
290+
EXIT;
263291
return;
264292
}
265293
}
@@ -268,6 +296,7 @@ mongoc_bulk_operation_update_one (mongoc_bulk_operation_t *bulk,
268296
_mongoc_write_command_init_update (&command, selector, document, upsert,
269297
false, bulk->ordered);
270298
_mongoc_array_append_val (&bulk->commands, command);
299+
EXIT;
271300
}
272301

273302

@@ -303,21 +332,21 @@ mongoc_bulk_operation_execute (mongoc_bulk_operation_t *bulk, /* IN */
303332
MONGOC_ERROR_COMMAND_INVALID_ARG,
304333
"mongoc_bulk_operation_execute() requires a client "
305334
"and one has not been set.");
306-
return false;
335+
RETURN (false);
307336
} else if (!bulk->database) {
308337
bson_set_error (error,
309338
MONGOC_ERROR_COMMAND,
310339
MONGOC_ERROR_COMMAND_INVALID_ARG,
311340
"mongoc_bulk_operation_execute() requires a database "
312341
"and one has not been set.");
313-
return false;
342+
RETURN (false);
314343
} else if (!bulk->collection) {
315344
bson_set_error (error,
316345
MONGOC_ERROR_COMMAND,
317346
MONGOC_ERROR_COMMAND_INVALID_ARG,
318347
"mongoc_bulk_operation_execute() requires a collection "
319348
"and one has not been set.");
320-
return false;
349+
RETURN (false);
321350
}
322351

323352
if (reply) {

0 commit comments

Comments
 (0)