Lines Matching defs:dbi
138 dbinstance_t *dbi = NULL;
150 dbi = (dbinstance_t *) dbdata;
153 if (dbi == NULL) {
167 if (dbi->allnodes_q == NULL) {
174 if (dbi->allowxfr_q == NULL) {
181 if (dbi->authority_q == NULL) {
188 if (dbi->findzone_q == NULL) {
199 if (dbi->countzone_q == NULL) {
206 if (dbi->lookup_q == NULL) {
233 dbi->zone = mysqldrv_escape_string((MYSQL *) dbi->dbconn,
235 if (dbi->zone == NULL) {
240 dbi->zone = NULL;
248 dbi->record = mysqldrv_escape_string((MYSQL *) dbi->dbconn,
250 if (dbi->record == NULL) {
255 dbi->record = NULL;
263 dbi->client = mysqldrv_escape_string((MYSQL *) dbi->dbconn,
265 if (dbi->client == NULL) {
270 dbi->client = NULL;
279 querystring = build_querystring(ns_g_mctx, dbi->allnodes_q);
282 querystring = build_querystring(ns_g_mctx, dbi->allowxfr_q);
285 querystring = build_querystring(ns_g_mctx, dbi->authority_q);
288 querystring = build_querystring(ns_g_mctx, dbi->findzone_q);
291 querystring = build_querystring(ns_g_mctx, dbi->countzone_q);
294 querystring = build_querystring(ns_g_mctx, dbi->lookup_q);
324 qres = mysql_query((MYSQL *) dbi->dbconn, querystring);
327 for (j=0; mysql_ping((MYSQL *) dbi->dbconn) != 0 && j < 4; j++)
334 *rs = mysql_store_result((MYSQL *) dbi->dbconn);
347 if (dbi == NULL)
350 /* free dbi->zone string */
351 if (dbi->zone != NULL)
352 isc_mem_free(ns_g_mctx, dbi->zone);
354 /* free dbi->record string */
355 if (dbi->record != NULL)
356 isc_mem_free(ns_g_mctx, dbi->record);
358 /* free dbi->client string */
359 if (dbi->client != NULL)
360 isc_mem_free(ns_g_mctx, dbi->client);
783 dbinstance_t *dbi = NULL;
854 argv[2], argv[3], NULL, &dbi);
858 argv[2], argv[3], NULL, &dbi);
862 argv[2], argv[3], NULL, &dbi);
867 argv[2], argv[3], NULL, &dbi);
872 argv[2], argv[3], argv[7], &dbi);
890 dbi->dbconn = mysql_init(NULL);
893 if (dbi->dbconn == NULL) {
931 if (mysql_options((MYSQL *) dbi->dbconn, MYSQL_OPT_RECONNECT,
941 dbc = mysql_real_connect((MYSQL *) dbi->dbconn, host,
956 *dbdata = dbi;
963 if (dbi != NULL)
964 destroy_sqldbinstance(dbi);
993 dbinstance_t *dbi;
997 dbi = (dbinstance_t *) dbdata;
1000 if (dbi->dbconn != NULL)
1001 mysql_close((MYSQL *) dbi->dbconn);
1004 destroy_sqldbinstance(dbi);