mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-21 05:46:59 +08:00
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.
This commit is contained in:
@ -301,7 +301,7 @@ SELECT 'Hawkeye' ILIKE 'h%' AS "true";
|
||||
SELECT 'Hawkeye' NOT ILIKE 'h%' AS "false";
|
||||
|
||||
--
|
||||
-- test %/_ combination cases, cf bug #4821
|
||||
-- test %/_ combination cases, cf bugs #4821 and #5478
|
||||
--
|
||||
|
||||
SELECT 'foo' LIKE '_%' as t, 'f' LIKE '_%' as t, '' LIKE '_%' as f;
|
||||
@ -310,6 +310,8 @@ SELECT 'foo' LIKE '%_' as t, 'f' LIKE '%_' as t, '' LIKE '%_' as f;
|
||||
SELECT 'foo' LIKE '__%' as t, 'foo' LIKE '___%' as t, 'foo' LIKE '____%' as f;
|
||||
SELECT 'foo' LIKE '%__' as t, 'foo' LIKE '%___' as t, 'foo' LIKE '%____' as f;
|
||||
|
||||
SELECT 'jack' LIKE '%____%' AS t;
|
||||
|
||||
|
||||
--
|
||||
-- test implicit type conversion
|
||||
|
||||
Reference in New Issue
Block a user