5252#define TYPE_KEYWORD "KEYWORD"
5353/* 8 */
5454#define TYPE_DATETIME "DATETIME"
55+ /* 9 */
56+ #define TYPE_GEOSHAPE "GEO_SHAPE"
57+ #define TYPE_GEOPOINT "GEO_POINT"
5558/* 10 */
5659#define TYPE_HALF_FLOAT "HALF_FLOAT"
5760/* 11 */
@@ -1906,6 +1909,28 @@ static BOOL elastic_name2types(wstr_st *type_name,
19061909 }
19071910 break ;
19081911
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+
19091934 /* 10: HALF_FLOAT */
19101935 case sizeof (TYPE_HALF_FLOAT ) - 1 :
19111936 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,
21952220 * apply any needed fixes
21962221 */
21972222
2198- /* notify if scales extremes are different */
2223+ /* notify if scales extremes are different, since ES/SQL makes use of
2224+ * fixed types only. */
21992225 if (types [i ].maximum_scale != types [i ].minimum_scale ) {
22002226 INFOH (dbc , "type `" LWPDL "` returned with non-equal max/min "
22012227 "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,
22202246 if (types [i ].data_type == ESODBC_SQL_BOOLEAN ) {
22212247 types [i ].data_type = ES_BOOLEAN_TO_SQL ;
22222248 }
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+ }
22232253
22242254 /* .data_type is used in data conversions -> make sure the SQL type
22252255 * derived from type's name is the same with type reported value */
@@ -2962,6 +2992,9 @@ SQLRETURN EsSQLSetConnectAttrW(
29622992 RET_HDIAGS (dbc , SQL_STATE_HYC00 );
29632993
29642994#ifndef NDEBUG
2995+ /* MicroStrategy Desktop invoked */
2996+ case 1041 :
2997+ case 1042 :
29652998 /* MS Access/Jet proprietary info type */
29662999 case 30002 :
29673000 ERRH (dbc , "unsupported info type." );
0 commit comments