- Notifications
You must be signed in to change notification settings - Fork5
Commit6aa2bdf
committed
Initialize the entryRes array between each call to triConsistent.
The shimTriConstistentFn, which calls the opclass's consistent function withall combinations of TRUE/FALSE for any MAYBE argument, modifies the entryResarray passed by the caller. Change startScanKey to re-initialize it betweeneach call to accommodate that.It's actually a bad habit by shimTriConsistentFn to modify its argument. Butthe only caller that doesn't already re-initialize the entryRes array wasstartScanKey, and it's easy for startScanKey to do so. Add a comment toshimTriConsistentFn about that.Note: this does not give a free pass to opclass-provided consistentfunctions to modify the entryRes argument; shimTriConsistent assumes thatthey don't, even though it does it itself.While at it, refactor startScanKey to allocate the requiredEntries andadditionalEntries after it knows exactly how large they need to be. Saves alittle bit of memory, and looks nicer anyway.Per complaint by Tom Lane, buildfarm and the pg_trgm regression test.1 parentdbc649f commit6aa2bdf
2 files changed
+29
-17
lines changedLines changed: 25 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
445 | 445 |
| |
446 | 446 |
| |
447 | 447 |
| |
| 448 | + | |
448 | 449 |
| |
449 | 450 |
| |
450 | 451 |
| |
| |||
472 | 473 |
| |
473 | 474 |
| |
474 | 475 |
| |
475 |
| - | |
476 |
| - | |
477 |
| - | |
478 |
| - | |
479 | 476 |
| |
480 | 477 |
| |
481 | 478 |
| |
482 | 479 |
| |
483 | 480 |
| |
484 | 481 |
| |
485 | 482 |
| |
486 |
| - | |
487 | 483 |
| |
488 | 484 |
| |
489 | 485 |
| |
490 |
| - | |
491 |
| - | |
492 |
| - | |
493 |
| - | |
| 486 | + | |
494 | 487 |
| |
495 |
| - | |
496 |
| - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
497 | 493 |
| |
498 | 494 |
| |
499 | 495 |
| |
500 | 496 |
| |
501 |
| - | |
502 |
| - | |
| 497 | + | |
503 | 498 |
| |
504 |
| - | |
505 | 499 |
| |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
506 | 513 |
| |
507 | 514 |
| |
508 | 515 |
| |
509 | 516 |
| |
510 |
| - | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
511 | 521 |
| |
512 | 522 |
| |
513 | 523 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
90 | 90 |
| |
91 | 91 |
| |
92 | 92 |
| |
| 93 | + | |
| 94 | + | |
93 | 95 |
| |
94 | 96 |
| |
95 | 97 |
| |
| |||
98 | 100 |
| |
99 | 101 |
| |
100 | 102 |
| |
101 |
| - | |
| 103 | + | |
102 | 104 |
| |
103 | 105 |
| |
104 | 106 |
| |
| |||
124 | 126 |
| |
125 | 127 |
| |
126 | 128 |
| |
127 |
| - | |
| 129 | + | |
128 | 130 |
| |
129 | 131 |
| |
130 | 132 |
| |
|
0 commit comments
Comments
(0)