From 9714f462d7bee6aa48c3cea900457f55af5ef746 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Tue, 6 Apr 2010 20:09:22 +0200 Subject: [PATCH] Lets uniformly call a INGconn a dbconn in all Ingres functions. --- bacula/src/cats/myingres.c | 34 +++++++++++++++++----------------- bacula/src/cats/myingres.sc | 26 +++++++++++++------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/bacula/src/cats/myingres.c b/bacula/src/cats/myingres.c index adf367db14..42a7fbfd26 100644 --- a/bacula/src/cats/myingres.c +++ b/bacula/src/cats/myingres.c @@ -50,7 +50,7 @@ IISQLCA *IIsqlca(); /* * ---Implementations--- */ -short INGgetCols(INGconn *conn, const char *query, bool transaction) +short INGgetCols(INGconn *dbconn, const char *query, bool transaction) { /* # line 52 "myingres.sc" */ @@ -67,7 +67,7 @@ short INGgetCols(INGconn *conn, const char *query, bool transaction) /* * Switch to the correct default session for this thread. */ - sess_id = conn->session_id; + sess_id = dbconn->session_id; /* # line 71 "myingres.sc" */ /* set_sql */ { IILQssSetSqlio(11,(short *)0,1,30,sizeof(sess_id),&sess_id); @@ -357,9 +357,9 @@ static inline int INGfetchAll(const char *query, INGresult *ing_res) /* # line 371 "myingres.sc" */ /* open */ { IIsqInit(&sqlca); - IIcsOpen((char *)"c2",14614,8429); + IIcsOpen((char *)"c2",30801,28581); IIwritio(0,(short *)0,1,32,0,(char *)"s2"); - IIcsQuery((char *)"c2",14614,8429); + IIcsQuery((char *)"c2",30801,28581); if (sqlca.sqlcode < 0) goto bail_out; } @@ -369,7 +369,7 @@ static inline int INGfetchAll(const char *query, INGresult *ing_res) /* # line 377 "myingres.sc" */ /* fetch */ { IIsqInit(&sqlca); - if (IIcsRetScroll((char *)"c2",14614,8429,-1,-1) != 0) { + if (IIcsRetScroll((char *)"c2",30801,28581,-1,-1) != 0) { IIcsDaGet(0,desc); IIcsERetrieve(); } /* IIcsRetrieve */ @@ -396,7 +396,7 @@ static inline int INGfetchAll(const char *query, INGresult *ing_res) /* # line 400 "myingres.sc" */ /* close */ { IIsqInit(&sqlca); - IIcsClose((char *)"c2",14614,8429); + IIcsClose((char *)"c2",30801,28581); } /* # line 402 "myingres.sc" */ /* host code */ ing_res->status = ING_COMMAND_OK; @@ -464,7 +464,7 @@ short INGftype(const INGresult *res, int column_number) { return res->fields[column_number].type; } -int INGexec(INGconn *conn, const char *query, bool transaction) +int INGexec(INGconn *dbconn, const char *query, bool transaction) { int check; /* # line 485 "myingres.sc" */ @@ -479,7 +479,7 @@ int INGexec(INGconn *conn, const char *query, bool transaction) /* * Switch to the correct default session for this thread. */ - sess_id = conn->session_id; + sess_id = dbconn->session_id; /* # line 498 "myingres.sc" */ /* set_sql */ { IILQssSetSqlio(11,(short *)0,1,30,sizeof(sess_id),&sess_id); @@ -520,7 +520,7 @@ bail_out: free(stmt); return rowcount; } -INGresult *INGquery(INGconn *conn, const char *query, bool transaction) +INGresult *INGquery(INGconn *dbconn, const char *query, bool transaction) { /* * TODO: error handling @@ -528,7 +528,7 @@ INGresult *INGquery(INGconn *conn, const char *query, bool transaction) IISQLDA *desc = NULL; INGresult *res = NULL; int rows = -1; - int cols = INGgetCols(conn, query, transaction); + int cols = INGgetCols(dbconn, query, transaction); /* # line 532 "myingres.sc" */ int sess_id; @@ -537,7 +537,7 @@ INGresult *INGquery(INGconn *conn, const char *query, bool transaction) /* * Switch to the correct default session for this thread. */ - sess_id = conn->session_id; + sess_id = dbconn->session_id; /* # line 540 "myingres.sc" */ /* set_sql */ { IILQssSetSqlio(11,(short *)0,1,30,sizeof(sess_id),&sess_id); @@ -588,7 +588,7 @@ void INGclear(INGresult *res) INGfreeDescriptor(res->sqlda); INGfreeINGresult(res); } -void INGcommit(const INGconn *conn) +void INGcommit(const INGconn *dbconn) { /* # line 587 "myingres.sc" */ @@ -712,7 +712,7 @@ void INGdisconnectDB(INGconn *dbconn) free(dbconn); } } -char *INGerrorMessage(const INGconn *conn) +char *INGerrorMessage(const INGconn *dbconn) { /* # line 682 "myingres.sc" */ @@ -724,16 +724,16 @@ char *INGerrorMessage(const INGconn *conn) IILQisInqSqlio((short *)0,1,32,255,errbuf,63); } /* # line 687 "myingres.sc" */ /* host code */ - strncpy(conn->msg, errbuf, sizeof(conn->msg)); - return conn->msg; + strncpy(dbconn->msg, errbuf, sizeof(dbconn->msg)); + return dbconn->msg; } char *INGcmdTuples(INGresult *res) { return res->numrowstring; } /* TODO? -int INGputCopyEnd(INGconn *conn, const char *errormsg); -int INGputCopyData(INGconn *conn, const char *buffer, int nbytes); +int INGputCopyEnd(INGconn *dbconn, const char *errormsg); +int INGputCopyData(INGconn *dbconn, const char *buffer, int nbytes); */ /* # line 701 "myingres.sc" */ #endif diff --git a/bacula/src/cats/myingres.sc b/bacula/src/cats/myingres.sc index f63484a76b..adebe2e6f0 100644 --- a/bacula/src/cats/myingres.sc +++ b/bacula/src/cats/myingres.sc @@ -47,7 +47,7 @@ EXEC SQL INCLUDE SQLDA; /* * ---Implementations--- */ -short INGgetCols(INGconn *conn, const char *query, bool transaction) +short INGgetCols(INGconn *dbconn, const char *query, bool transaction) { EXEC SQL BEGIN DECLARE SECTION; int sess_id; @@ -67,7 +67,7 @@ short INGgetCols(INGconn *conn, const char *query, bool transaction) /* * Switch to the correct default session for this thread. */ - sess_id = conn->session_id; + sess_id = dbconn->session_id; EXEC SQL SET_SQL (SESSION = :sess_id); EXEC SQL WHENEVER SQLERROR GOTO bail_out; @@ -479,7 +479,7 @@ short INGftype(const INGresult *res, int column_number) return res->fields[column_number].type; } -int INGexec(INGconn *conn, const char *query, bool transaction) +int INGexec(INGconn *dbconn, const char *query, bool transaction) { int check; EXEC SQL BEGIN DECLARE SECTION; @@ -494,7 +494,7 @@ int INGexec(INGconn *conn, const char *query, bool transaction) /* * Switch to the correct default session for this thread. */ - sess_id = conn->session_id; + sess_id = dbconn->session_id; EXEC SQL SET_SQL (SESSION = :sess_id); EXEC SQL WHENEVER SQLERROR GOTO bail_out; @@ -520,7 +520,7 @@ bail_out: return rowcount; } -INGresult *INGquery(INGconn *conn, const char *query, bool transaction) +INGresult *INGquery(INGconn *dbconn, const char *query, bool transaction) { /* * TODO: error handling @@ -528,7 +528,7 @@ INGresult *INGquery(INGconn *conn, const char *query, bool transaction) IISQLDA *desc = NULL; INGresult *res = NULL; int rows = -1; - int cols = INGgetCols(conn, query, transaction); + int cols = INGgetCols(dbconn, query, transaction); EXEC SQL BEGIN DECLARE SECTION; int sess_id; EXEC SQL END DECLARE SECTION; @@ -536,7 +536,7 @@ INGresult *INGquery(INGconn *conn, const char *query, bool transaction) /* * Switch to the correct default session for this thread. */ - sess_id = conn->session_id; + sess_id = dbconn->session_id; EXEC SQL SET_SQL (SESSION = :sess_id); desc = INGgetDescriptor(cols, query); @@ -582,7 +582,7 @@ void INGclear(INGresult *res) INGfreeINGresult(res); } -void INGcommit(const INGconn *conn) +void INGcommit(const INGconn *dbconn) { EXEC SQL BEGIN DECLARE SECTION; int sess_id; @@ -677,15 +677,15 @@ void INGdisconnectDB(INGconn *dbconn) } } -char *INGerrorMessage(const INGconn *conn) +char *INGerrorMessage(const INGconn *dbconn) { EXEC SQL BEGIN DECLARE SECTION; char errbuf[256]; EXEC SQL END DECLARE SECTION; EXEC SQL INQUIRE_INGRES (:errbuf = ERRORTEXT); - strncpy(conn->msg, errbuf, sizeof(conn->msg)); - return conn->msg; + strncpy(dbconn->msg, errbuf, sizeof(dbconn->msg)); + return dbconn->msg; } char *INGcmdTuples(INGresult *res) @@ -694,8 +694,8 @@ char *INGcmdTuples(INGresult *res) } /* TODO? -int INGputCopyEnd(INGconn *conn, const char *errormsg); -int INGputCopyData(INGconn *conn, const char *buffer, int nbytes); +int INGputCopyEnd(INGconn *dbconn, const char *errormsg); +int INGputCopyData(INGconn *dbconn, const char *buffer, int nbytes); */ #endif -- 2.39.5