]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Generate complete samples for sqlite_stat4 on WITHOUT ROWID tables.
authordrh <drh@noemail.net>
Mon, 30 Jun 2014 13:32:39 +0000 (13:32 +0000)
committerdrh <drh@noemail.net>
Mon, 30 Jun 2014 13:32:39 +0000 (13:32 +0000)
Ticket [b2fa5424e6fcb15b5]

FossilOrigin-Name: 8cb43eddab83c68b2163441df70e0e9496d5fa33

manifest
manifest.uuid
src/analyze.c

index 5cda3a858e6374d9add16d39c03d206c2d57104f..cbc32f11a298b977dedf4b5ea362515c34d291fe 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\smakefile\stargets\sfor\svarious\sdiagnostic\stools,\ssuch\sas\sshowstat4.\nFix\sharmless\scompiler\swarnings\sin\sdiagnostic\stools.
-D 2014-06-30T11:14:26.241
+C Generate\scomplete\ssamples\sfor\ssqlite_stat4\son\sWITHOUT\sROWID\stables.\nTicket\s[b2fa5424e6fcb15b5]
+D 2014-06-30T13:32:39.153
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 1732320ecac3fee229d560d7ef2afa34681d1815
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -161,7 +161,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
 F sqlite3.1 3d8b83c91651f53472ca17599dae3457b8b89494
 F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
 F src/alter.c b00900877f766f116f9e16116f1ccacdc21d82f1
-F src/analyze.c e8c8a9d20beb2ad156321330e8f4fea002d8deee
+F src/analyze.c b53dddb5a1bc4c28877952cd9ea6943aea62215d
 F src/attach.c 3801129015ef59d76bf23c95ef9b0069d18a0c52
 F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
 F src/backup.c a729e63cf5cd1829507cb7b8e89f99b95141bb53
@@ -1181,7 +1181,10 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P fb32e374b75b160e7b535e732ced6c34dbb513eb
-R 46fc4bdeeae8d59d2e02be8ec2b2e5ac
+P 6f86d89b8800c50035da7809bff941d08a33a6a2
+R 63e5822670c3cf845c9d764a3e96a618
+T *branch * stat4-without-rowid
+T *sym-stat4-without-rowid *
+T -sym-trunk *
 U drh
-Z cf9f7f35abbae67619fbb464751389eb
+Z 2446f0a421b05370ddd23634c032efe0
index 2b01869e5656248a51b32a2556c9fb814cc7343c..3cbe4903ed1f66dcc487c991e142ab8fd96a7d9a 100644 (file)
@@ -1 +1 @@
-6f86d89b8800c50035da7809bff941d08a33a6a2
\ No newline at end of file
+8cb43eddab83c68b2163441df70e0e9496d5fa33
\ No newline at end of file
index 4dcd7e8b8ff48507eb56f89fc790c0dc49fadd73..e112239a7489b58dd794b6a748dfd62c8d9b7025 100644 (file)
@@ -1045,7 +1045,7 @@ static void analyzeOneTable(
     ** the regPrev array and a trailing rowid (the rowid slot is required
     ** when building a record to insert into the sample column of 
     ** the sqlite_stat4 table.  */
-    pParse->nMem = MAX(pParse->nMem, regPrev+nCol);
+    pParse->nMem = MAX(pParse->nMem, regPrev+pIdx->nColumn);
 
     /* Open a read-only cursor on the index being analyzed. */
     assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
@@ -1186,11 +1186,12 @@ static void analyzeOneTable(
       sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur, 
                                       pIdx->aiColumn[0], regSample);
 #else
-      for(i=0; i<nCol; i++){
+      i = HasRowid(pTab) ? nCol-1 : pIdx->nColumn-1;
+      for(; i>=0; i--){
         i16 iCol = pIdx->aiColumn[i];
         sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur, iCol, regCol+i);
       }
-      sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, nCol+1, regSample);
+      sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, pIdx->nColumn, regSample);
 #endif
       sqlite3VdbeAddOp3(v, OP_MakeRecord, regTabname, 6, regTemp);
       sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur+1, regNewRowid);