- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit4875931
committed
Fix normalization of numeric values in JSONB GIN indexes.
The default JSONB GIN opclass (jsonb_ops) converts numeric data valuesto strings for storage in the index. It must ensure that numeric valuesthat would compare equal (such as 12 and 12.00) produce identical strings,else index searches would have behavior different from regular JSONBcomparisons. Unfortunately the function charged with doing this wascompletely wrong: it could reduce distinct numeric values to the samestring, or reduce equivalent numeric values to different strings. Theformer type of error would only lead to search inefficiency, but thelatter type of error would cause index entries that should be found bya search to not be found.Repairing this bug therefore means that it will be necessary for 9.4 betatesters to reindex GIN jsonb_ops indexes, if they care about gettingcorrect results from index searches involving numeric data values withinthe comparison JSONB object.Per report from Thomas Fanghaenel.1 parent5332b8c commit4875931
1 file changed
+20
-12
lines changedLines changed: 20 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
629 | 629 |
| |
630 | 630 |
| |
631 | 631 |
| |
632 |
| - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
633 | 636 |
| |
634 | 637 |
| |
635 | 638 |
| |
636 | 639 |
| |
637 | 640 |
| |
638 | 641 |
| |
639 |
| - | |
640 |
| - | |
| 642 | + | |
641 | 643 |
| |
642 | 644 |
| |
643 | 645 |
| |
| |||
649 | 651 |
| |
650 | 652 |
| |
651 | 653 |
| |
652 |
| - | |
653 |
| - | |
654 |
| - | |
| 654 | + | |
| 655 | + | |
655 | 656 |
| |
656 |
| - | |
657 |
| - | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
658 | 664 |
| |
659 |
| - | |
660 |
| - | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
661 | 668 |
| |
662 |
| - | |
663 |
| - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
664 | 672 |
| |
665 | 673 |
| |
666 | 674 |
| |
|
0 commit comments
Comments
(0)