summaryrefslogtreecommitdiff
path: root/src/interfaces/odbc/statement.c
diff options
context:
space:
mode:
authorHiroshi Inoue <inoue@tpf.co.jp>2002-02-18 03:16:11 +0000
committerHiroshi Inoue <inoue@tpf.co.jp>2002-02-18 03:16:11 +0000
commit3c16d095b5b395560a567db8ae8cfa06899150f9 (patch)
tree35c051e30bea40eb4003f2749117cb6ab627f1d0 /src/interfaces/odbc/statement.c
parentb6db89a02d187a42e33fc3af8170749f22fdac99 (diff)
The version is now 7.01.0010.
1) Handle parameter array. 2) Allow re-use of the connection handle after SQLDisconnect. 3) Reject NULL if no indicator specified. 4) Improve the handling of '_' in table name. 5) Unify internal begin/commit/abort operations. 6) Change SQLTables() to return null not "" for the table_owner. 7) Fix a bug about parameter handling reported by Benoit Menendez. 8) Add cast in handling ODBC date/time escape sequences. 9) Fix a bug about cache_size handing in declare/fetch mode. [ODBC3.0 related] 10) Improve the handling of descriptor handles(ODBC3.0). 11) Improve the type handling of some types for ODBC3.0. [Thanks to Marcelo Aceto for his useful patches] 12) Allow nested ODBC escape. 13) Allow changing autocommit on/off inside the transaction block. 14) Improve the handling of ODBC scalar functions.
Diffstat (limited to 'src/interfaces/odbc/statement.c')
-rw-r--r--src/interfaces/odbc/statement.c40
1 files changed, 12 insertions, 28 deletions
diff --git a/src/interfaces/odbc/statement.c b/src/interfaces/odbc/statement.c
index bfdb8a2fc01..2b2e5f0634e 100644
--- a/src/interfaces/odbc/statement.c
+++ b/src/interfaces/odbc/statement.c
@@ -263,6 +263,9 @@ SC_Constructor(void)
rv->data_at_exec = -1;
rv->current_exec_param = -1;
+ rv->exec_start_row = -1;
+ rv->exec_end_row = -1;
+ rv->exec_current_row = -1;
rv->put_data = FALSE;
rv->lobj_fd = -1;
@@ -404,6 +407,9 @@ SC_free_params(StatementClass *self, char option)
free(self->parameters);
self->parameters = NULL;
self->parameters_allocated = 0;
+ self->exec_start_row = -1;
+ self->exec_end_row = -1;
+ self->exec_current_row = -1;
}
mylog("SC_free_params: EXIT\n");
@@ -778,10 +784,12 @@ SC_fetch(StatementClass *self)
if (self->bookmark.buffer)
{
char buf[32];
+ UInt4 offset = self->options.row_offset_ptr ? *self->options.row_offset_ptr : 0;
sprintf(buf, "%ld", SC_get_bookmark(self));
result = copy_and_convert_field(self, 0, buf,
- SQL_C_ULONG, self->bookmark.buffer, 0, self->bookmark.used);
+ SQL_C_ULONG, self->bookmark.buffer + offset, 0,
+ self->bookmark.used ? self->bookmark.used + (offset >> 2) : NULL);
}
#ifdef DRIVER_CURSOR_IMPLEMENT
@@ -892,10 +900,7 @@ SC_execute(StatementClass *self)
{
static char *func = "SC_execute";
ConnectionClass *conn;
- QResultClass *res;
- char ok,
- was_ok,
- was_nonfatal;
+ char was_ok, was_nonfatal;
Int2 oldstatus,
numcols;
QueryInfo qi;
@@ -920,30 +925,13 @@ SC_execute(StatementClass *self)
(!CC_is_in_autocommit(conn) && self->statement_type != STMT_TYPE_OTHER)))
{
mylog(" about to begin a transaction on statement = %u\n", self);
- res = CC_send_query(conn, "BEGIN", NULL);
- if (QR_aborted(res))
+ if (!CC_begin(conn))
{
self->errormsg = "Could not begin a transaction";
self->errornumber = STMT_EXEC_ERROR;
SC_log_error(func, "", self);
return SQL_ERROR;
}
-
- ok = QR_command_successful(res);
-
- mylog("SC_exec: begin ok = %d, status = %d\n", ok, QR_get_status(res));
-
- QR_Destructor(res);
-
- if (!ok)
- {
- self->errormsg = "Could not begin a transaction";
- self->errornumber = STMT_EXEC_ERROR;
- SC_log_error(func, "", self);
- return SQL_ERROR;
- }
- else
- CC_set_in_trans(conn);
}
oldstatus = conn->status;
@@ -1008,11 +996,7 @@ SC_execute(StatementClass *self)
* transactions must be committed. (Hiroshi, 02/11/2001)
*/
if (!self->internal && CC_is_in_autocommit(conn) && CC_is_in_trans(conn))
- {
- res = CC_send_query(conn, "COMMIT", NULL);
- QR_Destructor(res);
- CC_set_no_trans(conn);
- }
+ CC_commit(conn);
}
conn->status = oldstatus;