SQLite

Check-in [c83052e48b]
Login

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

Overview
Comment:Fix an off-by-one assert() in the virtual table argument tokenizer.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c83052e48bbae0f45db2a44155b4e5482ee4a901
User & Date: drh 2015-04-19 23:11:10.399
Context
2015-04-20
01:13
Add an ALWAYS() around a new branch that was made unreachable by an even newer change. (check-in: 592c010478 user: drh tags: trunk)
2015-04-19
23:40
Merge updates from trunk. (check-in: 59d1a3bb60 user: mistachkin tags: vsix2015)
23:11
Fix an off-by-one assert() in the virtual table argument tokenizer. (check-in: c83052e48b user: drh tags: trunk)
22:41
Fix a broken assert() and comparison for INSERT INTO ... SELECT when the SELECT uses an unknown collating sequence. (check-in: e73ac0cbac user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vtab.c.
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
*/
void sqlite3VtabArgExtend(Parse *pParse, Token *p){
  Token *pArg = &pParse->sArg;
  if( pArg->z==0 ){
    pArg->z = p->z;
    pArg->n = p->n;
  }else{
    assert(pArg->z < p->z);
    pArg->n = (int)(&p->z[p->n] - pArg->z);
  }
}

/*
** Invoke a virtual table constructor (either xCreate or xConnect). The
** pointer to the function to invoke is passed as the fourth parameter







|







468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
*/
void sqlite3VtabArgExtend(Parse *pParse, Token *p){
  Token *pArg = &pParse->sArg;
  if( pArg->z==0 ){
    pArg->z = p->z;
    pArg->n = p->n;
  }else{
    assert(pArg->z <= p->z);
    pArg->n = (int)(&p->z[p->n] - pArg->z);
  }
}

/*
** Invoke a virtual table constructor (either xCreate or xConnect). The
** pointer to the function to invoke is passed as the fourth parameter