github.com/zuoyebang/bitalostable@v1.0.1-0.20240229032404-e3b99a834294/internal/keyspan/testdata/interleaving_iter (about) 1 define-rangekeys 2 a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 3 c-d:{(#4,RANGEKEYSET,@3,coconut)} 4 e-f:{(#20,RANGEKEYSET,@5,pineapple) (#20,RANGEKEYSET,@3,guava)} 5 h-j:{(#22,RANGEKEYDEL) (#21,RANGEKEYSET,@5,peaches) (#21,RANGEKEYSET,@3,starfruit)} 6 l-m:{(#2,RANGEKEYUNSET,@9) (#2,RANGEKEYUNSET,@5)} 7 q-z:{(#14,RANGEKEYSET,@9,mangos)} 8 ---- 9 OK 10 11 define-pointkeys 12 artichoke.SET.10 13 artichoke.SET.8 14 carrot.SET.13 15 cauliflower.DEL.9 16 parsnip.SET.3 17 tomato.SET.2 18 zucchini.MERGE.12 19 ---- 20 OK 21 22 iter 23 first 24 next 25 next 26 next 27 next 28 next 29 next 30 next 31 next 32 next 33 next 34 next 35 ---- 36 -- SpanChanged(nil) 37 -- SpanChanged(a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)}) 38 PointKey: a#72057594037927935,21 39 Span: a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 40 - 41 PointKey: artichoke#10,1 42 Span: a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 43 - 44 PointKey: artichoke#8,1 45 Span: a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 46 - 47 -- SpanChanged(c-d:{(#4,RANGEKEYSET,@3,coconut)}) 48 PointKey: c#72057594037927935,21 49 Span: c-d:{(#4,RANGEKEYSET,@3,coconut)} 50 - 51 PointKey: carrot#13,1 52 Span: c-d:{(#4,RANGEKEYSET,@3,coconut)} 53 - 54 PointKey: cauliflower#9,0 55 Span: c-d:{(#4,RANGEKEYSET,@3,coconut)} 56 - 57 -- SpanChanged(e-f:{(#20,RANGEKEYSET,@5,pineapple) (#20,RANGEKEYSET,@3,guava)}) 58 PointKey: e#72057594037927935,21 59 Span: e-f:{(#20,RANGEKEYSET,@5,pineapple) (#20,RANGEKEYSET,@3,guava)} 60 - 61 -- SpanChanged(h-j:{(#22,RANGEKEYDEL) (#21,RANGEKEYSET,@5,peaches) (#21,RANGEKEYSET,@3,starfruit)}) 62 PointKey: h#72057594037927935,19 63 Span: h-j:{(#22,RANGEKEYDEL) (#21,RANGEKEYSET,@5,peaches) (#21,RANGEKEYSET,@3,starfruit)} 64 - 65 -- SpanChanged(l-m:{(#2,RANGEKEYUNSET,@9) (#2,RANGEKEYUNSET,@5)}) 66 PointKey: l#72057594037927935,20 67 Span: l-m:{(#2,RANGEKEYUNSET,@9) (#2,RANGEKEYUNSET,@5)} 68 - 69 -- SpanChanged(nil) 70 PointKey: parsnip#3,1 71 Span: <invalid> 72 - 73 -- SpanChanged(q-z:{(#14,RANGEKEYSET,@9,mangos)}) 74 PointKey: q#72057594037927935,21 75 Span: q-z:{(#14,RANGEKEYSET,@9,mangos)} 76 - 77 PointKey: tomato#2,1 78 Span: q-z:{(#14,RANGEKEYSET,@9,mangos)} 79 - 80 81 # Test set-bounds passes through to the underlying point iterator and truncates 82 # a range key's end. 83 84 iter 85 set-bounds b carrot 86 seek-ge b 87 next 88 next 89 ---- 90 -- SpanChanged(nil) 91 -- SpanChanged(b-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)}) 92 PointKey: b#72057594037927935,21 93 Span: b-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 94 - 95 -- SpanChanged(c-carrot:{(#4,RANGEKEYSET,@3,coconut)}) 96 PointKey: c#72057594037927935,21 97 Span: c-carrot:{(#4,RANGEKEYSET,@3,coconut)} 98 - 99 -- SpanChanged(nil) 100 . 101 102 103 # Test set-bounds passes through to the underlying point iterator and truncates 104 # a range key's start. 105 106 iter 107 set-bounds b carrot 108 seek-lt carrot 109 prev 110 prev 111 ---- 112 -- SpanChanged(nil) 113 -- SpanChanged(c-carrot:{(#4,RANGEKEYSET,@3,coconut)}) 114 PointKey: c#72057594037927935,21 115 Span: c-carrot:{(#4,RANGEKEYSET,@3,coconut)} 116 - 117 -- SpanChanged(b-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)}) 118 PointKey: b#72057594037927935,21 119 Span: b-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 120 - 121 -- SpanChanged(nil) 122 . 123 124 # Test seek-ge. 125 # NB: The `seek-ge yyy` case demonstrates truncation to the search key. 126 127 iter 128 first 129 seek-ge a 130 seek-ge p 131 seek-ge yyy 132 seek-ge z 133 ---- 134 -- SpanChanged(nil) 135 -- SpanChanged(a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)}) 136 PointKey: a#72057594037927935,21 137 Span: a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 138 - 139 -- SpanChanged(nil) 140 -- SpanChanged(a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)}) 141 PointKey: a#72057594037927935,21 142 Span: a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 143 - 144 -- SpanChanged(nil) 145 -- SpanChanged(nil) 146 PointKey: parsnip#3,1 147 Span: <invalid> 148 - 149 -- SpanChanged(nil) 150 -- SpanChanged(q-z:{(#14,RANGEKEYSET,@9,mangos)}) 151 PointKey: yyy#72057594037927935,21 152 Span: q-z:{(#14,RANGEKEYSET,@9,mangos)} 153 - 154 -- SpanChanged(nil) 155 -- SpanChanged(nil) 156 PointKey: zucchini#12,2 157 Span: <invalid> 158 - 159 160 iter 161 last 162 prev 163 prev 164 prev 165 prev 166 next 167 next 168 next 169 next 170 ---- 171 -- SpanChanged(nil) 172 -- SpanChanged(nil) 173 PointKey: zucchini#12,2 174 Span: <invalid> 175 - 176 -- SpanChanged(q-z:{(#14,RANGEKEYSET,@9,mangos)}) 177 PointKey: tomato#2,1 178 Span: q-z:{(#14,RANGEKEYSET,@9,mangos)} 179 - 180 PointKey: q#72057594037927935,21 181 Span: q-z:{(#14,RANGEKEYSET,@9,mangos)} 182 - 183 -- SpanChanged(nil) 184 PointKey: parsnip#3,1 185 Span: <invalid> 186 - 187 -- SpanChanged(l-m:{(#2,RANGEKEYUNSET,@9) (#2,RANGEKEYUNSET,@5)}) 188 PointKey: l#72057594037927935,20 189 Span: l-m:{(#2,RANGEKEYUNSET,@9) (#2,RANGEKEYUNSET,@5)} 190 - 191 -- SpanChanged(nil) 192 -- SpanChanged(nil) 193 PointKey: parsnip#3,1 194 Span: <invalid> 195 - 196 -- SpanChanged(q-z:{(#14,RANGEKEYSET,@9,mangos)}) 197 PointKey: q#72057594037927935,21 198 Span: q-z:{(#14,RANGEKEYSET,@9,mangos)} 199 - 200 PointKey: tomato#2,1 201 Span: q-z:{(#14,RANGEKEYSET,@9,mangos)} 202 - 203 -- SpanChanged(nil) 204 PointKey: zucchini#12,2 205 Span: <invalid> 206 - 207 208 iter 209 seek-ge tomato 210 next 211 seek-ge q 212 seek-ge parsnip 213 next 214 ---- 215 -- SpanChanged(nil) 216 -- SpanChanged(q-z:{(#14,RANGEKEYSET,@9,mangos)}) 217 PointKey: tomato#72057594037927935,21 218 Span: q-z:{(#14,RANGEKEYSET,@9,mangos)} 219 - 220 PointKey: tomato#2,1 221 Span: q-z:{(#14,RANGEKEYSET,@9,mangos)} 222 - 223 -- SpanChanged(nil) 224 -- SpanChanged(q-z:{(#14,RANGEKEYSET,@9,mangos)}) 225 PointKey: q#72057594037927935,21 226 Span: q-z:{(#14,RANGEKEYSET,@9,mangos)} 227 - 228 -- SpanChanged(nil) 229 -- SpanChanged(nil) 230 PointKey: parsnip#3,1 231 Span: <invalid> 232 - 233 -- SpanChanged(q-z:{(#14,RANGEKEYSET,@9,mangos)}) 234 PointKey: q#72057594037927935,21 235 Span: q-z:{(#14,RANGEKEYSET,@9,mangos)} 236 - 237 238 iter 239 seek-lt tomato 240 prev 241 seek-lt a 242 ---- 243 -- SpanChanged(nil) 244 -- SpanChanged(q-z:{(#14,RANGEKEYSET,@9,mangos)}) 245 PointKey: q#72057594037927935,21 246 Span: q-z:{(#14,RANGEKEYSET,@9,mangos)} 247 - 248 -- SpanChanged(nil) 249 PointKey: parsnip#3,1 250 Span: <invalid> 251 - 252 -- SpanChanged(nil) 253 -- SpanChanged(nil) 254 . 255 256 define-rangekeys 257 a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 258 c-d:{(#4,RANGEKEYSET,@3,coconut)} 259 e-f:{(#20,RANGEKEYSET,@5,pineapple) (#20,RANGEKEYSET,@3,guava)} 260 h-j:{(#22,RANGEKEYDEL) (#21,RANGEKEYSET,@5,peaches) (#21,RANGEKEYSET,@3,starfruit)} 261 l-m:{(#2,RANGEKEYUNSET,@9) (#2,RANGEKEYUNSET,@5)} 262 q-z:{(#14,RANGEKEYSET,@9,mangos)} 263 ---- 264 OK 265 266 define-pointkeys 267 a.SET.10 268 a.SET.8 269 b.SET.13 270 c.DEL.9 271 d.SET.3 272 e.SET.2 273 ---- 274 OK 275 276 iter 277 seek-ge a 278 next 279 next 280 next 281 ---- 282 -- SpanChanged(nil) 283 -- SpanChanged(a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)}) 284 PointKey: a#72057594037927935,21 285 Span: a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 286 - 287 PointKey: a#10,1 288 Span: a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 289 - 290 PointKey: a#8,1 291 Span: a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 292 - 293 PointKey: b#13,1 294 Span: a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 295 - 296 297 iter 298 seek-lt a 299 ---- 300 -- SpanChanged(nil) 301 -- SpanChanged(nil) 302 . 303 304 iter 305 seek-ge ab 306 next 307 next 308 next 309 next 310 next 311 next 312 next 313 ---- 314 -- SpanChanged(nil) 315 -- SpanChanged(a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)}) 316 PointKey: ab#72057594037927935,21 317 Span: a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 318 - 319 PointKey: b#13,1 320 Span: a-c:{(#10,RANGEKEYSET,@5,apples) (#10,RANGEKEYDEL) (#8,RANGEKEYUNSET,@1) (#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@2,oranges)} 321 - 322 -- SpanChanged(c-d:{(#4,RANGEKEYSET,@3,coconut)}) 323 PointKey: c#72057594037927935,21 324 Span: c-d:{(#4,RANGEKEYSET,@3,coconut)} 325 - 326 PointKey: c#9,0 327 Span: c-d:{(#4,RANGEKEYSET,@3,coconut)} 328 - 329 -- SpanChanged(nil) 330 PointKey: d#3,1 331 Span: <invalid> 332 - 333 -- SpanChanged(e-f:{(#20,RANGEKEYSET,@5,pineapple) (#20,RANGEKEYSET,@3,guava)}) 334 PointKey: e#72057594037927935,21 335 Span: e-f:{(#20,RANGEKEYSET,@5,pineapple) (#20,RANGEKEYSET,@3,guava)} 336 - 337 PointKey: e#2,1 338 Span: e-f:{(#20,RANGEKEYSET,@5,pineapple) (#20,RANGEKEYSET,@3,guava)} 339 - 340 -- SpanChanged(h-j:{(#22,RANGEKEYDEL) (#21,RANGEKEYSET,@5,peaches) (#21,RANGEKEYSET,@3,starfruit)}) 341 PointKey: h#72057594037927935,19 342 Span: h-j:{(#22,RANGEKEYDEL) (#21,RANGEKEYSET,@5,peaches) (#21,RANGEKEYSET,@3,starfruit)} 343 - 344 345 define-rangekeys 346 a-z:{(#5,RANGEKEYSET,@5,apples)} 347 ---- 348 OK 349 350 define-pointkeys 351 a.SET.10 352 a.SET.8 353 b.SET.13 354 c.DEL.9 355 d.SET.3 356 e.SET.2 357 ---- 358 OK 359 360 iter 361 first 362 next 363 next 364 next 365 next 366 next 367 ---- 368 -- SpanChanged(nil) 369 -- SpanChanged(a-z:{(#5,RANGEKEYSET,@5,apples)}) 370 PointKey: a#72057594037927935,21 371 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 372 - 373 PointKey: a#10,1 374 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 375 - 376 PointKey: a#8,1 377 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 378 - 379 PointKey: b#13,1 380 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 381 - 382 PointKey: c#9,0 383 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 384 - 385 PointKey: d#3,1 386 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 387 - 388 389 # Switch to reverse within a range key. 390 # NB: The seek-ge b should truncate the range key a-z to b. 391 392 iter 393 seek-ge b 394 prev 395 ---- 396 -- SpanChanged(nil) 397 -- SpanChanged(a-z:{(#5,RANGEKEYSET,@5,apples)}) 398 PointKey: b#72057594037927935,21 399 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 400 - 401 -- SpanChanged(nil) 402 -- SpanChanged(a-z:{(#5,RANGEKEYSET,@5,apples)}) 403 PointKey: a#8,1 404 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 405 - 406 407 # Switch to reverse after a seek-ge. Reverse iteration should not revisit the 408 # interleaved range-key start at the seek-ge bound: The range-key start should 409 # be interleaved at its true start key. 410 411 iter 412 seek-ge b 413 next 414 prev 415 prev 416 prev 417 ---- 418 -- SpanChanged(nil) 419 -- SpanChanged(a-z:{(#5,RANGEKEYSET,@5,apples)}) 420 PointKey: b#72057594037927935,21 421 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 422 - 423 PointKey: b#13,1 424 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 425 - 426 -- SpanChanged(nil) 427 -- SpanChanged(a-z:{(#5,RANGEKEYSET,@5,apples)}) 428 PointKey: a#8,1 429 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 430 - 431 PointKey: a#10,1 432 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 433 - 434 PointKey: a#72057594037927935,21 435 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 436 - 437 438 # Switch to forward iteration after a seek-lt. 439 440 iter 441 seek-lt c 442 next 443 ---- 444 -- SpanChanged(nil) 445 -- SpanChanged(a-z:{(#5,RANGEKEYSET,@5,apples)}) 446 PointKey: b#13,1 447 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 448 - 449 -- SpanChanged(nil) 450 -- SpanChanged(a-z:{(#5,RANGEKEYSET,@5,apples)}) 451 PointKey: c#9,0 452 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 453 - 454 455 iter 456 seek-lt c 457 prev 458 next 459 ---- 460 -- SpanChanged(nil) 461 -- SpanChanged(a-z:{(#5,RANGEKEYSET,@5,apples)}) 462 PointKey: b#13,1 463 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 464 - 465 PointKey: a#8,1 466 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 467 - 468 -- SpanChanged(nil) 469 -- SpanChanged(a-z:{(#5,RANGEKEYSET,@5,apples)}) 470 PointKey: b#13,1 471 Span: a-z:{(#5,RANGEKEYSET,@5,apples)} 472 - 473 474 # Test sparse range keys. 475 476 define-rangekeys 477 ace-bat:{(#5,RANGEKEYSET,@5,v5)} 478 x-z:{(#6,RANGEKEYSET,@6,v5)} 479 ---- 480 OK 481 482 define-pointkeys 483 a.SET.9 484 b.SET.13 485 c.DEL.9 486 d.SET.18 487 m.SET.4 488 o.MERGE.3 489 r.SET.22 490 y.SET.3 491 z.SET.3 492 ---- 493 OK 494 495 iter 496 first 497 next 498 next 499 prev 500 next 501 next 502 ---- 503 -- SpanChanged(nil) 504 -- SpanChanged(nil) 505 PointKey: a#9,1 506 Span: <invalid> 507 - 508 -- SpanChanged(ace-bat:{(#5,RANGEKEYSET,@5,v5)}) 509 PointKey: ace#72057594037927935,21 510 Span: ace-bat:{(#5,RANGEKEYSET,@5,v5)} 511 - 512 PointKey: b#13,1 513 Span: ace-bat:{(#5,RANGEKEYSET,@5,v5)} 514 - 515 -- SpanChanged(nil) 516 -- SpanChanged(ace-bat:{(#5,RANGEKEYSET,@5,v5)}) 517 PointKey: ace#72057594037927935,21 518 Span: ace-bat:{(#5,RANGEKEYSET,@5,v5)} 519 - 520 -- SpanChanged(nil) 521 -- SpanChanged(ace-bat:{(#5,RANGEKEYSET,@5,v5)}) 522 PointKey: b#13,1 523 Span: ace-bat:{(#5,RANGEKEYSET,@5,v5)} 524 - 525 -- SpanChanged(nil) 526 PointKey: c#9,0 527 Span: <invalid> 528 - 529 530 iter 531 seek-lt ace 532 seek-lt zoo 533 ---- 534 -- SpanChanged(nil) 535 -- SpanChanged(nil) 536 PointKey: a#9,1 537 Span: <invalid> 538 - 539 -- SpanChanged(nil) 540 -- SpanChanged(nil) 541 PointKey: z#3,1 542 Span: <invalid> 543 - 544 545 iter 546 last 547 prev 548 next 549 next 550 ---- 551 -- SpanChanged(nil) 552 -- SpanChanged(nil) 553 PointKey: z#3,1 554 Span: <invalid> 555 - 556 -- SpanChanged(x-z:{(#6,RANGEKEYSET,@6,v5)}) 557 PointKey: y#3,1 558 Span: x-z:{(#6,RANGEKEYSET,@6,v5)} 559 - 560 -- SpanChanged(nil) 561 -- SpanChanged(nil) 562 PointKey: z#3,1 563 Span: <invalid> 564 - 565 -- SpanChanged(nil) 566 . 567 568 iter 569 seek-lt m 570 next 571 seek-ge m 572 prev 573 ---- 574 -- SpanChanged(nil) 575 -- SpanChanged(nil) 576 PointKey: d#18,1 577 Span: <invalid> 578 - 579 -- SpanChanged(nil) 580 -- SpanChanged(nil) 581 PointKey: m#4,1 582 Span: <invalid> 583 - 584 -- SpanChanged(nil) 585 -- SpanChanged(nil) 586 PointKey: m#4,1 587 Span: <invalid> 588 - 589 -- SpanChanged(nil) 590 -- SpanChanged(nil) 591 PointKey: d#18,1 592 Span: <invalid> 593 - 594 595 # First, Last, SeekLT and SeekGE elide spans without Sets. 596 597 define-rangekeys 598 b-d:{(#5,RANGEKEYDEL)} 599 f-g:{(#6,RANGEKEYDEL)} 600 ---- 601 OK 602 603 define-pointkeys 604 c.SET.8 605 ---- 606 OK 607 608 iter 609 first 610 last 611 seek-ge a 612 seek-lt d 613 ---- 614 -- SpanChanged(nil) 615 -- SpanChanged(b-d:{(#5,RANGEKEYDEL)}) 616 PointKey: b#72057594037927935,19 617 Span: b-d:{(#5,RANGEKEYDEL)} 618 - 619 -- SpanChanged(nil) 620 -- SpanChanged(f-g:{(#6,RANGEKEYDEL)}) 621 PointKey: f#72057594037927935,19 622 Span: f-g:{(#6,RANGEKEYDEL)} 623 - 624 -- SpanChanged(nil) 625 -- SpanChanged(b-d:{(#5,RANGEKEYDEL)}) 626 PointKey: b#72057594037927935,19 627 Span: b-d:{(#5,RANGEKEYDEL)} 628 - 629 -- SpanChanged(nil) 630 -- SpanChanged(b-d:{(#5,RANGEKEYDEL)}) 631 PointKey: c#8,1 632 Span: b-d:{(#5,RANGEKEYDEL)} 633 - 634 635 # Test a scenario where Next is out of point keys, the current range key has 636 # already been interleaved, and there are no more range keys. 637 638 define-rangekeys 639 w-y:{(#5,RANGEKEYSET,@1,v1)} 640 y-z:{(#5,RANGEKEYDEL)} 641 ---- 642 OK 643 644 define-pointkeys 645 x.SET.8 646 ---- 647 OK 648 649 iter 650 first 651 next 652 next 653 ---- 654 -- SpanChanged(nil) 655 -- SpanChanged(w-y:{(#5,RANGEKEYSET,@1,v1)}) 656 PointKey: w#72057594037927935,21 657 Span: w-y:{(#5,RANGEKEYSET,@1,v1)} 658 - 659 PointKey: x#8,1 660 Span: w-y:{(#5,RANGEKEYSET,@1,v1)} 661 - 662 -- SpanChanged(y-z:{(#5,RANGEKEYDEL)}) 663 PointKey: y#72057594037927935,19 664 Span: y-z:{(#5,RANGEKEYDEL)} 665 - 666 667 # Test a scenario where we change direction on a synthetic range key boundary 668 # key. 669 iter 670 first 671 prev 672 ---- 673 -- SpanChanged(nil) 674 -- SpanChanged(w-y:{(#5,RANGEKEYSET,@1,v1)}) 675 PointKey: w#72057594037927935,21 676 Span: w-y:{(#5,RANGEKEYSET,@1,v1)} 677 - 678 -- SpanChanged(nil) 679 -- SpanChanged(nil) 680 . 681 682 define-rangekeys 683 a-z:{(#5,RANGEKEYSET,@1,v1)} 684 ---- 685 OK 686 687 define-pointkeys 688 z.SET.8 689 ---- 690 OK 691 692 iter 693 seek-ge c 694 prev 695 next 696 ---- 697 -- SpanChanged(nil) 698 -- SpanChanged(a-z:{(#5,RANGEKEYSET,@1,v1)}) 699 PointKey: c#72057594037927935,21 700 Span: a-z:{(#5,RANGEKEYSET,@1,v1)} 701 - 702 -- SpanChanged(nil) 703 -- SpanChanged(a-z:{(#5,RANGEKEYSET,@1,v1)}) 704 PointKey: a#72057594037927935,21 705 Span: a-z:{(#5,RANGEKEYSET,@1,v1)} 706 - 707 -- SpanChanged(nil) 708 -- SpanChanged(nil) 709 PointKey: z#8,1 710 Span: <invalid> 711 - 712 713 iter 714 set-bounds . c 715 first 716 set-bounds c . 717 last 718 prev 719 prev 720 ---- 721 -- SpanChanged(nil) 722 -- SpanChanged(a-c:{(#5,RANGEKEYSET,@1,v1)}) 723 PointKey: a#72057594037927935,21 724 Span: a-c:{(#5,RANGEKEYSET,@1,v1)} 725 - 726 -- SpanChanged(nil) 727 -- SpanChanged(nil) 728 PointKey: z#8,1 729 Span: <invalid> 730 - 731 -- SpanChanged(c-z:{(#5,RANGEKEYSET,@1,v1)}) 732 PointKey: c#72057594037927935,21 733 Span: c-z:{(#5,RANGEKEYSET,@1,v1)} 734 - 735 -- SpanChanged(nil) 736 . 737 738 # Test switching directions after exhausting a range key iterator. 739 # Switching reverse to forward iteration. 740 741 define-rangekeys 742 j-l:{(#3,RANGEKEYSET,@1,v0)} 743 ---- 744 OK 745 746 define-pointkeys 747 g.SET.1 748 s.SET.1 749 v.SET.2 750 v.SET.1 751 z.SET.1 752 ---- 753 OK 754 755 iter 756 last 757 prev 758 prev 759 prev 760 prev 761 prev 762 next 763 ---- 764 -- SpanChanged(nil) 765 -- SpanChanged(nil) 766 PointKey: z#1,1 767 Span: <invalid> 768 - 769 -- SpanChanged(nil) 770 PointKey: v#1,1 771 Span: <invalid> 772 - 773 -- SpanChanged(nil) 774 PointKey: v#2,1 775 Span: <invalid> 776 - 777 -- SpanChanged(nil) 778 PointKey: s#1,1 779 Span: <invalid> 780 - 781 -- SpanChanged(j-l:{(#3,RANGEKEYSET,@1,v0)}) 782 PointKey: j#72057594037927935,21 783 Span: j-l:{(#3,RANGEKEYSET,@1,v0)} 784 - 785 -- SpanChanged(nil) 786 PointKey: g#1,1 787 Span: <invalid> 788 - 789 -- SpanChanged(nil) 790 -- SpanChanged(j-l:{(#3,RANGEKEYSET,@1,v0)}) 791 PointKey: j#72057594037927935,21 792 Span: j-l:{(#3,RANGEKEYSET,@1,v0)} 793 - 794 795 # Test switching directions after exhausting a range key iterator. 796 # Switching forward to reverse iteration. 797 798 define-rangekeys 799 j-l:{(#3,RANGEKEYSET,@1,v0)} 800 ---- 801 OK 802 803 define-pointkeys 804 a.SET.1 805 k.SET.1 806 m.SET.1 807 ---- 808 OK 809 810 iter 811 first 812 next 813 next 814 next 815 prev 816 ---- 817 -- SpanChanged(nil) 818 -- SpanChanged(nil) 819 PointKey: a#1,1 820 Span: <invalid> 821 - 822 -- SpanChanged(j-l:{(#3,RANGEKEYSET,@1,v0)}) 823 PointKey: j#72057594037927935,21 824 Span: j-l:{(#3,RANGEKEYSET,@1,v0)} 825 - 826 PointKey: k#1,1 827 Span: j-l:{(#3,RANGEKEYSET,@1,v0)} 828 - 829 -- SpanChanged(nil) 830 PointKey: m#1,1 831 Span: <invalid> 832 - 833 -- SpanChanged(nil) 834 -- SpanChanged(j-l:{(#3,RANGEKEYSET,@1,v0)}) 835 PointKey: k#1,1 836 Span: j-l:{(#3,RANGEKEYSET,@1,v0)} 837 - 838 839 # Test a seek that moves the lower bound beyond the upper bound. 840 841 define-rangekeys 842 a-d:{(#10,RANGEKEYSET,@5,apples)} 843 ---- 844 OK 845 846 define-pointkeys 847 b.SET.8 848 ---- 849 OK 850 851 852 iter 853 set-bounds a c 854 seek-ge c 855 ---- 856 -- SpanChanged(nil) 857 -- SpanChanged(nil) 858 . 859 860 iter 861 set-bounds a c 862 seek-lt a 863 ---- 864 -- SpanChanged(nil) 865 -- SpanChanged(nil) 866 . 867 868 # Test a SeekLT that searches a keyspace exclusive with the iterator's bounds. 869 # Previously, there was a bug that would incorrectly surface the span with the 870 # iterator's bounds, despite the fact the SeekLT search key is exclusive. See 871 # the comment in keyspanSeekLT. 872 873 define-rangekeys 874 b-f:{(#1,RANGEKEYSET,@1,foo)} 875 ---- 876 OK 877 878 define-pointkeys 879 f.SET.3 880 ---- 881 OK 882 883 iter 884 set-bounds d e 885 seek-lt d 886 ---- 887 -- SpanChanged(nil) 888 -- SpanChanged(nil) 889 . 890 891 # Test seek-prefix-ge and its truncation of bounds to the prefix's bounds. 892 893 define-rangekeys 894 b-d:{(#5,RANGEKEYSET,@1,foo)} 895 f-g:{(#6,RANGEKEYSET,@1,foo)} 896 ---- 897 OK 898 899 define-pointkeys 900 c.SET.8 901 ---- 902 OK 903 904 iter 905 seek-prefix-ge b 906 next 907 seek-prefix-ge c 908 next 909 ---- 910 -- SpanChanged(nil) 911 -- SpanChanged(b-b\x00:{(#5,RANGEKEYSET,@1,foo)}) 912 PointKey: b#72057594037927935,21 913 Span: b-b\x00:{(#5,RANGEKEYSET,@1,foo)} 914 - 915 PointKey: c#8,1 916 Span: b-b\x00:{(#5,RANGEKEYSET,@1,foo)} 917 - 918 -- SpanChanged(nil) 919 -- SpanChanged(c-c\x00:{(#5,RANGEKEYSET,@1,foo)}) 920 PointKey: c#72057594037927935,21 921 Span: c-c\x00:{(#5,RANGEKEYSET,@1,foo)} 922 - 923 PointKey: c#8,1 924 Span: c-c\x00:{(#5,RANGEKEYSET,@1,foo)} 925 -