Commit b0f4791
committed
Repair corner-case bug in array version of percentile_cont().
The code for advancing through the input rows overlooked the case that we
might already be past the first row of the row pair now being considered,
in case the previous percentile also fell between the same two input rows.
Report and patch by Andrew Gierth; logic rewritten a bit for clarity by me.1 parent 50f2c06 commit b0f4791
File tree
3 files changed
+26
-18
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+26
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
904 | 904 | | |
905 | 905 | | |
906 | 906 | | |
907 | | - | |
908 | | - | |
| 907 | + | |
| 908 | + | |
909 | 909 | | |
910 | 910 | | |
911 | | - | |
912 | | - | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
913 | 918 | | |
914 | | - | |
| 919 | + | |
915 | 920 | | |
916 | 921 | | |
917 | 922 | | |
918 | 923 | | |
919 | 924 | | |
920 | | - | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
921 | 928 | | |
922 | | - | |
| 929 | + | |
923 | 930 | | |
924 | 931 | | |
925 | | - | |
926 | | - | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
927 | 935 | | |
928 | 936 | | |
929 | 937 | | |
930 | 938 | | |
931 | 939 | | |
932 | | - | |
| 940 | + | |
933 | 941 | | |
934 | 942 | | |
935 | 943 | | |
936 | 944 | | |
937 | 945 | | |
938 | | - | |
939 | | - | |
| 946 | + | |
| 947 | + | |
940 | 948 | | |
941 | 949 | | |
942 | | - | |
| 950 | + | |
943 | 951 | | |
944 | 952 | | |
945 | 953 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
1426 | | - | |
| 1426 | + | |
1427 | 1427 | | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
1431 | 1431 | | |
1432 | 1432 | | |
1433 | 1433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
| 536 | + | |
537 | 537 | | |
538 | 538 | | |
539 | 539 | | |
| |||
0 commit comments