Lines Matching refs:sql

217 static int sql_exec_tran_no_cb(sqlite *db, char *sql, const char *dbname,
222 * Initialize 'dbname' using 'sql'
227 const char *detect_version_sql, char * const *sql,
307 sql[curr_version]);
309 rc = sql_exec_tran_no_cb(db, sql[curr_version], dbname,
449 char *sql[4];
453 sql[0] = DB_INSTALL_SQL;
454 sql[1] = DB_UPGRADE_FROM_v1_SQL;
455 sql[2] = NULL;
457 if (init_db_instance(IDMAP_DBNAME, DB_VERSION, DB_VERSION_SQL, sql,
462 sql[0] = CACHE_INSTALL_SQL;
463 sql[1] = CACHE_UPGRADE_FROM_v1_SQL;
464 sql[2] = CACHE_UPGRADE_FROM_v2_SQL;
465 sql[3] = NULL;
468 sql, REMOVE_IF_CORRUPT, &created, &upgraded) < 0)
521 sql_exec_tran_no_cb(sqlite *db, char *sql, const char *dbname,
535 rc = sqlite_exec(db, sql, NULL, NULL, &errmsg);
572 sql_exec_no_cb(sqlite *db, const char *dbname, char *sql)
578 r = sqlite_exec(db, sql, NULL, NULL, &errmsg);
583 "(%s)", dbname, sql, CHECK_NULL(errmsg));
691 process_list_svc_sql(sqlite *db, const char *dbname, char *sql, uint64_t limit,
705 r = sqlite_exec(db, sql, cb, &cb_data, &errmsg);
715 "%s (%s)", dbname, sql, CHECK_NULL(errmsg));
876 char *sql = NULL;
917 sql = sqlite_mprintf("INSERT into namerules "
926 if (sql == NULL) {
932 retcode = sql_exec_no_cb(db, IDMAP_DBNAME, sql);
940 if (sql != NULL)
941 sqlite_freemem(sql);
964 char *sql = NULL;
976 sql = sqlite_mprintf("DELETE FROM namerules WHERE 1 %s;", expr);
978 if (sql == NULL) {
985 retcode = sql_exec_no_cb(db, IDMAP_DBNAME, sql);
990 if (sql != NULL)
991 sqlite_freemem(sql);
1000 * sql - SQL statement
1015 sql_compile_n_step_once(sqlite *db, char *sql, sqlite_vm **vm, int *ncol,
1021 if ((r = sqlite_compile(db, sql, NULL, vm, &errmsg)) != SQLITE_OK) {
1022 idmapdlog(LOG_ERR, "Database error during %s (%s)", sql,
1047 idmapdlog(LOG_ERR, "Database error during %s (%s)", sql,
1504 char *sql = NULL;
1541 sql = sqlite_mprintf("SELECT pid, is_user, expiration, "
1555 sql = sqlite_mprintf("SELECT pid, is_user, expiration, "
1572 if (sql == NULL) {
1577 retcode = sql_compile_n_step_once(cache, sql, &vm, &ncol,
1579 sqlite_freemem(sql);
1745 char *sql = NULL;
1762 sql = sqlite_mprintf("SELECT canon_name, domain, type "
1768 if (sql == NULL) {
1773 retcode = sql_compile_n_step_once(cache, sql, &vm, &ncol, 3, &values);
1774 sqlite_freemem(sql);
3013 char *sql = NULL, *errmsg = NULL, *lower_winname = NULL;
3060 sql = sqlite_mprintf(
3068 if (sql == NULL) {
3074 if (sqlite_compile(state->db, sql, NULL, &vm, &errmsg) != SQLITE_OK) {
3196 if (sql != NULL)
3197 sqlite_freemem(sql);
3580 char *sql = NULL;
3667 sql = sqlite_mprintf("INSERT OR REPLACE into idmap_cache "
3684 if (sql == NULL) {
3690 retcode = sql_exec_no_cb(state->cache, IDMAP_CACHENAME, sql);
3695 sqlite_freemem(sql);
3696 sql = NULL;
3705 sql = sqlite_mprintf("INSERT OR REPLACE into name_cache "
3712 if (sql == NULL) {
3718 retcode = sql_exec_no_cb(state->cache, IDMAP_CACHENAME, sql);
3721 if (sql != NULL)
3722 sqlite_freemem(sql);
3730 char *sql = NULL;
3758 sql = sqlite_mprintf("UPDATE idmap_cache "
3765 if (sql == NULL) {
3771 retcode = sql_exec_no_cb(state->cache, IDMAP_CACHENAME, sql);
3775 sqlite_freemem(sql);
3776 sql = NULL;
3816 sql = sqlite_mprintf("INSERT OR REPLACE into idmap_cache "
3834 if (sql == NULL) {
3840 retcode = sql_exec_no_cb(state->cache, IDMAP_CACHENAME, sql);
3845 sqlite_freemem(sql);
3846 sql = NULL;
3855 sql = sqlite_mprintf("INSERT OR REPLACE into name_cache "
3862 if (sql == NULL) {
3868 retcode = sql_exec_no_cb(state->cache, IDMAP_CACHENAME, sql);
3871 if (sql != NULL)
3872 sqlite_freemem(sql);
3882 char *sql = NULL;
3901 sql = sqlite_mprintf("SELECT sidprefix, rid, "
3912 sql = sqlite_mprintf("SELECT sidprefix, rid, "
3927 if (sql == NULL) {
3933 cache, sql, &vm, &ncol, 14, &values);
3934 sqlite_freemem(sql);
4097 char *sql;
4120 sql = sqlite_mprintf("SELECT sidprefix, rid, type, canon_name "
4126 if (sql == NULL) {
4131 retcode = sql_compile_n_step_once(cache, sql, &vm, &ncol, 4, &values);
4133 sqlite_freemem(sql);
4413 char *sql = NULL, *errmsg = NULL;
4428 sql = sqlite_mprintf(
4435 if (sql == NULL) {
4441 if (sqlite_compile(state->db, sql, NULL, &vm, &errmsg) != SQLITE_OK) {
4578 if (sql != NULL)
4579 sqlite_freemem(sql);