Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix another bug in sqlite_stat3 related code. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
bad9060b5b98f4af8f6e455d794b77e6 |
User & Date: | dan 2013-06-24 20:06:42.454 |
Context
2013-06-25
| ||
11:58 | Run test files analyze5.test, analyze6.test and analyze7.test as part of src4.test. check-in: 8eb90b6647 user: dan tags: trunk | |
2013-06-24
| ||
20:06 | Fix another bug in sqlite_stat3 related code. check-in: bad9060b5b user: dan tags: trunk | |
19:03 | Fixes for the sqlite_stat3 related ANALYZE functionality. check-in: f93e75f2b1 user: dan tags: trunk | |
Changes
Changes to src/analyze.c.
︙ | |||
442 443 444 445 446 447 448 449 450 451 452 453 454 455 | 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | + | int regNumDLt = iMem++; /* Number of distinct keys less than regSample */ int regSample = iMem++; /* The next sample value */ int regAccum = iMem++; /* Register to hold Stat3Accum object */ int regLoop = iMem++; /* Loop counter */ int regCount = iMem++; /* Number of rows in the table or index */ int regTemp1 = iMem++; /* Intermediate register */ int regTemp2 = iMem++; /* Intermediate register */ int regNewSample = iMem++; int once = 1; /* One-time initialization */ int iTabCur = pParse->nTab++; /* Table cursor */ int addrEq; #endif int regRec = iMem++; /* Register holding completed record */ int regTemp = iMem++; /* Temporary use register */ int regNewRowid = iMem++; /* Rowid for the inserted record */ |
︙ | |||
543 544 545 546 547 548 549 550 | 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 | + - + - - - - - + + + + + - - + + + + - + | */ regCnt = iMem; regPrev = iMem+1; aregCard = iMem+2; sqlite4VdbeAddOp2(v, OP_Integer, 0, regCnt); sqlite4VdbeAddOp2(v, OP_Null, 0, regPrev); sqlite4VdbeAddOp2(v, OP_Null, 0, regSample); for(i=0; i<nCol; i++){ |
︙ |
Changes to src/vdbe.c.
︙ | |||
3608 3609 3610 3611 3612 3613 3614 | 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 | - + | /* Opcode: AnalyzeKey P1 P2 P3 P4 ** ** P1 is an open cursor that currently points to a valid row. P2 is a ** register that contains either a NULL value, or an index key. If it is ** not NULL, this opcode compares the key in register P2 with the key of ** the row P1 currently points to and determines the number of fields in ** the prefix that the two keys share in common (which may be zero). |
︙ | |||
3647 3648 3649 3650 3651 3652 3653 | 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 | - + | if( pKey->flags & MEM_Blob ){ for(i=0; i<nNew && i<pKey->n && pNew[i]==(KVByteArray)pKey->z[i]; i++); /* The two keys share i bytes in common. Figure out how many fields ** this corresponds to. Store said value in variable nEq. */ sqlite4VdbeShortKey(pNew, i, LARGEST_INT32, &nEq); }else{ |
︙ |
Changes to test/analyze4.test.
︙ | |||
43 44 45 46 47 48 49 | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | - + - + - + | # Verify that the t1b index shows that it does not narrow down the # search any at all. # do_test analyze4-1.1 { db eval { SELECT idx, stat FROM sqlite_stat1 WHERE tbl='t1' ORDER BY idx; } |
︙ | |||
102 103 104 105 106 107 108 | 102 103 104 105 106 107 108 109 110 111 | - + | INSERT INTO t2 VALUES(5, 'aBc', 'aBc', 'aBc'); INSERT INTO t2 VALUES(6, 'aBC', 'aBC', 'aBC'); INSERT INTO t2 VALUES(7, 'aBc ', 'aBc ', 'aBc '); INSERT INTO t2 VALUES(8, 'aBC ', 'aBC ', 'aBC '); ANALYZE; SELECT idx, stat FROM sqlite_stat1 WHERE tbl='t2' ORDER BY idx; } |
Changes to test/permutations.test.
︙ | |||
137 138 139 140 141 142 143 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | - + | lsm1.test lsm2.test lsm3.test lsm4.test lsm5.test csr1.test ckpt1.test mc1.test fts5expr1.test fts5query1.test fts5rnd1.test fts5create.test fts5snippet.test |
︙ |