Commit graph

17128 commits

Author SHA1 Message Date
Olivier Bertrand
a982f59b9b - JDBC using separate jmethodID for data types
Some DEBUG tests
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jdbconn.h
2016-05-21 11:56:59 +02:00
Olivier Bertrand
2f2797e52f - JDBC tables can be connected via foreign server wrapper
Redesign the handling of errors and exceptions
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jdbconn.h
  modified:   storage/connect/tabjdbc.cpp
  modified:   storage/connect/tabjdbc.h
2016-05-20 00:18:29 +02:00
Olivier Bertrand
7972a45b43 - Remove REQUIRED option that caused compilation to fail
Remove JVM_LIBRARY (is now dynamically loaded at run time)
  modified:   storage/connect/CMakeLists.txt
2016-05-12 17:22:45 +02:00
Olivier Bertrand
0f5ced1dd5 - Fix some typo ... causing crash!
modified:   storage/connect/jdbconn.cpp
2016-05-12 15:41:21 +02:00
Olivier Bertrand
6aa163bce8 - Continue working on the JDBC table type
Suppress the jpath option
  add the connect_jvm_path and connect_class_path global variables
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jdbccat.h
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jdbconn.h
  modified:   storage/connect/tabjdbc.cpp
  modified:   storage/connect/tabjdbc.h

- Add the envar UDF
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h

- Fix MDEV-9950
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/plgdbutl.cpp
2016-05-12 12:20:52 +02:00
Olivier Bertrand
2323cf0033 - Make the JVM lib dynamically loaded
This makes the CONNECT storage engine usable when Java JDK is not installed.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jdbconn.h

- Typo
  modified:   storage/connect/reldef.cpp
2016-05-09 17:26:50 +02:00
Olivier Bertrand
025decfc38 - Remove gcc compiling errors and warnings
modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/tabjdbc.h
2016-05-06 01:07:14 +02:00
Olivier Bertrand
80a204f27e - Try to fix MDEV-9950 (not tested yet)
modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/plgdbutl.cpp

- Fix Mdev-9997 (Sergey Vojtovitch)
  modified:   storage/connect/inihandl.c

- Try to have the JDBC type compiled by CMake
  modified:   storage/connect/CMakeLists.txt

- Fixing some bugs in the JDBC table type
  Use the CONNECTION option for the URL
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jdbconn.h
  modified:   storage/connect/tabjdbc.cpp

- Add the JdbcInterface.class to the project
  new file:   storage/connect/JdbcInterface.class
2016-05-05 01:03:26 +02:00
Olivier Bertrand
bbdeb911b8 - Add the JdbcInterface.java to the project
added:   storage/connect/JdbcInterface.java

- Add *.java to be handled
  modified:   .gitattributes
2016-04-27 12:57:27 +02:00
Olivier Bertrand
7b7414c0ef - Add the JDBC table type compilation for CMAKE.
modified:   storage/connect/CMakeLists.txt

- Fix MDEV-9993
  modified:   storage/connect/jsonudf.cpp
2016-04-27 12:36:55 +02:00
Olivier Bertrand
4a62480799 - Add the use of prepared statement in the JDBC table type.
modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jdbconn.h
  modified:   storage/connect/tabjdbc.cpp
  modified:   storage/connect/tabjdbc.h
2016-04-26 11:22:30 +02:00
Olivier Bertrand
c086a96b94 - Fix an error causing MYSQL table to fail saying "no result set"
when joining a table to a MYSQL indexed table.
  modified:   storage/connect/myconn.cpp
  modified:   storage/connect/myconn.h
  modified:   storage/connect/tabmysql.cpp

- Fix an error causing JDBC table to fail saying
  when joining a table to a JDBC indexed table.
  added:      storage/connect/tabjdbc.cpp

- Add more tests to the mysql_index.test file
  modified:   storage/connect/mysql-test/connect/r/mysql_index.result
  modified:   storage/connect/mysql-test/connect/t/mysql_index.test

- Add dummy JDBC support (NIY)
  modified:   storage/connect/CMakeLists.txt

- Typo
  modified:   storage/federatedx/ha_federatedx.cc
2016-04-24 19:56:32 +02:00
Olivier Bertrand
afecdd2419 - Fix and error causing remote indexing to fail when for not unique index.
Was experienced with MYSQL, ODBC and JDBC tables.
  modified:   storage/connect/connect.cc

- Fix MDEV-9966 (zero lines returned)
  modified:   storage/connect/ha_connect.cc
  modified:   storage/federatedx/ha_federatedx.cc

