Commit graph

308 commits

Author SHA1 Message Date
Sergei Golubchik
77b548484e Merge branch 'connect/10.0' into 10.0 2016-02-16 19:35:58 +01:00
Olivier Bertrand
481e6433f4 - 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 23:41:59 +01:00
Olivier Bertrand
62a5e56c01 - Change SQL_NTS to 0 when the string is NULL
modified:   storage/connect/odbconn.cpp

- 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 18:44:51 +01:00
Sergei Golubchik
6b4cc43f17 Merge branch 'connect/10.0' into 10.0 2015-12-13 23:52:43 +01:00
Olivier Bertrand
541d36f761 Update version number 2015-12-11 18:29:03 +01:00
Olivier Bertrand
27f9d2f929 Commit updating CONNECT from the 10.1 version 2015-12-04 22:38:16 +01:00
Monty
f813a00029 Fixed failing test cases and compiler warnings found by buildbot
- Added some extra command to rpl_start_stop to ensure that the
  IO thread has connected to the master before we shut down the server.
- if signal returns signalhandler_t, use this with the alarm code
- Added missing tests to sys_vars
- Fixed some possible overflow bugs in tabxml.cpp
2015-11-24 20:04:12 +02:00
Sergei Golubchik
3c5733cd2d Merge branch 'connect/10.0' into 10.0 2015-10-27 18:57:28 +01:00
Olivier Bertrand
ac9141cbc0 Merge branch 'ob-10.0' into 10.0 2015-10-20 18:45:45 +02:00
Olivier Bertrand
d51e466e63 Fix MDEV-8966
modified:   storage/connect/ha_connect.cc
2015-10-20 13:20:10 +02:00
Olivier Bertrand
f5154229ed Merge branch 'ob-10.0' into 10.0 2015-10-18 15:06:14 +02:00
Olivier Bertrand
90209463d0 Fix MDEV-8926
modified:   storage/connect/ha_connect.cc
2015-10-18 15:03:45 +02:00
Olivier Bertrand
80d1237470 Merge branch 'ob-10.0' into 10.0 2015-09-16 12:14:59 +02:00
Olivier Bertrand
019c9e0a65 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.
  modified:   storage/connect/ha_connect.cc
2015-09-16 12:11:28 +02:00
Olivier Bertrand
d69931eec2 Merge branch 'ob-10.0' into 10.0 2015-09-09 01:28:04 +02:00
Olivier Bertrand
e939ea58e5 Fix assert error for where clause with UDF's
was fixed in HA_CONNECT::CondFilter moving pval->val_str(&tmp)
  modified:   storage/connect/ha_connect.cc
2015-09-09 01:26:00 +02:00
Sergei Golubchik
0785b2d55d Merge 'https://github.com/Buggynours/MariaDB 10.0' into 10.0 2015-08-03 17:10:20 +02:00
Sergei Golubchik
6f14531b52 CONNECT: compiler warnings
and don't check table privileges in external_lock(F_UNLCK).
2015-07-27 10:52:22 +02:00
Sergei Golubchik
00967e114c CONNECT: clean up a stray variable
(patch originally by Alexander Barkov)
2015-07-27 10:52:21 +02:00
Sergei Golubchik
40a6160f4f MDEV-7574 Security definer views don't work with CONNECT ODBC tables
Instead of checking user's privileges with check_access(),
use the cached value in table->grant.privilege instead -
it is correctly set to the invoker or definer, depending
on SQL SECURITY mode.

Continue to use check_access() for DDLs when
table->grant.privilege may be not set (but these cases are
only possible on tables, never for views).

(patch originally by Alexander Barkov)
2015-07-27 10:52:21 +02:00
Olivier Bertrand
b520febbc3 Resolving conflict on ha_connect.cc 2015-07-09 12:33:17 +02:00
Olivier Bertrand
f07359349f Fix loosing result lines when all of this is true:
The table type is MYSQL
  The query where clause includes an indexed column
  The where clause contains < or <= operator on this column
