while ((cn = oracle_connections) != NULL)
{
oracle_connections = cn->next;
- DEBUG(D_lookup) debug_printf("close ORACLE connection: %s\n", cn->server);
+ DEBUG(D_lookup) debug_printf_indent("close ORACLE connection: %s\n", cn->server);
ologof(cn->handle);
}
}
if (!cn)
{
- DEBUG(D_lookup) debug_printf("ORACLE new connection: host=%s database=%s "
+ DEBUG(D_lookup) debug_printf_indent("ORACLE new connection: host=%s database=%s "
"user=%s\n", sdata[0], sdata[1], sdata[2]);
/* Get store for a new connection, initialize it, and connect to the server */
- oracle_handle = store_get(sizeof(struct cda_def));
- hda = store_get(HDA_SIZE);
+ oracle_handle = store_get(sizeof(struct cda_def), FALSE);
+ hda = store_get(HDA_SIZE, FALSE);
memset(hda,'\0',HDA_SIZE);
/*
/* Add the connection to the cache */
- cn = store_get(sizeof(oracle_connection));
+ cn = store_get(sizeof(oracle_connection), FALSE);
cn->server = server_copy;
cn->handle = oracle_handle;
cn->next = oracle_connections;
else
{
DEBUG(D_lookup)
- debug_printf("ORACLE using cached connection for %s\n", server_copy);
+ debug_printf_indent("ORACLE using cached connection for %s\n", server_copy);
}
/* We have a connection. Open a cursor and run the query */
-cda = store_get(sizeof(Cda_Def));
+cda = store_get(sizeof(Cda_Def), FALSE);
if (oopen(cda, oracle_handle, (text *)0, -1, -1, (text *)0, -1) != 0)
{
/* Find the number of fields returned and sort out their types. If the number
is one, we don't add field names to the data. Otherwise we do. */
-def = store_get(sizeof(Ora_Define)*MAX_SELECT_LIST_SIZE);
-desc = store_get(sizeof(Ora_Describe)*MAX_SELECT_LIST_SIZE);
+def = store_get(sizeof(Ora_Define)*MAX_SELECT_LIST_SIZE, FALSE);
+desc = store_get(sizeof(Ora_Describe)*MAX_SELECT_LIST_SIZE, FALSE);
if ((num_fields = describe_define(cda,def,desc)) == -1)
{
result = string_catn(result, s, slen);
result = string_catn(result, US"=", 1);
- /* int and float type wont ever need escaping. Otherwise, quote the value
+ /* int and float type won't ever need escaping. Otherwise, quote the value
if it contains spaces or is empty. */
if (desc[i].dbtype != INT_TYPE && desc[i].dbtype != FLOAT_TYPE &&
*errmsg = "ORACLE: no data found";
}
else
- store_reset(result->s + result->ptr + 1);
+ gstring_release_unused(result);
/* Get here by goto from various error checks. */
}
else
{
- DEBUG(D_lookup) debug_printf("%s\n", *errmsg);
+ DEBUG(D_lookup) debug_printf_indent("%s\n", *errmsg);
return yield; /* FAIL or DEFER */
}
}
do_cache = do_cache; /* Placate picky compilers */
-DEBUG(D_lookup) debug_printf("ORACLE query: %s\n", query);
+DEBUG(D_lookup) debug_printf_indent("ORACLE query: %s\n", query);
while ((server = string_nextinlist(&list, &sep, buffer, sizeof(buffer))) != NULL)
{
if (strchr("\n\t\r\b\'\"\\", c) != NULL) count++;
if (count == 0) return s;
-t = quoted = store_get((int)strlen(s) + count + 1);
+t = quoted = store_get((int)strlen(s) + count + 1, is_tainted(s));
while ((c = *s++) != 0)
{