diff options
| author | Hiroshi Inoue | 2016-10-25 09:58:12 +0000 |
|---|---|---|
| committer | Hiroshi Inoue | 2016-11-02 11:35:23 +0000 |
| commit | fa1666200b5d1d97f085569a5b120e76e41a2d87 (patch) | |
| tree | 3848bec5bcde833c197b82158883d4c147593729 /options.c | |
| parent | 67fa76d40114e6c1b3f34c06f35dfdff0a0f1e2d (diff) | |
Added to commit 7849ba( was a patch by Tsunakawa,Takayuki).
Now default isolation level is server's default instead of fixed SQL_TXN_READ_COMMITTED.
Also reduced the number of round trips using multiple commands.
Diffstat (limited to 'options.c')
| -rw-r--r-- | options.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -399,10 +399,9 @@ PGAPI_SetConnectOption(HDBC hdbc, * If the connection is not established, just record the setting to * reflect it upon connection. */ - if (conn->status == CONN_NOT_CONNECTED || conn->status == CONN_DOWN) + if (CC_not_connected(conn)) { conn->isolation = (UInt4) vParam; - conn->isolation_set_delay = 1; break; } @@ -531,6 +530,12 @@ PGAPI_GetConnectOption(HDBC hdbc, break; case SQL_TXN_ISOLATION: + if (conn->isolation == 0) + { + if (CC_not_connected(conn)) + return SQL_NO_DATA; + conn->isolation = CC_get_isolation(conn); + } *((SQLUINTEGER *) pvParam) = conn->isolation; break; @@ -540,7 +545,7 @@ PGAPI_GetConnectOption(HDBC hdbc, case 1209: #endif /* SQL_ATTR_CONNECTION_DEAD */ mylog("CONNECTION_DEAD status=%d", conn->status); - *((SQLUINTEGER *) pvParam) = (conn->status == CONN_NOT_CONNECTED || conn->status == CONN_DOWN); + *((SQLUINTEGER *) pvParam) = CC_not_connected(conn); mylog(" val=%d\n", *((SQLUINTEGER *) pvParam)); break; |
