From: drh Date: Tue, 27 Aug 2013 14:14:14 +0000 (+0000) Subject: In the ANALYZE command implementation make statInit() a 2-value function X-Git-Tag: version-3.8.1~131 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59b08dd449760338d04d19f6f34847e9a92b1bd8;p=thirdparty%2Fsqlite.git In the ANALYZE command implementation make statInit() a 2-value function since the 3rd parameter was always the same constant. FossilOrigin-Name: 959bb5acdc3b4e2b481e3c38f20867131bfc9dbc --- diff --git a/manifest b/manifest index 41b9caf087..c091ea3ce5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\sthe\sSTAT4\scapability\sinto\strunk. -D 2013-08-26T23:18:06.972 +C In\sthe\sANALYZE\scommand\simplementation\smake\sstatInit()\sa\s2-value\sfunction\nsince\sthe\s3rd\sparameter\swas\salways\sthe\ssame\sconstant. +D 2013-08-27T14:14:14.669 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -157,7 +157,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc F sqlite3.pc.in ae6f59a76e862f5c561eb32a380228a02afc3cad F src/alter.c 2af0330bb1b601af7a7789bf7229675fd772a083 -F src/analyze.c 10a4f1cda87aec6c56760c66e5feaaf1cdc9a641 +F src/analyze.c ce2a3385ac05f61e07d384b1c7e8c52e6ef1a3a6 F src/attach.c fea00cab11c854646a27641a263f5876569a51f9 F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34 F src/backup.c 2f1987981139bd2f6d8c728d64bf09fb387443c3 @@ -1107,7 +1107,7 @@ F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/wherecosttest.c f407dc4c79786982a475261866a161cd007947ae F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P edd5dbdc3239fc88799b822941603fcc828ecbb6 f86b75b6c7290ee6ddb3636090b00e99fc68c45e -R f565ac94f1ba86f7abdb8be442158ff1 +P a32af0abe5fa6d570604fa3534e8230d5b6042fc +R 5b1a9e2b24a504e796d0e448f0b689ac U drh -Z 3380b8636b10d59476656dd5f78e188d +Z 459d7705f4f327bb53f4cbbd349b98f8 diff --git a/manifest.uuid b/manifest.uuid index 877123ce44..08b8f406e7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a32af0abe5fa6d570604fa3534e8230d5b6042fc \ No newline at end of file +959bb5acdc3b4e2b481e3c38f20867131bfc9dbc \ No newline at end of file diff --git a/src/analyze.c b/src/analyze.c index e68070a112..d2fd3682ae 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -285,9 +285,9 @@ struct Stat4Accum { }; /* -** Implementation of the stat_init(C,N,S) SQL function. The three parameters -** are the number of rows in the table or index (C), the number of columns -** in the index (N) and the number of samples to accumulate (S). +** Implementation of the stat_init(C,N) SQL function. The two parameters +** are the number of rows in the table or index (C) and the number of columns +** in the index (N). ** ** This routine allocates the Stat4Accum object in heap memory. The return ** value is a pointer to the the Stat4Accum object encoded as a blob (i.e. @@ -309,7 +309,7 @@ static void statInit( /* Decode the three function arguments */ UNUSED_PARAMETER(argc); nRow = (tRowcnt)sqlite3_value_int64(argv[0]); - mxSample = sqlite3_value_int(argv[2]); + mxSample = SQLITE_STAT4_SAMPLES; nCol = sqlite3_value_int(argv[1]); assert( nCol>1 ); /* >1 because it includes the rowid column */ @@ -356,7 +356,7 @@ static void statInit( sqlite3_result_blob(context, p, sizeof(p), sqlite3_free); } static const FuncDef statInitFuncdef = { - 3, /* nArg */ + 2, /* nArg */ SQLITE_UTF8, /* iPrefEnc */ 0, /* flags */ 0, /* pUserData */ @@ -911,10 +911,9 @@ static void analyzeOneTable( */ sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regStat4+1); sqlite3VdbeAddOp2(v, OP_Integer, nCol+1, regStat4+2); - sqlite3VdbeAddOp2(v, OP_Integer, SQLITE_STAT4_SAMPLES, regStat4+3); sqlite3VdbeAddOp3(v, OP_Function, 0, regStat4+1, regStat4); sqlite3VdbeChangeP4(v, -1, (char*)&statInitFuncdef, P4_FUNCDEF); - sqlite3VdbeChangeP5(v, 3); + sqlite3VdbeChangeP5(v, 2); /* Implementation of the following: **