1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Chagnes the ESCAPE clause on the LIKE operator to overwrite wildcard

characters, in order ot match the behavior of PosgreSQL.

FossilOrigin-Name: 11e0844f71e8f2d27ce9363fb505e02fd7795c61dae0b3886cf0d8df4484dd97
This commit is contained in:
drh
2020-03-19 18:13:28 +00:00
parent f0a2172d1d
commit 589c787620
7 changed files with 74 additions and 27 deletions

View File

@ -143,7 +143,7 @@ static int icuLikeCompare(
** 3. uPattern is an unescaped escape character, or
** 4. uPattern is to be handled as an ordinary character
*/
if( !prevEscape && uPattern==MATCH_ALL ){
if( uPattern==MATCH_ALL && !prevEscape && uPattern!=(uint32_t)uEsc ){
/* Case 1. */
uint8_t c;
@ -169,12 +169,12 @@ static int icuLikeCompare(
}
return 0;
}else if( !prevEscape && uPattern==MATCH_ONE ){
}else if( uPattern==MATCH_ONE && !prevEscape && uPattern!=(uint32_t)uEsc ){
/* Case 2. */
if( *zString==0 ) return 0;
SQLITE_ICU_SKIP_UTF8(zString);
}else if( !prevEscape && uPattern==(uint32_t)uEsc){
}else if( uPattern==(uint32_t)uEsc && !prevEscape ){
/* Case 3. */
prevEscape = 1;