- Typo
  modified:   storage/connect/odbconn.cpp
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/tabmysql.cpp

- Add new table type JDBC
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/plgdbsem.h
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/tabodbc.cpp
  added:      storage/connect/jdbccat.h
  added:      storage/connect/jdbconn.cpp
  added:      storage/connect/jdbconn.h
  added:      storage/connect/tabjdbc.cpp
  added:      storage/connect/tabjdbc.h
2016-04-23 23:20:10 +02:00
Olivier Bertrand
a1b2a28e55 - Fix MDEV-9779. Avoid buffer overflow when setting partname.
modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/ha_connect.h
2016-03-25 13:02:34 +01:00
Olivier Bertrand
d681c50a70 - Fix MDEV-9779. Connection was not recognized in the option list.
This was a regression bug.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mysql-test/connect/r/part_table.result
  modified:   storage/connect/mysql-test/connect/t/part_table.test
2016-03-24 23:24:33 +01:00
Olivier Bertrand
59c4675c6b - Fix compile error when copying a string on itself.
modified:   storage/connect/value.cpp

- Fix compile error of MDEV-9603
  modified:   storage/connect/tabmysql.cpp
2016-03-19 12:02:03 +01:00
Olivier Bertrand
b80b292117 - Fix crash when sorting a TBL table with thread=yes.
This was because Tablist can be NULL when no lacal tables are in the list.
  modified:   storage/connect/tabtbl.cpp
  modified:   storage/connect/mysql-test/connect/r/tbl.result
  modified:   storage/connect/mysql-test/connect/t/tbl.test
2016-03-17 00:08:00 +01:00
Olivier Bertrand
7829cefa41 - Fix MDEV-9603 compiler error.
modified:   storage/connect/tabmysql.cpp

- Test invalid CSV separator when creating the table (MDEV-9714)
  modified:   storage/connect/ha_connect.cc

- Stop using SQLDescribeParam anymore
  modified:   storage/connect/odbconn.cpp

- Fix MDEV-9723 Regression due to calling Cardinality instead of
  GetMaxSize in info.
  modified:   storage/connect/tabtbl.h
  modified:   storage/connect/mysql-test/connect/r/tbl.result
  modified:   storage/connect/mysql-test/connect/t/tbl.test

- Typo
  modified:   storage/connect/tabodbc.cpp
2016-03-16 18:53:56 +01:00
Olivier Bertrand
69042ffe4e - Fix to MDEV-9579 be testing for void result.
modified:   storage/connect/tabodbc.cpp
2016-02-20 00:22:16 +01:00
Olivier Bertrand
d163ad338d - Fix to MDEV-9542 Connect was not handling NULLs in the answer
from catalog functions and tables. It does now and when decimal
  is NULL defines DOUBLE without parameters.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mysql-test/connect/r/odbc.result
  modified:   storage/connect/mysql-test/connect/r/odbc_oracle.result
  modified:   storage/connect/mysql-test/connect/r/odbc_postgresql.result
  modified:   storage/connect/mysql-test/connect/r/odbc_sqlite3.result
  modified:   storage/connect/mysql-test/connect/r/odbc_xls.result
  modified:   storage/connect/odbconn.cpp
  modified:   storage/connect/table.cpp
  modified:   storage/connect/valblk.h
2016-02-15 10:32:30 +01:00
Olivier Bertrand
8fb34ea8c1 - Fix to MDEV-9446 (using Json UDFs when CONNECT is not installed)
modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
  modified:   storage/connect/mysql-test/connect/r/json_udf.result
  modified:   storage/connect/mysql-test/connect/t/json_udf.inc
  modified:   storage/connect/mysql-test/connect/t/json_udf.test
  modified:   storage/connect/mysql-test/connect/t/json_udf2.inc
2016-01-25 14:10:09 +01:00
Olivier Bertrand
ddd62ba24a - Change SQL_NTS to 0 when the string is NULL
modified:   storage/connect/odbconn.cpp
2016-01-18 23:00:40 +01:00
Olivier Bertrand
3e20a0d8f4 - Fix MDEV-9239. Meanwhile, make all references to the database in XTAB Schema
(was sometimes in XTAB Catalog)
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/mycat.h
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/reldef.h
  modified:   storage/connect/tabmysql.cpp
  modified:   storage/connect/tabpivot.cpp
  modified:   storage/connect/tabtbl.cpp
  modified:   storage/connect/tabutil.cpp
