- fixed a really embarrasing bug introduced in the last version...
This commit is contained in:
parent
551f0a3ee2
commit
9e0d68ad76
|
@ -15,7 +15,7 @@ s48_value odbc_alloc_environment_handle()
|
|||
SQLHENV henv;
|
||||
SQLRETURN retval;
|
||||
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
retval = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
|
||||
ODBC_DEBUG_PRINTF_2("SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, ...): %x\n", henv);
|
||||
#else
|
||||
|
@ -28,13 +28,13 @@ s48_value odbc_alloc_environment_handle()
|
|||
case SQL_SUCCESS: case SQL_SUCCESS_WITH_INFO:
|
||||
return s48_enter_integer((long)henv);
|
||||
case SQL_ERROR:
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocHandle returned SQL_ERROR");
|
||||
#else
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocEnv returned SQL_ERROR");
|
||||
#endif /* (ODBCVER >= 0x300) */
|
||||
default:
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocHandle unknown return value");
|
||||
#else
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocEnv unknown return value");
|
||||
|
@ -87,7 +87,7 @@ s48_value odbc_alloc_connection_handle(s48_value env_handle) {
|
|||
|
||||
envh = (SQLHENV) s48_extract_integer(env_handle);
|
||||
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
retval = SQLAllocHandle(SQL_HANDLE_DBC, envh, &hdbc);
|
||||
ODBC_DEBUG_PRINTF_3("SQLAllocHandle(SQL_HANDLE_DBC, %x, ...): %x\n", envh, hdbc);
|
||||
#else
|
||||
|
@ -103,7 +103,7 @@ s48_value odbc_alloc_connection_handle(s48_value env_handle) {
|
|||
}
|
||||
case SQL_ERROR:
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocHandle returned SQL_ERROR");
|
||||
#else
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocConnect returned SQL_ERROR");
|
||||
|
@ -112,7 +112,7 @@ s48_value odbc_alloc_connection_handle(s48_value env_handle) {
|
|||
}
|
||||
case SQL_INVALID_HANDLE:
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocHandle got invalid handle");
|
||||
#else
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocConnect got invalid handle");
|
||||
|
@ -121,7 +121,7 @@ s48_value odbc_alloc_connection_handle(s48_value env_handle) {
|
|||
}
|
||||
default:
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocHandle returned unknown error code");
|
||||
#else
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocConnect returned unknown error code");
|
||||
|
@ -140,7 +140,7 @@ s48_value odbc_alloc_statement_handle(s48_value conn_handle) {
|
|||
|
||||
ch = (SQLHANDLE) s48_extract_integer(conn_handle);
|
||||
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
retval = SQLAllocHandle(SQL_HANDLE_STMT, ch, &hstmt);
|
||||
ODBC_DEBUG_PRINTF_3("SQLAllocHandle() %x %x\n", ch, hstmt);
|
||||
#else
|
||||
|
@ -156,7 +156,7 @@ s48_value odbc_alloc_statement_handle(s48_value conn_handle) {
|
|||
}
|
||||
case SQL_ERROR:
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocHandle returned SQL_ERROR");
|
||||
#else
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocStmt returned SQL_ERROR");
|
||||
|
@ -165,7 +165,7 @@ s48_value odbc_alloc_statement_handle(s48_value conn_handle) {
|
|||
}
|
||||
case SQL_INVALID_HANDLE:
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocHandle got invalid handle");
|
||||
#else
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocStmt returned SQL_ERROR");
|
||||
|
@ -174,7 +174,7 @@ s48_value odbc_alloc_statement_handle(s48_value conn_handle) {
|
|||
}
|
||||
default:
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocHandle returned unknown error code");
|
||||
#else
|
||||
ODBC_RAISE_EXCEPTION("SQLAllocStmt returned unknown error code");
|
||||
|
@ -406,7 +406,7 @@ s48_value odbc_sql_data_sources(s48_value env_handle)
|
|||
/* Returns the list of installed drivers and their attributes. */
|
||||
s48_value odbc_sql_drivers(s48_value env_handle)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x0200)
|
||||
#if (ODBCVER >= 0x0200)
|
||||
SQLHENV eh;
|
||||
SQLRETURN retval;
|
||||
SQLCHAR driver_descr[ODBC_MAX_DRIVER_NAME_LEN];
|
||||
|
@ -662,7 +662,7 @@ s48_value odbc_sql_set_connect_attr_int(s48_value conn_handle,
|
|||
s48_value attribute,
|
||||
s48_value value)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHDBC ch;
|
||||
SQLINTEGER attr;
|
||||
SQLUINTEGER val;
|
||||
|
@ -707,7 +707,7 @@ s48_value odbc_sql_set_connect_attr_string(s48_value conn_handle,
|
|||
s48_value attribute,
|
||||
s48_value value)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHDBC ch;
|
||||
SQLINTEGER attr;
|
||||
SQLCHAR *val;
|
||||
|
@ -751,7 +751,7 @@ s48_value odbc_sql_set_connect_attr_string(s48_value conn_handle,
|
|||
s48_value odbc_sql_get_connect_attr_string(s48_value conn_handle,
|
||||
s48_value attribute)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHDBC ch;
|
||||
SQLINTEGER attr;
|
||||
SQLCHAR *buffer = NULL;
|
||||
|
@ -805,7 +805,7 @@ s48_value odbc_sql_get_connect_attr_string(s48_value conn_handle,
|
|||
s48_value odbc_sql_get_connect_attr_int(s48_value conn_handle,
|
||||
s48_value attribute)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHDBC ch;
|
||||
SQLINTEGER attr;
|
||||
SQLUINTEGER buffer;
|
||||
|
@ -848,7 +848,7 @@ s48_value odbc_sql_set_env_attr_int(s48_value env_handle,
|
|||
s48_value attribute,
|
||||
s48_value value)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHENV eh;
|
||||
SQLINTEGER attr;
|
||||
SQLUINTEGER val;
|
||||
|
@ -892,7 +892,7 @@ s48_value odbc_sql_get_env_attr_int(s48_value env_handle,
|
|||
s48_value attribute,
|
||||
s48_value value)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHENV eh;
|
||||
SQLINTEGER attr;
|
||||
SQLUINTEGER val, str_len;
|
||||
|
@ -937,7 +937,7 @@ s48_value odbc_sql_set_stmt_attr_int(s48_value stmt_handle,
|
|||
s48_value attribute,
|
||||
s48_value value)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHSTMT sh;
|
||||
SQLINTEGER attr;
|
||||
SQLUINTEGER val;
|
||||
|
@ -982,7 +982,7 @@ s48_value odbc_sql_set_stmt_attr_string(s48_value stmt_handle,
|
|||
s48_value attribute,
|
||||
s48_value value)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHSTMT sh;
|
||||
SQLINTEGER attr;
|
||||
SQLCHAR *val;
|
||||
|
@ -1025,7 +1025,7 @@ s48_value odbc_sql_set_stmt_attr_string(s48_value stmt_handle,
|
|||
|
||||
s48_value odbc_sql_get_stmt_attr_int(s48_value stmt_handle, s48_value attribute)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHSTMT sh;
|
||||
SQLINTEGER attr, val, buf_size;
|
||||
SQLRETURN retval;
|
||||
|
@ -1067,7 +1067,7 @@ s48_value odbc_sql_get_stmt_attr_int(s48_value stmt_handle, s48_value attribute)
|
|||
s48_value odbc_sql_get_stmt_attr_string(s48_value stmt_handle,
|
||||
s48_value attribute)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHSTMT sh;
|
||||
SQLINTEGER attr, buffer_len, buffer_needed;
|
||||
SQLCHAR *buffer = NULL;
|
||||
|
@ -1129,7 +1129,7 @@ s48_value odbc_sql_get_stmt_attr_string(s48_value stmt_handle,
|
|||
s48_value odbc_sql_get_desc_field_int(s48_value desc_handle, s48_value rec_number,
|
||||
s48_value field_id)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHDESC dh;
|
||||
SQLSMALLINT rn, fi;
|
||||
SQLINTEGER value, buffer_len;
|
||||
|
@ -1194,7 +1194,7 @@ s48_value odbc_sql_get_desc_field_int(s48_value desc_handle, s48_value rec_numbe
|
|||
s48_value odbc_sql_get_desc_field_string(s48_value desc_handle, s48_value rec_number,
|
||||
s48_value field_id)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHDESC dh;
|
||||
SQLSMALLINT rn, fi;
|
||||
SQLCHAR *buffer = NULL;
|
||||
|
@ -1306,7 +1306,7 @@ s48_value odbc_sql_prepare(s48_value stmt_handle, s48_value stmt_txt)
|
|||
s48_value odbc_sql_bind_parameter_exec_out(s48_value stmt_handle,
|
||||
s48_value param_vals)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x200)
|
||||
#if (ODBCVER >= 0x200)
|
||||
SQLHSTMT sh;
|
||||
SQLSMALLINT value_type, param_type;
|
||||
SQLRETURN retval;
|
||||
|
@ -2010,7 +2010,7 @@ s48_value odbc_sql_set_pos(s48_value stmt_handle, s48_value row_number,
|
|||
update, delete, and fetch by bookmark. */
|
||||
s48_value odbc_sql_bulk_operations(s48_value stmt_handle, s48_value operation)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHSTMT sh;
|
||||
SQLUSMALLINT op;
|
||||
SQLRETURN retval;
|
||||
|
@ -2261,7 +2261,7 @@ s48_value odbc_sql_describe_col(s48_value stmt_handle, s48_value column_number)
|
|||
s48_value odbc_sql_col_attribute(s48_value stmt_handle, s48_value column_number,
|
||||
s48_value field_id)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHSTMT sh;
|
||||
SQLUSMALLINT cn, fi;
|
||||
SQLCHAR *buffer = NULL;
|
||||
|
@ -3173,7 +3173,7 @@ s48_value odbc_sql_free_statement(s48_value stmt_handle, s48_value option)
|
|||
/* Closes a cursor that has been opened on a statement handle */
|
||||
s48_value odbc_sql_close_cursor(s48_value stmt_handle)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLHSTMT sh;
|
||||
SQLRETURN retval;
|
||||
|
||||
|
@ -3246,7 +3246,7 @@ s48_value odbc_sql_cancel(s48_value stmt_handle)
|
|||
s48_value odbc_sql_endtran(s48_value handle_type, s48_value handle,
|
||||
s48_value completion_type)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLSMALLINT ht, ct;
|
||||
SQLHANDLE h;
|
||||
SQLRETURN retval;
|
||||
|
@ -3333,7 +3333,7 @@ s48_value odbc_sql_disconnect(s48_value conn_handle)
|
|||
/* Free a handle */
|
||||
s48_value odbc_sql_free_handle(s48_value handle_type, s48_value handle)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLSMALLINT ht;
|
||||
SQLHANDLE h;
|
||||
SQLRETURN retval;
|
||||
|
@ -3381,7 +3381,7 @@ s48_value odbc_sql_free_handle(s48_value handle_type, s48_value handle)
|
|||
|
||||
s48_value odbc_sql_get_diag_recs(s48_value handle_type, s48_value handle)
|
||||
{
|
||||
#ifdef (ODBCVER >= 0x300)
|
||||
#if (ODBCVER >= 0x300)
|
||||
SQLSMALLINT ht;
|
||||
SQLHANDLE h;
|
||||
SQLCHAR sql_state[6];
|
||||
|
@ -3462,7 +3462,7 @@ s48_value odbc_sql_get_diag_recs(s48_value handle_type, s48_value handle)
|
|||
#endif /* ODBCVER >= 0x300 */
|
||||
}
|
||||
|
||||
#ifdef ODBC_DEBUG_MSGS
|
||||
#if ODBC_DEBUG_MSGS
|
||||
/* print detailed debug information */
|
||||
|
||||
void odbc_debug_msgs(SQLSMALLINT handle_type, SQLHANDLE handle)
|
||||
|
|
Loading…
Reference in New Issue