diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2017-09-05 15:58:46 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2017-09-05 15:58:46 +0200 |
commit | 0f4b54078058c57b54ba95c28b2fde72698a6a3f (patch) | |
tree | 87d8736b8b1544ca6aca82b656f8ff15f28e9c89 /storage | |
parent | c23b8325566e4f21c6e3130171d791ddc7cafb8f (diff) | |
download | mariadb-git-0f4b54078058c57b54ba95c28b2fde72698a6a3f.tar.gz |
- Update version number
modified: storage/connect/ha_connect.cc
- Regard columns with binary charset as string (was binary)
modified: storage/connect/ha_connect.cc
modified: storage/connect/tabmysql.cpp
modified: storage/connect/tabutil.cpp
- Support length 0 for CHAR and VARCHAR
modified: storage/connect/ha_connect.cc
modified: storage/connect/reldef.cpp
modified: storage/connect/value.cpp
- Add ACCEPT option for void columns in discovery
modified: storage/connect/tabjson.cpp
- Update some tests because of above change
modified: storage/connect/mysql-test/connect/r/json_java_2.result
modified: storage/connect/mysql-test/connect/r/json_java_3.result
modified: storage/connect/mysql-test/connect/r/json_mongo_c.result
modified: storage/connect/mysql-test/connect/r/mongo_c.result
modified: storage/connect/mysql-test/connect/r/mongo_java_2.result
modified: storage/connect/mysql-test/connect/r/mongo_java_3.result
modified: storage/connect/mysql-test/connect/r/odbc_oracle.result
modified: storage/connect/mysql-test/connect/r/updelx.result
modified: storage/connect/mysql-test/connect/t/mongo_test.inc
Diffstat (limited to 'storage')
-rw-r--r-- | storage/connect/ha_connect.cc | 17 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/json_java_2.result | 19 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/json_java_3.result | 19 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/json_mongo_c.result | 17 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/mongo_c.result | 2 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/mongo_java_2.result | 4 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/mongo_java_3.result | 4 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/odbc_oracle.result | 32 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/updelx.result | 474 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/t/mongo_test.inc | 4 | ||||
-rw-r--r-- | storage/connect/reldef.cpp | 2 | ||||
-rw-r--r-- | storage/connect/tabjson.cpp | 7 | ||||
-rw-r--r-- | storage/connect/tabmysql.cpp | 3 | ||||
-rw-r--r-- | storage/connect/tabutil.cpp | 3 | ||||
-rw-r--r-- | storage/connect/value.cpp | 4 |
15 files changed, 311 insertions, 300 deletions
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 4ccb0ac67b7..7da17853d96 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -171,9 +171,9 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.06.0003 August 28, 2017"; + char version[]= "Version 1.06.0004 September 03, 2017"; #if defined(__WIN__) - char compver[]= "Version 1.06.0003 " __DATE__ " " __TIME__; + char compver[]= "Version 1.06.0004 " __DATE__ " " __TIME__; char slash= '\\'; #else // !__WIN__ char slash= '/'; @@ -1449,7 +1449,7 @@ PFOS ha_connect::GetFieldOptionStruct(Field *fdp) void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) { const char *cp; - char *chset, v; + char *chset, v = 0; ha_field_option_struct *fop; Field* fp; Field* *fldp; @@ -1502,7 +1502,6 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) } // endif fop chset = (char *)fp->charset()->name; - v = (!strcmp(chset, "binary")) ? 'B' : 0; switch (fp->type()) { case MYSQL_TYPE_BLOB: @@ -4343,7 +4342,7 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn, bool quick) } else return false; - /* Fall through to check FILE_ACL */ + /* Fall through to check FILE_ACL */ case TAB_ODBC: case TAB_JDBC: case TAB_MYSQL: @@ -5184,7 +5183,8 @@ static bool add_field(String *sql, const char *field_name, int typ, int len, error|= sql->append("` "); error|= sql->append(type); - if (len && typ != TYPE_DATE && (typ != TYPE_DOUBLE || dec >= 0)) { + if (typ == TYPE_STRING || + (len && typ != TYPE_DATE && (typ != TYPE_DOUBLE || dec >= 0))) { error|= sql->append('('); error|= sql->append_ulonglong(len); @@ -6410,6 +6410,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, case MYSQL_TYPE_VARCHAR: case MYSQL_TYPE_VAR_STRING: case MYSQL_TYPE_STRING: +#if 0 if (!fp->field_length) { sprintf(g->Message, "Unsupported 0 length for column %s", fp->field_name); @@ -6419,7 +6420,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, MYF(0), fp->field_name); DBUG_RETURN(rc); } // endif fp - +#endif // 0 break; // To be checked case MYSQL_TYPE_BIT: case MYSQL_TYPE_NULL: @@ -7206,7 +7207,7 @@ maria_declare_plugin(connect) 0x0106, /* version number (1.05) */ NULL, /* status variables */ connect_system_variables, /* system variables */ - "1.06.0003", /* string version */ + "1.06.0004", /* string version */ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ } maria_declare_plugin_end; diff --git a/storage/connect/mysql-test/connect/r/json_java_2.result b/storage/connect/mysql-test/connect/r/json_java_2.result index 83272ec00ce..5490783d855 100644 --- a/storage/connect/mysql-test/connect/r/json_java_2.result +++ b/storage/connect/mysql-test/connect/r/json_java_2.result @@ -1,4 +1,5 @@ -SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo2.jar'; +SET GLOBAL connect_class_path='C:/MariaDB-10.1/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo2.jar'; +set connect_enable_mongo=1; # # Test the MONGO table type # @@ -25,7 +26,6 @@ address_street 1 CHAR 38 38 0 0 address.street address_zipcode 1 CHAR 5 5 0 0 address.zipcode borough 1 CHAR 13 13 0 0 cuisine 1 CHAR 64 64 0 0 -grades 1 CHAR 0 0 0 1 grades_date 1 CHAR 256 256 0 1 grades.0.date grades_grade 1 CHAR 14 14 0 1 grades.0.grade grades_score 5 BIGINT 2 2 0 1 grades.0.score @@ -72,7 +72,6 @@ t1 CREATE TABLE `t1` ( `address_zipcode` char(5) NOT NULL `FIELD_FORMAT`='address.zipcode', `borough` char(13) NOT NULL, `cuisine` char(64) NOT NULL, - `grades` char(1) DEFAULT NULL, `grades_date` varchar(256) DEFAULT NULL `FIELD_FORMAT`='grades.0.date', `grades_grade` char(14) DEFAULT NULL `FIELD_FORMAT`='grades.0.grade', `grades_score` bigint(2) DEFAULT NULL `FIELD_FORMAT`='grades.0.score', @@ -80,12 +79,12 @@ t1 CREATE TABLE `t1` ( `restaurant_id` char(8) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `OPTION_LIST`='Level=1,Driver=Java,Version=2' `DATA_CHARSET`='utf8' `LRECL`=4096 SELECT * FROM t1 LIMIT 5; -_id address_building address_coord address_street address_zipcode borough cuisine grades grades_date grades_grade grades_score name restaurant_id -58ada47de5a51ddfcd5ed51c 1007 -73.856077 Morris Park Ave 10462 Bronx Bakery 2 2014-03-03T00:00:00.000Z A 2 Morris Park Bake Shop 30075445 -58ada47de5a51ddfcd5ed51d 469 -73.961704 Flatbush Avenue 11225 Brooklyn Hamburgers 2 2014-12-30T00:00:00.000Z A 8 Wendy'S 30112340 -58ada47de5a51ddfcd5ed51e 351 -73.98513559999999 West 57 Street 10019 Manhattan Irish 2 2014-09-06T00:00:00.000Z A 2 Dj Reynolds Pub And Restaurant 30191841 -58ada47de5a51ddfcd5ed51f 2780 -73.98241999999999 Stillwell Avenue 11224 Brooklyn American 2 2014-06-10T00:00:00.000Z A 5 Riviera Caterer 40356018 -58ada47de5a51ddfcd5ed520 97-22 -73.8601152 63 Road 11374 Queens Jewish/Kosher 2 2014-11-24T00:00:00.000Z Z 20 Tov Kosher Kitchen 40356068 +_id address_building address_coord address_street address_zipcode borough cuisine grades_date grades_grade grades_score name restaurant_id +58ada47de5a51ddfcd5ed51c 1007 -73.856077 Morris Park Ave 10462 Bronx Bakery 2014-03-03T00:00:00.000Z A 2 Morris Park Bake Shop 30075445 +58ada47de5a51ddfcd5ed51d 469 -73.961704 Flatbush Avenue 11225 Brooklyn Hamburgers 2014-12-30T00:00:00.000Z A 8 Wendy'S 30112340 +58ada47de5a51ddfcd5ed51e 351 -73.98513559999999 West 57 Street 10019 Manhattan Irish 2014-09-06T00:00:00.000Z A 2 Dj Reynolds Pub And Restaurant 30191841 +58ada47de5a51ddfcd5ed51f 2780 -73.98241999999999 Stillwell Avenue 11224 Brooklyn American 2014-06-10T00:00:00.000Z A 5 Riviera Caterer 40356018 +58ada47de5a51ddfcd5ed520 97-22 -73.8601152 63 Road 11374 Queens Jewish/Kosher 2014-11-24T00:00:00.000Z Z 20 Tov Kosher Kitchen 40356068 DROP TABLE t1; # # Dropping a column @@ -259,7 +258,6 @@ t1 CREATE TABLE `t1` ( `address_street` char(38) NOT NULL `FIELD_FORMAT`='address.street', `address_zipcode` char(5) NOT NULL `FIELD_FORMAT`='address.zipcode', `borough` char(13) NOT NULL, - `grades` char(1) DEFAULT NULL, `grades_date` char(24) DEFAULT NULL `FIELD_FORMAT`='grades.0.date', `grades_grade` char(14) DEFAULT NULL `FIELD_FORMAT`='grades.0.grade', `grades_score` bigint(2) DEFAULT NULL `FIELD_FORMAT`='grades.0.score', @@ -384,3 +382,4 @@ planner 167 41.75 postcard 23 5.75 DROP TABLE t1; true +set connect_enable_mongo=0; diff --git a/storage/connect/mysql-test/connect/r/json_java_3.result b/storage/connect/mysql-test/connect/r/json_java_3.result index 563bcef7321..13462cf944e 100644 --- a/storage/connect/mysql-test/connect/r/json_java_3.result +++ b/storage/connect/mysql-test/connect/r/json_java_3.result @@ -1,4 +1,5 @@ -SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo3.jar'; +SET GLOBAL connect_class_path='C:/MariaDB-10.1/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo3.jar'; +set connect_enable_mongo=1; # # Test the MONGO table type # @@ -25,7 +26,6 @@ address_street 1 CHAR 38 38 0 0 address.street address_zipcode 1 CHAR 5 5 0 0 address.zipcode borough 1 CHAR 13 13 0 0 cuisine 1 CHAR 64 64 0 0 -grades 1 CHAR 0 0 0 1 grades_date 1 CHAR 256 256 0 1 grades.0.date grades_grade 1 CHAR 14 14 0 1 grades.0.grade grades_score 5 BIGINT 2 2 0 1 grades.0.score @@ -72,7 +72,6 @@ t1 CREATE TABLE `t1` ( `address_zipcode` char(5) NOT NULL `FIELD_FORMAT`='address.zipcode', `borough` char(13) NOT NULL, `cuisine` char(64) NOT NULL, - `grades` char(1) DEFAULT NULL, `grades_date` varchar(256) DEFAULT NULL `FIELD_FORMAT`='grades.0.date', `grades_grade` char(14) DEFAULT NULL `FIELD_FORMAT`='grades.0.grade', `grades_score` bigint(2) DEFAULT NULL `FIELD_FORMAT`='grades.0.score', @@ -80,12 +79,12 @@ t1 CREATE TABLE `t1` ( `restaurant_id` char(8) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `OPTION_LIST`='Level=1,Driver=Java,Version=3' `DATA_CHARSET`='utf8' `LRECL`=4096 SELECT * FROM t1 LIMIT 5; -_id address_building address_coord address_street address_zipcode borough cuisine grades grades_date grades_grade grades_score name restaurant_id -58ada47de5a51ddfcd5ed51c 1007 -73.856077 Morris Park Ave 10462 Bronx Bakery 1 1393804800 A 2 Morris Park Bake Shop 30075445 -58ada47de5a51ddfcd5ed51d 469 -73.961704 Flatbush Avenue 11225 Brooklyn Hamburgers 1 1419897600 A 8 Wendy'S 30112340 -58ada47de5a51ddfcd5ed51e 351 -73.98513559999999 West 57 Street 10019 Manhattan Irish 1 1409961600 A 2 Dj Reynolds Pub And Restaurant 30191841 -58ada47de5a51ddfcd5ed51f 2780 -73.98241999999999 Stillwell Avenue 11224 Brooklyn American 1 1402358400 A 5 Riviera Caterer 40356018 -58ada47de5a51ddfcd5ed520 97-22 -73.8601152 63 Road 11374 Queens Jewish/Kosher 1 1416787200 Z 20 Tov Kosher Kitchen 40356068 +_id address_building address_coord address_street address_zipcode borough cuisine grades_date grades_grade grades_score name restaurant_id +58ada47de5a51ddfcd5ed51c 1007 -73.856077 Morris Park Ave 10462 Bronx Bakery 1393804800 A 2 Morris Park Bake Shop 30075445 +58ada47de5a51ddfcd5ed51d 469 -73.961704 Flatbush Avenue 11225 Brooklyn Hamburgers 1419897600 A 8 Wendy'S 30112340 +58ada47de5a51ddfcd5ed51e 351 -73.98513559999999 West 57 Street 10019 Manhattan Irish 1409961600 A 2 Dj Reynolds Pub And Restaurant 30191841 +58ada47de5a51ddfcd5ed51f 2780 -73.98241999999999 Stillwell Avenue 11224 Brooklyn American 1402358400 A 5 Riviera Caterer 40356018 +58ada47de5a51ddfcd5ed520 97-22 -73.8601152 63 Road 11374 Queens Jewish/Kosher 1416787200 Z 20 Tov Kosher Kitchen 40356068 DROP TABLE t1; # # Dropping a column @@ -259,7 +258,6 @@ t1 CREATE TABLE `t1` ( `address_street` char(38) NOT NULL `FIELD_FORMAT`='address.street', `address_zipcode` char(5) NOT NULL `FIELD_FORMAT`='address.zipcode', `borough` char(13) NOT NULL, - `grades` char(1) DEFAULT NULL, `grades_date` bigint(13) DEFAULT NULL `FIELD_FORMAT`='grades.0.date', `grades_grade` char(14) DEFAULT NULL `FIELD_FORMAT`='grades.0.grade', `grades_score` bigint(2) DEFAULT NULL `FIELD_FORMAT`='grades.0.score', @@ -384,3 +382,4 @@ planner 167 41.75 postcard 23 5.75 DROP TABLE t1; true +set connect_enable_mongo=0; diff --git a/storage/connect/mysql-test/connect/r/json_mongo_c.result b/storage/connect/mysql-test/connect/r/json_mongo_c.result index d3363f39eab..afcad8d2ea2 100644 --- a/storage/connect/mysql-test/connect/r/json_mongo_c.result +++ b/storage/connect/mysql-test/connect/r/json_mongo_c.result @@ -1,3 +1,4 @@ +set connect_enable_mongo=1; # # Test the MONGO table type # @@ -24,7 +25,6 @@ address_street 1 CHAR 38 38 0 0 address.street address_zipcode 1 CHAR 5 5 0 0 address.zipcode borough 1 CHAR 13 13 0 0 cuisine 1 CHAR 64 64 0 0 -grades 1 CHAR 0 0 0 1 grades_date 1 CHAR 256 256 0 1 grades.0.date grades_grade 1 CHAR 14 14 0 1 grades.0.grade grades_score 5 BIGINT 2 2 0 1 grades.0.score @@ -71,7 +71,6 @@ t1 CREATE TABLE `t1` ( `address_zipcode` char(5) NOT NULL `FIELD_FORMAT`='address.zipcode', `borough` char(13) NOT NULL, `cuisine` char(64) NOT NULL, - `grades` char(1) DEFAULT NULL, `grades_date` varchar(256) DEFAULT NULL `FIELD_FORMAT`='grades.0.date', `grades_grade` char(14) DEFAULT NULL `FIELD_FORMAT`='grades.0.grade', `grades_score` bigint(2) DEFAULT NULL `FIELD_FORMAT`='grades.0.score', @@ -79,12 +78,12 @@ t1 CREATE TABLE `t1` ( `restaurant_id` char(8) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `OPTION_LIST`='Level=1,Driver=C,Version=0' `DATA_CHARSET`='utf8' `LRECL`=1024 SELECT * FROM t1 LIMIT 5; -_id address_building address_coord address_street address_zipcode borough cuisine grades grades_date grades_grade grades_score name restaurant_id -58ada47de5a51ddfcd5ed51c 1007 -73.856076999999999089 Morris Park Ave 10462 Bronx Bakery 1 1393804800 A 2 Morris Park Bake Shop 30075445 -58ada47de5a51ddfcd5ed51d 469 -73.96170399999999745 Flatbush Avenue 11225 Brooklyn Hamburgers 1 1419897600 A 8 Wendy'S 30112340 -58ada47de5a51ddfcd5ed51e 351 -73.985135599999992451 West 57 Street 10019 Manhattan Irish 1 1409961600 A 2 Dj Reynolds Pub And Restaurant 30191841 -58ada47de5a51ddfcd5ed51f 2780 -73.982419999999990523 Stillwell Avenue 11224 Brooklyn American 1 1402358400 A 5 Riviera Caterer 40356018 -58ada47de5a51ddfcd5ed520 97-22 -73.860115199999995639 63 Road 11374 Queens Jewish/Kosher 1 1416787200 Z 20 Tov Kosher Kitchen 40356068 +_id address_building address_coord address_street address_zipcode borough cuisine grades_date grades_grade grades_score name restaurant_id +58ada47de5a51ddfcd5ed51c 1007 -73.856076999999999089 Morris Park Ave 10462 Bronx Bakery 1393804800 A 2 Morris Park Bake Shop 30075445 +58ada47de5a51ddfcd5ed51d 469 -73.96170399999999745 Flatbush Avenue 11225 Brooklyn Hamburgers 1419897600 A 8 Wendy'S 30112340 +58ada47de5a51ddfcd5ed51e 351 -73.985135599999992451 West 57 Street 10019 Manhattan Irish 1409961600 A 2 Dj Reynolds Pub And Restaurant 30191841 +58ada47de5a51ddfcd5ed51f 2780 -73.982419999999990523 Stillwell Avenue 11224 Brooklyn American 1402358400 A 5 Riviera Caterer 40356018 +58ada47de5a51ddfcd5ed520 97-22 -73.860115199999995639 63 Road 11374 Queens Jewish/Kosher 1416787200 Z 20 Tov Kosher Kitchen 40356068 DROP TABLE t1; # # Dropping a column @@ -258,7 +257,6 @@ t1 CREATE TABLE `t1` ( `address_street` char(38) NOT NULL `FIELD_FORMAT`='address.street', `address_zipcode` char(5) NOT NULL `FIELD_FORMAT`='address.zipcode', `borough` char(13) NOT NULL, - `grades` char(1) DEFAULT NULL, `grades_date` bigint(13) DEFAULT NULL `FIELD_FORMAT`='grades.0.date', `grades_grade` char(14) DEFAULT NULL `FIELD_FORMAT`='grades.0.grade', `grades_score` bigint(2) DEFAULT NULL `FIELD_FORMAT`='grades.0.score', @@ -383,3 +381,4 @@ planner 167 41.75 postcard 23 5.75 DROP TABLE t1; true +set connect_enable_mongo=0; diff --git a/storage/connect/mysql-test/connect/r/mongo_c.result b/storage/connect/mysql-test/connect/r/mongo_c.result index da0832994c2..f90f3a94b44 100644 --- a/storage/connect/mysql-test/connect/r/mongo_c.result +++ b/storage/connect/mysql-test/connect/r/mongo_c.result @@ -1,3 +1,4 @@ +set connect_enable_mongo=1; # # Test the MONGO table type # @@ -376,3 +377,4 @@ planner 167 41.750000 postcard 23 5.750000 DROP TABLE t1; true +set connect_enable_mongo=0; diff --git a/storage/connect/mysql-test/connect/r/mongo_java_2.result b/storage/connect/mysql-test/connect/r/mongo_java_2.result index b1e9ea74f72..597fef0961b 100644 --- a/storage/connect/mysql-test/connect/r/mongo_java_2.result +++ b/storage/connect/mysql-test/connect/r/mongo_java_2.result @@ -1,4 +1,5 @@ -SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo2.jar'; +SET GLOBAL connect_class_path='C:/MariaDB-10.1/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo2.jar'; +set connect_enable_mongo=1; # # Test the MONGO table type # @@ -377,3 +378,4 @@ planner 167 41.75 postcard 23 5.75 DROP TABLE t1; true +set connect_enable_mongo=0; diff --git a/storage/connect/mysql-test/connect/r/mongo_java_3.result b/storage/connect/mysql-test/connect/r/mongo_java_3.result index e2fe584620f..5f4a98331b4 100644 --- a/storage/connect/mysql-test/connect/r/mongo_java_3.result +++ b/storage/connect/mysql-test/connect/r/mongo_java_3.result @@ -1,4 +1,5 @@ -SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo3.jar'; +SET GLOBAL connect_class_path='C:/MariaDB-10.1/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo3.jar'; +set connect_enable_mongo=1; # # Test the MONGO table type # @@ -377,3 +378,4 @@ planner 167 41.75 postcard 23 5.75 DROP TABLE t1; true +set connect_enable_mongo=0; diff --git a/storage/connect/mysql-test/connect/r/odbc_oracle.result b/storage/connect/mysql-test/connect/r/odbc_oracle.result index db7f78f67cd..8dc7dc07bb1 100644 --- a/storage/connect/mysql-test/connect/r/odbc_oracle.result +++ b/storage/connect/mysql-test/connect/r/odbc_oracle.result @@ -72,11 +72,11 @@ TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' CATFUNC=Columns; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks -NULL MTR T1 A 3 DECIMAL 38 40 0 10 1 NULL -NULL MTR T1 B 6 NUMBER 38 40 NULL NULL 1 NULL -NULL MTR T2 A 12 VARCHAR2 64 64 NULL NULL 1 NULL -NULL MTR V1 A 3 DECIMAL 38 40 0 10 1 NULL -NULL MTR V1 B 6 NUMBER 38 40 NULL NULL 1 NULL + MTR T1 A 3 DECIMAL 38 40 0 10 1 + MTR T1 B 6 NUMBER 38 40 NULL NULL 1 + MTR T2 A 12 VARCHAR2 64 64 NULL NULL 1 + MTR V1 A 3 DECIMAL 38 40 0 10 1 + MTR V1 B 6 NUMBER 38 40 NULL NULL 1 DROP TABLE t1; # All columns in all schemas (limited with WHERE) CREATE TABLE t1 ENGINE=CONNECT @@ -84,18 +84,18 @@ TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%'; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks -NULL MTR T1 A 3 DECIMAL 38 40 0 10 1 NULL -NULL MTR T1 B 6 NUMBER 38 40 NULL NULL 1 NULL -NULL MTR T2 A 12 VARCHAR2 64 64 NULL NULL 1 NULL -NULL MTR V1 A 3 DECIMAL 38 40 0 10 1 NULL -NULL MTR V1 B 6 NUMBER 38 40 NULL NULL 1 NULL + MTR T1 A 3 DECIMAL 38 40 0 10 1 + MTR T1 B 6 NUMBER 38 40 NULL NULL 1 + MTR T2 A 12 VARCHAR2 64 64 NULL NULL 1 + MTR V1 A 3 DECIMAL 38 40 0 10 1 + MTR V1 B 6 NUMBER 38 40 NULL NULL 1 DROP TABLE t1; # All tables "T1" in all schemas (limited with WHERE) CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.T1'; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks -NULL MTR T1 A 3 DECIMAL 38 40 0 10 1 NULL -NULL MTR T1 B 6 NUMBER 38 40 NULL NULL 1 NULL + MTR T1 A 3 DECIMAL 38 40 0 10 1 + MTR T1 B 6 NUMBER 38 40 NULL NULL 1 DROP TABLE t1; # Table "T1" in the schema "MTR" CREATE TABLE t1 ENGINE=CONNECT @@ -103,8 +103,8 @@ TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='MTR.T1'; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks -NULL MTR T1 A 3 DECIMAL 38 40 0 10 1 NULL -NULL MTR T1 B 6 NUMBER 38 40 NULL NULL 1 NULL + MTR T1 A 3 DECIMAL 38 40 0 10 1 + MTR T1 B 6 NUMBER 38 40 NULL NULL 1 DROP TABLE t1; # All tables "T1" in all schemas (filtered with WHERE) CREATE TABLE t1 ENGINE=CONNECT @@ -112,8 +112,8 @@ TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.T1'; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks -NULL MTR T1 A 3 DECIMAL 38 40 0 10 1 NULL -NULL MTR T1 B 6 NUMBER 38 40 NULL NULL 1 NULL + MTR T1 A 3 DECIMAL 38 40 0 10 1 + MTR T1 B 6 NUMBER 38 40 NULL NULL 1 DROP TABLE t1; # # Checking tables diff --git a/storage/connect/mysql-test/connect/r/updelx.result b/storage/connect/mysql-test/connect/r/updelx.result index 4b8441a6cde..2aed1e06928 100644 --- a/storage/connect/mysql-test/connect/r/updelx.result +++ b/storage/connect/mysql-test/connect/r/updelx.result @@ -986,108 +986,108 @@ DELETE FROM t1; INSERT INTO t1 VALUES(4, 'four'),(7,'seven'),(10,'ten'),(40,'forty'),(60,'sixty'),(81,'eighty one'),(72,'seventy two'),(11,'eleven'),(1,'one'),(35,'thirty five'),(8,'eight'); SELECT * FROM t1; id msg -4 four -7 seven -10 ten -40 forty -60 sixty -81 eighty one -72 seventy two -11 eleven -1 one -35 thirty five -8 eight +4 four +7 seven +10 ten +40 forty +60 sixty +81 eighty one +72 seventy two +11 eleven +1 one +35 thirty five +8 eight UPDATE t1 SET msg = 'bof' WHERE id = 35; SELECT * FROM t1; id msg -4 four -7 seven -10 ten -40 forty -60 sixty -81 eighty one -72 seventy two -11 eleven -1 one -35 bof -8 eight +4 four +7 seven +10 ten +40 forty +60 sixty +81 eighty one +72 seventy two +11 eleven +1 one +35 bof +8 eight UPDATE t1 SET msg = 'big' WHERE id > 50; SELECT * FROM t1; id msg -4 four -7 seven -10 ten -40 forty -60 big -81 big -72 big -11 eleven -1 one -35 bof -8 eight +4 four +7 seven +10 ten +40 forty +60 big +81 big +72 big +11 eleven +1 one +35 bof +8 eight UPDATE t1 SET msg = 'updated' WHERE id IN (8,35,60,72); SELECT * FROM t1; id msg -4 four -7 seven -10 ten -40 forty -60 updated -81 big -72 updated -11 eleven -1 one -35 updated -8 updated +4 four +7 seven +10 ten +40 forty +60 updated +81 big +72 updated +11 eleven +1 one +35 updated +8 updated UPDATE t1 SET msg = 'twin' WHERE id IN (81,10); SELECT * FROM t1; id msg -4 four -7 seven -10 twin -40 forty -60 updated -81 twin -72 updated -11 eleven -1 one -35 updated -8 updated +4 four +7 seven +10 twin +40 forty +60 updated +81 twin +72 updated +11 eleven +1 one +35 updated +8 updated UPDATE t1 SET msg = 'sixty' WHERE id = 60; SELECT * FROM t1 WHERE id = 60; id msg -60 sixty +60 sixty DELETE FROM t1 WHERE id = 4; SELECT * FROM t1; id msg -7 seven -10 twin -40 forty -60 sixty -81 twin -72 updated -11 eleven -1 one -35 updated -8 updated +7 seven +10 twin +40 forty +60 sixty +81 twin +72 updated +11 eleven +1 one +35 updated +8 updated DELETE FROM t1 WHERE id IN (40,11,35); SELECT * FROM t1; id msg -7 seven -10 twin -60 sixty -81 twin -72 updated -1 one -8 updated +7 seven +10 twin +60 sixty +81 twin +72 updated +1 one +8 updated DELETE FROM t1 WHERE id IN (4,60,1); SELECT msg FROM t1; msg -seven -twin -twin -updated -updated +seven +twin +twin +updated +updated DELETE FROM t1 WHERE id IN (81,72); SELECT id FROM t1; id @@ -1097,7 +1097,7 @@ id DELETE FROM t1 WHERE id IN (7,10); SELECT * FROM t1; id msg -8 updated +8 updated DELETE FROM t1 WHERE id = 8; SELECT * FROM t1; id msg @@ -1106,108 +1106,108 @@ DELETE FROM t1; INSERT INTO t1 VALUES(4, 'four'),(7,'seven'),(10,'ten'),(40,'forty'),(60,'sixty'),(81,'eighty one'),(72,'seventy two'),(11,'eleven'),(1,'one'),(35,'thirty five'),(8,'eight'); SELECT * FROM t1; id msg -4 four -7 seven -10 ten -40 forty -60 sixty -81 eighty one -72 seventy two -11 eleven -1 one -35 thirty five -8 eight +4 four +7 seven +10 ten +40 forty +60 sixty +81 eighty one +72 seventy two +11 eleven +1 one +35 thirty five +8 eight UPDATE t1 SET msg = 'bof' WHERE id = 35; SELECT * FROM t1; id msg -4 four -7 seven -10 ten -40 forty -60 sixty -81 eighty one -72 seventy two -11 eleven -1 one -35 bof -8 eight +4 four +7 seven +10 ten +40 forty +60 sixty +81 eighty one +72 seventy two +11 eleven +1 one +35 bof +8 eight UPDATE t1 SET msg = 'big' WHERE id > 50; SELECT * FROM t1; id msg -4 four -7 seven -10 ten -40 forty -60 big -81 big -72 big -11 eleven -1 one -35 bof -8 eight +4 four +7 seven +10 ten +40 forty +60 big +81 big +72 big +11 eleven +1 one +35 bof +8 eight UPDATE t1 SET msg = 'updated' WHERE id IN (8,35,60,72); SELECT * FROM t1; id msg -4 four -7 seven -10 ten -40 forty -60 updated -81 big -72 updated -11 eleven -1 one -35 updated -8 updated +4 four +7 seven +10 ten +40 forty +60 updated +81 big +72 updated +11 eleven +1 one +35 updated +8 updated UPDATE t1 SET msg = 'twin' WHERE id IN (81,10); SELECT * FROM t1; id msg -4 four -7 seven -10 twin -40 forty -60 updated -81 twin -72 updated -11 eleven -1 one -35 updated -8 updated +4 four +7 seven +10 twin +40 forty +60 updated +81 twin +72 updated +11 eleven +1 one +35 updated +8 updated UPDATE t1 SET msg = 'sixty' WHERE id = 60; SELECT * FROM t1 WHERE id = 60; id msg -60 sixty +60 sixty DELETE FROM t1 WHERE id = 4; SELECT * FROM t1; id msg -7 seven -10 twin -40 forty -60 sixty -81 twin -72 updated -11 eleven -1 one -35 updated -8 updated +7 seven +10 twin +40 forty +60 sixty +81 twin +72 updated +11 eleven +1 one +35 updated +8 updated DELETE FROM t1 WHERE id IN (40,11,35); SELECT * FROM t1; id msg -7 seven -10 twin -60 sixty -81 twin -72 updated -1 one -8 updated +7 seven +10 twin +60 sixty +81 twin +72 updated +1 one +8 updated DELETE FROM t1 WHERE id IN (4,60,1); SELECT msg FROM t1; msg -seven -twin -twin -updated -updated +seven +twin +twin +updated +updated DELETE FROM t1 WHERE id IN (81,72); SELECT id FROM t1; id @@ -1217,7 +1217,7 @@ id DELETE FROM t1 WHERE id IN (7,10); SELECT * FROM t1; id msg -8 updated +8 updated DELETE FROM t1 WHERE id = 8; SELECT * FROM t1; id msg @@ -1226,108 +1226,108 @@ DELETE FROM t1; INSERT INTO t1 VALUES(4, 'four'),(7,'seven'),(10,'ten'),(40,'forty'),(60,'sixty'),(81,'eighty one'),(72,'seventy two'),(11,'eleven'),(1,'one'),(35,'thirty five'),(8,'eight'); SELECT * FROM t1; id msg -4 four -7 seven -10 ten -40 forty -60 sixty -81 eighty one -72 seventy two -11 eleven -1 one -35 thirty five -8 eight +4 four +7 seven +10 ten +40 forty +60 sixty +81 eighty one +72 seventy two +11 eleven +1 one +35 thirty five +8 eight UPDATE t1 SET msg = 'bof' WHERE id = 35; SELECT * FROM t1; id msg -4 four -7 seven -10 ten -40 forty -60 sixty -81 eighty one -72 seventy two -11 eleven -1 one -35 bof -8 eight +4 four +7 seven +10 ten +40 forty +60 sixty +81 eighty one +72 seventy two +11 eleven +1 one +35 bof +8 eight UPDATE t1 SET msg = 'big' WHERE id > 50; SELECT * FROM t1; id msg -4 four -7 seven -10 ten -40 forty -60 big -81 big -72 big -11 eleven -1 one -35 bof -8 eight +4 four +7 seven +10 ten +40 forty +60 big +81 big +72 big +11 eleven +1 one +35 bof +8 eight UPDATE t1 SET msg = 'updated' WHERE id IN (8,35,60,72); SELECT * FROM t1; id msg -4 four -7 seven -10 ten -40 forty -60 updated -81 big -72 updated -11 eleven -1 one -35 updated -8 updated +4 four +7 seven +10 ten +40 forty +60 updated +81 big +72 updated +11 eleven +1 one +35 updated +8 updated UPDATE t1 SET msg = 'twin' WHERE id IN (81,10); SELECT * FROM t1; id msg -4 four -7 seven -10 twin -40 forty -60 updated -81 twin -72 updated -11 eleven -1 one -35 updated -8 updated +4 four +7 seven +10 twin +40 forty +60 updated +81 twin +72 updated +11 eleven +1 one +35 updated +8 updated UPDATE t1 SET msg = 'sixty' WHERE id = 60; SELECT * FROM t1 WHERE id = 60; id msg -60 sixty +60 sixty DELETE FROM t1 WHERE id = 4; SELECT * FROM t1; id msg -7 seven -10 twin -40 forty -60 sixty -81 twin -72 updated -11 eleven -1 one -35 updated -8 updated +7 seven +10 twin +40 forty +60 sixty +81 twin +72 updated +11 eleven +1 one +35 updated +8 updated DELETE FROM t1 WHERE id IN (40,11,35); SELECT * FROM t1; id msg -7 seven -10 twin -60 sixty -81 twin -72 updated -1 one -8 updated +7 seven +10 twin +60 sixty +81 twin +72 updated +1 one +8 updated DELETE FROM t1 WHERE id IN (4,60,1); SELECT msg FROM t1; msg -seven -twin -twin -updated -updated +seven +twin +twin +updated +updated DELETE FROM t1 WHERE id IN (81,72); SELECT id FROM t1; id @@ -1337,7 +1337,7 @@ id DELETE FROM t1 WHERE id IN (7,10); SELECT * FROM t1; id msg -8 updated +8 updated DELETE FROM t1 WHERE id = 8; SELECT * FROM t1; id msg diff --git a/storage/connect/mysql-test/connect/t/mongo_test.inc b/storage/connect/mysql-test/connect/t/mongo_test.inc index c223e70f719..c728b85fd2f 100644 --- a/storage/connect/mysql-test/connect/t/mongo_test.inc +++ b/storage/connect/mysql-test/connect/t/mongo_test.inc @@ -1,3 +1,5 @@ +set connect_enable_mongo=1; + --echo # --echo # Test the MONGO table type --echo # @@ -201,3 +203,5 @@ OPTION_LIST='Driver=$DRV,Version=$VERS,Pipeline=YES' $CONN; SELECT * FROM t1; DROP TABLE t1; --exec $MONGO --eval "db.testcoll.drop()" --quiet + +set connect_enable_mongo=0; diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index 95069baf76e..031fdebe650 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -789,7 +789,7 @@ int COLDEF::Define(PGLOBAL g, void *, PCOLINFO cfp, int poff) Poff = poff; Buf_Type = cfp->Type; - if ((Clen = GetTypeSize(Buf_Type, cfp->Length)) <= 0) { + if ((Clen = GetTypeSize(Buf_Type, cfp->Length)) < 0) { sprintf(g->Message, MSG(BAD_COL_TYPE), GetTypeName(Buf_Type), Name); return -1; } // endswitch diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 76a3d5e9988..401441520da 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -136,6 +136,7 @@ PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info) tdp->Base = GetIntegerTableOption(g, topt, "Base", 0) ? 1 : 0; tdp->Pretty = GetIntegerTableOption(g, topt, "Pretty", 2); tdp->Xcol = GetStringTableOption(g, topt, "Expand", NULL); + tdp->Accept = GetBooleanTableOption(g, topt, "Accept", false); tdp->Uri = (dsn && *dsn ? dsn : NULL); if (!tdp->Fn && !tdp->Uri) { @@ -365,7 +366,7 @@ PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info) jcp->Scale = MY_MAX(jcp->Scale, jcol.Scale); jcp->Cbn |= jcol.Cbn; jcp->Found = true; - } else { + } else if (jcol.Type != TYPE_UNKNOWN || tdp->Accept) { // New column jcp = (PJCL)PlugSubAlloc(g, NULL, sizeof(JCOL)); *jcp = jcol; @@ -448,8 +449,8 @@ PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info) /* Now get the results into blocks. */ /*********************************************************************/ for (i = 0, jcp = fjcp; jcp; i++, jcp = jcp->Next) { - if (jcp->Type == TYPE_UNKNOWN) // Void column - jcp->Type = TYPE_STRING; + if (jcp->Type == TYPE_UNKNOWN) + jcp->Type = TYPE_STRING; // Void column crp = qrp->Colresp; // Column Name crp->Kdata->SetValue(jcp->Name, i); diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index 72e30d774a0..d1e2ae69608 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -1260,7 +1260,8 @@ MYSQLCOL::MYSQLCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PCSZ am) : COLBLK(NULL, tdbp, i) { const char *chset = get_charset_name(fld->charsetnr); - char v = (!strcmp(chset, "binary")) ? 'B' : 0; +//char v = (!strcmp(chset, "binary")) ? 'B' : 0; + char v = 0; Name = fld->name; Opt = 0; diff --git a/storage/connect/tabutil.cpp b/storage/connect/tabutil.cpp index 574cef28ea3..a2c04e2cf62 100644 --- a/storage/connect/tabutil.cpp +++ b/storage/connect/tabutil.cpp @@ -186,7 +186,8 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db, crp->Kdata->SetValue(colname, i); chset = (char *)fp->charset()->name; - v = (!strcmp(chset, "binary")) ? 'B' : 0; +// v = (!strcmp(chset, "binary")) ? 'B' : 0; + v = 0; if ((type = MYSQLtoPLG(fp->type(), &v)) == TYPE_ERROR) { if (v == 'K') { diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index 51c422389ca..f08d18b5421 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -176,7 +176,7 @@ int GetTypeSize(int type, int len) case TYPE_DOUBLE: len = sizeof(double); break; case TYPE_TINY: len = sizeof(char); break; case TYPE_PCHAR: len = sizeof(char*); break; - default: len = 0; + default: len = -1; } // endswitch type return len; @@ -1370,7 +1370,7 @@ bool TYPVAL<PSZ>::SetValue_char(const char *cp, int n) if (!cp || n == 0) { Reset(); - Null = Nullable; + Null = (cp) ? false : Nullable; } else if (cp != Strp) { const char *p = cp + n - 1; |