SQLite

Check-in [d49c32e6e7]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d49c32e6e7cc341b5961d2c7b7c68d1649c6542eeec201660e3f82a55aea9e3b
User & Date: drh 2019-03-02 12:17:35.599
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: fd085e9260 user: drh tags: trunk)
12:17
Remove a redundant parameter extraction call from the percentile.c extension. (check-in: d49c32e6e7 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: f5732f4caf user: drh tags: trunk)
Changes
Unified Diff Show Whitespace Changes Patch
Changes to ext/misc/percentile.c.
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
  int eType;
  double y;
  assert( argc==2 );

  /* Requirement 3:  P must be a number between 0 and 100 */
  eType = sqlite3_value_numeric_type(argv[1]);
  rPct = sqlite3_value_double(argv[1]);
  if( (eType!=SQLITE_INTEGER && eType!=SQLITE_FLOAT) ||
      ((rPct = sqlite3_value_double(argv[1]))<0.0 || rPct>100.0) ){
    sqlite3_result_error(pCtx, "2nd argument to percentile() is not "
                         "a number between 0.0 and 100.0", -1);
    return;
  }

  /* Allocate the session context. */
  p = (Percentile*)sqlite3_aggregate_context(pCtx, sizeof(*p));







|
|







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
  int eType;
  double y;
  assert( argc==2 );

  /* Requirement 3:  P must be a number between 0 and 100 */
  eType = sqlite3_value_numeric_type(argv[1]);
  rPct = sqlite3_value_double(argv[1]);
  if( (eType!=SQLITE_INTEGER && eType!=SQLITE_FLOAT)
   || rPct<0.0 || rPct>100.0 ){
    sqlite3_result_error(pCtx, "2nd argument to percentile() is not "
                         "a number between 0.0 and 100.0", -1);
    return;
  }

  /* Allocate the session context. */
  p = (Percentile*)sqlite3_aggregate_context(pCtx, sizeof(*p));