MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / idxBuildSampleTable

Function idxBuildSampleTable

modules/dasSQLITE/sqlite/shell.c:11900–11915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11898}
11899
11900static int idxBuildSampleTable(sqlite3expert *p, const char *zTab){
11901 int rc;
11902 char *zSql;
11903
11904 rc = sqlite3_exec(p->dbv,"DROP TABLE IF EXISTS temp."UNIQUE_TABLE_NAME,0,0,0);
11905 if( rc!=SQLITE_OK ) return rc;
11906
11907 zSql = sqlite3_mprintf(
11908 "CREATE TABLE temp." UNIQUE_TABLE_NAME " AS SELECT * FROM %Q", zTab
11909 );
11910 if( zSql==0 ) return SQLITE_NOMEM;
11911 rc = sqlite3_exec(p->dbv, zSql, 0, 0, 0);
11912 sqlite3_free(zSql);
11913
11914 return rc;
11915}
11916
11917/*
11918** This function is called as part of sqlite3_expert_analyze(). Candidate

Callers 1

idxPopulateStat1Function · 0.85

Calls 1

sqlite3_execFunction · 0.85

Tested by

no test coverage detected