hphp/hack/src/heap/hh_shared.c
// Expects the database to be open
Expects the database to be open
Expects the database to be open
static void create_sqlite_header(sqlite3 *db) {
  const char *sql = "CREATE TABLE HEADER(" \
               "MAGIC_CONSTANT INTEGER PRIMARY KEY NOT NULL," \
               "BUILDINFO TEXT NOT NULL);";
  assert_sql(sqlite3_exec(db, sql, NULL, 0, NULL), SQLITE_OK);
  sqlite3_stmt *insert_stmt = NULL;
  sql = "INSERT INTO HEADER (MAGIC_CONSTANT, BUILDINFO) VALUES (?,?)";
  assert_sql(sqlite3_prepare_v2(db, sql, -1, &insert_stmt, NULL), SQLITE_OK);
  assert_sql(sqlite3_bind_int64(insert_stmt, 1, MAGIC_CONSTANT), SQLITE_OK);
  assert_sql(sqlite3_bind_text(insert_stmt, 2,
        BuildInfo_kRevision, -1,
        SQLITE_TRANSIENT),
        SQLITE_OK);
  assert_sql(sqlite3_step(insert_stmt), SQLITE_DONE);
  assert_sql(sqlite3_finalize(insert_stmt), SQLITE_OK);
}
static void create_sqlite_header ( sqlite3 * db ) { const char * sql = " " " " " " ; assert_sql ( sqlite3_exec ( db , sql , NULL , 0 , NULL ) , SQLITE_OK ) ; sqlite3_stmt * insert_stmt = NULL ; sql = " " ; assert_sql ( sqlite3_prepare_v2 ( db , sql , -1 , & insert_stmt , NULL ) , SQLITE_OK ) ; assert_sql ( sqlite3_bind_int64 ( insert_stmt , 1 , MAGIC_CONSTANT ) , SQLITE_OK ) ; assert_sql ( sqlite3_bind_text ( insert_stmt , 2 , BuildInfo_kRevision , -1 , SQLITE_TRANSIENT ) , SQLITE_OK ) ; assert_sql ( sqlite3_step ( insert_stmt ) , SQLITE_DONE ) ; assert_sql ( sqlite3_finalize ( insert_stmt ) , SQLITE_OK ) ; }
Expects the database to be open
Expects the database to be open
// Create Header // Insert magic constant and build info