- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit6661030

Richard Guo
Fix Assert failure in XMLTABLE parser
In an XMLTABLE expression, columns can be marked NOT NULL, and theparser internally fabricates an option named "is_not_null" torepresent this. However, the parser also allows users to specifyarbitrary option names. This creates a conflict: a user canexplicitly use "is_not_null" as an option name and assign it anon-Boolean value, which violates internal assumptions and triggers anassertion failure.To fix, this patch checks whether a user-supplied name collides withthe internally reserved option name and raises an error if so.Additionally, the internal name is renamed to "__pg__is_not_null" tofurther reduce the risk of collision with user-defined names.Reported-by: Евгений Горбанев <gorbanyoves@basealt.ru>Author: Richard Guo <guofenglinux@gmail.com>Reviewed-by: Alvaro Herrera <alvherre@kurilemu.de>Discussion:https://postgr.es/m/6bac9886-65bf-4cec-96bd-e304159f28db@basealt.ruBackpatch-through: 151 parent7f1da18 commit6661030
5 files changed
+25
-4
lines changedLines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13820 | 13820 |
| |
13821 | 13821 |
| |
13822 | 13822 |
| |
13823 |
| - | |
| 13823 | + | |
13824 | 13824 |
| |
13825 | 13825 |
| |
13826 | 13826 |
| |
| |||
13863 | 13863 |
| |
13864 | 13864 |
| |
13865 | 13865 |
| |
13866 |
| - | |
| 13866 | + | |
| 13867 | + | |
| 13868 | + | |
| 13869 | + | |
| 13870 | + | |
| 13871 | + | |
| 13872 | + | |
| 13873 | + | |
13867 | 13874 |
| |
13868 | 13875 |
| |
13869 | 13876 |
| |
13870 |
| - | |
| 13877 | + | |
13871 | 13878 |
| |
13872 |
| - | |
| 13879 | + | |
13873 | 13880 |
| |
13874 | 13881 |
| |
13875 | 13882 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1139 | 1139 |
| |
1140 | 1140 |
| |
1141 | 1141 |
| |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
1142 | 1146 |
| |
1143 | 1147 |
| |
1144 | 1148 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
876 | 876 |
| |
877 | 877 |
| |
878 | 878 |
| |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
879 | 883 |
| |
880 | 884 |
| |
881 | 885 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1125 | 1125 |
| |
1126 | 1126 |
| |
1127 | 1127 |
| |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
1128 | 1132 |
| |
1129 | 1133 |
| |
1130 | 1134 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
387 | 387 |
| |
388 | 388 |
| |
389 | 389 |
| |
| 390 | + | |
| 391 | + | |
390 | 392 |
| |
391 | 393 |
| |
392 | 394 |
| |
|
0 commit comments
Comments
(0)