@@ -1734,7 +1734,11 @@ PGAPI_Columns(
1734
1734
* a statement is actually executed, so we'll have to do this
1735
1735
* ourselves.
1736
1736
*/
1737
+ #if (ODBCVER >=0x0300 )
1738
+ result_cols = 18 ;
1739
+ #else
1737
1740
result_cols = 14 ;
1741
+ #endif /* ODBCVER */
1738
1742
extend_bindings (stmt ,result_cols );
1739
1743
1740
1744
/* set the field names */
@@ -1803,7 +1807,12 @@ PGAPI_Columns(
1803
1807
set_tuplefield_string (& row -> tuple [11 ],"" );
1804
1808
1805
1809
#if (ODBCVER >=0x0300 )
1810
+ set_tuplefield_null (& row -> tuple [12 ]);
1806
1811
set_tuplefield_int2 (& row -> tuple [13 ],sqltype );
1812
+ set_tuplefield_null (& row -> tuple [14 ]);
1813
+ set_tuplefield_int4 (& row -> tuple [15 ],pgtype_length (stmt ,the_type ,PG_STATIC ,PG_STATIC ));
1814
+ set_tuplefield_int4 (& row -> tuple [16 ],0 );
1815
+ set_tuplefield_string (& row -> tuple [17 ],"No" );
1807
1816
#else
1808
1817
set_tuplefield_int4 (& row -> tuple [12 ],pgtype_display_size (stmt ,the_type ,PG_STATIC ,PG_STATIC ));
1809
1818
set_tuplefield_int4 (& row -> tuple [13 ],the_type );
@@ -1918,9 +1927,12 @@ PGAPI_Columns(
1918
1927
break ;
1919
1928
default :
1920
1929
set_tuplefield_int2 (& row -> tuple [13 ],sqltype );
1930
+ set_tuplefield_null (& row -> tuple [14 ]);
1921
1931
break ;
1922
1932
}
1933
+ set_tuplefield_int4 (& row -> tuple [15 ],pgtype_length (stmt ,field_type ,PG_STATIC ,PG_STATIC ));
1923
1934
set_tuplefield_int4 (& row -> tuple [16 ],field_number );
1935
+ set_tuplefield_null (& row -> tuple [17 ]);
1924
1936
#else
1925
1937
set_tuplefield_int4 (& row -> tuple [13 ],field_type );
1926
1938
#endif /* ODBCVER */
@@ -1956,16 +1968,26 @@ PGAPI_Columns(
1956
1968
set_tuplefield_string (& row -> tuple [1 ],"" );
1957
1969
set_tuplefield_string (& row -> tuple [2 ],table_name );
1958
1970
set_tuplefield_string (& row -> tuple [3 ],"xmin" );
1959
- set_tuplefield_int2 (& row -> tuple [4 ],pgtype_to_sqltype (stmt ,the_type ));
1971
+ sqltype = pgtype_to_sqltype (stmt ,the_type );
1972
+ set_tuplefield_int2 (& row -> tuple [4 ],sqltype );
1960
1973
set_tuplefield_string (& row -> tuple [5 ],pgtype_to_name (stmt ,the_type ));
1961
1974
set_tuplefield_int4 (& row -> tuple [6 ],pgtype_precision (stmt ,the_type ,PG_STATIC ,PG_STATIC ));
1962
1975
set_tuplefield_int4 (& row -> tuple [7 ],pgtype_length (stmt ,the_type ,PG_STATIC ,PG_STATIC ));
1963
1976
set_nullfield_int2 (& row -> tuple [8 ],pgtype_scale (stmt ,the_type ,PG_STATIC ));
1964
1977
set_nullfield_int2 (& row -> tuple [9 ],pgtype_radix (stmt ,the_type ));
1965
1978
set_tuplefield_int2 (& row -> tuple [10 ],SQL_NO_NULLS );
1966
1979
set_tuplefield_string (& row -> tuple [11 ],"" );
1980
+ #if (ODBCVER >=0x0300 )
1981
+ set_tuplefield_null (& row -> tuple [12 ]);
1982
+ set_tuplefield_int2 (& row -> tuple [13 ],sqltype );
1983
+ set_tuplefield_null (& row -> tuple [14 ]);
1984
+ set_tuplefield_int4 (& row -> tuple [15 ],pgtype_length (stmt ,the_type ,PG_STATIC ,PG_STATIC ));
1985
+ set_tuplefield_int4 (& row -> tuple [16 ],0 );
1986
+ set_tuplefield_string (& row -> tuple [17 ],"No" );
1987
+ #else
1967
1988
set_tuplefield_int4 (& row -> tuple [12 ],pgtype_display_size (stmt ,the_type ,PG_STATIC ,PG_STATIC ));
1968
1989
set_tuplefield_int4 (& row -> tuple [13 ],the_type );
1990
+ #endif /* ODBCVER */
1969
1991
1970
1992
QR_add_tuple (res ,row );
1971
1993
}