aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/delete.c8
-rw-r--r--src/sqliteInt.h1
-rw-r--r--src/test1.c1
3 files changed, 9 insertions, 1 deletions
diff --git a/src/delete.c b/src/delete.c
index e6038ddbb..6e45a2e7e 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -648,8 +648,14 @@ int sqlite3GenerateIndexKey(
}
}
if( doMakeRec ){
+ const char *zAff;
+ if( pTab->pSelect || (pParse->db->flags & SQLITE_IdxRealAsInt)!=0 ){
+ zAff = 0;
+ }else{
+ zAff = sqlite3IndexAffinityStr(v, pIdx);
+ }
sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase, nCol+1, regOut);
- sqlite3VdbeChangeP4(v, -1, sqlite3IndexAffinityStr(v, pIdx), P4_TRANSIENT);
+ sqlite3VdbeChangeP4(v, -1, zAff, P4_TRANSIENT);
}
sqlite3ReleaseTempRange(pParse, regBase, nCol+1);
return regBase;
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index c80b93564..aac0cdf3b 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -963,6 +963,7 @@ struct sqlite3 {
#define SQLITE_IndexCover 0x10 /* Disable index covering table */
#define SQLITE_GroupByOrder 0x20 /* Disable GROUPBY cover of ORDERBY */
#define SQLITE_FactorOutConst 0x40 /* Disable factoring out constants */
+#define SQLITE_IdxRealAsInt 0x80 /* Store REAL as INT in indices */
#define SQLITE_OptMask 0xff /* Mask of all disablable opts */
/*
diff --git a/src/test1.c b/src/test1.c
index acb6d67d7..7fdf54b12 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -5605,6 +5605,7 @@ static int optimization_control(
{ "index-cover", SQLITE_IndexCover },
{ "groupby-order", SQLITE_GroupByOrder },
{ "factor-constants", SQLITE_FactorOutConst },
+ { "real-as-int", SQLITE_IdxRealAsInt },
};
if( objc!=4 ){