Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi Inoue2002-03-11 10:25:57 +0000
committerHiroshi Inoue2002-03-11 10:25:57 +0000
commitdadb718b103d6675399547d3f6c12d0726f9537e (patch)
tree52a79b9c8affb5d5c4b7591516d470367483f60a /src/interfaces/odbc/info.c
parentd0d3ab532509c11c6f21ce189ad1ba44437baa62 (diff)
Bug fixes for the 2002-03-08 change.
1) Put back the error message for SQLError(). 2) Change Disallow premature to handle the SELECTed result. 3) Put back the behavior of AUTUCOMMIT mode change. 4) Fix SQLColumns for ODBC3.0. 5) Improve the handling of variable bookmark in ODBC3.0. 6) Enable Recognize Unique Index Button.
Diffstat (limited to 'src/interfaces/odbc/info.c')
-rw-r--r--src/interfaces/odbc/info.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/interfaces/odbc/info.c b/src/interfaces/odbc/info.c
index fc5dcef3415..10a900207c6 100644
--- a/src/interfaces/odbc/info.c
+++ b/src/interfaces/odbc/info.c
@@ -1734,7 +1734,11 @@ PGAPI_Columns(
* a statement is actually executed, so we'll have to do this
* ourselves.
*/
+#if (ODBCVER >= 0x0300)
+ result_cols = 18;
+#else
result_cols = 14;
+#endif /* ODBCVER */
extend_bindings(stmt, result_cols);
/* set the field names */
@@ -1803,7 +1807,12 @@ PGAPI_Columns(
set_tuplefield_string(&row->tuple[11], "");
#if (ODBCVER >= 0x0300)
+ set_tuplefield_null(&row->tuple[12]);
set_tuplefield_int2(&row->tuple[13], sqltype);
+ set_tuplefield_null(&row->tuple[14]);
+ set_tuplefield_int4(&row->tuple[15], pgtype_length(stmt, the_type, PG_STATIC, PG_STATIC));
+ set_tuplefield_int4(&row->tuple[16], 0);
+ set_tuplefield_string(&row->tuple[17], "No");
#else
set_tuplefield_int4(&row->tuple[12], pgtype_display_size(stmt, the_type, PG_STATIC, PG_STATIC));
set_tuplefield_int4(&row->tuple[13], the_type);
@@ -1918,9 +1927,12 @@ PGAPI_Columns(
break;
default:
set_tuplefield_int2(&row->tuple[13], sqltype);
+ set_tuplefield_null(&row->tuple[14]);
break;
}
+ set_tuplefield_int4(&row->tuple[15], pgtype_length(stmt, field_type, PG_STATIC, PG_STATIC));
set_tuplefield_int4(&row->tuple[16], field_number);
+ set_tuplefield_null(&row->tuple[17]);
#else
set_tuplefield_int4(&row->tuple[13], field_type);
#endif /* ODBCVER */
@@ -1956,7 +1968,8 @@ PGAPI_Columns(
set_tuplefield_string(&row->tuple[1], "");
set_tuplefield_string(&row->tuple[2], table_name);
set_tuplefield_string(&row->tuple[3], "xmin");
- set_tuplefield_int2(&row->tuple[4], pgtype_to_sqltype(stmt, the_type));
+ sqltype = pgtype_to_sqltype(stmt, the_type);
+ set_tuplefield_int2(&row->tuple[4], sqltype);
set_tuplefield_string(&row->tuple[5], pgtype_to_name(stmt, the_type));
set_tuplefield_int4(&row->tuple[6], pgtype_precision(stmt, the_type, PG_STATIC, PG_STATIC));
set_tuplefield_int4(&row->tuple[7], pgtype_length(stmt, the_type, PG_STATIC, PG_STATIC));
@@ -1964,8 +1977,17 @@ PGAPI_Columns(
set_nullfield_int2(&row->tuple[9], pgtype_radix(stmt, the_type));
set_tuplefield_int2(&row->tuple[10], SQL_NO_NULLS);
set_tuplefield_string(&row->tuple[11], "");
+#if (ODBCVER >= 0x0300)
+ set_tuplefield_null(&row->tuple[12]);
+ set_tuplefield_int2(&row->tuple[13], sqltype);
+ set_tuplefield_null(&row->tuple[14]);
+ set_tuplefield_int4(&row->tuple[15], pgtype_length(stmt, the_type, PG_STATIC, PG_STATIC));
+ set_tuplefield_int4(&row->tuple[16], 0);
+ set_tuplefield_string(&row->tuple[17], "No");
+#else
set_tuplefield_int4(&row->tuple[12], pgtype_display_size(stmt, the_type, PG_STATIC, PG_STATIC));
set_tuplefield_int4(&row->tuple[13], the_type);
+#endif /* ODBCVER */
QR_add_tuple(res, row);
}