Fix LIKE's special-case code for % followed by _. I'm not entirely sure that
Tom Lane <tgl@sss.pgh.pa.us>
Fix LIKE's special-case code for % followed by _. I'm not entirely sure that this case is worth a special code path, but a special code path that gets the boundary condition wrong is definitely no good. Per bug #4821 from Andrew Gierth. In passing, clean up some minor code formatting issues (excess parentheses and blank lines in odd places). Back-patch to 8.3, where the bug was introduced.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/like_match.c | modified | +58 −62 |
| src/test/regress/expected/strings.out | modified | +27 −0 |
| src/test/regress/sql/strings.sql | modified | +11 −0 |