1
0
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:
drh
2017-06-29 01:23:12 +00:00
parent c080422642
commit 5aa307e2a6
3 changed files with 12 additions and 12 deletions

View File

@@ -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);