Change version date
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/tabmysql.cpp

Add visual studio 2013 files to ignore
  modified:   .gitignore
2015-07-06 12:33:11 +02:00
Olivier Bertrand
8e524d2f84 Set maturity to GAMMA modified ha_connect.cc 2015-06-25 00:06:55 +02:00
Olivier Bertrand
0e270f7399 Set maturity to GAMMA modified ha_connect.cc 2015-06-25 00:01:38 +02:00
Olivier Bertrand
0599d80fcc Fix swapping key numeric values on Big Endian machines.
Fix typo error in CntIndexRange (kp instead of p)
Change version date
  modified:   storage/connect/connect.cc
  modified:   storage/connect/ha_connect.cc
2015-06-03 17:37:51 +02:00
Olivier Bertrand
514a7d8462 Add unicode ODBC types to the types recognized by CONNECT.
Was added in function TranslateSQLType.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/odbconn.cpp
  modified:   storage/connect/value.h

Add some trace in particular in indexing routines.
  modified:   storage/connect/block.h
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/plugutil.c
  modified:   storage/connect/xindex.cpp
  modified:   storage/connect/xindex.h
2015-05-30 10:59:34 +02:00
Olivier Bertrand
b6a56370d6 Change all preprocessor compiler directives to use __WIN__ as the mean of
specifying Windows or not Windows compile. This is what MariaDB does.
  modified:   storage/connect/array.cpp
  modified:   storage/connect/blkfil.cpp
  modified:   storage/connect/block.h
  modified:   storage/connect/colblk.cpp
  modified:   storage/connect/domdoc.cpp
  modified:   storage/connect/filamap.cpp
  modified:   storage/connect/filamdbf.cpp
  modified:   storage/connect/filamfix.cpp
  modified:   storage/connect/filamtxt.cpp
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filter.cpp
  modified:   storage/connect/filter.h
  modified:   storage/connect/fmdlex.c
  modified:   storage/connect/global.h
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/json.cpp
  modified:   storage/connect/macutil.cpp
  modified:   storage/connect/macutil.h
  modified:   storage/connect/maputil.cpp
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/myconn.cpp
  modified:   storage/connect/myconn.h
  modified:   storage/connect/myutil.cpp
  modified:   storage/connect/odbconn.cpp
  modified:   storage/connect/odbconn.h
  modified:   storage/connect/os.h
  modified:   storage/connect/osutil.c
  modified:   storage/connect/plgdbsem.h
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/plugutil.c
  modified:   storage/connect/rcmsg.c
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/reldef.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabmac.cpp
  modified:   storage/connect/tabmac.h
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmul.h
  modified:   storage/connect/tabmysql.cpp
  modified:   storage/connect/taboccur.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/tabxcl.cpp
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/valblk.cpp
  modified:   storage/connect/value.cpp
  modified:   storage/connect/xindex.cpp
  modified:   storage/connect/xindex.h
2015-05-27 16:23:38 +02:00
Olivier Bertrand
fb98632930 JSONColumns and XMLColumns revisited. They can retrieve their parameters directly
from the PTOS argument. For this to work, finding the table options is now split
in HA_CONNECT functions and exported functions available from out of ha_connect.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/libdoc.cpp
  modified:   storage/connect/mycat.h
  modified:   storage/connect/plgdbsem.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/tabxml.h

The BIN table formats have been changed to handle the case of floating point values
when used with Big Endian or Little Endian machines.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mysql-test/connect/r/bin.result
  modified:   storage/connect/mysql-test/connect/t/bin.test
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfix.
h
2015-05-26 01:02:33 +02:00
Olivier Bertrand
e6b60ee5af Make BIN table files more flexible with new column format.
In particular enable to set length and endian setting.
This should solve all problems on IBM390s machines.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfix.h

Make DBF tables to be usable in big-endian machines (test version)
  modified:   storage/connect/filamdbf.cpp

