forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd01f03a
committed
Preserve integer and float values accurately in (de)serialize_deflist.
Previously, this code just smashed all types of DefElem values tostrings, cavalierly reasoning that nobody would care. But in point offact, most of the defGetFoo functions do distinguish among differentinput syntaxes; for instance defGetBoolean will accept 1 as an integerbut not "1" as a string. This led to CREATE/ALTER TEXT SEARCHDICTIONARY accepting 0 and 1 as values for boolean dictionaryproperties, only to have the dictionary fail at runtime.We can upgrade this behavior by teaching serialize_deflist that itdoes not need to quote T_Integer or T_Float nodes' values on output,and then teaching deserialize_deflist to restore unquoted integer orfloat values as the appropriate node type. This should not breakanything using pg_ts_dict.dictinitoption, since that field is justdefined as being something valid to include in CREATE TEXT SEARCHDICTIONARY.deserialize_deflist is also used to parse the options argumentsfor the ts_headline family of functions, but so far as I can seethis won't cause any problems there either: the only consumer ofthat output is prsd_headline which always uses defGetString.(Really that's a bad idea, but I won't risk changing it here.)This is surely a bug fix, but given the lack of field complaintsI don't think it's necessary to back-patch.Discussion:https://postgr.es/m/CAMkU=1xRcs_BUPzR0+V3WndaCAv0E_m3h6aUEJ8NF-sY1nnHsw@mail.gmail.com1 parent40b3e2c commitd01f03a
File tree
5 files changed
+154
-23
lines changed- contrib/dict_int
- expected
- sql
- src
- backend/commands
- test/regress
- expected
- sql
5 files changed
+154
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
305 | 307 | | |
306 | 308 | | |
307 | 309 | | |
| |||
327 | 329 | | |
328 | 330 | | |
329 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
1519 | 1522 | | |
1520 | 1523 | | |
1521 | 1524 | | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | 1525 | | |
1526 | 1526 | | |
1527 | 1527 | | |
| |||
1539 | 1539 | | |
1540 | 1540 | | |
1541 | 1541 | | |
1542 | | - | |
1543 | | - | |
1544 | | - | |
1545 | | - | |
1546 | | - | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
1547 | 1551 | | |
1548 | | - | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
1549 | 1559 | | |
1550 | | - | |
| 1560 | + | |
| 1561 | + | |
1551 | 1562 | | |
1552 | | - | |
| 1563 | + | |
| 1564 | + | |
1553 | 1565 | | |
1554 | | - | |
1555 | 1566 | | |
1556 | 1567 | | |
1557 | 1568 | | |
| |||
1566 | 1577 | | |
1567 | 1578 | | |
1568 | 1579 | | |
1569 | | - | |
| 1580 | + | |
1570 | 1581 | | |
1571 | 1582 | | |
1572 | 1583 | | |
| |||
1694 | 1705 | | |
1695 | 1706 | | |
1696 | 1707 | | |
1697 | | - | |
1698 | | - | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
1699 | 1711 | | |
1700 | 1712 | | |
1701 | 1713 | | |
| |||
1726 | 1738 | | |
1727 | 1739 | | |
1728 | 1740 | | |
1729 | | - | |
1730 | | - | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
1731 | 1744 | | |
1732 | 1745 | | |
1733 | 1746 | | |
| |||
1741 | 1754 | | |
1742 | 1755 | | |
1743 | 1756 | | |
1744 | | - | |
1745 | | - | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
1746 | 1760 | | |
1747 | 1761 | | |
1748 | 1762 | | |
| |||
1760 | 1774 | | |
1761 | 1775 | | |
1762 | 1776 | | |
1763 | | - | |
1764 | | - | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
1765 | 1780 | | |
1766 | 1781 | | |
1767 | 1782 | | |
| |||
1773 | 1788 | | |
1774 | 1789 | | |
1775 | 1790 | | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
473 | 508 | | |
474 | 509 | | |
475 | 510 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
151 | 164 | | |
152 | 165 | | |
153 | 166 | | |
| |||
0 commit comments
Comments
(0)