Fossil SCM

Update the built-in SQLite to include the latest last-minute patches for version 3.8.4.

drh 2014-03-06 15:02 trunk
Commit f00167e4e10009ea6c9bb8ab494a79b09449a35e
3 files changed +6 -3 +71 -16 +1 -1
+6 -3
--- src/shell.c
+++ src/shell.c
@@ -1182,10 +1182,11 @@
11821182
** itself by 2 spaces.
11831183
**
11841184
** * For each "Goto", if the jump destination is earlier in the program
11851185
** and ends on one of:
11861186
** Yield SeekGt SeekLt RowSetRead Rewind
1187
+** or if the P1 parameter is one instead of zero,
11871188
** then indent all opcodes between the earlier instruction
11881189
** and "Goto" by 2 spaces.
11891190
*/
11901191
static void explain_data_prepare(struct callback_data *p, sqlite3_stmt *pSql){
11911192
const char *zSql; /* The text of the SQL statement */
@@ -1229,11 +1230,13 @@
12291230
p->nIndent = iOp+1;
12301231
12311232
if( str_in_array(zOp, azNext) ){
12321233
for(i=p2op; i<iOp; i++) p->aiIndent[i] += 2;
12331234
}
1234
- if( str_in_array(zOp, azGoto) && p2op<p->nIndent && abYield[p2op] ){
1235
+ if( str_in_array(zOp, azGoto) && p2op<p->nIndent
1236
+ && (abYield[p2op] || sqlite3_column_int(pSql, 2))
1237
+ ){
12351238
for(i=p2op+1; i<iOp; i++) p->aiIndent[i] += 2;
12361239
}
12371240
}
12381241
12391242
p->iIndent = 0;
@@ -3815,12 +3818,12 @@
38153818
"Enter \".help\" for usage hints.\n",
38163819
sqlite3_libversion(), sqlite3_sourceid()
38173820
);
38183821
if( warnInmemoryDb ){
38193822
printf("Connected to a ");
3820
- printBold("transient in-memory database.");
3821
- printf("\nUse \".open FILENAME\" to reopen on a "
3823
+ printBold("transient in-memory database");
3824
+ printf(".\nUse \".open FILENAME\" to reopen on a "
38223825
"persistent database.\n");
38233826
}
38243827
zHome = find_home_dir();
38253828
if( zHome ){
38263829
nHistory = strlen30(zHome) + 20;
38273830
--- src/shell.c
+++ src/shell.c
@@ -1182,10 +1182,11 @@
1182 ** itself by 2 spaces.
1183 **
1184 ** * For each "Goto", if the jump destination is earlier in the program
1185 ** and ends on one of:
1186 ** Yield SeekGt SeekLt RowSetRead Rewind
 
1187 ** then indent all opcodes between the earlier instruction
1188 ** and "Goto" by 2 spaces.
1189 */
1190 static void explain_data_prepare(struct callback_data *p, sqlite3_stmt *pSql){
1191 const char *zSql; /* The text of the SQL statement */
@@ -1229,11 +1230,13 @@
1229 p->nIndent = iOp+1;
1230
1231 if( str_in_array(zOp, azNext) ){
1232 for(i=p2op; i<iOp; i++) p->aiIndent[i] += 2;
1233 }
1234 if( str_in_array(zOp, azGoto) && p2op<p->nIndent && abYield[p2op] ){
 
 
1235 for(i=p2op+1; i<iOp; i++) p->aiIndent[i] += 2;
1236 }
1237 }
1238
1239 p->iIndent = 0;
@@ -3815,12 +3818,12 @@
3815 "Enter \".help\" for usage hints.\n",
3816 sqlite3_libversion(), sqlite3_sourceid()
3817 );
3818 if( warnInmemoryDb ){
3819 printf("Connected to a ");
3820 printBold("transient in-memory database.");
3821 printf("\nUse \".open FILENAME\" to reopen on a "
3822 "persistent database.\n");
3823 }
3824 zHome = find_home_dir();
3825 if( zHome ){
3826 nHistory = strlen30(zHome) + 20;
3827
--- src/shell.c
+++ src/shell.c
@@ -1182,10 +1182,11 @@
1182 ** itself by 2 spaces.
1183 **
1184 ** * For each "Goto", if the jump destination is earlier in the program
1185 ** and ends on one of:
1186 ** Yield SeekGt SeekLt RowSetRead Rewind
1187 ** or if the P1 parameter is one instead of zero,
1188 ** then indent all opcodes between the earlier instruction
1189 ** and "Goto" by 2 spaces.
1190 */
1191 static void explain_data_prepare(struct callback_data *p, sqlite3_stmt *pSql){
1192 const char *zSql; /* The text of the SQL statement */
@@ -1229,11 +1230,13 @@
1230 p->nIndent = iOp+1;
1231
1232 if( str_in_array(zOp, azNext) ){
1233 for(i=p2op; i<iOp; i++) p->aiIndent[i] += 2;
1234 }
1235 if( str_in_array(zOp, azGoto) && p2op<p->nIndent
1236 && (abYield[p2op] || sqlite3_column_int(pSql, 2))
1237 ){
1238 for(i=p2op+1; i<iOp; i++) p->aiIndent[i] += 2;
1239 }
1240 }
1241
1242 p->iIndent = 0;
@@ -3815,12 +3818,12 @@
3818 "Enter \".help\" for usage hints.\n",
3819 sqlite3_libversion(), sqlite3_sourceid()
3820 );
3821 if( warnInmemoryDb ){
3822 printf("Connected to a ");
3823 printBold("transient in-memory database");
3824 printf(".\nUse \".open FILENAME\" to reopen on a "
3825 "persistent database.\n");
3826 }
3827 zHome = find_home_dir();
3828 if( zHome ){
3829 nHistory = strlen30(zHome) + 20;
3830
+71 -16
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -222,11 +222,11 @@
222222
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
223223
** [sqlite_version()] and [sqlite_source_id()].
224224
*/
225225
#define SQLITE_VERSION "3.8.4"
226226
#define SQLITE_VERSION_NUMBER 3008004
227
-#define SQLITE_SOURCE_ID "2014-03-05 19:04:46 0723effc9ccae7c660fb847b36ce9324e0cb5042"
227
+#define SQLITE_SOURCE_ID "2014-03-06 13:38:37 0a4200f95cf46ad620b9fd91f4444114a0c74730"
228228
229229
/*
230230
** CAPI3REF: Run-Time Library Version Numbers
231231
** KEYWORDS: sqlite3_version, sqlite3_sourceid
232232
**
@@ -36484,12 +36484,29 @@
3648436484
** Interfaces for opening a shared library, finding entry points
3648536485
** within the shared library, and closing the shared library.
3648636486
*/
3648736487
static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
3648836488
HANDLE h;
36489
+#if defined(__CYGWIN__)
36490
+ int nFull = pVfs->mxPathname+1;
36491
+ char *zFull = sqlite3MallocZero( nFull );
36492
+ void *zConverted = 0;
36493
+ if( zFull==0 ){
36494
+ OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0));
36495
+ return 0;
36496
+ }
36497
+ if( winFullPathname(pVfs, zFilename, nFull, zFull)!=SQLITE_OK ){
36498
+ sqlite3_free(zFull);
36499
+ OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0));
36500
+ return 0;
36501
+ }
36502
+ zConverted = winConvertFromUtf8Filename(zFull);
36503
+ sqlite3_free(zFull);
36504
+#else
3648936505
void *zConverted = winConvertFromUtf8Filename(zFilename);
3649036506
UNUSED_PARAMETER(pVfs);
36507
+#endif
3649136508
if( zConverted==0 ){
3649236509
OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0));
3649336510
return 0;
3649436511
}
3649536512
if( osIsNT() ){
@@ -55371,11 +55388,11 @@
5537155388
assert( pIdxKey->default_rc==1
5537255389
|| pIdxKey->default_rc==0
5537355390
|| pIdxKey->default_rc==-1
5537455391
);
5537555392
}else{
55376
- xRecordCompare = 0; /* Not actually used. Avoids a compiler warning. */
55393
+ xRecordCompare = 0; /* All keys are integers */
5537755394
}
5537855395
5537955396
rc = moveToRoot(pCur);
5538055397
if( rc ){
5538155398
return rc;
@@ -62561,10 +62578,14 @@
6256162578
** sqlite3MemRelease() were called from here. With -O2, this jumps
6256262579
** to 6.6 percent. The test case is inserting 1000 rows into a table
6256362580
** with no indexes using a single prepared INSERT statement, bind()
6256462581
** and reset(). Inserts are grouped into a transaction.
6256562582
*/
62583
+ testcase( p->flags & MEM_Agg );
62584
+ testcase( p->flags & MEM_Dyn );
62585
+ testcase( p->flags & MEM_Frame );
62586
+ testcase( p->flags & MEM_RowSet );
6256662587
if( p->flags&(MEM_Agg|MEM_Dyn|MEM_Frame|MEM_RowSet) ){
6256762588
sqlite3VdbeMemRelease(p);
6256862589
}else if( p->zMalloc ){
6256962590
sqlite3DbFree(db, p->zMalloc);
6257062591
p->zMalloc = 0;
@@ -64289,31 +64310,36 @@
6428964310
break;
6429064311
}
6429164312
case 1: { /* 1-byte signed integer */
6429264313
pMem->u.i = ONE_BYTE_INT(buf);
6429364314
pMem->flags = MEM_Int;
64315
+ testcase( pMem->u.i<0 );
6429464316
return 1;
6429564317
}
6429664318
case 2: { /* 2-byte signed integer */
6429764319
pMem->u.i = TWO_BYTE_INT(buf);
6429864320
pMem->flags = MEM_Int;
64321
+ testcase( pMem->u.i<0 );
6429964322
return 2;
6430064323
}
6430164324
case 3: { /* 3-byte signed integer */
6430264325
pMem->u.i = THREE_BYTE_INT(buf);
6430364326
pMem->flags = MEM_Int;
64327
+ testcase( pMem->u.i<0 );
6430464328
return 3;
6430564329
}
6430664330
case 4: { /* 4-byte signed integer */
6430764331
y = FOUR_BYTE_UINT(buf);
6430864332
pMem->u.i = (i64)*(int*)&y;
6430964333
pMem->flags = MEM_Int;
64334
+ testcase( pMem->u.i<0 );
6431064335
return 4;
6431164336
}
6431264337
case 5: { /* 6-byte signed integer */
6431364338
pMem->u.i = FOUR_BYTE_UINT(buf+2) + (((i64)1)<<32)*TWO_BYTE_INT(buf);
6431464339
pMem->flags = MEM_Int;
64340
+ testcase( pMem->u.i<0 );
6431564341
return 6;
6431664342
}
6431764343
case 6: /* 8-byte signed integer */
6431864344
case 7: { /* IEEE floating point */
6431964345
#if !defined(NDEBUG) && !defined(SQLITE_OMIT_FLOATING_POINT)
@@ -64332,10 +64358,11 @@
6433264358
y = FOUR_BYTE_UINT(buf+4);
6433364359
x = (x<<32) | y;
6433464360
if( serial_type==6 ){
6433564361
pMem->u.i = *(i64*)&x;
6433664362
pMem->flags = MEM_Int;
64363
+ testcase( pMem->u.i<0 );
6433764364
}else{
6433864365
assert( sizeof(x)==8 && sizeof(pMem->r)==8 );
6433964366
swapMixedEndianFloat(x);
6434064367
memcpy(&pMem->r, &x, sizeof(x));
6434164368
pMem->flags = sqlite3IsNaN(pMem->r) ? MEM_Null : MEM_Real;
@@ -64677,24 +64704,30 @@
6467764704
u32 y;
6467864705
assert( CORRUPT_DB || (serial_type>=1 && serial_type<=9 && serial_type!=7) );
6467964706
switch( serial_type ){
6468064707
case 0:
6468164708
case 1:
64709
+ testcase( aKey[0]&0x80 );
6468264710
return ONE_BYTE_INT(aKey);
6468364711
case 2:
64712
+ testcase( aKey[0]&0x80 );
6468464713
return TWO_BYTE_INT(aKey);
6468564714
case 3:
64715
+ testcase( aKey[0]&0x80 );
6468664716
return THREE_BYTE_INT(aKey);
6468764717
case 4: {
64718
+ testcase( aKey[0]&0x80 );
6468864719
y = FOUR_BYTE_UINT(aKey);
6468964720
return (i64)*(int*)&y;
6469064721
}
6469164722
case 5: {
64723
+ testcase( aKey[0]&0x80 );
6469264724
return FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
6469364725
}
6469464726
case 6: {
6469564727
u64 x = FOUR_BYTE_UINT(aKey);
64728
+ testcase( aKey[0]&0x80 );
6469664729
x = (x<<32) | FOUR_BYTE_UINT(aKey+4);
6469764730
return (i64)*(i64*)&x;
6469864731
}
6469964732
}
6470064733
@@ -64758,10 +64791,11 @@
6475864791
u32 serial_type;
6475964792
6476064793
/* RHS is an integer */
6476164794
if( pRhs->flags & MEM_Int ){
6476264795
serial_type = aKey1[idx1];
64796
+ testcase( serial_type==12 );
6476364797
if( serial_type>=12 ){
6476464798
rc = +1;
6476564799
}else if( serial_type==0 ){
6476664800
rc = -1;
6476764801
}else if( serial_type==7 ){
@@ -64808,16 +64842,19 @@
6480864842
}
6480964843
6481064844
/* RHS is a string */
6481164845
else if( pRhs->flags & MEM_Str ){
6481264846
getVarint32(&aKey1[idx1], serial_type);
64847
+ testcase( serial_type==12 );
6481364848
if( serial_type<12 ){
6481464849
rc = -1;
6481564850
}else if( !(serial_type & 0x01) ){
6481664851
rc = +1;
6481764852
}else{
6481864853
mem1.n = (serial_type - 12) / 2;
64854
+ testcase( (d1+mem1.n)==(unsigned)nKey1 );
64855
+ testcase( (d1+mem1.n+1)==(unsigned)nKey1 );
6481964856
if( (d1+mem1.n) > (unsigned)nKey1 ){
6482064857
rc = 1; /* Corruption */
6482164858
}else if( pKeyInfo->aColl[i] ){
6482264859
mem1.enc = pKeyInfo->enc;
6482364860
mem1.db = pKeyInfo->db;
@@ -64833,14 +64870,17 @@
6483364870
}
6483464871
6483564872
/* RHS is a blob */
6483664873
else if( pRhs->flags & MEM_Blob ){
6483764874
getVarint32(&aKey1[idx1], serial_type);
64875
+ testcase( serial_type==12 );
6483864876
if( serial_type<12 || (serial_type & 0x01) ){
6483964877
rc = -1;
6484064878
}else{
6484164879
int nStr = (serial_type - 12) / 2;
64880
+ testcase( (d1+nStr)==(unsigned)nKey1 );
64881
+ testcase( (d1+nStr+1)==(unsigned)nKey1 );
6484264882
if( (d1+nStr) > (unsigned)nKey1 ){
6484364883
rc = 1; /* Corruption */
6484464884
}else{
6484564885
int nCmp = MIN(nStr, pRhs->n);
6484664886
rc = memcmp(&aKey1[d1], pRhs->z, nCmp);
@@ -64910,33 +64950,39 @@
6491064950
6491164951
assert( bSkip==0 );
6491264952
switch( serial_type ){
6491364953
case 1: { /* 1-byte signed integer */
6491464954
lhs = ONE_BYTE_INT(aKey);
64955
+ testcase( lhs<0 );
6491564956
break;
6491664957
}
6491764958
case 2: { /* 2-byte signed integer */
6491864959
lhs = TWO_BYTE_INT(aKey);
64960
+ testcase( lhs<0 );
6491964961
break;
6492064962
}
6492164963
case 3: { /* 3-byte signed integer */
6492264964
lhs = THREE_BYTE_INT(aKey);
64965
+ testcase( lhs<0 );
6492364966
break;
6492464967
}
6492564968
case 4: { /* 4-byte signed integer */
6492664969
y = FOUR_BYTE_UINT(aKey);
6492764970
lhs = (i64)*(int*)&y;
64971
+ testcase( lhs<0 );
6492864972
break;
6492964973
}
6493064974
case 5: { /* 6-byte signed integer */
6493164975
lhs = FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
64976
+ testcase( lhs<0 );
6493264977
break;
6493364978
}
6493464979
case 6: { /* 8-byte signed integer */
6493564980
x = FOUR_BYTE_UINT(aKey);
6493664981
x = (x<<32) | FOUR_BYTE_UINT(aKey+4);
6493764982
lhs = *(i64*)&x;
64983
+ testcase( lhs<0 );
6493864984
break;
6493964985
}
6494064986
case 8:
6494164987
lhs = 0;
6494264988
break;
@@ -65069,13 +65115,15 @@
6506965115
p->r2 = 1;
6507065116
}
6507165117
if( (flags & MEM_Int) ){
6507265118
return vdbeRecordCompareInt;
6507365119
}
65074
- if( (flags & (MEM_Int|MEM_Real|MEM_Null|MEM_Blob))==0
65075
- && p->pKeyInfo->aColl[0]==0
65076
- ){
65120
+ testcase( flags & MEM_Real );
65121
+ testcase( flags & MEM_Null );
65122
+ testcase( flags & MEM_Blob );
65123
+ if( (flags & (MEM_Real|MEM_Null|MEM_Blob))==0 && p->pKeyInfo->aColl[0]==0 ){
65124
+ assert( flags & MEM_Str );
6507765125
return vdbeRecordCompareString;
6507865126
}
6507965127
}
6508065128
6508165129
return sqlite3VdbeRecordCompare;
@@ -66978,11 +67026,11 @@
6697867026
** value of the cell. This macro verifies that shallow copies are
6697967027
** not misused. A shallow copy of a string or blob just copies a
6698067028
** pointer to the string or blob, not the content. If the original
6698167029
** is changed while the copy is still in use, the string or blob might
6698267030
** be changed out from under the copy. This macro verifies that nothing
66983
-** like that every happens.
67031
+** like that ever happens.
6698467032
*/
6698567033
#ifdef SQLITE_DEBUG
6698667034
# define memAboutToChange(P,M) sqlite3VdbeMemAboutToChange(P,M)
6698767035
#else
6698867036
# define memAboutToChange(P,M)
@@ -67710,10 +67758,15 @@
6771067758
**
6771167759
** An unconditional jump to address P2.
6771267760
** The next instruction executed will be
6771367761
** the one at index P2 from the beginning of
6771467762
** the program.
67763
+**
67764
+** The P1 parameter is not actually used by this opcode. However, it
67765
+** is sometimes set to 1 instead of 0 as a hint to the command-line shell
67766
+** that this Goto is the bottom of a loop and that the lines from P2 down
67767
+** to the current line should be indented for EXPLAIN output.
6771567768
*/
6771667769
case OP_Goto: { /* jump */
6771767770
pc = pOp->p2 - 1;
6771867771
6771967772
/* Opcodes that are used as the bottom of a loop (OP_Next, OP_Prev,
@@ -69205,12 +69258,12 @@
6920569258
6920669259
/* Opcode: Once P1 P2 * * *
6920769260
**
6920869261
** Check if OP_Once flag P1 is set. If so, jump to instruction P2. Otherwise,
6920969262
** set the flag and fall through to the next instruction. In other words,
69210
-** this opcode causes all following up codes up through P2 (but not including
69211
-** P2) to run just once and skipped on subsequent times through the loop.
69263
+** this opcode causes all following opcodes up through P2 (but not including
69264
+** P2) to run just once and to be skipped on subsequent times through the loop.
6921269265
*/
6921369266
case OP_Once: { /* jump */
6921469267
assert( pOp->p1<p->nOnceFlag );
6921569268
VdbeBranchTaken(p->aOnceFlag[pOp->p1]!=0, 2);
6921669269
if( p->aOnceFlag[pOp->p1] ){
@@ -83299,11 +83352,14 @@
8329983352
VdbeCoverage(v);
8330083353
callStatGet(v, regStat4, STAT_GET_NEQ, regEq);
8330183354
callStatGet(v, regStat4, STAT_GET_NLT, regLt);
8330283355
callStatGet(v, regStat4, STAT_GET_NDLT, regDLt);
8330383356
sqlite3VdbeAddOp4Int(v, seekOp, iTabCur, addrNext, regSampleRowid, 0);
83304
- VdbeCoverage(v);
83357
+ /* We know that the regSampleRowid row exists because it was read by
83358
+ ** the previous loop. Thus the not-found jump of seekOp will never
83359
+ ** be taken */
83360
+ VdbeCoverageNeverTaken(v);
8330583361
#ifdef SQLITE_ENABLE_STAT3
8330683362
sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur,
8330783363
pIdx->aiColumn[0], regSample);
8330883364
#else
8330983365
for(i=0; i<nCol; i++){
@@ -83313,11 +83369,11 @@
8331383369
sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, nCol+1, regSample);
8331483370
#endif
8331583371
sqlite3VdbeAddOp3(v, OP_MakeRecord, regTabname, 6, regTemp);
8331683372
sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur+1, regNewRowid);
8331783373
sqlite3VdbeAddOp3(v, OP_Insert, iStatCur+1, regTemp, regNewRowid);
83318
- sqlite3VdbeAddOp2(v, OP_Goto, 0, addrNext);
83374
+ sqlite3VdbeAddOp2(v, OP_Goto, 1, addrNext); /* P1==1 for end-of-loop */
8331983375
sqlite3VdbeJumpHere(v, addrIsNull);
8332083376
}
8332183377
#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
8332283378
8332383379
/* End of analysis */
@@ -93479,17 +93535,17 @@
9347993535
9348093536
/*
9348193537
** Compute the affinity string for table pTab, if it has not already been
9348293538
** computed. As an optimization, omit trailing SQLITE_AFF_NONE affinities.
9348393539
**
93484
-** If the affinity exists (if it is no entirely SQLITE_AFF_NONE values and
93540
+** If the affinity exists (if it is no entirely SQLITE_AFF_NONE values) and
9348593541
** if iReg>0 then code an OP_Affinity opcode that will set the affinities
9348693542
** for register iReg and following. Or if affinities exists and iReg==0,
9348793543
** then just set the P4 operand of the previous opcode (which should be
9348893544
** an OP_MakeRecord) to the affinity string.
9348993545
**
93490
-** A column affinity string has one character column:
93546
+** A column affinity string has one character per column:
9349193547
**
9349293548
** Character Column affinity
9349393549
** ------------------------------
9349493550
** 'a' TEXT
9349593551
** 'b' NONE
@@ -93526,14 +93582,13 @@
9352693582
}
9352793583
}
9352893584
9352993585
/*
9353093586
** Return non-zero if the table pTab in database iDb or any of its indices
93531
-** have been opened at any point in the VDBE program beginning at location
93532
-** iStartAddr throught the end of the program. This is used to see if
93587
+** have been opened at any point in the VDBE program. This is used to see if
9353393588
** a statement of the form "INSERT INTO <iDb, pTab> SELECT ..." can
93534
-** run without using temporary table for the results of the SELECT.
93589
+** run without using a temporary table for the results of the SELECT.
9353593590
*/
9353693591
static int readsTable(Parse *p, int iDb, Table *pTab){
9353793592
Vdbe *v = sqlite3GetVdbe(p);
9353893593
int i;
9353993594
int iEnd = sqlite3VdbeCurrentAddr(v);
@@ -112384,17 +112439,17 @@
112384112439
}
112385112440
if( pLoop->wsFlags & WHERE_TOP_LIMIT ){
112386112441
pRangeEnd = pLoop->aLTerm[j++];
112387112442
nExtraReg = 1;
112388112443
if( pRangeStart==0
112389
- && (pRangeEnd->wtFlags & TERM_VNULL)==0
112390112444
&& (j = pIdx->aiColumn[nEq])>=0
112391112445
&& pIdx->pTable->aCol[j].notNull==0
112392112446
){
112393112447
bSeekPastNull = 1;
112394112448
}
112395112449
}
112450
+ assert( pRangeEnd==0 || (pRangeEnd->wtFlags & TERM_VNULL)==0 );
112396112451
112397112452
/* Generate code to evaluate all constraint terms using == or IN
112398112453
** and store the values of those terms in an array of registers
112399112454
** starting at regBase.
112400112455
*/
112401112456
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -222,11 +222,11 @@
222 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
223 ** [sqlite_version()] and [sqlite_source_id()].
224 */
225 #define SQLITE_VERSION "3.8.4"
226 #define SQLITE_VERSION_NUMBER 3008004
227 #define SQLITE_SOURCE_ID "2014-03-05 19:04:46 0723effc9ccae7c660fb847b36ce9324e0cb5042"
228
229 /*
230 ** CAPI3REF: Run-Time Library Version Numbers
231 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
232 **
@@ -36484,12 +36484,29 @@
36484 ** Interfaces for opening a shared library, finding entry points
36485 ** within the shared library, and closing the shared library.
36486 */
36487 static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
36488 HANDLE h;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36489 void *zConverted = winConvertFromUtf8Filename(zFilename);
36490 UNUSED_PARAMETER(pVfs);
 
36491 if( zConverted==0 ){
36492 OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0));
36493 return 0;
36494 }
36495 if( osIsNT() ){
@@ -55371,11 +55388,11 @@
55371 assert( pIdxKey->default_rc==1
55372 || pIdxKey->default_rc==0
55373 || pIdxKey->default_rc==-1
55374 );
55375 }else{
55376 xRecordCompare = 0; /* Not actually used. Avoids a compiler warning. */
55377 }
55378
55379 rc = moveToRoot(pCur);
55380 if( rc ){
55381 return rc;
@@ -62561,10 +62578,14 @@
62561 ** sqlite3MemRelease() were called from here. With -O2, this jumps
62562 ** to 6.6 percent. The test case is inserting 1000 rows into a table
62563 ** with no indexes using a single prepared INSERT statement, bind()
62564 ** and reset(). Inserts are grouped into a transaction.
62565 */
 
 
 
 
62566 if( p->flags&(MEM_Agg|MEM_Dyn|MEM_Frame|MEM_RowSet) ){
62567 sqlite3VdbeMemRelease(p);
62568 }else if( p->zMalloc ){
62569 sqlite3DbFree(db, p->zMalloc);
62570 p->zMalloc = 0;
@@ -64289,31 +64310,36 @@
64289 break;
64290 }
64291 case 1: { /* 1-byte signed integer */
64292 pMem->u.i = ONE_BYTE_INT(buf);
64293 pMem->flags = MEM_Int;
 
64294 return 1;
64295 }
64296 case 2: { /* 2-byte signed integer */
64297 pMem->u.i = TWO_BYTE_INT(buf);
64298 pMem->flags = MEM_Int;
 
64299 return 2;
64300 }
64301 case 3: { /* 3-byte signed integer */
64302 pMem->u.i = THREE_BYTE_INT(buf);
64303 pMem->flags = MEM_Int;
 
64304 return 3;
64305 }
64306 case 4: { /* 4-byte signed integer */
64307 y = FOUR_BYTE_UINT(buf);
64308 pMem->u.i = (i64)*(int*)&y;
64309 pMem->flags = MEM_Int;
 
64310 return 4;
64311 }
64312 case 5: { /* 6-byte signed integer */
64313 pMem->u.i = FOUR_BYTE_UINT(buf+2) + (((i64)1)<<32)*TWO_BYTE_INT(buf);
64314 pMem->flags = MEM_Int;
 
64315 return 6;
64316 }
64317 case 6: /* 8-byte signed integer */
64318 case 7: { /* IEEE floating point */
64319 #if !defined(NDEBUG) && !defined(SQLITE_OMIT_FLOATING_POINT)
@@ -64332,10 +64358,11 @@
64332 y = FOUR_BYTE_UINT(buf+4);
64333 x = (x<<32) | y;
64334 if( serial_type==6 ){
64335 pMem->u.i = *(i64*)&x;
64336 pMem->flags = MEM_Int;
 
64337 }else{
64338 assert( sizeof(x)==8 && sizeof(pMem->r)==8 );
64339 swapMixedEndianFloat(x);
64340 memcpy(&pMem->r, &x, sizeof(x));
64341 pMem->flags = sqlite3IsNaN(pMem->r) ? MEM_Null : MEM_Real;
@@ -64677,24 +64704,30 @@
64677 u32 y;
64678 assert( CORRUPT_DB || (serial_type>=1 && serial_type<=9 && serial_type!=7) );
64679 switch( serial_type ){
64680 case 0:
64681 case 1:
 
64682 return ONE_BYTE_INT(aKey);
64683 case 2:
 
64684 return TWO_BYTE_INT(aKey);
64685 case 3:
 
64686 return THREE_BYTE_INT(aKey);
64687 case 4: {
 
64688 y = FOUR_BYTE_UINT(aKey);
64689 return (i64)*(int*)&y;
64690 }
64691 case 5: {
 
64692 return FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
64693 }
64694 case 6: {
64695 u64 x = FOUR_BYTE_UINT(aKey);
 
64696 x = (x<<32) | FOUR_BYTE_UINT(aKey+4);
64697 return (i64)*(i64*)&x;
64698 }
64699 }
64700
@@ -64758,10 +64791,11 @@
64758 u32 serial_type;
64759
64760 /* RHS is an integer */
64761 if( pRhs->flags & MEM_Int ){
64762 serial_type = aKey1[idx1];
 
64763 if( serial_type>=12 ){
64764 rc = +1;
64765 }else if( serial_type==0 ){
64766 rc = -1;
64767 }else if( serial_type==7 ){
@@ -64808,16 +64842,19 @@
64808 }
64809
64810 /* RHS is a string */
64811 else if( pRhs->flags & MEM_Str ){
64812 getVarint32(&aKey1[idx1], serial_type);
 
64813 if( serial_type<12 ){
64814 rc = -1;
64815 }else if( !(serial_type & 0x01) ){
64816 rc = +1;
64817 }else{
64818 mem1.n = (serial_type - 12) / 2;
 
 
64819 if( (d1+mem1.n) > (unsigned)nKey1 ){
64820 rc = 1; /* Corruption */
64821 }else if( pKeyInfo->aColl[i] ){
64822 mem1.enc = pKeyInfo->enc;
64823 mem1.db = pKeyInfo->db;
@@ -64833,14 +64870,17 @@
64833 }
64834
64835 /* RHS is a blob */
64836 else if( pRhs->flags & MEM_Blob ){
64837 getVarint32(&aKey1[idx1], serial_type);
 
64838 if( serial_type<12 || (serial_type & 0x01) ){
64839 rc = -1;
64840 }else{
64841 int nStr = (serial_type - 12) / 2;
 
 
64842 if( (d1+nStr) > (unsigned)nKey1 ){
64843 rc = 1; /* Corruption */
64844 }else{
64845 int nCmp = MIN(nStr, pRhs->n);
64846 rc = memcmp(&aKey1[d1], pRhs->z, nCmp);
@@ -64910,33 +64950,39 @@
64910
64911 assert( bSkip==0 );
64912 switch( serial_type ){
64913 case 1: { /* 1-byte signed integer */
64914 lhs = ONE_BYTE_INT(aKey);
 
64915 break;
64916 }
64917 case 2: { /* 2-byte signed integer */
64918 lhs = TWO_BYTE_INT(aKey);
 
64919 break;
64920 }
64921 case 3: { /* 3-byte signed integer */
64922 lhs = THREE_BYTE_INT(aKey);
 
64923 break;
64924 }
64925 case 4: { /* 4-byte signed integer */
64926 y = FOUR_BYTE_UINT(aKey);
64927 lhs = (i64)*(int*)&y;
 
64928 break;
64929 }
64930 case 5: { /* 6-byte signed integer */
64931 lhs = FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
 
64932 break;
64933 }
64934 case 6: { /* 8-byte signed integer */
64935 x = FOUR_BYTE_UINT(aKey);
64936 x = (x<<32) | FOUR_BYTE_UINT(aKey+4);
64937 lhs = *(i64*)&x;
 
64938 break;
64939 }
64940 case 8:
64941 lhs = 0;
64942 break;
@@ -65069,13 +65115,15 @@
65069 p->r2 = 1;
65070 }
65071 if( (flags & MEM_Int) ){
65072 return vdbeRecordCompareInt;
65073 }
65074 if( (flags & (MEM_Int|MEM_Real|MEM_Null|MEM_Blob))==0
65075 && p->pKeyInfo->aColl[0]==0
65076 ){
 
 
65077 return vdbeRecordCompareString;
65078 }
65079 }
65080
65081 return sqlite3VdbeRecordCompare;
@@ -66978,11 +67026,11 @@
66978 ** value of the cell. This macro verifies that shallow copies are
66979 ** not misused. A shallow copy of a string or blob just copies a
66980 ** pointer to the string or blob, not the content. If the original
66981 ** is changed while the copy is still in use, the string or blob might
66982 ** be changed out from under the copy. This macro verifies that nothing
66983 ** like that every happens.
66984 */
66985 #ifdef SQLITE_DEBUG
66986 # define memAboutToChange(P,M) sqlite3VdbeMemAboutToChange(P,M)
66987 #else
66988 # define memAboutToChange(P,M)
@@ -67710,10 +67758,15 @@
67710 **
67711 ** An unconditional jump to address P2.
67712 ** The next instruction executed will be
67713 ** the one at index P2 from the beginning of
67714 ** the program.
 
 
 
 
 
67715 */
67716 case OP_Goto: { /* jump */
67717 pc = pOp->p2 - 1;
67718
67719 /* Opcodes that are used as the bottom of a loop (OP_Next, OP_Prev,
@@ -69205,12 +69258,12 @@
69205
69206 /* Opcode: Once P1 P2 * * *
69207 **
69208 ** Check if OP_Once flag P1 is set. If so, jump to instruction P2. Otherwise,
69209 ** set the flag and fall through to the next instruction. In other words,
69210 ** this opcode causes all following up codes up through P2 (but not including
69211 ** P2) to run just once and skipped on subsequent times through the loop.
69212 */
69213 case OP_Once: { /* jump */
69214 assert( pOp->p1<p->nOnceFlag );
69215 VdbeBranchTaken(p->aOnceFlag[pOp->p1]!=0, 2);
69216 if( p->aOnceFlag[pOp->p1] ){
@@ -83299,11 +83352,14 @@
83299 VdbeCoverage(v);
83300 callStatGet(v, regStat4, STAT_GET_NEQ, regEq);
83301 callStatGet(v, regStat4, STAT_GET_NLT, regLt);
83302 callStatGet(v, regStat4, STAT_GET_NDLT, regDLt);
83303 sqlite3VdbeAddOp4Int(v, seekOp, iTabCur, addrNext, regSampleRowid, 0);
83304 VdbeCoverage(v);
 
 
 
83305 #ifdef SQLITE_ENABLE_STAT3
83306 sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur,
83307 pIdx->aiColumn[0], regSample);
83308 #else
83309 for(i=0; i<nCol; i++){
@@ -83313,11 +83369,11 @@
83313 sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, nCol+1, regSample);
83314 #endif
83315 sqlite3VdbeAddOp3(v, OP_MakeRecord, regTabname, 6, regTemp);
83316 sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur+1, regNewRowid);
83317 sqlite3VdbeAddOp3(v, OP_Insert, iStatCur+1, regTemp, regNewRowid);
83318 sqlite3VdbeAddOp2(v, OP_Goto, 0, addrNext);
83319 sqlite3VdbeJumpHere(v, addrIsNull);
83320 }
83321 #endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
83322
83323 /* End of analysis */
@@ -93479,17 +93535,17 @@
93479
93480 /*
93481 ** Compute the affinity string for table pTab, if it has not already been
93482 ** computed. As an optimization, omit trailing SQLITE_AFF_NONE affinities.
93483 **
93484 ** If the affinity exists (if it is no entirely SQLITE_AFF_NONE values and
93485 ** if iReg>0 then code an OP_Affinity opcode that will set the affinities
93486 ** for register iReg and following. Or if affinities exists and iReg==0,
93487 ** then just set the P4 operand of the previous opcode (which should be
93488 ** an OP_MakeRecord) to the affinity string.
93489 **
93490 ** A column affinity string has one character column:
93491 **
93492 ** Character Column affinity
93493 ** ------------------------------
93494 ** 'a' TEXT
93495 ** 'b' NONE
@@ -93526,14 +93582,13 @@
93526 }
93527 }
93528
93529 /*
93530 ** Return non-zero if the table pTab in database iDb or any of its indices
93531 ** have been opened at any point in the VDBE program beginning at location
93532 ** iStartAddr throught the end of the program. This is used to see if
93533 ** a statement of the form "INSERT INTO <iDb, pTab> SELECT ..." can
93534 ** run without using temporary table for the results of the SELECT.
93535 */
93536 static int readsTable(Parse *p, int iDb, Table *pTab){
93537 Vdbe *v = sqlite3GetVdbe(p);
93538 int i;
93539 int iEnd = sqlite3VdbeCurrentAddr(v);
@@ -112384,17 +112439,17 @@
112384 }
112385 if( pLoop->wsFlags & WHERE_TOP_LIMIT ){
112386 pRangeEnd = pLoop->aLTerm[j++];
112387 nExtraReg = 1;
112388 if( pRangeStart==0
112389 && (pRangeEnd->wtFlags & TERM_VNULL)==0
112390 && (j = pIdx->aiColumn[nEq])>=0
112391 && pIdx->pTable->aCol[j].notNull==0
112392 ){
112393 bSeekPastNull = 1;
112394 }
112395 }
 
112396
112397 /* Generate code to evaluate all constraint terms using == or IN
112398 ** and store the values of those terms in an array of registers
112399 ** starting at regBase.
112400 */
112401
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -222,11 +222,11 @@
222 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
223 ** [sqlite_version()] and [sqlite_source_id()].
224 */
225 #define SQLITE_VERSION "3.8.4"
226 #define SQLITE_VERSION_NUMBER 3008004
227 #define SQLITE_SOURCE_ID "2014-03-06 13:38:37 0a4200f95cf46ad620b9fd91f4444114a0c74730"
228
229 /*
230 ** CAPI3REF: Run-Time Library Version Numbers
231 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
232 **
@@ -36484,12 +36484,29 @@
36484 ** Interfaces for opening a shared library, finding entry points
36485 ** within the shared library, and closing the shared library.
36486 */
36487 static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
36488 HANDLE h;
36489 #if defined(__CYGWIN__)
36490 int nFull = pVfs->mxPathname+1;
36491 char *zFull = sqlite3MallocZero( nFull );
36492 void *zConverted = 0;
36493 if( zFull==0 ){
36494 OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0));
36495 return 0;
36496 }
36497 if( winFullPathname(pVfs, zFilename, nFull, zFull)!=SQLITE_OK ){
36498 sqlite3_free(zFull);
36499 OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0));
36500 return 0;
36501 }
36502 zConverted = winConvertFromUtf8Filename(zFull);
36503 sqlite3_free(zFull);
36504 #else
36505 void *zConverted = winConvertFromUtf8Filename(zFilename);
36506 UNUSED_PARAMETER(pVfs);
36507 #endif
36508 if( zConverted==0 ){
36509 OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0));
36510 return 0;
36511 }
36512 if( osIsNT() ){
@@ -55371,11 +55388,11 @@
55388 assert( pIdxKey->default_rc==1
55389 || pIdxKey->default_rc==0
55390 || pIdxKey->default_rc==-1
55391 );
55392 }else{
55393 xRecordCompare = 0; /* All keys are integers */
55394 }
55395
55396 rc = moveToRoot(pCur);
55397 if( rc ){
55398 return rc;
@@ -62561,10 +62578,14 @@
62578 ** sqlite3MemRelease() were called from here. With -O2, this jumps
62579 ** to 6.6 percent. The test case is inserting 1000 rows into a table
62580 ** with no indexes using a single prepared INSERT statement, bind()
62581 ** and reset(). Inserts are grouped into a transaction.
62582 */
62583 testcase( p->flags & MEM_Agg );
62584 testcase( p->flags & MEM_Dyn );
62585 testcase( p->flags & MEM_Frame );
62586 testcase( p->flags & MEM_RowSet );
62587 if( p->flags&(MEM_Agg|MEM_Dyn|MEM_Frame|MEM_RowSet) ){
62588 sqlite3VdbeMemRelease(p);
62589 }else if( p->zMalloc ){
62590 sqlite3DbFree(db, p->zMalloc);
62591 p->zMalloc = 0;
@@ -64289,31 +64310,36 @@
64310 break;
64311 }
64312 case 1: { /* 1-byte signed integer */
64313 pMem->u.i = ONE_BYTE_INT(buf);
64314 pMem->flags = MEM_Int;
64315 testcase( pMem->u.i<0 );
64316 return 1;
64317 }
64318 case 2: { /* 2-byte signed integer */
64319 pMem->u.i = TWO_BYTE_INT(buf);
64320 pMem->flags = MEM_Int;
64321 testcase( pMem->u.i<0 );
64322 return 2;
64323 }
64324 case 3: { /* 3-byte signed integer */
64325 pMem->u.i = THREE_BYTE_INT(buf);
64326 pMem->flags = MEM_Int;
64327 testcase( pMem->u.i<0 );
64328 return 3;
64329 }
64330 case 4: { /* 4-byte signed integer */
64331 y = FOUR_BYTE_UINT(buf);
64332 pMem->u.i = (i64)*(int*)&y;
64333 pMem->flags = MEM_Int;
64334 testcase( pMem->u.i<0 );
64335 return 4;
64336 }
64337 case 5: { /* 6-byte signed integer */
64338 pMem->u.i = FOUR_BYTE_UINT(buf+2) + (((i64)1)<<32)*TWO_BYTE_INT(buf);
64339 pMem->flags = MEM_Int;
64340 testcase( pMem->u.i<0 );
64341 return 6;
64342 }
64343 case 6: /* 8-byte signed integer */
64344 case 7: { /* IEEE floating point */
64345 #if !defined(NDEBUG) && !defined(SQLITE_OMIT_FLOATING_POINT)
@@ -64332,10 +64358,11 @@
64358 y = FOUR_BYTE_UINT(buf+4);
64359 x = (x<<32) | y;
64360 if( serial_type==6 ){
64361 pMem->u.i = *(i64*)&x;
64362 pMem->flags = MEM_Int;
64363 testcase( pMem->u.i<0 );
64364 }else{
64365 assert( sizeof(x)==8 && sizeof(pMem->r)==8 );
64366 swapMixedEndianFloat(x);
64367 memcpy(&pMem->r, &x, sizeof(x));
64368 pMem->flags = sqlite3IsNaN(pMem->r) ? MEM_Null : MEM_Real;
@@ -64677,24 +64704,30 @@
64704 u32 y;
64705 assert( CORRUPT_DB || (serial_type>=1 && serial_type<=9 && serial_type!=7) );
64706 switch( serial_type ){
64707 case 0:
64708 case 1:
64709 testcase( aKey[0]&0x80 );
64710 return ONE_BYTE_INT(aKey);
64711 case 2:
64712 testcase( aKey[0]&0x80 );
64713 return TWO_BYTE_INT(aKey);
64714 case 3:
64715 testcase( aKey[0]&0x80 );
64716 return THREE_BYTE_INT(aKey);
64717 case 4: {
64718 testcase( aKey[0]&0x80 );
64719 y = FOUR_BYTE_UINT(aKey);
64720 return (i64)*(int*)&y;
64721 }
64722 case 5: {
64723 testcase( aKey[0]&0x80 );
64724 return FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
64725 }
64726 case 6: {
64727 u64 x = FOUR_BYTE_UINT(aKey);
64728 testcase( aKey[0]&0x80 );
64729 x = (x<<32) | FOUR_BYTE_UINT(aKey+4);
64730 return (i64)*(i64*)&x;
64731 }
64732 }
64733
@@ -64758,10 +64791,11 @@
64791 u32 serial_type;
64792
64793 /* RHS is an integer */
64794 if( pRhs->flags & MEM_Int ){
64795 serial_type = aKey1[idx1];
64796 testcase( serial_type==12 );
64797 if( serial_type>=12 ){
64798 rc = +1;
64799 }else if( serial_type==0 ){
64800 rc = -1;
64801 }else if( serial_type==7 ){
@@ -64808,16 +64842,19 @@
64842 }
64843
64844 /* RHS is a string */
64845 else if( pRhs->flags & MEM_Str ){
64846 getVarint32(&aKey1[idx1], serial_type);
64847 testcase( serial_type==12 );
64848 if( serial_type<12 ){
64849 rc = -1;
64850 }else if( !(serial_type & 0x01) ){
64851 rc = +1;
64852 }else{
64853 mem1.n = (serial_type - 12) / 2;
64854 testcase( (d1+mem1.n)==(unsigned)nKey1 );
64855 testcase( (d1+mem1.n+1)==(unsigned)nKey1 );
64856 if( (d1+mem1.n) > (unsigned)nKey1 ){
64857 rc = 1; /* Corruption */
64858 }else if( pKeyInfo->aColl[i] ){
64859 mem1.enc = pKeyInfo->enc;
64860 mem1.db = pKeyInfo->db;
@@ -64833,14 +64870,17 @@
64870 }
64871
64872 /* RHS is a blob */
64873 else if( pRhs->flags & MEM_Blob ){
64874 getVarint32(&aKey1[idx1], serial_type);
64875 testcase( serial_type==12 );
64876 if( serial_type<12 || (serial_type & 0x01) ){
64877 rc = -1;
64878 }else{
64879 int nStr = (serial_type - 12) / 2;
64880 testcase( (d1+nStr)==(unsigned)nKey1 );
64881 testcase( (d1+nStr+1)==(unsigned)nKey1 );
64882 if( (d1+nStr) > (unsigned)nKey1 ){
64883 rc = 1; /* Corruption */
64884 }else{
64885 int nCmp = MIN(nStr, pRhs->n);
64886 rc = memcmp(&aKey1[d1], pRhs->z, nCmp);
@@ -64910,33 +64950,39 @@
64950
64951 assert( bSkip==0 );
64952 switch( serial_type ){
64953 case 1: { /* 1-byte signed integer */
64954 lhs = ONE_BYTE_INT(aKey);
64955 testcase( lhs<0 );
64956 break;
64957 }
64958 case 2: { /* 2-byte signed integer */
64959 lhs = TWO_BYTE_INT(aKey);
64960 testcase( lhs<0 );
64961 break;
64962 }
64963 case 3: { /* 3-byte signed integer */
64964 lhs = THREE_BYTE_INT(aKey);
64965 testcase( lhs<0 );
64966 break;
64967 }
64968 case 4: { /* 4-byte signed integer */
64969 y = FOUR_BYTE_UINT(aKey);
64970 lhs = (i64)*(int*)&y;
64971 testcase( lhs<0 );
64972 break;
64973 }
64974 case 5: { /* 6-byte signed integer */
64975 lhs = FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
64976 testcase( lhs<0 );
64977 break;
64978 }
64979 case 6: { /* 8-byte signed integer */
64980 x = FOUR_BYTE_UINT(aKey);
64981 x = (x<<32) | FOUR_BYTE_UINT(aKey+4);
64982 lhs = *(i64*)&x;
64983 testcase( lhs<0 );
64984 break;
64985 }
64986 case 8:
64987 lhs = 0;
64988 break;
@@ -65069,13 +65115,15 @@
65115 p->r2 = 1;
65116 }
65117 if( (flags & MEM_Int) ){
65118 return vdbeRecordCompareInt;
65119 }
65120 testcase( flags & MEM_Real );
65121 testcase( flags & MEM_Null );
65122 testcase( flags & MEM_Blob );
65123 if( (flags & (MEM_Real|MEM_Null|MEM_Blob))==0 && p->pKeyInfo->aColl[0]==0 ){
65124 assert( flags & MEM_Str );
65125 return vdbeRecordCompareString;
65126 }
65127 }
65128
65129 return sqlite3VdbeRecordCompare;
@@ -66978,11 +67026,11 @@
67026 ** value of the cell. This macro verifies that shallow copies are
67027 ** not misused. A shallow copy of a string or blob just copies a
67028 ** pointer to the string or blob, not the content. If the original
67029 ** is changed while the copy is still in use, the string or blob might
67030 ** be changed out from under the copy. This macro verifies that nothing
67031 ** like that ever happens.
67032 */
67033 #ifdef SQLITE_DEBUG
67034 # define memAboutToChange(P,M) sqlite3VdbeMemAboutToChange(P,M)
67035 #else
67036 # define memAboutToChange(P,M)
@@ -67710,10 +67758,15 @@
67758 **
67759 ** An unconditional jump to address P2.
67760 ** The next instruction executed will be
67761 ** the one at index P2 from the beginning of
67762 ** the program.
67763 **
67764 ** The P1 parameter is not actually used by this opcode. However, it
67765 ** is sometimes set to 1 instead of 0 as a hint to the command-line shell
67766 ** that this Goto is the bottom of a loop and that the lines from P2 down
67767 ** to the current line should be indented for EXPLAIN output.
67768 */
67769 case OP_Goto: { /* jump */
67770 pc = pOp->p2 - 1;
67771
67772 /* Opcodes that are used as the bottom of a loop (OP_Next, OP_Prev,
@@ -69205,12 +69258,12 @@
69258
69259 /* Opcode: Once P1 P2 * * *
69260 **
69261 ** Check if OP_Once flag P1 is set. If so, jump to instruction P2. Otherwise,
69262 ** set the flag and fall through to the next instruction. In other words,
69263 ** this opcode causes all following opcodes up through P2 (but not including
69264 ** P2) to run just once and to be skipped on subsequent times through the loop.
69265 */
69266 case OP_Once: { /* jump */
69267 assert( pOp->p1<p->nOnceFlag );
69268 VdbeBranchTaken(p->aOnceFlag[pOp->p1]!=0, 2);
69269 if( p->aOnceFlag[pOp->p1] ){
@@ -83299,11 +83352,14 @@
83352 VdbeCoverage(v);
83353 callStatGet(v, regStat4, STAT_GET_NEQ, regEq);
83354 callStatGet(v, regStat4, STAT_GET_NLT, regLt);
83355 callStatGet(v, regStat4, STAT_GET_NDLT, regDLt);
83356 sqlite3VdbeAddOp4Int(v, seekOp, iTabCur, addrNext, regSampleRowid, 0);
83357 /* We know that the regSampleRowid row exists because it was read by
83358 ** the previous loop. Thus the not-found jump of seekOp will never
83359 ** be taken */
83360 VdbeCoverageNeverTaken(v);
83361 #ifdef SQLITE_ENABLE_STAT3
83362 sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur,
83363 pIdx->aiColumn[0], regSample);
83364 #else
83365 for(i=0; i<nCol; i++){
@@ -83313,11 +83369,11 @@
83369 sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, nCol+1, regSample);
83370 #endif
83371 sqlite3VdbeAddOp3(v, OP_MakeRecord, regTabname, 6, regTemp);
83372 sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur+1, regNewRowid);
83373 sqlite3VdbeAddOp3(v, OP_Insert, iStatCur+1, regTemp, regNewRowid);
83374 sqlite3VdbeAddOp2(v, OP_Goto, 1, addrNext); /* P1==1 for end-of-loop */
83375 sqlite3VdbeJumpHere(v, addrIsNull);
83376 }
83377 #endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
83378
83379 /* End of analysis */
@@ -93479,17 +93535,17 @@
93535
93536 /*
93537 ** Compute the affinity string for table pTab, if it has not already been
93538 ** computed. As an optimization, omit trailing SQLITE_AFF_NONE affinities.
93539 **
93540 ** If the affinity exists (if it is no entirely SQLITE_AFF_NONE values) and
93541 ** if iReg>0 then code an OP_Affinity opcode that will set the affinities
93542 ** for register iReg and following. Or if affinities exists and iReg==0,
93543 ** then just set the P4 operand of the previous opcode (which should be
93544 ** an OP_MakeRecord) to the affinity string.
93545 **
93546 ** A column affinity string has one character per column:
93547 **
93548 ** Character Column affinity
93549 ** ------------------------------
93550 ** 'a' TEXT
93551 ** 'b' NONE
@@ -93526,14 +93582,13 @@
93582 }
93583 }
93584
93585 /*
93586 ** Return non-zero if the table pTab in database iDb or any of its indices
93587 ** have been opened at any point in the VDBE program. This is used to see if
 
93588 ** a statement of the form "INSERT INTO <iDb, pTab> SELECT ..." can
93589 ** run without using a temporary table for the results of the SELECT.
93590 */
93591 static int readsTable(Parse *p, int iDb, Table *pTab){
93592 Vdbe *v = sqlite3GetVdbe(p);
93593 int i;
93594 int iEnd = sqlite3VdbeCurrentAddr(v);
@@ -112384,17 +112439,17 @@
112439 }
112440 if( pLoop->wsFlags & WHERE_TOP_LIMIT ){
112441 pRangeEnd = pLoop->aLTerm[j++];
112442 nExtraReg = 1;
112443 if( pRangeStart==0
 
112444 && (j = pIdx->aiColumn[nEq])>=0
112445 && pIdx->pTable->aCol[j].notNull==0
112446 ){
112447 bSeekPastNull = 1;
112448 }
112449 }
112450 assert( pRangeEnd==0 || (pRangeEnd->wtFlags & TERM_VNULL)==0 );
112451
112452 /* Generate code to evaluate all constraint terms using == or IN
112453 ** and store the values of those terms in an array of registers
112454 ** starting at regBase.
112455 */
112456
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107107
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108108
** [sqlite_version()] and [sqlite_source_id()].
109109
*/
110110
#define SQLITE_VERSION "3.8.4"
111111
#define SQLITE_VERSION_NUMBER 3008004
112
-#define SQLITE_SOURCE_ID "2014-03-05 19:04:46 0723effc9ccae7c660fb847b36ce9324e0cb5042"
112
+#define SQLITE_SOURCE_ID "2014-03-06 13:38:37 0a4200f95cf46ad620b9fd91f4444114a0c74730"
113113
114114
/*
115115
** CAPI3REF: Run-Time Library Version Numbers
116116
** KEYWORDS: sqlite3_version, sqlite3_sourceid
117117
**
118118
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.8.4"
111 #define SQLITE_VERSION_NUMBER 3008004
112 #define SQLITE_SOURCE_ID "2014-03-05 19:04:46 0723effc9ccae7c660fb847b36ce9324e0cb5042"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
118
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.8.4"
111 #define SQLITE_VERSION_NUMBER 3008004
112 #define SQLITE_SOURCE_ID "2014-03-06 13:38:37 0a4200f95cf46ad620b9fd91f4444114a0c74730"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
118

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button