| 2251 | |
| 2252 | |
| 2253 | static void |
| 2254 | CallUpdateOne(MongoCollection *collection, UpdateOneParams *updateOneParams, |
| 2255 | int64 shardKeyHash, text *transactionId, UpdateOneResult *result, |
| 2256 | bool forceInlineWrites, ExprEvalState *stateForSchemaValidation) |
| 2257 | { |
| 2258 | /* If we can simply call the updateOne here, don't bother trying to spin up an SPI runtime |
| 2259 | * to call UpdateOne again. |
| 2260 | * In the scenarios where we can thunk directly to the table since the table (shard) is on the same |
| 2261 | * node as the query coordinator, call the functions directly here. |
| 2262 | */ |
| 2263 | if (forceInlineWrites || DefaultInlineWriteOperations || |
| 2264 | collection->shardTableName[0] != '\0') |
| 2265 | { |
| 2266 | if (transactionId != NULL) |
| 2267 | { |
| 2268 | UpdateOneInternalWithRetryRecord(collection, shardKeyHash, |
| 2269 | transactionId, updateOneParams, |
| 2270 | result, stateForSchemaValidation); |
| 2271 | } |
| 2272 | else |
| 2273 | { |
| 2274 | UpdateOneInternal(collection, updateOneParams, |
| 2275 | shardKeyHash, result, stateForSchemaValidation); |
| 2276 | } |
| 2277 | } |
| 2278 | else |
| 2279 | { |
| 2280 | /* Otherwise, call the worker via worker update one */ |
| 2281 | /* pass down bypassDocumentValidation to updateOne*/ |
| 2282 | updateOneParams->bypassDocumentValidation = !EnableSchemaValidation || |
| 2283 | stateForSchemaValidation == NULL; |
| 2284 | CallUpdateWorkerForUpdateOne(collection, updateOneParams, shardKeyHash, |
| 2285 | transactionId, result); |
| 2286 | } |
| 2287 | } |
| 2288 | |
| 2289 | |
| 2290 | static Datum |
no test coverage detected