Ignore git files on storage/connect
  modified:   .gitignore
2015-05-13 19:58:21 +02:00
Olivier Bertrand
c63bd866fd Get rid of more GCC warnings about unused parameters
modified:   storage/connect/array.cpp
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/user_connect.cc
  modified:   storage/connect/user_connect.h
2015-05-10 12:14:21 +02:00
Olivier Bertrand
f5d0c77062 Get rid of GCC warnings about unused parameters
modified:   storage/connect/array.cpp
  modified:   storage/connect/blkfil.cpp
  modified:   storage/connect/block.h
  modified:   storage/connect/catalog.h
  modified:   storage/connect/colblk.cpp
  modified:   storage/connect/colblk.h
  modified:   storage/connect/connect.cc
  modified:   storage/connect/filamap.cpp
  modified:   storage/connect/filamdbf.cpp
  modified:   storage/connect/filamfix.cpp
  modified:   storage/connect/filamtxt.cpp
  modified:   storage/connect/filamtxt.h
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filter.h
  modified:   storage/connect/ha_connect.c
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/mycat.h
  modified:   storage/connect/myconn.cpp
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/reldef.h
  modified:   storage/connect/tabcol.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabfmt.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
  modified:   storage/connect/table.cpp
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmysql.cpp
  modified:   storage/connect/tabmysql.h
  modified:   storage/connect/taboccur.cpp
  modified:   storage/connect/tabpivot.cpp
  modified:   storage/connect/tabsys.cpp
  modified:   storage/connect/tabtbl.cpp
  modified:   storage/connect/tabtbl.h
  modified:   storage/connect/tabutil.cpp
  modified:   storage/connect/tabutil.h
  modified:   storage/connect/tabvct.cpp
  modified:   storage/connect/tabvir.cpp
  modified:   storage/connect/tabvir.h
  modified:   storage/connect/tabxcl.cpp
  modified:   storage/connect/tabxcl.h
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/tabxml.h
  modified:   storage/connect/valblk.cpp
  modified:   storage/connect/valblk.h
  modified:   storage/connect/value.cpp
  modified:   storage/connect/value.h
  modified:   storage/connect/xindex.cpp
  modified:   storage/connect/xindex.h
  modified:   storage/connect/xobject.h
  modified:   storage/connect/xtable.h
2015-05-09 17:30:20 +02:00
Olivier Bertrand
3a889b1f90 Fix a bug in init_table_share that caused syntax error with Boolean options:
oom|= sql->append(vull ? "ON" : "OFF");
  replaced by:
  oom|= sql->append(vull ? "YES" : "NO");
modified:
  ha_connect.cc

Make DBF tables to be usable in big-endian machines (test version)
modified:
  filamdbf.cpp
2015-05-07 16:59:25 +02:00
Olivier Bertrand
12bebceb8e - Fix a regression bug on (XML) HTML tables.
modified:
  tabxml.cpp
added:
  xml_html.test
  xml_html.result
  beers.xml
  coffee.htm

- Fix MDEV-7935 by suppressing error resetting code in delete_or_rename_table.
  However, the issue is that this code was added because without it an assertion
  was raised in some cases. Unfortunately I can't remember what were these cases.
  Therefore fixing it in this case will perhaps make a new crash happening on another cases.
modified:
  ha_connect.cc

- Add the UDF Json_Array_Delete.
modified:
  jsonudf.cpp
2015-05-05 11:37:21 +02:00
Olivier Bertrand
f5b05a11c1 - Fix bug on updating JSON expanded values
modified:
  json.result
  tabjson.cpp
  tabjson.h

- Fix bug on multiple tables (directories must be eliminated from file list)
modified:
  tabmul.cpp

- Update version
modified:
  ha_connect.cc

- Typo
modified:
  global.h
  ha_connect.cc
  tabtbl.cpp
  tabutil.cpp
  value.cpp
