Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Purge lingering references to SQLITE_STAT2 from the code and test scripts. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
aed2bf7a3c828a7191389b3f8235a938 |
User & Date: | drh 2011-10-21 19:06:32.669 |
Context
2011-10-22
| ||
21:00 | Avoid a harmless reference to an uninitialized variable following an error in FTS3. This is not a bug. The change is to silence a valgrind warning. (check-in: d980c5b22f user: drh tags: trunk) | |
2011-10-21
| ||
19:06 | Purge lingering references to SQLITE_STAT2 from the code and test scripts. (check-in: aed2bf7a3c user: drh tags: trunk) | |
16:47 | Remove stale requirements marks from the query planner. (check-in: 76de9914be user: drh tags: trunk) | |
Changes
Changes to src/analyze.c.
︙ | ︙ | |||
115 116 117 118 119 120 121 | */ #ifndef SQLITE_OMIT_ANALYZE #include "sqliteInt.h" /* ** This routine generates code that opens the sqlite_stat1 table for ** writing with cursor iStatCur. If the library was built with the | | | | | | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | */ #ifndef SQLITE_OMIT_ANALYZE #include "sqliteInt.h" /* ** This routine generates code that opens the sqlite_stat1 table for ** writing with cursor iStatCur. If the library was built with the ** SQLITE_ENABLE_STAT3 macro defined, then the sqlite_stat3 table is ** opened for writing using cursor (iStatCur+1) ** ** If the sqlite_stat1 tables does not previously exist, it is created. ** Similarly, if the sqlite_stat3 table does not exist and the library ** is compiled with SQLITE_ENABLE_STAT3 defined, it is created. ** ** Argument zWhere may be a pointer to a buffer containing a table name, ** or it may be a NULL pointer. If it is not NULL, then all entries in ** the sqlite_stat1 and (if applicable) sqlite_stat3 tables associated ** with the named table are deleted. If zWhere==0, then code is generated ** to delete all stat table entries. */ static void openStatTable( Parse *pParse, /* Parsing context */ int iDb, /* The database we are looking in */ int iStatCur, /* Open the sqlite_stat1 table on this cursor */ |
︙ | ︙ |
Changes to src/build.c.
︙ | ︙ | |||
1977 1978 1979 1980 1981 1982 1983 | iDestroyed = iLargest; } } #endif } /* | | < < < < < | > > | | | 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 | iDestroyed = iLargest; } } #endif } /* ** Remove entries from the sqlite_statN tables (for N in (1,2,3)) ** after a DROP INDEX or DROP TABLE command. */ static void sqlite3ClearStatTables( Parse *pParse, /* The parsing context */ int iDb, /* The database number */ const char *zType, /* "idx" or "tbl" */ const char *zName /* Name of index or table */ ){ int i; const char *zDbName = pParse->db->aDb[iDb].zName; for(i=1; i<=3; i++){ char zTab[24]; sqlite3_snprintf(sizeof(zTab),zTab,"sqlite_stat%d",i); if( sqlite3FindTable(pParse->db, zTab, zDbName) ){ sqlite3NestedParse(pParse, "DELETE FROM %Q.%s WHERE %s=%Q", zDbName, zTab, zType, zName ); } } } /* ** Generate code to drop a table. |
︙ | ︙ |
Changes to src/ctime.c.
︙ | ︙ | |||
110 111 112 113 114 115 116 | #endif #ifdef SQLITE_ENABLE_OVERSIZE_CELL_CHECK "ENABLE_OVERSIZE_CELL_CHECK", #endif #ifdef SQLITE_ENABLE_RTREE "ENABLE_RTREE", #endif | < < < | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | #endif #ifdef SQLITE_ENABLE_OVERSIZE_CELL_CHECK "ENABLE_OVERSIZE_CELL_CHECK", #endif #ifdef SQLITE_ENABLE_RTREE "ENABLE_RTREE", #endif #ifdef SQLITE_ENABLE_STAT3 "ENABLE_STAT3", #endif #ifdef SQLITE_ENABLE_UNLOCK_NOTIFY "ENABLE_UNLOCK_NOTIFY", #endif #ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT |
︙ | ︙ |
Changes to src/sqliteInt.h.
︙ | ︙ | |||
72 73 74 75 76 77 78 | #ifdef HAVE_STDINT_H #include <stdint.h> #endif #ifdef HAVE_INTTYPES_H #include <inttypes.h> #endif | < < < < < < < | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | #ifdef HAVE_STDINT_H #include <stdint.h> #endif #ifdef HAVE_INTTYPES_H #include <inttypes.h> #endif /* ** The following macros are used to cast pointers to integers and ** integers to pointers. The way you do this varies from one compiler ** to the next, so we have developed the following set of #if statements ** to generate appropriate macros for a wide range of compilers. ** ** The correct "ANSI" way to do this is to use the intptr_t type. |
︙ | ︙ | |||
1510 1511 1512 1513 1514 1515 1516 | int nSample; /* Number of elements in aSample[] */ tRowcnt avgEq; /* Average nEq value for key values not in aSample */ IndexSample *aSample; /* Samples of the left-most key */ #endif }; /* | | | > | 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 | int nSample; /* Number of elements in aSample[] */ tRowcnt avgEq; /* Average nEq value for key values not in aSample */ IndexSample *aSample; /* Samples of the left-most key */ #endif }; /* ** Each sample stored in the sqlite_stat3 table is represented in memory ** using a structure of this type. See documentation at the top of the ** analyze.c source file for additional information. */ struct IndexSample { union { char *z; /* Value if eType is SQLITE_TEXT or SQLITE_BLOB */ double r; /* Value if eType is SQLITE_FLOAT */ i64 i; /* Value if eType is SQLITE_INTEGER */ } u; |
︙ | ︙ |
Changes to src/test_config.c.
︙ | ︙ | |||
420 421 422 423 424 425 426 | #ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS Tcl_SetVar2(interp, "sqlite_options", "schema_version", "0", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY); #endif | < < < < < < | 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | #ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS Tcl_SetVar2(interp, "sqlite_options", "schema_version", "0", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY); #endif #ifdef SQLITE_ENABLE_STAT3 Tcl_SetVar2(interp, "sqlite_options", "stat3", "1", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "stat3", "0", TCL_GLOBAL_ONLY); #endif #if !defined(SQLITE_ENABLE_LOCKING_STYLE) |
︙ | ︙ |
Changes to src/where.c.
︙ | ︙ | |||
3163 3164 3165 3166 3167 3168 3169 | ** to do a binary search to locate a row in a table or index is roughly ** log10(N) times the time to move from one row to the next row within ** a table or index. The actual times can vary, with the size of ** records being an important factor. Both moves and searches are ** slower with larger records, presumably because fewer records fit ** on one page and hence more pages have to be fetched. ** | | | 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 | ** to do a binary search to locate a row in a table or index is roughly ** log10(N) times the time to move from one row to the next row within ** a table or index. The actual times can vary, with the size of ** records being an important factor. Both moves and searches are ** slower with larger records, presumably because fewer records fit ** on one page and hence more pages have to be fetched. ** ** The ANALYZE command and the sqlite_stat1 and sqlite_stat3 tables do ** not give us data on the relative sizes of table and index records. ** So this computation assumes table records are about twice as big ** as index records */ if( (wsFlags & WHERE_NOT_FULLSCAN)==0 ){ /* The cost of a full table scan is a number of move operations equal ** to the number of rows in the table. |
︙ | ︙ |
Changes to test/alter.test.
︙ | ︙ | |||
842 843 844 845 846 847 848 | #------------------------------------------------------------------------- # Test that it is not possible to use ALTER TABLE on any system table. # set system_table_list {1 sqlite_master} catchsql ANALYZE ifcapable analyze { lappend system_table_list 2 sqlite_stat1 } | < | 842 843 844 845 846 847 848 849 850 851 852 853 854 855 | #------------------------------------------------------------------------- # Test that it is not possible to use ALTER TABLE on any system table. # set system_table_list {1 sqlite_master} catchsql ANALYZE ifcapable analyze { lappend system_table_list 2 sqlite_stat1 } ifcapable stat3 { lappend system_table_list 4 sqlite_stat3 } foreach {tn tbl} $system_table_list { do_test alter-15.$tn.1 { catchsql "ALTER TABLE $tbl RENAME TO xyz" } [list 1 "table $tbl may not be altered"] |
︙ | ︙ |
Deleted test/analyze2.test.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to test/analyze3.test.
︙ | ︙ | |||
66 67 68 69 70 71 72 | # INTEGER) with integer values from 100 to 1100. Create an index on this # column. ANALYZE the table. # # analyze3-1.1.2 - 3.1.3 # Show that there are two possible plans for querying the table with # a range constraint on the indexed column - "full table scan" or "use # the index". When the range is specified using literal values, SQLite | | | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | # INTEGER) with integer values from 100 to 1100. Create an index on this # column. ANALYZE the table. # # analyze3-1.1.2 - 3.1.3 # Show that there are two possible plans for querying the table with # a range constraint on the indexed column - "full table scan" or "use # the index". When the range is specified using literal values, SQLite # is able to pick the best plan based on the samples in sqlite_stat3. # # analyze3-1.1.4 - 3.1.9 # Show that using SQL variables produces the same results as using # literal values to constrain the range scan. # # These tests also check that the compiler code considers column # affinities when estimating the number of rows scanned by the "use |
︙ | ︙ |
Changes to test/auth.test.
︙ | ︙ | |||
2317 2318 2319 2320 2321 2322 2323 | } ifcapable view { execsql { DROP TABLE v1chng; } } } | < < < | | | | < | | 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 | } ifcapable view { execsql { DROP TABLE v1chng; } } } ifcapable stat3 { set stat3 "sqlite_stat3 " } else { set stat3 "" } do_test auth-5.2 { execsql { SELECT name FROM ( SELECT * FROM sqlite_master UNION ALL SELECT * FROM sqlite_temp_master) WHERE type='table' ORDER BY name } } "sqlite_stat1 ${stat3}t1 t2 t3 t4" } # Ticket #3944 # ifcapable trigger { do_test auth-5.3.1 { execsql { |
︙ | ︙ |
Changes to test/malloc.test.
︙ | ︙ | |||
863 864 865 866 867 868 869 | execsql {INSERT INTO t1 VALUES(3, 4)} db2 } {} db2 close } catch { db2 close } } | < < < < < < < < < < < < < < < < < < < < < < < < < < | 863 864 865 866 867 868 869 870 871 872 873 874 875 876 | execsql {INSERT INTO t1 VALUES(3, 4)} db2 } {} db2 close } catch { db2 close } } # Test that if an OOM error occurs, aux-data is still correctly destroyed. # This test case was causing either a memory-leak or an assert() failure # at one point, depending on the configuration. # do_malloc_test 39 -tclprep { sqlite3 db test.db |
︙ | ︙ |