/ Check-in [029430c5]
Login

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

Overview
Comment:Fix an issue in the test8.c test module that arises because of the change to PRAGMA index_list(). Remove an unused local variable.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | row-size-est
Files: files | file ages | folders
SHA1: 029430c503f243a34439698779db7e591cfbe126
User & Date: drh 2013-10-05 20:18:25
Context
2013-10-06
22:12
Accept the sz=N parameter on table-only lines of sqlite_stat1. check-in: e9e932aa user: drh tags: row-size-est
2013-10-05
20:18
Fix an issue in the test8.c test module that arises because of the change to PRAGMA index_list(). Remove an unused local variable. check-in: 029430c5 user: drh tags: row-size-est
19:18
Completely remove the iScanRatio field. The PRAGMA index_list(TABLE) command shows the estimated row size in the forth column. It also generates a row for the table with an index name of NULL. The query planner still does not take row size estimates into account - that is the next step. check-in: 8b4aa0c7 user: drh tags: row-size-est
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/build.c.

1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
  Token *pEnd,            /* The final ')' token in the CREATE TABLE */
  Select *pSelect         /* Select from a "CREATE ... AS SELECT" */
){
  Table *p;                 /* The new table */
  sqlite3 *db = pParse->db; /* The database connection */
  int iDb;                  /* Database in which the table lives */
  Index *pIdx;              /* An implied index of the table */
  unsigned wTable;          /* Estimated average width of a row in the table */

  if( (pEnd==0 && pSelect==0) || db->mallocFailed ){
    return;
  }
  p = pParse->pNewTable;
  if( p==0 ) return;








<







1559
1560
1561
1562
1563
1564
1565

1566
1567
1568
1569
1570
1571
1572
  Token *pEnd,            /* The final ')' token in the CREATE TABLE */
  Select *pSelect         /* Select from a "CREATE ... AS SELECT" */
){
  Table *p;                 /* The new table */
  sqlite3 *db = pParse->db; /* The database connection */
  int iDb;                  /* Database in which the table lives */
  Index *pIdx;              /* An implied index of the table */


  if( (pEnd==0 && pSelect==0) || db->mallocFailed ){
    return;
  }
  p = pParse->pNewTable;
  if( p==0 ) return;

Changes to src/test8.c.

261
262
263
264
265
266
267

268
269
270
271
272
273
274

  /* For each index, figure out the left-most column and set the 
  ** corresponding entry in aIndex[] to 1.
  */
  while( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){
    const char *zIdx = (const char *)sqlite3_column_text(pStmt, 1);
    sqlite3_stmt *pStmt2 = 0;

    zSql = sqlite3_mprintf("PRAGMA index_info(%s)", zIdx);
    if( !zSql ){
      rc = SQLITE_NOMEM;
      goto get_index_array_out;
    }
    rc = sqlite3_prepare(db, zSql, -1, &pStmt2, 0);
    sqlite3_free(zSql);







>







261
262
263
264
265
266
267
268
269
270
271
272
273
274
275

  /* For each index, figure out the left-most column and set the 
  ** corresponding entry in aIndex[] to 1.
  */
  while( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){
    const char *zIdx = (const char *)sqlite3_column_text(pStmt, 1);
    sqlite3_stmt *pStmt2 = 0;
    if( zIdx==0 ) continue;
    zSql = sqlite3_mprintf("PRAGMA index_info(%s)", zIdx);
    if( !zSql ){
      rc = SQLITE_NOMEM;
      goto get_index_array_out;
    }
    rc = sqlite3_prepare(db, zSql, -1, &pStmt2, 0);
    sqlite3_free(zSql);