We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e836e51 commit 6d5b4acCopy full SHA for 6d5b4ac
driver/connect.c
@@ -58,6 +58,7 @@
58
#define TYPE_BOOLEAN "BOOLEAN"
59
#define TYPE_INTEGER "INTEGER"
60
#define TYPE_KEYWORD "KEYWORD"
61
+#define TYPE_VERSION "VERSION"
62
/* 8 */
63
#define TYPE_DATETIME "DATETIME"
64
/* 9 */
@@ -2297,7 +2298,7 @@ static BOOL elastic_name2types(wstr_st *type_name,
2297
2298
}
2299
break;
2300
- /* 7: INTEGER, BOOLEAN, KEYWORD */
2301
+ /* 7: INTEGER, BOOLEAN, KEYWORD, VERSION */
2302
case sizeof(TYPE_INTEGER) - 1:
2303
switch (tolower(type_name->str[0])) {
2304
case (SQLWCHAR)'i': /* integer */
@@ -2324,6 +2325,14 @@ static BOOL elastic_name2types(wstr_st *type_name,
2324
2325
return TRUE;
2326
2327
2328
+ case (SQLWCHAR)'v': /* version */
2329
+ if (wmemncasecmp(type_name->str, MK_WPTR(TYPE_VERSION),
2330
+ type_name->cnt) == 0) {
2331
+ *c_sql = ES_VERSION_TO_CSQL;
2332
+ *sql = ES_VERSION_TO_SQL;
2333
+ return TRUE;
2334
+ }
2335
+ break;
2336
2337
2338
driver/defs.h
@@ -417,7 +417,7 @@
417
#define ESODBC_SQL_NESTED 2002
418
419
/* the SQL type ES/SQL uses for string types (KEYWORD, TEXT),
420
- * plus IP and GEO */
+ * plus IP, VERSION and GEO */
421
#define ESODBC_SQL_VARCHAR SQL_VARCHAR
422
423
/* C SQL and SQL types for ES types that
@@ -474,6 +474,9 @@
474
/* 12: IP */
475
#define ES_IP_TO_CSQL ES_VARCHAR_CSQL
476
#define ES_IP_TO_SQL ES_VARCHAR_SQL
477
+/* 12: VERSION */
478
+#define ES_VERSION_TO_CSQL ES_VARCHAR_CSQL
479
+#define ES_VERSION_TO_SQL ES_VARCHAR_SQL
480
/* 92: TIME */
481
#define ES_TIME_TO_CSQL SQL_C_TYPE_TIME
482
#define ES_TIME_TO_SQL SQL_TYPE_TIME
driver/queries.c
@@ -2513,8 +2513,9 @@ esodbc_estype_st *lookup_es_type(esodbc_dbc_st *dbc,
2513
SQLULEN i;
2514
SQLINTEGER sz;
2515
2516
- /* for strings, choose text straight away: some type (IP, GEO) must coform
2517
- * to a format and no content inspection is done in the driver */
+ /* for strings, choose text straight away: some types (IP, VERSION, GEO)
+ * must conform to a format and no content inspection is done in the driver
2518
+ */
2519
if (es_type == ES_VARCHAR_SQL || es_type == ES_WVARCHAR_SQL) {
2520
return dbc->max_varchar_type;
2521
@@ -2554,7 +2555,7 @@ static esodbc_estype_st *match_es_type(esodbc_rec_st *irec)
2554
2555
return dbc->max_float_type;
2556
2557
case ES_WVARCHAR_SQL: /* KEYWORD, TEXT */
- case ES_VARCHAR_SQL: /* IP, GEO+ */
2558
+ case ES_VARCHAR_SQL: /* IP, VERSION, GEO+ */
2559
2560
default:
2561
/* unequivocal match */
@@ -2877,7 +2878,7 @@ static SQLRETURN convert_param_val(esodbc_rec_st *arec, esodbc_rec_st *irec,
2877
2878
2879
/* JSON string */
2880
2881
2882
return c2sql_varchar(arec, irec, pos, dest, len);
2883
2884
case SQL_TYPE_DATE:
test/connected_dbc.h
@@ -77,6 +77,7 @@ extern "C" {
77
[\"IP\", 12, 45, \"'\", \"'\", null, 2, false, 3, true, false, false, null, null, null, 12, 0, null, null],\
78
[\"KEYWORD\", 12, 32766, \"'\", \"'\", null, 2, true, 3, true, false, false, null, null, null, 12, 0, null, null],\
79
[\"TEXT\", 12, 2147483647, \"'\", \"'\", null, 2, true, 3, true, false, false, null, null, null, 12, 0, null, null],\
80
+ [\"VERSION\", 12, 2147483647, \"'\", \"'\", null, 2, true, 3, true, false, false, null, null, null, 12, 0, null, null],\
81
[\"BOOLEAN\", 16, 1, \"'\", \"'\", null, 2, false, 3, true, false, false, null, null, null, 16, 0, null, null],\
82
[\"DATE\", 91, 29, \"'\", \"'\", null, 2, false, 3, true, false, false, null, 3, 3, 91, 0, null, null],\
83
[\"TIME\", 92, 18, \"'\", \"'\", null, 2, false, 3, true, false, false, null, null, null, 92, 0, null, null],\
test/integration/elasticsearch.py
@@ -152,6 +152,7 @@ def _update_es_yaml(self, es_dir, append=True):
152
with open(yaml, mode="a" if append else "w", newline="\n") as f:
153
f.write("#\n# ODBC Integration Test\n#\n")
154
f.write("xpack.security.enabled: True\n")
155
+ f.write("xpack.watcher.enabled: False\n")
156
f.write("http.port: %s\n" % self._port) # don't bind on next avail port
157
f.write("cluster.routing.allocation.disk.threshold_enabled: False\n")
158
0 commit comments