2015-05-01 15:59:12 +02:00
Olivier Bertrand
eae8318b19 - Fix Catalog JSON table crash when no Jpath
- Added JSON OBJECT specification for pretty != 2.
- Fix NULL values not recognized for nullable JSON columns
- Issue an error message when a JSON table is created without specifying LRECL if PRETTY != 2.
- Make JSONColumns use a TDBJSON class.
- Make JSON table using MAPFAM
modified:
  filamap.h
  filamtxt.h
  ha_connect.cc
  json.result
  tabjson.cpp
  tabjson.h
  table.cpp

- Implementing Discovery for the XML table type.
modified:
  domdoc.cpp
  domdoc.h
  ha_connect.cc
  libdoc.cpp
  plgxml.cpp
  plgxml.h
  reldef.cpp
  reldef.h
  tabxml.cpp
  tabxml.h

- Providing an error message when creating an ODBC table via discovery returns
  columns of more than one table.
modified:
  ha_connect.cc

- TableOptionStruct declaration moved from ha_connect.h to mycat.h
  To make it easier to use by other classes.
modified:
  ha_connect.cc
  ha_connect.h
  mycat.cc
  mycat.h
  reldef.cpp
  tabmysql.cpp
  taboccur.cpp
  tabpivot.cpp
  tabtbl.cpp
  tabutil.cpp
  tabxcl.cpp
2015-04-17 20:05:41 +02:00
Olivier Bertrand
05b30fbcc3 Fix MDEV-7890 2015-04-04 19:29:34 +02:00
Olivier Bertrand
8721d20fb1 - Fix MDEV-7879 by adding a test in all SetValue_pval function to return when valp == this.
- Fix MDEV-7840 by making proper datetime constant in ha_connect::CheckCond on a second place.
2015-03-30 19:03:57 +02:00
Olivier Bertrand
daa8b6b5ba D:\Ber\Develop\git3.msg 2015-03-28 20:18:46 +01:00
Olivier Bertrand
9cace9932f - Fix a bug that caused a crash when doing delete on a json table with wrong syntax file
- Suppress MYSQL_SUPPORT preprocessor variable
2015-03-22 11:34:29 +01:00
Olivier Bertrand
2bb42803df This commit includes changes done in a previous (deleted) branch plus new ones.
From the previous branch:
commit eda4928ff122a0845baf5ade83b4aa29244a3a89
Author: Olivier Bertrand <bertrandop@gmail.com>
Date:   Mon Mar 9 22:34:56 2015 +0100

- Add discovery to JSON tables
  When columns are not defined, CONNECT analyses the json file to find column definitions.
  This wors only on table that are an array of objects. Pair keys are used to generate the
  column names and pair values are used for its definition. When the LEVEL option is defined
  as a not null integer, the eventual JPATH is scanned up to the LEVEL value.

From the current one:
- Fix MDEV-7521 when column names are utf8 encoded (not a general multi-charset fix)

- Adds more to JSON discovery processing and UDF's

- Use PlugDup everywhere it replaces PlugSubAlloc + strcpy.
2015-03-18 13:30:14 +01:00
Olivier Bertrand
d862d7c049 - Implement random access to ODBC tables
modified:
  storage/connect/odbconn.cpp
  storage/connect/odbconn.h

- Fix get proper length of ODBC DECIMAL column in discovery
modified:
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/odbc_oracle.result

- Implement random access to JSON tables
modified:
  storage/connect/tabjson.cpp
  storage/connect/tabjson.h

- Fix MDEV-7636
modified:
  storage/connect/tabutil.cpp
2015-02-28 23:01:55 +01:00
Olivier Bertrand
e027f5e8d5 - Fix MDEV-7616 by adding SQLCOM_SET_OPTION to the accepted command list.
modified:
  storage/connect/ha_connect.cc

- Add new JSON UDF functions and JSON functionalities.
modified:
  storage/connect/json.cpp
  storage/connect/json.h
  storage/connect/jsonudf.cpp
  storage/connect/tabjson.cpp
