- Notifications
You must be signed in to change notification settings - Fork5
Commit6cfaffc
committed
Fix regexport.c to behave sanely with lookaround constraints.
regexport.c thought it could just ignore LACON arcs, but the correctbehavior is to treat them as satisfiable while consuming zero input(rather reminiscently of commit9f1e642). Otherwise, the emittedsimplified-NFA representation may contain no paths leading from initialto final state, which unsurprisingly confuses pg_trgm, as seen inbug #14623 from Jeff Janes.Since regexport's output representation has no concept of an arc thatconsumes zero input, recurse internally to find the next normal arc(s)after any LACON transitions. We'd be forced into changing thatrepresentation if a LACON could be the last arc reaching the finalstate, but fortunately the regex library never builds NFAs with sucha configuration, so there always is a next normal arc.Back-patch to 9.3 where this logic was introduced.Discussion:https://postgr.es/m/20170413180503.25948.94871@wrigleys.postgresql.org1 parent885fea5 commit6cfaffc
File tree
3 files changed
+80
-25
lines changed- contrib/pg_trgm
- expected
- sql
- src/backend/regex
3 files changed
+80
-25
lines changedLines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3684 | 3684 |
| |
3685 | 3685 |
| |
3686 | 3686 |
| |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
3687 | 3693 |
| |
3688 | 3694 |
| |
3689 | 3695 |
| |
| |||
3864 | 3870 |
| |
3865 | 3871 |
| |
3866 | 3872 |
| |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
3867 | 3879 |
| |
3868 | 3880 |
| |
3869 | 3881 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
86 | 86 |
| |
87 | 87 |
| |
88 | 88 |
| |
| 89 | + | |
89 | 90 |
| |
| 91 | + | |
90 | 92 |
| |
91 | 93 |
| |
92 | 94 |
| |
| |||
121 | 123 |
| |
122 | 124 |
| |
123 | 125 |
| |
| 126 | + | |
124 | 127 |
| |
125 | 128 |
| |
126 | 129 |
| |
|
Lines changed: 65 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
10 |
| - | |
| 9 | + | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
75 |
| - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
76 | 86 |
| |
77 |
| - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
78 | 132 |
| |
79 | 133 |
| |
80 | 134 |
| |
81 | 135 |
| |
82 | 136 |
| |
83 |
| - | |
84 |
| - | |
| 137 | + | |
85 | 138 |
| |
86 | 139 |
| |
87 | 140 |
| |
88 | 141 |
| |
89 | 142 |
| |
90 | 143 |
| |
91 |
| - | |
92 |
| - | |
93 |
| - | |
94 |
| - | |
95 |
| - | |
96 |
| - | |
97 |
| - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
98 | 147 |
| |
99 | 148 |
| |
100 | 149 |
| |
| |||
107 | 156 |
| |
108 | 157 |
| |
109 | 158 |
| |
110 |
| - | |
| 159 | + | |
111 | 160 |
| |
112 | 161 |
| |
113 | 162 |
| |
114 | 163 |
| |
115 | 164 |
| |
116 | 165 |
| |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 |
| - | |
121 |
| - | |
122 |
| - | |
123 |
| - | |
124 |
| - | |
125 |
| - | |
126 |
| - | |
127 |
| - | |
| 166 | + | |
| 167 | + | |
128 | 168 |
| |
129 | 169 |
| |
130 | 170 |
| |
|
0 commit comments
Comments
(0)