1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-08 03:22:21 +03:00

Fix for ticket #107: Fix a design defect in indices that was causing queries

to fail when using an index on a column containing an empty string.  This
fix is an incompatible file-format change. (CVS 681)

FossilOrigin-Name: 20d152fcddb4fa53556a9c93c7a869600a7c5183
This commit is contained in:
drh
2002-07-18 00:34:09 +00:00
parent 53e3fc70bf
commit 491791a827
12 changed files with 206 additions and 71 deletions

View File

@@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
** $Id: expr.c,v 1.78 2002/07/16 02:05:44 drh Exp $
** $Id: expr.c,v 1.79 2002/07/18 00:34:12 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -999,7 +999,7 @@ void sqliteExprCode(Parse *pParse, Expr *pExpr){
case TK_GE:
case TK_NE:
case TK_EQ: {
if( pParse->db->file_format>=3 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){
if( pParse->db->file_format>=4 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){
op += 6; /* Convert numeric opcodes to text opcodes */
}
/* Fall through into the next case */
@@ -1232,7 +1232,7 @@ void sqliteExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
case TK_EQ: {
sqliteExprCode(pParse, pExpr->pLeft);
sqliteExprCode(pParse, pExpr->pRight);
if( pParse->db->file_format>=3 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){
if( pParse->db->file_format>=4 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){
op += 6; /* Convert numeric opcodes to text opcodes */
}
sqliteVdbeAddOp(v, op, jumpIfNull, dest);
@@ -1325,7 +1325,7 @@ void sqliteExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
case TK_GE:
case TK_NE:
case TK_EQ: {
if( pParse->db->file_format>=3 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){
if( pParse->db->file_format>=4 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){
op += 6; /* Convert numeric opcodes to text opcodes */
}
sqliteExprCode(pParse, pExpr->pLeft);