forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5d79fc6
committed
Adjust bytea get_bit/set_bit to cope with bytea strings > 256MB.
Since the existing bit number argument can't exceed INT32_MAX, it'snot possible for these functions to manipulate bits beyond the first256MB of a bytea value. However, it'd be good if they could do atleast that much, and not fall over entirely for longer bytea values.Adjust the comparisons to be done in int64 arithmetic so that works.Also tweak the error reports to show sane values in case of overflow.Also add some test cases to improve the miserable code coverageof these functions.Apply patch to back branches only; HEAD has a better solutionas of commit26a944c.Extracted from a much larger patch by Movead LiDiscussion:https://postgr.es/m/20200312115135445367128@highgo.ca1 parent41faafb commit5d79fc6
File tree
3 files changed
+105
-4
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+105
-4
lines changedLines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3081 | 3081 |
| |
3082 | 3082 |
| |
3083 | 3083 |
| |
3084 |
| - | |
| 3084 | + | |
| 3085 | + | |
3085 | 3086 |
| |
3086 | 3087 |
| |
3087 | 3088 |
| |
3088 |
| - | |
| 3089 | + | |
3089 | 3090 |
| |
3090 | 3091 |
| |
3091 | 3092 |
| |
| |||
3152 | 3153 |
| |
3153 | 3154 |
| |
3154 | 3155 |
| |
3155 |
| - | |
| 3156 | + | |
| 3157 | + | |
3156 | 3158 |
| |
3157 | 3159 |
| |
3158 | 3160 |
| |
3159 |
| - | |
| 3161 | + | |
3160 | 3162 |
| |
3161 | 3163 |
| |
3162 | 3164 |
| |
|
Lines changed: 76 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1509 | 1509 |
| |
1510 | 1510 |
| |
1511 | 1511 |
| |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
1512 | 1588 |
| |
1513 | 1589 |
| |
1514 | 1590 |
| |
|
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
526 | 526 |
| |
527 | 527 |
| |
528 | 528 |
| |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
529 | 552 |
| |
530 | 553 |
| |
531 | 554 |
| |
|
0 commit comments
Comments
(0)