B2G/gecko/toolkit/components/places/tests/expiration/test_analyze_runs.js
/**
 * Checks that we ran ANALYZE on the specified table.
 *
 * @param aTableName
 *        The table to check if ANALYZE was ran.
 * @param aRan
 *        True if it was expected to run, false otherwise
 */
Checks that we ran ANALYZE on the specified table.
@param aTableName
The table to check if ANALYZE was ran.
@param aRan
True if it was expected to run, false otherwise
Checks that we ran ANALYZE on the specified table . @param aTableName The table to check if ANALYZE was ran . @param aRan True if it was expected to run false otherwise
function do_check_analyze_ran(aTableName, aRan)
{
  let db = DBConn();
  do_check_true(db.tableExists("sqlite_stat1"));
  let stmt = db.createStatement("SELECT idx FROM sqlite_stat1 WHERE tbl = :table");
  stmt.params.table = aTableName;
  try {
    if (aRan) {
      do_check_true(stmt.executeStep());
      do_check_neq(stmt.row.idx, null);
    }
    else {
      do_check_false(stmt.executeStep());
    }
  }
  finally {
    stmt.finalize();
  }
}
function do_check_analyze_ran ( aTableName , aRan ) { let db = DBConn ( ) ; do_check_true ( db . tableExists ( "sqlite_stat1" ) ) ; let stmt = db . createStatement ( "SELECT idx FROM sqlite_stat1 WHERE tbl = :table" ) ; stmt . params . table = aTableName ; try { if ( aRan ) { do_check_true ( stmt . executeStep ( ) ) ; do_check_neq ( stmt . row . idx , null ) ; } else { do_check_false ( stmt . executeStep ( ) ) ; } } finally { stmt . finalize ( ) ; } }
Checks that we ran ANALYZE on the specified table.
Checks that we ran ANALYZE on the specified table .