/ Check-in [d49c32e6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove a redundant parameter extraction call from the percentile.c extension.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:d49c32e6e7cc341b5961d2c7b7c68d1649c6542eeec201660e3f82a55aea9e3b
User & Date: drh 2019-03-02 12:17:35
Context
2019-03-02
15:25
Fix the SQLITE_DIRECT_OVERFLOW_READ compile-time option so that it works with SQLITE_HAS_CODEC. check-in: fd085e92 user: drh tags: trunk
12:17
Remove a redundant parameter extraction call from the percentile.c extension. check-in: d49c32e6 user: drh tags: trunk
2019-03-01
21:33
The fts3_tokenizer() function returns NULL if the SQLITE_DBCONFIG_ENABLE_FTS_TOKENIZER setting is disabled, which is is by default. check-in: f5732f4c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/percentile.c.

   104    104     int eType;
   105    105     double y;
   106    106     assert( argc==2 );
   107    107   
   108    108     /* Requirement 3:  P must be a number between 0 and 100 */
   109    109     eType = sqlite3_value_numeric_type(argv[1]);
   110    110     rPct = sqlite3_value_double(argv[1]);
   111         -  if( (eType!=SQLITE_INTEGER && eType!=SQLITE_FLOAT) ||
   112         -      ((rPct = sqlite3_value_double(argv[1]))<0.0 || rPct>100.0) ){
          111  +  if( (eType!=SQLITE_INTEGER && eType!=SQLITE_FLOAT)
          112  +   || rPct<0.0 || rPct>100.0 ){
   113    113       sqlite3_result_error(pCtx, "2nd argument to percentile() is not "
   114    114                            "a number between 0.0 and 100.0", -1);
   115    115       return;
   116    116     }
   117    117   
   118    118     /* Allocate the session context. */
   119    119     p = (Percentile*)sqlite3_aggregate_context(pCtx, sizeof(*p));