Skip to content

Commit 2a51e98

Browse files
authored
DRIVERS-2641: Allow int32 or int64 for getMore cursor ID (#1427)
This accommodate drivers that encode BSON integers according to their range and is consistent with what is done in most other spec tests.
1 parent c773534 commit 2a51e98

File tree

9 files changed

+73
-25
lines changed

9 files changed

+73
-25
lines changed

source/client-side-encryption/etc/test-templates/getMore.yml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ tests:
4848
command_name: find
4949
- command_started_event:
5050
command:
51-
getMore: { $$type: "long" }
51+
getMore: { $$type: [ int, long ] }
5252
collection: *collection_name
5353
batchSize: 2
5454
command_name: getMore

source/client-side-encryption/tests/legacy/getMore.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@
216216
"command_started_event": {
217217
"command": {
218218
"getMore": {
219-
"$$type": "long"
219+
"$$type": [
220+
"int",
221+
"long"
222+
]
220223
},
221224
"collection": "default",
222225
"batchSize": 2

source/client-side-encryption/tests/legacy/getMore.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ tests:
4848
command_name: find
4949
- command_started_event:
5050
command:
51-
getMore: { $$type: "long" }
51+
getMore: { $$type: [ int, long ] }
5252
collection: *collection_name
5353
batchSize: 2
5454
command_name: getMore

source/load-balancers/tests/cursors.json

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@
222222
"reply": {
223223
"cursor": {
224224
"id": {
225-
"$$type": "long"
225+
"$$type": [
226+
"int",
227+
"long"
228+
]
226229
},
227230
"firstBatch": {
228231
"$$type": "array"
@@ -239,7 +242,10 @@
239242
"commandStartedEvent": {
240243
"command": {
241244
"getMore": {
242-
"$$type": "long"
245+
"$$type": [
246+
"int",
247+
"long"
248+
]
243249
},
244250
"collection": "coll0"
245251
},
@@ -333,7 +339,10 @@
333339
"reply": {
334340
"cursor": {
335341
"id": {
336-
"$$type": "long"
342+
"$$type": [
343+
"int",
344+
"long"
345+
]
337346
},
338347
"firstBatch": {
339348
"$$type": "array"
@@ -475,7 +484,10 @@
475484
"reply": {
476485
"cursor": {
477486
"id": {
478-
"$$type": "long"
487+
"$$type": [
488+
"int",
489+
"long"
490+
]
479491
},
480492
"firstBatch": {
481493
"$$type": "array"
@@ -492,7 +504,10 @@
492504
"commandStartedEvent": {
493505
"command": {
494506
"getMore": {
495-
"$$type": "long"
507+
"$$type": [
508+
"int",
509+
"long"
510+
]
496511
},
497512
"collection": "coll0"
498513
},
@@ -605,7 +620,10 @@
605620
"reply": {
606621
"cursor": {
607622
"id": {
608-
"$$type": "long"
623+
"$$type": [
624+
"int",
625+
"long"
626+
]
609627
},
610628
"firstBatch": {
611629
"$$type": "array"
@@ -750,7 +768,10 @@
750768
"reply": {
751769
"cursor": {
752770
"id": {
753-
"$$type": "long"
771+
"$$type": [
772+
"int",
773+
"long"
774+
]
754775
},
755776
"firstBatch": {
756777
"$$type": "array"
@@ -767,7 +788,10 @@
767788
"commandStartedEvent": {
768789
"command": {
769790
"getMore": {
770-
"$$type": "long"
791+
"$$type": [
792+
"int",
793+
"long"
794+
]
771795
},
772796
"collection": "coll0"
773797
},
@@ -858,7 +882,10 @@
858882
"commandStartedEvent": {
859883
"command": {
860884
"getMore": {
861-
"$$type": "long"
885+
"$$type": [
886+
"int",
887+
"long"
888+
]
862889
},
863890
"collection": "coll0"
864891
},
@@ -950,7 +977,10 @@
950977
"commandStartedEvent": {
951978
"command": {
952979
"getMore": {
953-
"$$type": "long"
980+
"$$type": [
981+
"int",
982+
"long"
983+
]
954984
},
955985
"collection": {
956986
"$$type": "string"
@@ -1100,7 +1130,10 @@
11001130
"commandStartedEvent": {
11011131
"command": {
11021132
"getMore": {
1103-
"$$type": "long"
1133+
"$$type": [
1134+
"int",
1135+
"long"
1136+
]
11041137
},
11051138
"collection": "coll0"
11061139
},

source/load-balancers/tests/cursors.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ tests:
126126
commandSucceededEvent:
127127
reply:
128128
cursor:
129-
id: { $$type: long }
129+
id: { $$type: [ int, long ] }
130130
firstBatch: { $$type: array }
131131
ns: { $$type: string }
132132
commandName: find
133133
- &getMoreStarted
134134
commandStartedEvent:
135135
command:
136-
getMore: { $$type: long }
136+
getMore: { $$type: [ int, long ] }
137137
collection: *collection0Name
138138
commandName: getMore
139139
- &getMoreSucceeded
@@ -386,7 +386,7 @@ tests:
386386
# is not equal to *collection0Name as the command is not executed against a collection.
387387
- commandStartedEvent:
388388
command:
389-
getMore: { $$type: long }
389+
getMore: { $$type: [ int, long ] }
390390
collection: { $$type: string }
391391
commandName: getMore
392392
- *getMoreSucceeded

source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@
9393
"commandStartedEvent": {
9494
"command": {
9595
"getMore": {
96-
"$$type": "long"
96+
"$$type": [
97+
"int",
98+
"long"
99+
]
97100
},
98101
"collection": "coll0"
99102
},

source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ tests:
5454
databaseName: *database0Name
5555
- commandStartedEvent:
5656
command:
57-
getMore: { $$type: long }
57+
getMore: { $$type: [ int, long ] }
5858
collection: *collection0Name
5959
commandName: getMore

source/unified-test-format/tests/valid-pass/entity-find-cursor.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@
109109
"reply": {
110110
"cursor": {
111111
"id": {
112-
"$$type": "long"
112+
"$$type": [
113+
"int",
114+
"long"
115+
]
113116
},
114117
"ns": {
115118
"$$type": "string"
@@ -126,7 +129,10 @@
126129
"commandStartedEvent": {
127130
"command": {
128131
"getMore": {
129-
"$$type": "long"
132+
"$$type": [
133+
"int",
134+
"long"
135+
]
130136
},
131137
"collection": "coll0"
132138
},
@@ -138,7 +144,10 @@
138144
"reply": {
139145
"cursor": {
140146
"id": {
141-
"$$type": "long"
147+
"$$type": [
148+
"int",
149+
"long"
150+
]
142151
},
143152
"ns": {
144153
"$$type": "string"

source/unified-test-format/tests/valid-pass/entity-find-cursor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ tests:
6161
- commandSucceededEvent:
6262
reply:
6363
cursor:
64-
id: { $$type: long }
64+
id: { $$type: [ int, long ] }
6565
ns: { $$type: string }
6666
firstBatch: { $$type: array }
6767
commandName: find
6868
- commandStartedEvent:
6969
command:
70-
getMore: { $$type: long }
70+
getMore: { $$type: [ int, long ] }
7171
collection: *collection0Name
7272
commandName: getMore
7373
- commandSucceededEvent:
7474
reply:
7575
cursor:
76-
id: { $$type: long }
76+
id: { $$type: [ int, long ] }
7777
ns: { $$type: string }
7878
nextBatch: { $$type: array }
7979
commandName: getMore

0 commit comments

Comments
 (0)