/ Check-in [cb3dec42]
Login

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

Overview
Comment:Fix a valgrind problem in fts3corrupt4.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cb3dec427e399064eeec31c15565346f045bd7c46d2f7860b1cd346bbcccb124
User & Date: dan 2019-07-05 15:16:22
Context
2019-07-08
12:01
Ensure collation sequences and affinities work in window function queries. Fix for [9ece23d2]. check-in: 28196d89 user: dan tags: trunk
2019-07-05
15:16
Fix a valgrind problem in fts3corrupt4.test. check-in: cb3dec42 user: dan tags: trunk
2019-07-04
19:19
As it requires wal mode support, do not run test file chunksize.test as part of the "journaltest" permutation. check-in: acd2df36 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3_write.c.

  4278   4278   
  4279   4279         for(i=nHeight+1; i<FTS_MAX_APPENDABLE_HEIGHT; i++){
  4280   4280           pWriter->aNodeWriter[i].iBlock = pWriter->iStart + i*pWriter->nLeafEst;
  4281   4281         }
  4282   4282   
  4283   4283         pNode = &pWriter->aNodeWriter[nHeight];
  4284   4284         pNode->iBlock = pWriter->iStart + pWriter->nLeafEst*nHeight;
  4285         -      blobGrowBuffer(&pNode->block, MAX(nRoot, p->nNodeSize), &rc);
         4285  +      blobGrowBuffer(&pNode->block, 
         4286  +          MAX(nRoot, p->nNodeSize)+FTS3_NODE_PADDING, &rc
         4287  +      );
  4286   4288         if( rc==SQLITE_OK ){
  4287   4289           memcpy(pNode->block.a, aRoot, nRoot);
  4288   4290           pNode->block.n = nRoot;
         4291  +        memset(&pNode->block.a[nRoot], 0, FTS3_NODE_PADDING);
  4289   4292         }
  4290   4293   
  4291   4294         for(i=nHeight; i>=0 && rc==SQLITE_OK; i--){
  4292   4295           NodeReader reader;
  4293   4296           pNode = &pWriter->aNodeWriter[i];
  4294   4297   
  4295   4298           rc = nodeReaderInit(&reader, pNode->block.a, pNode->block.n);
................................................................................
  4301   4304               pNode->key.n = reader.term.n;
  4302   4305               if( i>0 ){
  4303   4306                 char *aBlock = 0;
  4304   4307                 int nBlock = 0;
  4305   4308                 pNode = &pWriter->aNodeWriter[i-1];
  4306   4309                 pNode->iBlock = reader.iChild;
  4307   4310                 rc = sqlite3Fts3ReadBlock(p, reader.iChild, &aBlock, &nBlock, 0);
  4308         -              blobGrowBuffer(&pNode->block, MAX(nBlock, p->nNodeSize), &rc);
         4311  +              blobGrowBuffer(&pNode->block, 
         4312  +                  MAX(nBlock, p->nNodeSize)+FTS3_NODE_PADDING, &rc
         4313  +              );
  4309   4314                 if( rc==SQLITE_OK ){
  4310   4315                   memcpy(pNode->block.a, aBlock, nBlock);
  4311   4316                   pNode->block.n = nBlock;
         4317  +                memset(&pNode->block.a[nBlock], 0, FTS3_NODE_PADDING);
  4312   4318                 }
  4313   4319                 sqlite3_free(aBlock);
  4314   4320               }
  4315   4321             }
  4316   4322           }
  4317   4323           nodeReaderRelease(&reader);
  4318   4324         }