Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Remove incorrect ALWAYS() macros from the window function logic. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
94ac51cc4e7fdf484214e1936fc96104 |
User & Date: | drh 2018-07-10 23:31:17.172 |
Context
2018-07-11
| ||
03:27 | Adjustments to VdbeCoverage macros to deal with byte-code branches that can never be taken in some directions. (check-in: b170c0092b user: drh tags: trunk) | |
2018-07-10
| ||
23:31 | Remove incorrect ALWAYS() macros from the window function logic. (check-in: 94ac51cc4e user: drh tags: trunk) | |
22:24 | Add VdbeModuleComment()s on the three main code generators for window functions. (check-in: f7c239e959 user: drh tags: trunk) | |
Changes
Changes to src/window.c.
︙ | ︙ | |||
146 147 148 149 150 151 152 | */ static void row_numberStepFunc( sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ i64 *p = (i64*)sqlite3_aggregate_context(pCtx, sizeof(*p)); | < < | | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | */ static void row_numberStepFunc( sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ i64 *p = (i64*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ) (*p)++; UNUSED_PARAMETER(nArg); UNUSED_PARAMETER(apArg); } static void row_numberValueFunc(sqlite3_context *pCtx){ i64 *p = (i64*)sqlite3_aggregate_context(pCtx, sizeof(*p)); sqlite3_result_int64(pCtx, (p ? *p : 0)); } |
︙ | ︙ | |||
180 181 182 183 184 185 186 | static void dense_rankStepFunc( sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ struct CallCount *p; p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); | < | | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | static void dense_rankStepFunc( sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ struct CallCount *p; p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ) p->nStep = 1; UNUSED_PARAMETER(nArg); UNUSED_PARAMETER(apArg); } static void dense_rankValueFunc(sqlite3_context *pCtx){ struct CallCount *p; p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ){ |
︙ | ︙ | |||
210 211 212 213 214 215 216 | static void rankStepFunc( sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ struct CallCount *p; p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); | < | | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | static void rankStepFunc( sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ struct CallCount *p; p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ){ p->nStep++; if( p->nValue==0 ){ p->nValue = p->nStep; } } UNUSED_PARAMETER(nArg); UNUSED_PARAMETER(apArg); |
︙ | ︙ | |||
244 245 246 247 248 249 250 | int nArg, sqlite3_value **apArg ){ struct CallCount *p; UNUSED_PARAMETER(nArg); assert( nArg==1 ); p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); | < | | 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | int nArg, sqlite3_value **apArg ){ struct CallCount *p; UNUSED_PARAMETER(nArg); assert( nArg==1 ); p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ){ if( p->nTotal==0 ){ p->nTotal = sqlite3_value_int64(apArg[0]); } p->nStep++; if( p->nValue==0 ){ p->nValue = p->nStep; } |
︙ | ︙ | |||
284 285 286 287 288 289 290 | int nArg, sqlite3_value **apArg ){ struct CallCount *p; assert( nArg==1 ); UNUSED_PARAMETER(nArg); p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); | < | | 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | int nArg, sqlite3_value **apArg ){ struct CallCount *p; assert( nArg==1 ); UNUSED_PARAMETER(nArg); p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ){ if( p->nTotal==0 ){ p->nTotal = sqlite3_value_int64(apArg[0]); } p->nStep++; } } static void cume_distValueFunc(sqlite3_context *pCtx){ |
︙ | ︙ | |||
324 325 326 327 328 329 330 | sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ struct NtileCtx *p; assert( nArg==2 ); UNUSED_PARAMETER(nArg); p = (struct NtileCtx*)sqlite3_aggregate_context(pCtx, sizeof(*p)); | < | | 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ struct NtileCtx *p; assert( nArg==2 ); UNUSED_PARAMETER(nArg); p = (struct NtileCtx*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ){ if( p->nTotal==0 ){ p->nParam = sqlite3_value_int64(apArg[0]); p->nTotal = sqlite3_value_int64(apArg[1]); if( p->nParam<=0 ){ sqlite3_result_error( pCtx, "argument of ntile must be a positive integer", -1 ); |
︙ | ︙ |