2016-01-09 19:51:51 +01:00
Olivier Bertrand
3e76d54b98 - Fix MDEV-9322.
modified:   storage/connect/json.cpp
2015-12-27 19:37:28 +01:00
Olivier Bertrand
e57876eacf - Fix MDEV-9279. Replacing exit(1) in yy_fatal_error by a longjmp.
modified:   storage/connect/fmdlex.c
  modified:   storage/connect/plgdbutl.cpp
2015-12-14 23:49:17 +01:00
Olivier Bertrand
2ce0043bf3 - Copy error message from G to g when using temporary storage for parsing.
modified:   storage/connect/tabjson.cpp
2015-12-13 18:43:37 +01:00
Olivier Bertrand
673cc06598 Merge branch 'ob-10.1' into 10.1 2015-12-11 19:19:21 +01:00
Olivier Bertrand
32879b9580 Update version number 2015-12-11 18:43:54 +01:00
Olivier Bertrand
32393e2253 Merge branch 'ob-10.1' into 10.1 2015-12-09 00:02:04 +01:00
Olivier Bertrand
a18a3fbdd1 - Serialize: Protect again eventual longjmp's.
Always return NULL on error.
Adding also the file length.
  modified:   storage/connect/json.cpp
  modified:   storage/connect/jsonudf.cpp

- JSONCOL::WriteColumn Add types SHORT and BIGINT as accepted
  modified:   storage/connect/tabjson.cpp

- TDBJSN: Make this type use a separate storage for Json parsing
and retrieve this memory between each rows. This is necessary
to be able to handle big tables. See MDEV-9228.
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
2015-12-09 00:00:08 +01:00
Olivier Bertrand
1ad5a8dfb7 Fix memory error when a plain string argument is parsed.
Parsing memory, not added in CalcLen, is added in CheckMemory.
Adding also the file length.
  modified:   storage/connect/jsonudf.cpp
2015-12-05 20:51:40 +01:00
Olivier Bertrand
0ec89291f1 Remove warning on Linux
modified:   storage/connect/filamzip.cpp

Avoid calling the wrong AddValue (Windows compiler error ???)
  modified:   storage/connect/json.h

Fix looping bug in JARRAY::AddValue for arrays having one value.
Fix potential crash in JVALUE::SetValue
  modified:   storage/connect/json.cpp

Many changes to fix bugs, enhance memory handling and modify Jpath.
In JSNX some functions have been re-written or added to handle new Jpath.
BMX was re-defined to avoid a different size between Windows an Linux.
Jbin memory was fixed to use the proper memory when adding values.
Default pretty value is now 0 instead of 2.
Filename is stored in BSON when IsJson == 2.
BSON size is added to memlen in CalcLen when applicable.
The order or parameter was switch in Json_Object_Grp.
File name argument must be a constant (temporary?)
Json_Set_Item now returns file name when applicable.
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h

Include "mycat.h"
  modified:   storage/connect/mycat.cc

Udf_json test revisited and fixed for Linux
  modified:   storage/connect/mysql-test/connect/r/json_udf.result
  modified:   storage/connect/mysql-test/connect/t/json_udf.inc
  modified:   storage/connect/mysql-test/connect/t/json_udf.test
  modified:   storage/connect/mysql-test/connect/t/json_udf2.inc
2015-12-04 01:02:27 +01:00
Olivier Bertrand
8a860fda0c Remove commented lines.
modified:   storage/connect/value.cpp
Avoid warning on redefined XSTR
  modified:   storage/connect/tabxml.cpp
