summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--options.c24
-rw-r--r--pgapi30.c6
-rw-r--r--pgapifunc.h2
-rw-r--r--results.c6
4 files changed, 19 insertions, 19 deletions
diff --git a/options.c b/options.c
index 2759000..8ab2158 100644
--- a/options.c
+++ b/options.c
@@ -314,7 +314,7 @@ set_statement_option(ConnectionClass *conn,
RETCODE SQL_API
PGAPI_SetConnectOption(HDBC hdbc,
SQLUSMALLINT fOption,
- SQLUINTEGER vParam)
+ SQLPOINTER vParam)
{
CSTR func = "PGAPI_SetConnectOption";
ConnectionClass *conn = (ConnectionClass *) hdbc;
@@ -322,7 +322,7 @@ PGAPI_SetConnectOption(HDBC hdbc,
RETCODE retval;
int i;
- mylog("%s: entering fOption = %d vParam = %d\n", func, fOption, vParam);
+ mylog("%s: entering fOption = %d vParam = %d\n", func, fOption, (unsigned long) vParam);
if (!conn)
{
CC_log_error(func, "", NULL);
@@ -353,14 +353,14 @@ PGAPI_SetConnectOption(HDBC hdbc,
for (i = 0; i < conn->num_stmts; i++)
{
if (conn->stmts[i])
- set_statement_option(NULL, conn->stmts[i], fOption, vParam);
+ set_statement_option(NULL, conn->stmts[i], fOption, (UDWORD) ((unsigned long) vParam));
}
/*
* Become the default for all future statements on this
* connection
*/
- retval = set_statement_option(conn, NULL, fOption, vParam);
+ retval = set_statement_option(conn, NULL, fOption, (UDWORD) ((unsigned long) vParam));
if (retval == SQL_SUCCESS_WITH_INFO)
changed = TRUE;
@@ -377,16 +377,16 @@ PGAPI_SetConnectOption(HDBC hdbc,
break;
case SQL_AUTOCOMMIT:
- if (vParam == SQL_AUTOCOMMIT_ON && CC_is_in_autocommit(conn))
+ if (vParam == (SQLPOINTER) SQL_AUTOCOMMIT_ON && CC_is_in_autocommit(conn))
break;
- else if (vParam == SQL_AUTOCOMMIT_OFF && !CC_is_in_autocommit(conn))
+ else if (vParam == (SQLPOINTER) SQL_AUTOCOMMIT_OFF && !CC_is_in_autocommit(conn))
break;
if (CC_is_in_trans(conn))
CC_commit(conn);
mylog("PGAPI_SetConnectOption: AUTOCOMMIT: transact_status=%d, vparam=%d\n", conn->transact_status, vParam);
- switch (vParam)
+ switch ((unsigned long) vParam)
{
case SQL_AUTOCOMMIT_OFF:
CC_set_autocommit_off(conn);
@@ -423,9 +423,9 @@ PGAPI_SetConnectOption(HDBC hdbc,
CC_log_error(func, "", conn);
return SQL_ERROR;
}
- if (conn->isolation == vParam)
+ if (conn->isolation == (unsigned long) vParam)
break;
- switch (vParam)
+ switch ((unsigned long) vParam)
{
case SQL_TXN_SERIALIZABLE:
if (PG_VERSION_GE(conn, 6.5) &&
@@ -450,7 +450,7 @@ PGAPI_SetConnectOption(HDBC hdbc,
char *query;
QResultClass *res;
- if (vParam == SQL_TXN_SERIALIZABLE)
+ if (vParam == (SQLPOINTER) SQL_TXN_SERIALIZABLE)
query = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE";
else
query = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED";
@@ -458,7 +458,7 @@ PGAPI_SetConnectOption(HDBC hdbc,
if (!res || !QR_command_maybe_successful(res))
retval = SQL_ERROR;
else
- conn->isolation = vParam;
+ conn->isolation = (SQLUINTEGER) ((unsigned long) vParam);
if (res)
QR_Destructor(res);
if (SQL_ERROR == retval)
@@ -483,7 +483,7 @@ PGAPI_SetConnectOption(HDBC hdbc,
char option[64];
CC_set_error(conn, CONN_UNSUPPORTED_OPTION, "Unknown connect option (Set)");
- sprintf(option, "fOption=%d, vParam=%ld", fOption, vParam);
+ sprintf(option, "fOption=%d, vParam=%ld", fOption, (unsigned long) vParam);
if (fOption == 30002 && vParam)
{
int cmp;
diff --git a/pgapi30.c b/pgapi30.c
index 4bc910f..36a6c9b 100644
--- a/pgapi30.c
+++ b/pgapi30.c
@@ -1556,7 +1556,7 @@ PGAPI_SetConnectAttr(HDBC ConnectionHandle,
CC_set_error(conn, STMT_OPTION_NOT_FOR_THE_DRIVER, "Unsupported connect attribute (Set)");
return SQL_ERROR;
default:
- ret = PGAPI_SetConnectOption(ConnectionHandle, (UWORD) Attribute, (UDWORD) ((unsigned long) Value));
+ ret = PGAPI_SetConnectOption(ConnectionHandle, (UWORD) Attribute, Value);
}
return ret;
}
@@ -1833,7 +1833,7 @@ RETCODE bulk_ope_callback(RETCODE retcode, void *para)
}
conn = SC_get_conn(s->stmt);
if (s->auto_commit_needed)
- PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);
+ PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_ON);
irdflds = SC_get_IRDF(s->stmt);
if (irdflds->rowsFetched)
*(irdflds->rowsFetched) = s->processed;
@@ -1863,7 +1863,7 @@ PGAPI_BulkOperations(HSTMT hstmt, SQLSMALLINT operationX)
{
conn = SC_get_conn(s.stmt);
if (s.auto_commit_needed = (char) CC_is_in_autocommit(conn), s.auto_commit_needed)
- PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
+ PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_OFF);
}
if (SQL_ADD != s.operation)
{
diff --git a/pgapifunc.h b/pgapifunc.h
index af07a89..59b0f9b 100644
--- a/pgapifunc.h
+++ b/pgapifunc.h
@@ -143,7 +143,7 @@ RETCODE SQL_API PGAPI_RowCount(HSTMT hstmt,
SQLINTEGER *pcrow);
RETCODE SQL_API PGAPI_SetConnectOption(HDBC hdbc,
SQLUSMALLINT fOption,
- SQLUINTEGER vParam);
+ SQLPOINTER vParam);
RETCODE SQL_API PGAPI_SetCursorName(HSTMT StatementHandle,
SQLCHAR *CursorName, SQLSMALLINT NameLength);
RETCODE SQL_API PGAPI_SetParam(HSTMT StatementHandle,
diff --git a/results.c b/results.c
index 32db362..bbe2da0 100644
--- a/results.c
+++ b/results.c
@@ -3020,7 +3020,7 @@ RETCODE spos_callback(RETCODE retcode, void *para)
if (SQL_ERROR == ret)
CC_abort(conn);
if (s->auto_commit_needed)
- PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);
+ PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_ON);
if (s->irow > 0)
{
if (SQL_ADD != s->fOption && s->ridx >= 0) /* for SQLGetData */
@@ -3126,7 +3126,7 @@ PGAPI_SetPos(
case SQL_DELETE:
case SQL_ADD:
if (s.auto_commit_needed = CC_is_in_autocommit(conn), s.auto_commit_needed)
- PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
+ PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_OFF);
break;
}
#endif /* DRIVER_CURSOR_IMPLEMENT */
@@ -3187,7 +3187,7 @@ PGAPI_SetPos(
if (SQL_ERROR == ret)
CC_abort(conn);
if (auto_commit_needed)
- PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);
+ PGAPI_SetConnectOption(conn, SQL_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_ON);
if (irow > 0)
{
if (SQL_ADD != fOption && ridx >= 0) /* for SQLGetData */