diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-04-24 20:28:31 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-04-26 14:15:18 +0200 |
commit | 5ae2656b69e8a232107890aa0be517358739e997 (patch) | |
tree | 7f044f33d7fbfeb8bb4b9c008296008bd3b99c9e /storage/connect/mysql-test | |
parent | 1bd33ca82b951dd408b50b010b25a490063818e5 (diff) | |
download | mariadb-git-5ae2656b69e8a232107890aa0be517358739e997.tar.gz |
Squashed commit of connect/10.0:
commit c545d544378483bf68c4fb713cd4ec872d0df2c4
Author: Olivier Bertrand <bertrandop@gmail.com>
Date: Tue Mar 27 23:13:14 2018 +0200
- Fix MDEV-15577 CONNECT engine JDBC remote index prevents UPDATE
Fixed in TDBJDBC::OpenDB because query can be null for updates
modified: storage/connect/tabjdbc.cpp
commit c4f1fe2e8e74566e9c3296f435448d9f5c718b23
Author: Olivier Bertrand <bertrandop@gmail.com>
Date: Wed Mar 14 12:21:17 2018 +0100
- Fix MDEV-15429 CONNECT engine JDBC handling Postgresql UUID type
Also handle Postgresql sending type VARCHAR for TEXT column and
setting length to b x7FFFFFF when the length is unknown.
modified: storage/connect/Client.java
modified: storage/connect/JavaWrappers.jar
modified: storage/connect/JdbcInterface.java
modified: storage/connect/PostgresqlInterface.java
modified: storage/connect/global.h
modified: storage/connect/ha_connect.cc
modified: storage/connect/jdbconn.cpp
modified: storage/connect/jdbconn.h
modified: storage/connect/mysql-test/connect/r/jdbc_postgresql.result
modified: storage/connect/mysql-test/connect/t/jdbc_postgresql.test
modified: storage/connect/mysql-test/connect/t/jdbconn.inc
modified: storage/connect/plgdbsem.h
modified: storage/connect/tabjdbc.cpp
modified: storage/connect/tabjdbc.h
added: storage/connect/mysql-test/connect/std_data/JavaWrappers.jar
commit 3068bb4882a316c6c32c624609db2bf24ae3ad40
Author: Olivier Bertrand <bertrandop@gmail.com>
Date: Mon Feb 26 19:40:27 2018 +0100
Revert to old cmake file to avoid compile error
commit da8c1c0bd6a327fd03bd321be3170f468122ef67
Author: Olivier Bertrand <bertrandop@gmail.com>
Date: Mon Feb 26 16:13:39 2018 +0100
- Remove warning on not used tabtyp variable in connect_assisted_discovery
modified: storage/connect/ha_connect.cc
- Fix a bug causing CONNECT to loop when expanding a JSON column
when the expanded column value is null or void array.
- Adding the FullArray option to JSON tables.
- Skipping expanded JSON lines when the expanded column value is null.
modified: storage/connect/connect.cc
modified: storage/connect/tabdos.h
modified: storage/connect/tabjson.cpp
modified: storage/connect/tabjson.h
- Fix MDEV-13353 No file privilege for ODBC, JDBC, MONGO, MAC, WMI file types.
modified: storage/connect/ha_connect.cc
- Make some Json UDFs to accept a non JSON item as 1st parameter.
modified: storage/connect/json.cpp
modified: storage/connect/json.h
modified: storage/connect/jsonudf.cpp
modified: storage/connect/jsonudf.h
- Update Json UDF tests to cope with above changes.
modified: storage/connect/mysql-test/connect/r/json_udf.result
modified: storage/connect/mysql-test/connect/r/json_udf_bin.result
modified: storage/connect/mysql-test/connect/r/vcol.result
modified: storage/connect/mysql-test/connect/t/json_udf.test
modified: storage/connect/mysql-test/connect/t/vcol.test
- Fix some compiler warning treated as error
PlugSubAlloc no more exported because it does throw.
modified: storage/connect/global.h
modified: storage/connect/ha_connect.cc
modified: storage/connect/jsonudf.cpp
modified: storage/connect/tabjson.cpp
modified: storage/connect/tabjson.h
- Other files modified (?) when going back to wrong merge
modified: storage/connect/CMakeLists.txt
modified: storage/connect/array.cpp
modified: storage/connect/colblk.cpp
modified: storage/connect/connect.cc
modified: storage/connect/csort.cpp
modified: storage/connect/domdoc.cpp
modified: storage/connect/filamap.cpp
modified: storage/connect/filamgz.cpp
modified: storage/connect/filamtxt.cpp
modified: storage/connect/filamzip.cpp
modified: storage/connect/filter.cpp
modified: storage/connect/fmdlex.c
modified: storage/connect/jdbconn.cpp
modified: storage/connect/macutil.cpp
modified: storage/connect/myconn.cpp
modified: storage/connect/odbconn.cpp
modified: storage/connect/plgdbutl.cpp
modified: storage/connect/plugutil.cpp
modified: storage/connect/preparse.h
modified: storage/connect/rcmsg.c
modified: storage/connect/rcmsg.h
modified: storage/connect/reldef.cpp
modified: storage/connect/tabdos.cpp
modified: storage/connect/tabfmt.cpp
modified: storage/connect/tabmac.cpp
modified: storage/connect/tabmul.cpp
modified: storage/connect/tabmysql.cpp
modified: storage/connect/tabmysql.h
modified: storage/connect/tabodbc.cpp
modified: storage/connect/tabtbl.cpp
modified: storage/connect/tabxml.cpp
modified: storage/connect/value.cpp
modified: storage/connect/xobject.cpp
commit 5095628b31ed8c94bd7c794c6b0162894a9040b1
Author: Olivier Bertrand <bertrandop@gmail.com>
Date: Tue Feb 13 14:29:00 2018 +0100
- Fix a bug causing CONNECT to loop when expanding a JSON column
when the expanded column value is null or void array.
- Adding the FullArray option to JSON tables.
- Skipping expanded JSON lines when the expanded column value is null.
modified: storage/connect/connect.cc
modified: storage/connect/tabdos.h
modified: storage/connect/tabjson.cpp
modified: storage/connect/tabjson.h
commit 9896174328da42016735630c893fd09eb128b48e
Author: Olivier Bertrand <bertrandop@gmail.com>
Date: Fri Feb 2 15:48:57 2018 +0100
- Remove warning on not used tabtyp variable in connect_assisted_discovery
modified: storage/connect/ha_connect.cc
commit d7e254c05f88173eb04d8dafc813013eb42ccdbe
Author: Olivier Bertrand <bertrandop@gmail.com>
Date: Wed Jan 31 14:42:45 2018 +0100
- Use delayed load for the MongoDB C Drive on Windows
modified: storage/connect/CMakeLists.txt
modified: storage/connect/cmgoconn.cpp
modified: storage/connect/ha_connect.cc
- Add FORCE to the connect_type_conv enum values
This will translate binary values to TYPE_STRING
modified: storage/connect/checklvl.h
modified: storage/connect/ha_connect.cc
modified: storage/connect/odbconn.cpp
- Change the connect_xtrace variable to from int to set
modified: storage/connect/array.cpp
modified: storage/connect/blkfil.cpp
modified: storage/connect/block.h
modified: storage/connect/cmgoconn.cpp
modified: storage/connect/colblk.cpp
modified: storage/connect/connect.cc
modified: storage/connect/filamap.cpp
modified: storage/connect/filamdbf.cpp
modified: storage/connect/filamfix.cpp
modified: storage/connect/filamgz.cpp
modified: storage/connect/filamtxt.cpp
modified: storage/connect/filamvct.cpp
modified: storage/connect/filamzip.cpp
modified: storage/connect/filter.cpp
modified: storage/connect/global.h
modified: storage/connect/ha_connect.cc
modified: storage/connect/inihandl.cpp
modified: storage/connect/javaconn.cpp
modified: storage/connect/jdbconn.cpp
modified: storage/connect/jmgfam.cpp
modified: storage/connect/jmgoconn.cpp
modified: storage/connect/json.cpp
modified: storage/connect/jsonudf.cpp
modified: storage/connect/libdoc.cpp
modified: storage/connect/mongo.cpp
modified: storage/connect/mycat.cc
modified: storage/connect/myconn.cpp
modified: storage/connect/odbconn.cpp
modified: storage/connect/plgdbutl.cpp
modified: storage/connect/plugutil.cpp
modified: storage/connect/reldef.cpp
modified: storage/connect/tabcol.cpp
modified: storage/connect/tabdos.cpp
modified: storage/connect/tabext.cpp
modified: storage/connect/tabfix.cpp
modified: storage/connect/tabfmt.cpp
modified: storage/connect/tabjdbc.cpp
modified: storage/connect/tabjson.cpp
modified: storage/connect/table.cpp
modified: storage/connect/tabmul.cpp
modified: storage/connect/tabmysql.cpp
modified: storage/connect/tabodbc.cpp
modified: storage/connect/tabpivot.cpp
modified: storage/connect/tabsys.cpp
modified: storage/connect/tabtbl.cpp
modified: storage/connect/tabutil.cpp
modified: storage/connect/tabvct.cpp
modified: storage/connect/tabwmi.cpp
modified: storage/connect/tabxml.cpp
modified: storage/connect/user_connect.cc
modified: storage/connect/valblk.cpp
modified: storage/connect/value.cpp
modified: storage/connect/xindex.cpp
- Restore connect_enable_mongo variable (but undocumented)
modified: storage/connect/ha_connect.cc
modified: storage/connect/mycat.cc
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/tbl_thread.result
modified: storage/connect/mysql-test/connect/t/mongo.inc
modified: storage/connect/mysql-test/connect/t/mongo_test.inc
modified: storage/connect/mysql-test/connect/t/tbl_thread.test
Diffstat (limited to 'storage/connect/mysql-test')
21 files changed, 147 insertions, 54 deletions
diff --git a/storage/connect/mysql-test/connect/r/jdbc_postgresql.result b/storage/connect/mysql-test/connect/r/jdbc_postgresql.result index 6d77d79d5d3..7969672dd66 100644 --- a/storage/connect/mysql-test/connect/r/jdbc_postgresql.result +++ b/storage/connect/mysql-test/connect/r/jdbc_postgresql.result @@ -1,9 +1,11 @@ +SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar;C:/Jconnectors/postgresql-42.2.1.jar'; CREATE TABLE t2 ( command varchar(128) not null, number int(5) not null flag=1, message varchar(255) flag=2) -ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:postgresql://localhost/mtr' -OPTION_LIST='User=mtr,Password=mtr,Schema=public,Execsrc=1'; +ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono' +OPTION_LIST='Execsrc=1'; SELECT * FROM t2 WHERE command='drop table employee'; command number message drop table employee 0 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas @@ -14,17 +16,18 @@ SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'E command number message insert into employee values(4567,'Johnson', 'Engineer', 12560.50) 1 Affected rows CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables -CONNECTION='jdbc:postgresql://localhost/mtr' -OPTION_LIST='User=mtr,Password=mtr,Schema=public,Tabtype=TABLE,Maxres=10'; +CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono' +OPTION_LIST='Tabtype=TABLE,Maxres=10'; SELECT * FROM t1; Table_Cat Table_Schema Table_Name Table_Type Remark - public employee TABLE NULL - public t1 TABLE NULL - public t2 TABLE NULL +NULL public employee TABLE NULL +NULL public t1 TABLE NULL +NULL public t2 TABLE NULL +NULL public tchar TABLE NULL +NULL public testuuid TABLE NULL DROP TABLE t1; -CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=columns -CONNECTION='jdbc:postgresql://localhost/mtr' tabname=employee -OPTION_LIST='User=mtr,Password=mtr,Maxres=10'; +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC tabname=employee CATFUNC=columns +CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono'; SELECT * FROM t1; Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks NULL public employee id 4 int4 10 0 0 10 0 NULL @@ -34,13 +37,14 @@ NULL public employee salary 2 numeric 8 0 2 10 1 NULL DROP TABLE t1; CREATE SERVER 'postgresql' FOREIGN DATA WRAPPER 'postgresql' OPTIONS ( HOST 'localhost', -DATABASE 'mtr', -USER 'mtr', -PASSWORD 'mtr', +DATABASE 'test', +USER 'postgres', +PASSWORD 'tinono', PORT 0, SOCKET '', OWNER 'root'); -CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='postgresql/public.employee'; +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='postgresql/public.employee'; SELECT * FROM t1; id name title salary 4567 Johnson Engineer 12560.50 @@ -60,6 +64,3 @@ SELECT * FROM t2 WHERE command='drop table employee'; command number message drop table employee 0 Affected rows DROP TABLE t2; -SET GLOBAL connect_jvm_path=NULL; -SET GLOBAL connect_class_path=NULL; -SET GLOBAL time_zone = SYSTEM; 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 783d86e6595..1a90132dede 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.1/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo2.jar'; +SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo2.jar'; +set connect_enable_mongo=1; # # Test the MONGO table type # @@ -381,3 +382,7 @@ planner 167 41.75 postcard 23 5.75 DROP TABLE t1; true +<<<<<<< HEAD +======= +set connect_enable_mongo=0; +>>>>>>> connect/10.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 a301e0273d5..4c5fc94fca6 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.1/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo3.jar'; +SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo3.jar'; +set connect_enable_mongo=1; # # Test the MONGO table type # @@ -381,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 8adc006a51b..550e94f286e 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 # @@ -380,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/json_udf.result b/storage/connect/mysql-test/connect/r/json_udf.result index 7d81ca5e73d..09544bb1ecb 100644 --- a/storage/connect/mysql-test/connect/r/json_udf.result +++ b/storage/connect/mysql-test/connect/r/json_udf.result @@ -50,17 +50,19 @@ SELECT Json_Array_Add(Json_Make_Array(56, 3.1416, 'foo', NULL), 'One more') Arra Array [56,3.141600,"foo",null,"One more"] SELECT Json_Array_Add(JsonValue('one value'), 'One more'); -ERROR HY000: Can't initialize function 'json_array_add'; First argument must be a json item +Json_Array_Add(JsonValue('one value'), 'One more') +["\"one value\"","One more"] SELECT Json_Array_Add('one value', 'One more'); -ERROR HY000: Can't initialize function 'json_array_add'; First argument must be a json item +Json_Array_Add('one value', 'One more') +["one value","One more"] SELECT Json_Array_Add('one value' json_, 'One more'); Json_Array_Add('one value' json_, 'One more') one value Warnings: Warning 1105 Error 2 opening one value -Warning 1105 First argument target is not an array SELECT Json_Array_Add(5 json_, 'One more'); -ERROR HY000: Can't initialize function 'json_array_add'; First argument must be a json item +Json_Array_Add(5 json_, 'One more') +[5,"One more"] SELECT Json_Array_Add('[5,3,8,7,9]' json_, 4, 0); Json_Array_Add('[5,3,8,7,9]' json_, 4, 0) [4,5,3,8,7,9] diff --git a/storage/connect/mysql-test/connect/r/json_udf_bin.result b/storage/connect/mysql-test/connect/r/json_udf_bin.result index 0c009d612fe..d0819619c33 100644 --- a/storage/connect/mysql-test/connect/r/json_udf_bin.result +++ b/storage/connect/mysql-test/connect/r/json_udf_bin.result @@ -272,10 +272,9 @@ Json_Serialize(Jbin_Array('a','b','c')) ["a","b","c"] SELECT Json_Serialize(Jbin_Array_Add(Jbin_File('not_exist.json'), 'd')); Json_Serialize(Jbin_Array_Add(Jbin_File('not_exist.json'), 'd')) -Null json tree +[null,"d"] Warnings: Warning 1105 Open(map) error 2 on not_exist.json -Warning 1105 First argument is not an array # This does not modify the file SELECT Json_Serialize(Jbin_Array_Add(Jbin_File('bt1.json'), 'd')); Json_Serialize(Jbin_Array_Add(Jbin_File('bt1.json'), 'd')) diff --git a/storage/connect/mysql-test/connect/r/mongo_c.result b/storage/connect/mysql-test/connect/r/mongo_c.result index c7aadcf1165..132bb34ce64 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 708b6f1cc7c..67c67653e88 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.1/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo2.jar'; +SET GLOBAL connect_class_path='C:/MariaDB-10.2/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 672d9f15b80..665178bd3ea 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.1/MariaDB/storage/connect/mysql-test/connect/std_data/Mongo3.jar'; +SET GLOBAL connect_class_path='C:/MariaDB-10.2/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/tbl_thread.result b/storage/connect/mysql-test/connect/r/tbl_thread.result index e07fc0988fd..9633f358c97 100644 --- a/storage/connect/mysql-test/connect/r/tbl_thread.result +++ b/storage/connect/mysql-test/connect/r/tbl_thread.result @@ -79,7 +79,7 @@ a b CREATE TABLE total (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2,t3,t4,t5' OPTION_LIST='thread=yes,port=PORT'; -set connect_xtrace=1; +set connect_xtrace=96; SELECT * FROM total order by a desc; a b 19 test19 @@ -118,7 +118,7 @@ SELECT * FROM t2; v 22 CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=PORT';; -set connect_xtrace=1; +set connect_xtrace=96; SELECT * FROM total order by v desc; v 22 @@ -137,7 +137,7 @@ SELECT * FROM t2; v 22 CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=PORT';; -set connect_xtrace=1; +set connect_xtrace=96; SELECT * FROM total order by v desc; v 22 diff --git a/storage/connect/mysql-test/connect/r/vcol.result b/storage/connect/mysql-test/connect/r/vcol.result new file mode 100644 index 00000000000..4c59a3b06d8 --- /dev/null +++ b/storage/connect/mysql-test/connect/r/vcol.result @@ -0,0 +1,29 @@ +create table t1 ( +#linenum int(6) not null default 0 special=rowid, +name char(12) not null, +city char(11) not null, +birth date not null date_format='DD/MM/YYYY', +hired date not null date_format='DD/MM/YYYY' flag=36, +agehired int(3) as (floor(datediff(hired,birth)/365.25)) +) +engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47 ending=1; +select * from t1; +name city birth hired agehired +John Boston 1986-01-25 2010-06-02 24 +Henry Boston 1987-06-07 2008-04-01 20 +George San Jose 1981-08-10 2010-06-02 28 +Sam Chicago 1979-11-22 2007-10-10 27 +James Dallas 1992-05-13 2009-12-14 17 +Bill Boston 1986-09-11 2008-02-10 21 +drop table t1; +create table t1 ( +#linenum int(6) not null default 0 special=rowid, +name char(12) not null, +city char(11) not null, +birth date not null date_format='DD/MM/YYYY', +hired date not null date_format='DD/MM/YYYY' flag=36, +agehired int(3) as (floor(datediff(hired,birth)/365.25)), +index (agehired) +) +engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47 ending=1; +ERROR HY000: Key/Index cannot be defined on a non-stored computed column diff --git a/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar b/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar Binary files differnew file mode 100644 index 00000000000..33b29e7685b --- /dev/null +++ b/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar diff --git a/storage/connect/mysql-test/connect/std_data/Mongo2.jar b/storage/connect/mysql-test/connect/std_data/Mongo2.jar Binary files differindex d019bf6906b..9be654bd4c8 100644 --- a/storage/connect/mysql-test/connect/std_data/Mongo2.jar +++ b/storage/connect/mysql-test/connect/std_data/Mongo2.jar diff --git a/storage/connect/mysql-test/connect/std_data/Mongo3.jar b/storage/connect/mysql-test/connect/std_data/Mongo3.jar Binary files differindex 21c6c2d10bd..2850177a668 100644 --- a/storage/connect/mysql-test/connect/std_data/Mongo3.jar +++ b/storage/connect/mysql-test/connect/std_data/Mongo3.jar diff --git a/storage/connect/mysql-test/connect/t/jdbc_postgresql.test b/storage/connect/mysql-test/connect/t/jdbc_postgresql.test index 1041ef468d7..8036f71020d 100644 --- a/storage/connect/mysql-test/connect/t/jdbc_postgresql.test +++ b/storage/connect/mysql-test/connect/t/jdbc_postgresql.test @@ -3,25 +3,32 @@ # # This test is run against Postgresql driver # +eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/JavaWrappers.jar;C:/Jconnectors/postgresql-42.2.1.jar'; CREATE TABLE t2 ( command varchar(128) not null, number int(5) not null flag=1, message varchar(255) flag=2) -ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:postgresql://localhost/mtr' -OPTION_LIST='User=mtr,Password=mtr,Schema=public,Execsrc=1'; +ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono' +OPTION_LIST='Execsrc=1'; +#CONNECTION='jdbc:postgresql://localhost/mtr' +#OPTION_LIST='User=mtr,Password=mtr,Schema=public,Execsrc=1'; SELECT * FROM t2 WHERE command='drop table employee'; SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2))'; SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)"; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables -CONNECTION='jdbc:postgresql://localhost/mtr' -OPTION_LIST='User=mtr,Password=mtr,Schema=public,Tabtype=TABLE,Maxres=10'; +CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono' +OPTION_LIST='Tabtype=TABLE,Maxres=10'; +#CONNECTION='jdbc:postgresql://localhost/mtr' +#OPTION_LIST='User=mtr,Password=mtr,Schema=public,Tabtype=TABLE,Maxres=10'; SELECT * FROM t1; DROP TABLE t1; -CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=columns -CONNECTION='jdbc:postgresql://localhost/mtr' tabname=employee -OPTION_LIST='User=mtr,Password=mtr,Maxres=10'; +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC tabname=employee CATFUNC=columns +CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono'; +#CONNECTION='jdbc:postgresql://localhost/mtr' tabname=employee; +#OPTION_LIST='User=mtr,Password=mtr,Maxres=10'; SELECT * FROM t1; DROP TABLE t1; @@ -30,14 +37,18 @@ DROP TABLE t1; # CREATE SERVER 'postgresql' FOREIGN DATA WRAPPER 'postgresql' OPTIONS ( HOST 'localhost', -DATABASE 'mtr', -USER 'mtr', -PASSWORD 'mtr', +DATABASE 'test', +USER 'postgres', +PASSWORD 'tinono', PORT 0, SOCKET '', OWNER 'root'); +#DATABASE 'mtr', +#USER 'mtr', +#PASSWORD 'mtr', -CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='postgresql/public.employee'; +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC +CONNECTION='postgresql/public.employee'; SELECT * FROM t1; INSERT INTO t1 VALUES(3126,'Smith', 'Clerk', 5230.00); UPDATE t1 SET salary = salary + 100.00; diff --git a/storage/connect/mysql-test/connect/t/jdbconn.inc b/storage/connect/mysql-test/connect/t/jdbconn.inc index 05122f51924..81ec80c13d6 100644 --- a/storage/connect/mysql-test/connect/t/jdbconn.inc +++ b/storage/connect/mysql-test/connect/t/jdbconn.inc @@ -22,10 +22,11 @@ DROP TABLE t1; # 1 - The current directory. # 2 - The paths of the connect_class_path global variable. # 3 - The paths of the CLASSPATH environment variable. -# In this test we use an executable jar file that contains all what is needed. -eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/JdbcMariaDB.jar'; +# In this test we use an executable jar file that contains all the eisting wrappers. +#eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/JdbcMariaDB.jar'; +eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/JavaWrappers.jar'; -# Paths to the JDK classes and to the MySQL and MariaDB drivers can be defined in the CLASSPATH environment variable +# Paths to the JDK classes and to the JDBC drivers should be defined in the CLASSPATH environment variable #CREATE FUNCTION envar RETURNS STRING SONAME 'ha_connect.dll'; #SELECT envar('CLASSPATH'); diff --git a/storage/connect/mysql-test/connect/t/json_udf.test b/storage/connect/mysql-test/connect/t/json_udf.test index 35dbbfed706..d45131f32ba 100644 --- a/storage/connect/mysql-test/connect/t/json_udf.test +++ b/storage/connect/mysql-test/connect/t/json_udf.test @@ -29,12 +29,12 @@ SELECT Json_Make_Array(Json_Make_Array(56, 3.1416, 'foo'), TRUE); --error ER_CANT_INITIALIZE_UDF SELECT Json_Array_Add(Json_Make_Array(56, 3.1416, 'foo', NULL)) Array; SELECT Json_Array_Add(Json_Make_Array(56, 3.1416, 'foo', NULL), 'One more') Array; ---error ER_CANT_INITIALIZE_UDF +#--error ER_CANT_INITIALIZE_UDF SELECT Json_Array_Add(JsonValue('one value'), 'One more'); ---error ER_CANT_INITIALIZE_UDF +#--error ER_CANT_INITIALIZE_UDF SELECT Json_Array_Add('one value', 'One more'); SELECT Json_Array_Add('one value' json_, 'One more'); ---error ER_CANT_INITIALIZE_UDF +#--error ER_CANT_INITIALIZE_UDF SELECT Json_Array_Add(5 json_, 'One more'); SELECT Json_Array_Add('[5,3,8,7,9]' json_, 4, 0); SELECT Json_Array_Add('[5,3,8,7,9]' json_, 4, 2) Array; diff --git a/storage/connect/mysql-test/connect/t/mongo.inc b/storage/connect/mysql-test/connect/t/mongo.inc index 2d7cbcfa8bd..fab2ca84139 100644 --- a/storage/connect/mysql-test/connect/t/mongo.inc +++ b/storage/connect/mysql-test/connect/t/mongo.inc @@ -1,3 +1,3 @@ -let $MONGO= C:/PROGRA~1/MongoDB/Server/3.4/bin/mongo; -let $MONGOIMPORT= C:/PROGRA~1/MongoDB/Server/3.4/bin/mongoimport; +let $MONGO= C:/Applic/MongoDB/Server/3.6/bin/mongo; +let $MONGOIMPORT= C:/Applic/MongoDB/Server/3.6/bin/mongoimport; diff --git a/storage/connect/mysql-test/connect/t/mongo_test.inc b/storage/connect/mysql-test/connect/t/mongo_test.inc index dfc223e9074..357fa55240b 100644 --- a/storage/connect/mysql-test/connect/t/mongo_test.inc +++ b/storage/connect/mysql-test/connect/t/mongo_test.inc @@ -1,4 +1,4 @@ -#set connect_enable_mongo=1; +set connect_enable_mongo=1; --echo # --echo # Test the MONGO table type @@ -130,7 +130,9 @@ DROP TABLE t1; --echo # --echo # try CRUD operations --echo # +--disable_query_log --exec $MONGO --eval "db.testcoll.drop()" --quiet +--enable_query_log eval CREATE TABLE t1 (_id INT(4) NOT NULL, msg CHAR(64)) ENGINE=CONNECT TABLE_TYPE=$TYPE TABNAME='testcoll' OPTION_LIST='Driver=$DRV,Version=$VERS' $CONN; @@ -147,7 +149,9 @@ DROP TABLE t1; --echo # --echo # List states whose population is equal or more than 10 millions --echo # +--disable_query_log --exec $MONGO --eval "db.cities.drop()" --quiet +--enable_query_log --exec $MONGOIMPORT --quiet $MTR_SUITE_DIR/std_data/cities.json eval CREATE TABLE t1 ( _id char(5) NOT NULL, @@ -204,4 +208,4 @@ SELECT * FROM t1; DROP TABLE t1; --exec $MONGO --eval "db.testcoll.drop()" --quiet -#set connect_enable_mongo=0; +set connect_enable_mongo=0; diff --git a/storage/connect/mysql-test/connect/t/tbl_thread.test b/storage/connect/mysql-test/connect/t/tbl_thread.test index 68a0ebcd44d..05409c695fb 100644 --- a/storage/connect/mysql-test/connect/t/tbl_thread.test +++ b/storage/connect/mysql-test/connect/t/tbl_thread.test @@ -56,7 +56,7 @@ SELECT * FROM t5; eval CREATE TABLE total (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2,t3,t4,t5' OPTION_LIST='thread=yes,port=$PORT'; -set connect_xtrace=1; +set connect_xtrace=96; SELECT * FROM total order by a desc; set connect_xtrace=0; @@ -85,7 +85,7 @@ SELECT * FROM t2; --replace_result $PORT PORT --eval CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=$PORT'; -set connect_xtrace=1; +set connect_xtrace=96; SELECT * FROM total order by v desc; set connect_xtrace=0; DROP TABLE t1,t2,total; @@ -101,7 +101,7 @@ SELECT * FROM t2; --replace_result $PORT PORT --eval CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=$PORT'; -set connect_xtrace=1; +set connect_xtrace=96; SELECT * FROM total order by v desc; set connect_xtrace=0; diff --git a/storage/connect/mysql-test/connect/t/vcol.test b/storage/connect/mysql-test/connect/t/vcol.test new file mode 100644 index 00000000000..88b822102d0 --- /dev/null +++ b/storage/connect/mysql-test/connect/t/vcol.test @@ -0,0 +1,31 @@ +let datadir= `select @@datadir`; +--copy_file $MTR_SUITE_DIR/std_data/boys.txt $datadir/test/boys.txt + +create table t1 ( + #linenum int(6) not null default 0 special=rowid, + name char(12) not null, + city char(11) not null, + birth date not null date_format='DD/MM/YYYY', + hired date not null date_format='DD/MM/YYYY' flag=36, + agehired int(3) as (floor(datediff(hired,birth)/365.25)) + ) +engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47 ending=1; +select * from t1; +drop table t1; + +--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN +create table t1 ( + #linenum int(6) not null default 0 special=rowid, + name char(12) not null, + city char(11) not null, + birth date not null date_format='DD/MM/YYYY', + hired date not null date_format='DD/MM/YYYY' flag=36, + agehired int(3) as (floor(datediff(hired,birth)/365.25)), + index (agehired) + ) +engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47 ending=1; + +# +# Clean up +# +--remove_file $datadir/test/boys.txt |