52
52
#define TYPE_KEYWORD "KEYWORD"
53
53
/* 8 */
54
54
#define TYPE_DATETIME "DATETIME"
55
+ /* 9 */
56
+ #define TYPE_GEOSHAPE "GEO_SHAPE"
57
+ #define TYPE_GEOPOINT "GEO_POINT"
55
58
/* 10 */
56
59
#define TYPE_HALF_FLOAT "HALF_FLOAT"
57
60
/* 11 */
@@ -1906,6 +1909,28 @@ static BOOL elastic_name2types(wstr_st *type_name,
1906
1909
}
1907
1910
break ;
1908
1911
1912
+ /* 9: GEO_POINT, GEO_SHAPE */
1913
+ case sizeof (TYPE_GEOSHAPE ) - 1 :
1914
+ switch (tolower (type_name -> str [/*'GEO_x'*/ 4 ])) {
1915
+ case (SQLWCHAR )'s' :
1916
+ if (! wmemncasecmp (type_name -> str , MK_WPTR (TYPE_GEOSHAPE ),
1917
+ type_name -> cnt )) {
1918
+ * c_sql = ES_GEO_TO_CSQL ;
1919
+ * sql = ES_GEO_TO_SQL ;
1920
+ return TRUE;
1921
+ }
1922
+ break ;
1923
+ case (SQLWCHAR )'p' :
1924
+ if (! wmemncasecmp (type_name -> str , MK_WPTR (TYPE_GEOPOINT ),
1925
+ type_name -> cnt )) {
1926
+ * c_sql = ES_GEO_TO_CSQL ;
1927
+ * sql = ES_GEO_TO_SQL ;
1928
+ return TRUE;
1929
+ }
1930
+ break ;
1931
+ }
1932
+ break ;
1933
+
1909
1934
/* 10: HALF_FLOAT */
1910
1935
case sizeof (TYPE_HALF_FLOAT ) - 1 :
1911
1936
if (! wmemncasecmp (type_name -> str , MK_WPTR (TYPE_HALF_FLOAT ),
@@ -2195,7 +2220,8 @@ static void *copy_types_rows(esodbc_dbc_st *dbc, estype_row_st *type_row,
2195
2220
* apply any needed fixes
2196
2221
*/
2197
2222
2198
- /* notify if scales extremes are different */
2223
+ /* notify if scales extremes are different, since ES/SQL makes use of
2224
+ * fixed types only. */
2199
2225
if (types [i ].maximum_scale != types [i ].minimum_scale ) {
2200
2226
INFOH (dbc , "type `" LWPDL "` returned with non-equal max/min "
2201
2227
"scale: %d/%d -- using the max." , LWSTR (& types [i ].type_name ),
@@ -2220,6 +2246,10 @@ static void *copy_types_rows(esodbc_dbc_st *dbc, estype_row_st *type_row,
2220
2246
if (types [i ].data_type == ESODBC_SQL_BOOLEAN ) {
2221
2247
types [i ].data_type = ES_BOOLEAN_TO_SQL ;
2222
2248
}
2249
+ /* GEO (SHAPE, POINT) types are WKT encodings */
2250
+ if (types [i ].data_type == ESODBC_SQL_GEO ) {
2251
+ types [i ].data_type = ES_GEO_TO_SQL ;
2252
+ }
2223
2253
2224
2254
/* .data_type is used in data conversions -> make sure the SQL type
2225
2255
* derived from type's name is the same with type reported value */
@@ -2962,6 +2992,9 @@ SQLRETURN EsSQLSetConnectAttrW(
2962
2992
RET_HDIAGS (dbc , SQL_STATE_HYC00 );
2963
2993
2964
2994
#ifndef NDEBUG
2995
+ /* MicroStrategy Desktop invoked */
2996
+ case 1041 :
2997
+ case 1042 :
2965
2998
/* MS Access/Jet proprietary info type */
2966
2999
case 30002 :
2967
3000
ERRH (dbc , "unsupported info type." );
0 commit comments