mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Fix the exprCompareVariable() routine so that it works for non-UTF8 text.
FossilOrigin-Name: 25acd9658be792d686b3ebfaa8c3692f9830e043538ed0afecf97110a07758a4
This commit is contained in:
@@ -4683,8 +4683,11 @@ static int exprCompareVariable(Parse *pParse, Expr *pVar, Expr *pExpr){
|
||||
iVar = pVar->iColumn;
|
||||
sqlite3VdbeSetVarmask(pParse->pVdbe, iVar);
|
||||
pL = sqlite3VdbeGetBoundValue(pParse->pReprepare, iVar, SQLITE_AFF_BLOB);
|
||||
if( pL && 0==sqlite3MemCompare(pL, pR, 0) ){
|
||||
res = 1;
|
||||
if( pL ){
|
||||
if( sqlite3_value_type(pL)==SQLITE_TEXT ){
|
||||
sqlite3_value_text(pL); /* Make sure the encoding is UTF-8 */
|
||||
}
|
||||
res = 0==sqlite3MemCompare(pL, pR, 0);
|
||||
}
|
||||
sqlite3ValueFree(pR);
|
||||
sqlite3ValueFree(pL);
|
||||
|
||||
Reference in New Issue
Block a user