Integer IDs can also be int32

This commit is contained in:
Hannes Magnusson
2014-12-02 17:21:57 -08:00
parent 29bfcd96cc
commit 67040bde2b
+4
View File
@@ -348,6 +348,10 @@ void phongo_writeresult_init(zval *return_value, const bson_t *bson, int server_
php_phongo_objectid_new_from_oid(zid, bson_iter_oid(&outer) TSRMLS_CC);
add_index_zval(writeresult->upsertedIds, index, zid);
} else if (BSON_ITER_HOLDS_INT32(&outer)) {
int32_t val = bson_iter_int32(&outer);
add_index_long(writeresult->upsertedIds, index, val);
} else if (BSON_ITER_HOLDS_INT64(&outer)) {
int64_t val = bson_iter_int64(&outer);