2015-11-22 16:15:57 +01:00
Olivier Bertrand
1d239d8c94 Make changes required by version 10.1.9 (see Sergei's mmail):
Use PlgDBSuballoc in JbinAlloc to avoid unsupported longjmp's.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
  modified:   storage/connect/mysql-test/connect/r/json_udf.result
  modified:   storage/connect/mysql-test/connect/t/json_udf.inc
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/value.cpp
Add new UDF functions jsoncontains, jsoncontains_path, json_set_item,
json_insert_item, json_update_item, jbin_set_item, jbin_insert_item,
jbin_update_item
  modified:   storage/connect/json.cpp
  modified:   storage/connect/json.h
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
2015-11-22 14:49:51 +01:00
Olivier Bertrand
ad916ef33c Merge branch 'ob-10.1' into 10.1 2015-11-08 14:56:48 +01:00
Olivier Bertrand
0a852591db PATCH-P0-FIX-UPSTREAM: Fix possible buffer overflow (MDEV-8317)
Maintainer: Michal Hrusecky <Michal.Hrusecky@opensuse.org>
(modified by O. Bertrand --> adding and using the XSTR macro)
  modified:   storage/connect/tabxml.cpp
2015-11-08 14:54:56 +01:00
Olivier Bertrand
e7fa7e0858 Fix error and warnings raised by gcc on Linux:
Define O_RDONLY in jsonudf.cpp
 Correct wrong deinit function names
 Make Locate functions use the variable more
 Avoid signed/unsigned warning in ha_connect.cc GetIntegerTableOption
 Initialize oom in tabodbc MakeInsert
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/tabodbc.cpp
2015-10-25 21:19:45 +01:00
Olivier Bertrand
abe87bb011 Fix error and warnings raised by gcc on Linux:
Define O_RDONLY in jsonudf.cpp
 Correct wrong deinit function names
 Make Locate functions use the variable more
 Avoid signed/unsigned warning in ha_connect.cc GetIntegerTableOption
 Initialize oom in tabodbc MakeInsert
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/tabodbc.cpp
2015-10-25 21:11:04 +01:00
Buggynours
de19721296 Fix of error and warnings when compiling on linux
modifié :         storage/connect/ha_connect.cc
	modifié :         storage/connect/jsonudf.cpp
	nouveau fichier : storage/connect/mysql-test/connect/r/odbc_firebird.result
	modifié :         storage/connect/mysql-test/connect/t/json.test
	nouveau fichier : storage/connect/mysql-test/connect/t/odbc_firebird.test
	modifié :         storage/connect/tabodbc.cpp
	supprimé :        storage/connect/Makefile
2015-10-25 17:46:20 +01:00
Olivier Bertrand
1816eca57c Fix MDEV-8882
modified:   storage/connect/tabodbc.cpp
2015-10-21 19:26:35 +02:00
Olivier Bertrand
2445b1b212 Typo 2015-10-20 18:49:33 +02:00
Olivier Bertrand
7cd9af694f Fix MDEV-8926
modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mysql-test/connect/r/datest.result
  modified:   storage/connect/mysql-test/connect/t/datest.test
2015-10-18 16:04:25 +02:00
Olivier Bertrand
100be0b6ee Update JSON UDFs to version 1.04.0004
modified:   storage/connect/json.cpp
  modified:   storage/connect/json.h
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/mysql-test/connect/r/json_udf.result
  modified:   storage/connect/mysql-test/connect/std_data/biblio.json
  modified:   storage/connect/mysql-test/connect/t/json_udf.inc
  modified:   storage/connect/mysql-test/connect/t/json_udf.test
  modified:   storage/connect/tabjson.cpp
2015-10-17 17:23:11 +02:00
Olivier Bertrand
608ad38a0d Temporary changes for making compile to work 2015-10-04 11:57:57 +02:00
Olivier Bertrand
a575d90fe1 Fold all json UDF names to lower case
modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
  modified:   storage/connect/mysql-test/connect/r/json_udf.result
  modified:   storage/connect/mysql-test/connect/t/json_udf.inc
  modified:   storage/connect/value.cpp
2015-09-21 21:14:18 +02:00
Olivier Bertrand
9c6405fefa Commit resolved conflicts 2015-09-18 18:39:08 +02:00
Alexander Barkov
d9b25ae3db MDEV-8466 CAST works differently for DECIMAL/INT vs DOUBLE for empty strings
MDEV-8468 CAST and INSERT work differently for DECIMAL/INT vs DOUBLE for a string with trailing spaces
2015-09-17 11:05:07 +04:00
Olivier Bertrand
f4fe138321 Fix assert error for where clause with UDF's
was fixed in HA_CONNECT::CondFilter moving res= pval->val_str(&tmp)
    but this was wrong. Now res is only used for strings.
Change version number
  modified:   storage/connect/ha_connect.cc

Add some new UDF's
  modified:   storage/connect/json.cpp
  modified:   storage/connect/json.h
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h

Fix change in tests json_udf
  modified:   storage/connect/mysql-test/connect/r/json_udf.result
  modified:   storage/connect/mysql-test/connect/t/json_udf.inc
  modified:   storage/connect/mysql-test/connect/t/json_udf.test
2015-09-15 20:42:51 +02:00
Jan Lindström
9e6f3df51a MDEV-8799: Server crashes in btr_defragment_add_index, encryption.innodb-bad-key-change5 and alike fail in buildbot
Problem was unsafe access to NULL pointer. Added additional checks to avoid
access to NULL pointer.
2015-09-15 09:40:04 +03:00
Jan Lindström
3079bd43af Fix release build compile failure. 2015-09-14 16:28:16 +03:00