- Notifications
You must be signed in to change notification settings - Fork28
Commitfedc97c
committed
Remove ruleutils.c's special case for BIT [VARYING] literals.
Up to now, get_const_expr() insisted on prefixing BIT and VARBITliterals with 'B'. That's not really necessary, because we alwaysappend explicit-cast syntax to identify the constant's type.Moreover, it's subtly wrong for VARBIT, because the parser willinterpret B'...' as '...'::"bit"; see make_const() which explicitlyassigns type BITOID for a T_BitString literal. So what had beena simple VARBIT literal is reconstructed as ('...'::"bit")::varbit,which is not the same thing, at least not before constant folding.This results in odd differences after dump/restore, as complainedof by the patch submitter, and it could result in actual failures inpartitioning or inheritance DDL operations (see commit542320c,which repaired similar misbehaviors for some other data types).Fixing it is pretty easy: just remove the special case and let thedefault code path handle these types. We could have kept the specialcase for BIT only, but there seems little point in that.Like the previous patch, I judge that back-patching this into stablebranches wouldn't be a good idea. However, it seems not quite toolate for v11, so let's fix it there.Paul Guo, reviewed by Davy Machado and John Naylor, minor adjustmentsby meDiscussion:https://postgr.es/m/CABQrizdTra=2JEqA6+Ms1D1k1Kqw+aiBBhC9TreuZRX2JzxLAA@mail.gmail.com1 parent500d497 commitfedc97c
File tree
6 files changed
+41
-11
lines changed- contrib/btree_gist/expected
- src
- backend/utils/adt
- test/regress
- expected
- sql
6 files changed
+41
-11
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
72 |
| - | |
| 71 | + | |
| 72 | + | |
73 | 73 |
| |
74 |
| - | |
| 74 | + | |
75 | 75 |
| |
76 | 76 |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
72 |
| - | |
| 71 | + | |
| 72 | + | |
73 | 73 |
| |
74 |
| - | |
| 74 | + | |
75 | 75 |
| |
76 | 76 |
|
Lines changed: 0 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9490 | 9490 |
| |
9491 | 9491 |
| |
9492 | 9492 |
| |
9493 |
| - | |
9494 |
| - | |
9495 |
| - | |
9496 |
| - | |
9497 |
| - | |
9498 | 9493 |
| |
9499 | 9494 |
| |
9500 | 9495 |
| |
|
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
549 | 549 |
| |
550 | 550 |
| |
551 | 551 |
| |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + |
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| 22 | + | |
22 | 23 |
| |
23 | 24 |
| |
24 | 25 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
195 | 195 |
| |
196 | 196 |
| |
197 | 197 |
| |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + |
0 commit comments
Comments
(0)