2015-02-24 23:18:04 +01:00
Olivier Bertrand
a736e63f7c - Add new Json UDF's Json_Array_Add, Json_Array_Grp and Json_Object_Grp.
Handle longjmp's raised during json processing.
modified:
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/json.cpp
  storage/connect/jsonudf.cpp

- Fix wrong references to the suppressed g->Trace variables.
modified:
  storage/connect/global.h
  storage/connect/plugutil.c
  storage/connect/tabjson.cpp
  storage/connect/tabodbc.cpp
2015-02-22 17:53:02 +01:00
Olivier Bertrand
dcfe068d59 - Adding json udf's. Making the second version of json tables.
added:
  storage/connect/jsonudf.cpp
modified:
  storage/connect/CMakeLists.txt
  storage/connect/json.cpp
  storage/connect/json.h
  storage/connect/tabjson.cpp
  storage/connect/tabjson.h

- Fix utf8 issues with PROXY tables
modified:
  storage/connect/ha_connect.cc
  storage/connect/tabutil.cpp
  storage/connect/tabutil.h
2015-02-11 21:39:41 +01:00
Olivier Bertrand
3c097fd689 - Remove some GCC warnings
modified:
  storage/connect/ha_connect.cc
2015-02-08 19:47:26 +01:00
Olivier Bertrand
96ba1f1473 - Handle the use of date/time values when making queries for MYSQL or
ODBC. Was raised by 7549.
modified:
  storage/connect/ha_connect.cc
  storage/connect/odbconn.cpp
  storage/connect/tabodbc.cpp
2015-02-08 18:17:29 +01:00
Olivier Bertrand
35548d577c - Modify the connect_type_conv and connect_conv_size variables.
They were global (read-only) now they are session (not read-only)
modified:
  storage/connect/checklvl.h
  storage/connect/ha_connect.cc
  storage/connect/myconn.cpp
  storage/connect/myutil.cpp
  storage/connect/tabutil.cpp

- Suppress the compver variable on Linux compile. Was not
  debian reproductible because using __DATE__ and __TIME__ macros.
modified:
  storage/connect/ha_connect.cc

- ODBC LONGVARVAR type conversion now uses connect_conv_size.
modified:
  storage/connect/odbconn.cpp
2015-02-07 11:33:52 +01:00
Olivier Bertrand
6a78371991 - Fix a bug causing UseCnc not being initialized for ODBC catalog tables.
This made errors by calling SQLConnect or SQLDriverConnect randomly
  with incorrect parameters.
modified:
  storage/connect/tabodbc.cpp
  
- Removing GCC warnings  
modified:
  storage/connect/ha_connect.cc

- Typo
modified:
  storage/connect/odbconn.cpp
2015-02-01 12:16:30 +01:00
Olivier Bertrand
180b2be63c - Add the possibility to establish an ODBC connection via SQLConnect (the
default being still to use SQLDriverConnect)
modified:
  storage/connect/ha_connect.cc
  storage/connect/odbccat.h
  storage/connect/odbconn.cpp
  storage/connect/odbconn.h
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h

- Cardinality testing not possible for TBL tables
modified:
  storage/connect/tabtbl.cpp

- Make all line ending LF instead of CRLF
modified:
  storage/connect/tabjson.cpp
2015-01-31 15:05:43 +01:00
Olivier Bertrand
fd1ca70bb3 - Enhance JSON tables handling.
modified:
  storage/connect/json.cpp
  storage/connect/json.h
  storage/connect/mysql-test/connect/r/json.result
  storage/connect/mysql-test/connect/t/json.test
  storage/connect/tabjson.cpp
  storage/connect/tabjson.h

- Avoid crash when a partition table name pattern is ill formed
  (such as using place holder %i instead of %s)
modified:
  storage/connect/ha_connect.cc
2015-01-30 10:57:00 +01:00