From: Marco van Wieringen Date: Sat, 20 Feb 2010 20:57:48 +0000 (+0100) Subject: Sync between master and this branch as some ingres changes did go into master but... X-Git-Tag: Release-5.0.1~22 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=34deaec045c6322d86d82f4f870303e54eb7fb7b;p=bacula%2Fbacula Sync between master and this branch as some ingres changes did go into master but not into this branch. --- diff --git a/bacula/src/cats/ingres.c b/bacula/src/cats/ingres.c index 99d75f3c46..37e22481f3 100755 --- a/bacula/src/cats/ingres.c +++ b/bacula/src/cats/ingres.c @@ -1,7 +1,8 @@ + /* Bacula® - The Network Backup Solution - Copyright (C) 2003-2007 Free Software Foundation Europe e.V. + Copyright (C) 2003-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -285,6 +286,11 @@ db_close_database(JCR *jcr, B_DB *mdb) V(mutex); } +void db_check_backend_thread_safe() +{ } + + + void db_thread_cleanup() { } @@ -493,7 +499,6 @@ void my_ingres_field_seek(B_DB *mdb, int field) /* * Note, if this routine returns 1 (failure), Bacula expects * that no result has been stored. - * This is where QUERY_DB comes with Ingres. SRE: true? * * Returns: 0 on success * 1 on failure @@ -507,21 +512,16 @@ int my_ingres_query(B_DB *mdb, const char *query) mdb->row_number = -1; mdb->field_number = -1; + int cols = -1; + if (mdb->result) { INGclear(mdb->result); /* hmm, someone forgot to free?? */ mdb->result = NULL; } Dmsg1(500, "my_ingres_query starts with '%s'\n", query); - mdb->result = INGexec(mdb->db, query); - if (!mdb->result) { - Dmsg1(50, "Query failed: %s\n", query); - goto bail_out; - } - mdb->status = INGresultStatus(mdb->result); - if (mdb->status == ING_COMMAND_OK) { - Dmsg1(500, "we have a result\n", query); + /* TODO: differentiate between SELECTs and other queries */ if ((cols = INGgetCols(query)) <= 0) { if (cols < 0 ) { @@ -560,13 +560,6 @@ int my_ingres_query(B_DB *mdb, const char *query) Dmsg0(500, "my_ingres_query finishing\n"); return mdb->status; - -bail_out: - Dmsg1(500, "we failed\n", query); - INGclear(mdb->result); - mdb->result = NULL; - mdb->status = 1; /* failed */ - return mdb->status; } void my_ingres_free_result(B_DB *mdb) diff --git a/bacula/src/cats/myingres.c b/bacula/src/cats/myingres.c index 6098ceeec7..bb89a10e0e 100644 --- a/bacula/src/cats/myingres.c +++ b/bacula/src/cats/myingres.c @@ -1,7 +1,5 @@ - #include "bacula.h" -#include "cats.h" - +/* # line 3 "myingres.sc" */ #ifdef HAVE_INGRES #include extern IISQLCA sqlca; /* SQL Communications Area */ @@ -376,7 +374,7 @@ short INGftype(const INGresult *res, int column_number) { return res->fields[column_number].type; } -INGresult *INGexec(INGconn *conn, const char *query) +int INGexec(INGconn *conn, const char *query) { int check; /* # line 402 "myingres.sc" */ diff --git a/bacula/src/cats/myingres.sc b/bacula/src/cats/myingres.sc index 1eec7019af..2a61fe20c0 100644 --- a/bacula/src/cats/myingres.sc +++ b/bacula/src/cats/myingres.sc @@ -1,3 +1,6 @@ +#include "bacula.h" + +#ifdef HAVE_INGRES EXEC SQL INCLUDE SQLCA; EXEC SQL INCLUDE SQLDA;