Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Merge in support for the index_xinfo pragma. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | ota-update |
Files: | files | file ages | folders |
SHA1: |
f9b6dc77021ee421bffd5697d5d337d3 |
User & Date: | drh 2015-01-31 02:34:23.039 |
Context
2015-01-31
| ||
20:42 | Have ota use imposter tables to write to indexes instead of the sqlite3_index_writer() interface. The error handling in this version is broken in a few small ways. (check-in: cdaeab467f user: dan tags: ota-update) | |
02:34 | Merge in support for the index_xinfo pragma. (check-in: f9b6dc7702 user: drh tags: ota-update) | |
02:00 | Add the "index_xinfo" pragma. Add new columns to the "index_info" and "index_list" pragmas. (check-in: 30f51d7b3b user: drh tags: index_xinfo) | |
2015-01-30
| ||
21:00 | Merge the SQLITE_TESTCTRL_IMPOSTER changes from trunk. (check-in: 3ed6eb2fab user: drh tags: ota-update) | |
Changes
Changes to src/pragma.c.
︙ | |||
258 259 260 261 262 263 264 265 266 267 268 269 270 271 | 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | + + + + | /* ePragTyp: */ PragTyp_INDEX_INFO, /* ePragFlag: */ PragFlag_NeedSchema, /* iArg: */ 0 }, { /* zName: */ "index_list", /* ePragTyp: */ PragTyp_INDEX_LIST, /* ePragFlag: */ PragFlag_NeedSchema, /* iArg: */ 0 }, { /* zName: */ "index_xinfo", /* ePragTyp: */ PragTyp_INDEX_INFO, /* ePragFlag: */ PragFlag_NeedSchema, /* iArg: */ 1 }, #endif #if !defined(SQLITE_OMIT_INTEGRITY_CHECK) { /* zName: */ "integrity_check", /* ePragTyp: */ PragTyp_INTEGRITY_CHECK, /* ePragFlag: */ PragFlag_NeedSchema, /* iArg: */ 0 }, #endif |
︙ | |||
488 489 490 491 492 493 494 | 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 | - + | #if !defined(SQLITE_OMIT_FLAG_PRAGMAS) { /* zName: */ "writable_schema", /* ePragTyp: */ PragTyp_FLAG, /* ePragFlag: */ 0, /* iArg: */ SQLITE_WriteSchema|SQLITE_RecoveryMode }, #endif }; |
︙ | |||
743 744 745 746 747 748 749 750 751 752 753 754 755 756 | 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 | + | char *aFcntl[4]; /* Argument to SQLITE_FCNTL_PRAGMA */ int iDb; /* Database index for <database> */ int lwr, upr, mid = 0; /* Binary search bounds */ int rc; /* return value form SQLITE_FCNTL_PRAGMA */ sqlite3 *db = pParse->db; /* The database connection */ Db *pDb; /* The specific database being pragmaed */ Vdbe *v = sqlite3GetVdbe(pParse); /* Prepared statement */ const struct sPragmaNames *pPragma; if( v==0 ) return; sqlite3VdbeRunOnlyOnce(v); pParse->nMem = 2; /* Interpret the [database.] part of the pragma statement. iDb is the ** index of the database this pragma is being applied to in db.aDb[]. */ |
︙ | |||
820 821 822 823 824 825 826 827 828 | 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 | + - + - + | if( rc<0 ){ upr = mid - 1; }else{ lwr = mid + 1; } } if( lwr>upr ) goto pragma_out; pPragma = &aPragmaNames[mid]; /* Make sure the database schema is loaded if the pragma requires that */ |
︙ | |||
1450 1451 1452 1453 1454 1455 1456 | 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 | - + - - + | break; } #endif /* SQLITE_OMIT_PAGER_PRAGMAS */ #ifndef SQLITE_OMIT_FLAG_PRAGMAS case PragTyp_FLAG: { if( zRight==0 ){ |
︙ | |||
1585 1586 1587 1588 1589 1590 1591 1592 | 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 | + - - + + + + + - + - - - + + + + + + + + + - - + + + + + + + - + | case PragTyp_INDEX_INFO: if( zRight ){ Index *pIdx; Table *pTab; pIdx = sqlite3FindIndex(db, zRight, zDb); if( pIdx ){ int i; int mx = pPragma->iArg ? pIdx->nColumn : pIdx->nKeyCol; pTab = pIdx->pTable; |
︙ | |||
2191 2192 2193 2194 2195 2196 2197 | 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 | - + - + | ** the schema-version is potentially dangerous and may lead to program ** crashes or database corruption. Use with caution! ** ** The user-version is not used internally by SQLite. It may be used by ** applications for any purpose. */ case PragTyp_HEADER_VALUE: { |
︙ | |||
2313 2314 2315 2316 2317 2318 2319 | 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 | - + | ** ** Call sqlite3_busy_timeout(db, N). Return the current timeout value ** if one is set. If no busy handler or a different busy handler is set ** then 0 is returned. Setting the busy_timeout to 0 or negative ** disables the timeout. */ /*case PragTyp_BUSY_TIMEOUT*/ default: { |
︙ |
Changes to test/pragma.test.
︙ | |||
46 47 48 49 50 51 52 53 54 55 56 57 58 59 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + | # directive - if it is present. # ifcapable !pragma { finish_test return } # Capture the output of a pragma in a TEMP table. # proc capture_pragma {db tabname sql} { $db eval "DROP TABLE IF EXISTS temp.$tabname" set once 1 $db eval $sql x { if {$once} { set once 0 set ins "INSERT INTO $tabname VALUES" set crtab "CREATE TEMP TABLE $tabname " set sep "(" foreach col $x(*) { append ins ${sep}\$x($col) append crtab ${sep}\"$col\" set sep , } append ins ) append crtab ) $db eval $crtab } $db eval $ins } } # Delete the preexisting database to avoid the special setup # that the "all.test" script does. # db close delete_file test.db test.db-journal delete_file test3.db test3.db-journal |
︙ | |||
616 617 618 619 620 621 622 | 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 | - + + + + + | } {} do_test pragma-6.3.4 { execsql { pragma foreign_key_list(t5); } } {} do_test pragma-6.4 { |
︙ | |||
672 673 674 675 676 677 678 | 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 | - + + + - - + - - + + | CREATE TABLE test_table( one INT NOT NULL DEFAULT -1, two text, three VARCHAR(45, 65) DEFAULT 'abcde', four REAL DEFAULT X'abcdef', five DEFAULT CURRENT_TIME ); |
︙ | |||
1701 1702 1703 1704 1705 1706 1707 | 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 | - + - - + + + + + + + - - + + + | CREATE TABLE t1(a INTEGER PRIMARY KEY,b,c,d); CREATE INDEX i1 ON t1(b,c); CREATE INDEX i2 ON t1(c,d); CREATE TABLE t2(x INTEGER REFERENCES t1); } db2 eval {SELECT name FROM sqlite_master} } {t1 i1 i2 t2} |
︙ |
Changes to tool/mkpragmatab.tcl.
︙ | |||
201 202 203 204 205 206 207 208 209 210 211 212 213 214 | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | + + + + + + + + | IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS) NAME: stats FLAG: NeedSchema IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS) NAME: index_info TYPE: INDEX_INFO ARG: 0 FLAG: NeedSchema IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS) NAME: index_xinfo TYPE: INDEX_INFO ARG: 1 FLAG: NeedSchema IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS) NAME: index_list FLAG: NeedSchema IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS) |
︙ |