Rewrite LIKE's %-followed-by-_ optimization so it really works (this time
Tom Lane <tgl@sss.pgh.pa.us>
Rewrite LIKE's %-followed-by-_ optimization so it really works (this time for sure ;-)). It now also optimizes more cases, such as %_%_. Improve comments too. Per bug #5478. In passing, also rename the TCHAR macro to GETCHAR, because pgindent is messing with the formatting of the former (apparently it now thinks TCHAR is a typedef name). Back-patch to 8.3, where the bug was introduced.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/like_match.c | modified | +64 −68 |
| src/test/regress/expected/strings.out | modified | +7 −1 |
| src/test/regress/sql/strings.sql | modified | +3 −1 |