From e9e979f43578da78804d9fb0420ef10c1c24526c Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Sat, 12 May 2012 02:50:58 +0000 Subject: [PATCH] Fix the bug reported by Alexandre(alepaes@aldeiadigital.com.br). 1. Don't discard the result of unnamed statements for later SQLDescribeCol or SQLColAttribute calls. 2. Set rowstart_in_cache properly when closing eof cursors. --- qresult.c | 3 ++- results.c | 2 +- statement.h | 2 +- version.h | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qresult.c b/qresult.c index 82257f3..c7f7363 100644 --- a/qresult.c +++ b/qresult.c @@ -695,6 +695,7 @@ QR_close(QResultClass *self) self->cursTuple = -1; QR_set_cursor(self, NULL); + QR_set_has_valid_base(self); if (!ret) return ret; @@ -1217,7 +1218,7 @@ inolog("id='%c' response_length=%d\n", id, response_length); self->next = QR_Constructor(); if (!self->next) { - CC_set_error(conn, CONNECTION_COULD_NOT_RECEIVE, "Could not create result info in send_query.", func); + CC_set_error(conn, CONNECTION_COULD_NOT_RECEIVE, "Could not create result info in QR_next_tuple.", func); CC_on_abort(conn, CONN_DEAD); return FALSE; } diff --git a/results.c b/results.c index 777c2c8..f3acb05 100644 --- a/results.c +++ b/results.c @@ -1754,7 +1754,7 @@ inolog("num_tuples=%d\n", num_tuples); /* currTuple is always 1 row prior to the rowset start */ stmt->currTuple = RowIdx2GIdx(-1, stmt); - if (useCursor || + if (SC_is_fetchcursor(stmt) || SQL_CURSOR_KEYSET_DRIVEN == stmt->options.cursor_type) { move_cursor_position_if_needed(stmt, res); diff --git a/statement.h b/statement.h index 3d800d1..cb21911 100644 --- a/statement.h +++ b/statement.h @@ -440,7 +440,7 @@ do { \ if (PREPARED_TEMPORARILY == (a)->prepared) \ { \ SC_set_prepared(a, ONCE_DESCRIBED); \ - if (!SC_IsExecuting((a))) \ + if (FALSE && !SC_IsExecuting((a))) \ { \ QResultClass *res = SC_get_Curres((a)); \ if (NULL != res && !res->dataFilled && !QR_is_fetching_tuples(res)) \ diff --git a/version.h b/version.h index 776eefd..7681d52 100644 --- a/version.h +++ b/version.h @@ -12,6 +12,6 @@ #define POSTGRESDRIVERVERSION "09.01.0101" #define POSTGRES_RESOURCE_VERSION "09.01.0101\0" #define PG_DRVFILE_VERSION 9,1,01,01 -#define PG_BUILD_VERSION "201205120004" +#define PG_BUILD_VERSION "201205120005 #endif -- 2.39.5