Commit graph

174799 commits

Author SHA1 Message Date
Olivier Bertrand
2d573a6c5a CONNECT Storage Engine: Support of ENUM and SET column types
for MYSQL tables.
  modified:   storage/connect/myconn.cpp
  modified:   storage/connect/myutil.cpp

Order the result of multiple=3 table, otherwise being different
on Linux and Windows causing the test to fail.
  modified:   storage/connect/mysql-test/connect/r/mul_new.result
  modified:   storage/connect/mysql-test/connect/t/mul_new.test
2017-03-10 17:53:36 +01:00
Olivier Bertrand
bf6cadf923 CONNECT Storage Engine:
The last commited changes have brought important additions to CONNECT.
1 - Replacement of setjmp/longjump's by try/catch/throw
2 - Support of multiple tables in subdirectories
3 - Support translating ENUM to VARCHAR for MYSQL tables.
4 - Tables based on ZIP files

Support ENUM data type for MYSQL tables.
  modified:   storage/connect/myconn.cpp
  modified:   storage/connect/myutil.cpp

Fix typo causing the test to fail on Linux.
  modified:   storage/connect/mysql-test/connect/r/mul_new.result
  modified:   storage/connect/mysql-test/connect/t/mul_new.test
2017-03-10 00:28:26 +01:00
Olivier Bertrand
cdc7a69ea2 CONNECT DIR tables: fix retrieving file date values under Windows.
modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmul.h
2017-03-09 16:28:11 +01:00
Olivier Bertrand
95667ae294 Fix errors in function TDBSDR::FindInDir.
Comment out PSYSTEMTIME stp not used in DIRCOL::ReadColumn causing
a compile error won Linux?
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmul.h
2017-03-08 23:30:24 +01:00
Olivier Bertrand
fc8cf00429 Implement sub-directory search for multiple tables.
This is specifies by MULTIPLE=3 when creating the table.
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmul.h
  added:      storage/connect/mysql-test/connect/r/mul_new.result
  added:      storage/connect/mysql-test/connect/t/mul_new.test

Update version date
  modified:   storage/connect/ha_connect.cc
2017-03-08 11:12:36 +01:00
Olivier Bertrand
c4471352db Fix MDEV-12142 crash when creating CSV table
Was an unprepared longjmp (now throw)
Also fix a wrong calculation of To_Line sometimes causing a crash
because of buffer overflow.
  modified:   storage/connect/tabdos.cpp

Fix a wrong setting of USER for JDBC tables in connect_assisted_discovery.
Update jdbc_new.test after that fix, which changed errors.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mysql-test/connect/r/jdbc_new.result
  modified:   storage/connect/mysql-test/connect/t/jdbc_new.test

Make using try/catch/throw the default option
  modified:   storage/connect/CMakeLists.txt

Typo
  modified:   storage/connect/xindex.cpp
2017-03-05 23:54:54 +01:00
Olivier Bertrand
e52bf14714 Replace setjmp-longjmp's by try_catch-throw
modified:   storage/connect/CMakeLists.txt
  modified:   storage/connect/array.cpp
  modified:   storage/connect/blkfil.cpp
  modified:   storage/connect/colblk.cpp
  modified:   storage/connect/connect.cc
  modified:   storage/connect/filamtxt.cpp
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/filter.cpp
  modified:   storage/connect/global.h
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/json.cpp
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/odbconn.cpp
  modified:   storage/connect/osutil.c
  modified:   storage/connect/plgdbutl.cpp
  deleted:    storage/connect/plugutil.c
  added:      storage/connect/plugutil.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjdbc.cpp
  modified:   storage/connect/tabjdbc.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmul.h
  modified:   storage/connect/tabmysql.cpp
  modified:   storage/connect/tabodbc.cpp
  modified:   storage/connect/tabodbc.h
  modified:   storage/connect/tabpivot.cpp
  modified:   storage/connect/tabsys.cpp
  modified:   storage/connect/tabvct.cpp
  modified:   storage/connect/tabvir.cpp
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/valblk.cpp
  modified:   storage/connect/value.cpp
  modified:   storage/connect/xindex.cpp
  modified:   storage/connect/xobject.cpp
2017-03-05 19:43:17 +01:00
Olivier Bertrand
180fe61c1a Update version number and date
modified:   storage/connect/ha_connect.cc

Add conditional SE exception support
  modified:   storage/connect/json.cpp
  modified:   storage/connect/plgdbutl.cpp

Change %p in %x in some sprintf functions.
This to avoid some compiler warnings.
  modified:   storage/connect/tabwmi.cpp
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/value.h

Add JavaWrappers.jar to the class path
  modified:   storage/connect/jdbconn.cpp

Fix wrong declare (char *buf[256]; --> char  buf[256];)
  modified:   storage/connect/xindex.cpp
2017-03-01 12:17:25 +01:00
Olivier Bertrand
62cd105689 Fix crashing when joining two JDBC tables..
Was in close (the virtual machine could have been detached.
  modified:   storage/connect/jdbconn.cpp
2017-02-24 23:15:28 +01:00
Olivier Bertrand
403ef9918f Fix gcc compile error on friend declaration.
"friend TDBEXT" must specified as "friend class TDBEXT"
  modified:   storage/connect/tabext.h
2017-02-15 00:30:00 +01:00
Olivier Bertrand
6aa144f8d6 Fix gcc compile error on strlwr.
modified:   storage/connect/tabext.cpp
2017-02-14 21:15:26 +01:00
Olivier Bertrand
41b4ef4348 Add the tabext.cpp and tabext.h files in the source list.
modified:   storage/connect/CMakeLists.txt
2017-02-14 15:38:07 +01:00
Olivier Bertrand
5c2c68d454 This is a major update concerning many source files.
Fix MDEV-12035.
  modified:   storage/connect/jsonudf.cpp

Working on MDEV-11832: Srcdef performance enhancement
This require to mark place holders into srcdef to indicate where to insert
the where/having clauses that are retrieved in push_cond.
However this also make necessary to handle aliases in the srcdef.
This was the opportunity to base all external tables on common classes
called EXTDEF, TABEXT and EXTCOL.
  modified:   storage/connect/array.cpp
  modified:   storage/connect/array.h
  modified:   storage/connect/colblk.cpp
  modified:   storage/connect/connect.cc
  modified:   storage/connect/filamdbf.cpp
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/myconn.cpp
  modified:   storage/connect/odbconn.cpp
  modified:   storage/connect/plgdbsem.h
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/reldef.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfix.h
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabfmt.h
  modified:   storage/connect/tabjdbc.cpp
  modified:   storage/connect/tabjdbc.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
  modified:   storage/connect/table.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/tabmysql.h
  modified:   storage/connect/taboccur.cpp
  modified:   storage/connect/tabodbc.cpp
  modified:   storage/connect/tabodbc.h
  modified:   storage/connect/tabpivot.cpp
  modified:   storage/connect/tabpivot.h
  modified:   storage/connect/tabsys.cpp
  modified:   storage/connect/tabsys.h
  modified:   storage/connect/tabtbl.cpp
  modified:   storage/connect/tabutil.cpp
  modified:   storage/connect/tabutil.h
  modified:   storage/connect/tabvct.cpp
  modified:   storage/connect/tabvct.h
  modified:   storage/connect/tabvir.cpp
  modified:   storage/connect/tabwmi.cpp
  modified:   storage/connect/tabxcl.cpp
  modified:   storage/connect/tabxcl.h
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/tabxml.h
  modified:   storage/connect/xindex.cpp
  modified:   storage/connect/xindex.h
  modified:   storage/connect/xobject.h
  modified:   storage/connect/xtable.h
  added:      storage/connect/tabext.cpp
  added:      storage/connect/tabext.h
2017-02-14 12:20:20 +01:00
Olivier Bertrand
9fa0d2fe98 Replace bios.json CRLF by LF to avoid test failing on Linux.
modified:   storage/connect/mysql-test/connect/r/zip.result
  modified:   storage/connect/mysql-test/connect/std_data/bios.json
2017-01-17 10:42:41 +01:00
Olivier Bertrand
286819aef2 Fix gcc errors and warnings.
modified:   storage/connect/filamzip.cpp

Remove unused variables in connect_assisted_discovery
  modified:   storage/connect/ha_connect.cc
2017-01-16 22:42:56 +01:00
Olivier Bertrand
b1bd990e45 Add #include <fnmatch.h>
#include <dirent.h>
to avoid compile error on Linux.
  modified:   storage/connect/filamzip.cpp
2017-01-16 18:57:35 +01:00
Olivier Bertrand
c7446daeb6 Add #include <fnmatch.h>
#include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
to avoid compile error on Linux.
  modified:   storage/connect/filamzip.cpp
2017-01-16 18:03:09 +01:00
Olivier Bertrand
0cb9369b37 Add #include <fnmatch.h> to avoid compile error on Linux.
modified:   storage/connect/filamzip.cpp

Remove unused file
  deleted:    storage/connect/JdbcInterface.jar
2017-01-16 17:18:54 +01:00
Olivier Bertrand
707cd98592 Fix info cardinality for catalog tables.
Was returning 0, which caused an assert error when retreiving records.
  modified:   storage/connect/connect.cc
  modified:   storage/connect/xtable.h

Add the create and insert possibility to zipped tables
  modified:   storage/connect/domdoc.cpp
  modified:   storage/connect/domdoc.h
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filamzip.h
  modified:   storage/connect/ha_connect.c
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/plgxml.cpp
  modified:   storage/connect/plgxml.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabfmt.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/tabzip.cpp
  modified:   storage/connect/tabzip.h

Fix skipping header record for mulentries zipped CSV tabled
  modified:   storage/connect/filamap.cpp

Accept M (memo) column type for DBF tables
Fix miscalculation of Blksize when LRECL was replaced by DBF LRECL
  modified:   storage/connect/filamdbf.cpp

Change the names of GZ compress classes (not to be confused with ZIP)
  modified:   storage/connect/filamgz.cpp
  modified:   storage/connect/filamgz.h

add trace in PlugSetPath
  modified:   storage/connect/plugutil.c

Add tests fir ZIP
  added:      storage/connect/mysql-test/connect/r/xml_zip.result
  added:      storage/connect/mysql-test/connect/r/zip.result
  added:      storage/connect/mysql-test/connect/std_data/bios.json
  added:      storage/connect/mysql-test/connect/std_data/xsample2.xml
  added:      storage/connect/mysql-test/connect/t/have_zip.inc
  added:      storage/connect/mysql-test/connect/t/xml_zip.test
  added:      storage/connect/mysql-test/connect/t/zip.test
2017-01-16 15:13:40 +01:00
Olivier Bertrand
df21d45fdd Merge branch '10.1' of https://github.com/MariaDB/server into ob-10.1 2016-12-24 17:48:21 +01:00
Olivier Bertrand
00e0acd814 Changing version number in ha_connect.cc 2016-12-24 17:48:10 +01:00
Olivier Bertrand
5c0c623577 Fix some XML table type bugs:
- in DOMNODELIST::DropItem
  if (Listp == NULL || Listp->length <= n)
    return true;
is wrong, should be:
  if (Listp == NULL || Listp->length < n)
    return true;
- Crash in discovery with libxml2 in XMLColumns because:
            if (!tdp->Usedom)    // nl was destroyed
              vp->nl = vp->pn->GetChildElements(g);
is executed with vp->pn uninitialized. Fixed by adding:
          vp->pn = node;
line 264.
-In discovery with libxml2 some columns are not found.
Because list was not recovered properly, nodes being modified and not reallocated.
Fixed lines 214 and 277.
  modified:   storage/connect/domdoc.cpp
  modified:   storage/connect/tabxml.cpp

Add support for zipped table files
  modified:   storage/connect/domdoc.cpp
  modified:   storage/connect/domdoc.h
  modified:   storage/connect/filamap.cpp
  modified:   storage/connect/filamap.h
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filamzip.h
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/libdoc.cpp
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/plgxml.cpp
  modified:   storage/connect/plgxml.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabxml.cpp
2016-12-23 14:23:46 +01:00
Marko Mäkelä
545c912696 Remove an unnecessary comparison. 2016-12-22 15:10:39 +02:00
Marko Mäkelä
7e02fd1f71 MDEV-11630 Call mutex_free() before freeing the mutex list
Make some global fil_crypt_ variables static.

fil_close(): Call mutex_free(&fil_system->mutex) also in InnoDB, not
only in XtraDB. In InnoDB, sync_close() was called before fil_close().

innobase_shutdown_for_mysql(): Call fil_close() before sync_close(),
similar to XtraDB shutdown.

fil_space_crypt_cleanup(): Call mutex_free() to pair with
fil_space_crypt_init().

fil_crypt_threads_cleanup(): Call mutex_free() to pair with
fil_crypt_threads_init().
2016-12-22 14:33:58 +02:00
Jan Lindström
55eb7120a0 MDEV-11218: encryption.innodb_encryption_discard_import failed in buildbot
Try to stabilize test cases. These test behave badly when run in certain order.
2016-12-22 14:02:51 +02:00
Monty
c51c885dee Fixed compiler warning 2016-12-21 22:41:07 +02:00
Monty
c33c638f39 MDEV-7558 analyze_stmt_slow_query_log fails sporadically in buildbot
The reason was that the test was reusing the same log file without deleting it between tests.
Fixed by creating a new log file as part of the test
2016-12-21 22:40:52 +02:00
Sachin Setiya
9e032d6150 MDEV-11490 Galera_3nodes test suite does not suppress Warnings.
Problem:- While running individual tests of Galera_3nodes ,
  We get warnings like '[Warning] WSREP: Could not open state file
  for reading: '. And because of this individual tests fails.

  Solution:- We change suite.pm of Galera_3nodes to supress these warnings.
2016-12-21 09:37:58 +05:30
Nirbhay Choubey
75ab65aece Fix failing galera tests. 2016-12-20 15:31:18 -05:00
Marko Mäkelä
195241e125 Port the test innodb.doublewrite from MySQL 5.7. 2016-12-20 15:03:56 +02:00
Marko Mäkelä
44da95e5ed Merge branch '10.0' into 10.1 2016-12-19 17:15:25 +02:00
Marko Mäkelä
9f863a15b0 MDEV-11602 InnoDB leaks foreign key metadata on DDL operations
Essentially revert MDEV-6759, which addressed a double free of memory
by removing the freeing altogether, introducing the memory leaks.
No double free was observed when running the test suite -DWITH_ASAN.

Replace some mem_heap_free(foreign->heap) with dict_foreign_free(foreign)
so that the calls can be located and instrumented more easily when needed.
2016-12-19 15:57:41 +02:00
Daniel Bartholomew
8e198336c2 bump the VERSION 2016-12-15 10:34:41 -05:00
Vladislav Vaintroub
c13b501162 Fix broken cmake -DBUILD_CONFIG=mysql_release on Windows.
mysql_release.cmake set WITH_JEMALLOC=static, which makes windows
builds fail since there is no jemalloc either static or shared there
2016-12-14 19:20:17 +00:00
Sachin Setiya
d93bbcad36 MDEV-11479 Improved wsrep_dirty_reads
Updated sysvars_wsrep.result file.
2016-12-14 20:13:36 +05:30
Olivier Bertrand
b3d2ac3492 - MDEV-11295: developing handling files contained in ZIP file.
Fix bug using multiple zip files
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filamzip.h
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjson.cpp

- Add error msg when trying to make discovery on multiple tables
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabxml.cpp
2016-12-14 14:37:31 +01:00
Olivier Bertrand
8a3fc7c041 - MDEV-11295: developing handling files contained in ZIP file.
Enable using multiple zip files
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/ha_connect.h
  modified:   storage/connect/mycat.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjson.cpp
2016-12-14 11:11:22 +01:00
Varun Gupta
f41bd7e545 MDEV-11060 sql/protocol.cc:532: void Protocol::end_statement(): Assertion `0' failed
In file sql/opt_range.cc,when calculate_cond_selectivity_for_table() is called with optimizer_use_condition_selectivity=4 then
	- thd->no_errors is set to 1
	- the original value of thd->no_error is not restored to its original value
	- this is causing the assertion to fail in the subsequent queries

Fixed by restoring the original value of thd->no_errors
2016-12-14 12:45:50 +05:30
Sachin Setiya
0c79de2419 MDEV-11479 Improved wsrep_dirty_reads
Tasks:-
         Changes in wsrep_dirty_reads variable
         1.) Global + Session scope (Current: session-only)
         2.) Can be set using command line.
         3.) Allow all commands that do not change data (besides SELECT)
         4.) Allow prepared Statements that do not change data
         5.) Works with wsrep_sync_wait enabled
2016-12-14 09:30:43 +05:30
Sachin Setiya
25a9a3da34 Revert "MDEV-11016 wsrep_node_is_ready() check is too strict"
This reverts commit 7ed5563bbe.
2016-12-14 08:39:36 +05:30
Jan Lindström
72cc73cea2 MDEV-10368: get_latest_version() called too often
Reduce the number of calls to encryption_get_key_get_latest_version
when doing key rotation with two different methods:

(1) We need to fetch key information when tablespace not yet
have a encryption information, invalid keys are handled now
differently (see below). There was extra call to detect
if key_id is not found on key rotation.

(2) If key_id is not found from encryption plugin, do not
try fetching new key_version for it as it will fail anyway.
We store return value from encryption_get_key_get_latest_version
call and if it returns ENCRYPTION_KEY_VERSION_INVALID there
is no need to call it again.
2016-12-13 11:51:33 +02:00
Nirbhay Choubey
67b570af50 MDEV-10545: Server crashed in my_copy_fix_mb on querying I_S and P_S tables
After applying/replaying the transaction, the memory that
stored the query string was also wrongly freed.
2016-12-12 08:51:50 -05:00
Nirbhay Choubey
9c88a54c10 MDEV-11179: WSREP transaction excceded size limit in Galera cluster
... causes MariaDB to crash

On error, the wsrep replication buffer (binlog) is dumped to a file
to aid investigations. In order to also include the binlog header,
FDLE object is also needed. This object is only available for wsrep-
threads.
Fix: Instantiate an FDLE object for non-wsrep threads.
2016-12-12 08:51:50 -05:00
Nirbhay Choubey
dbb06d2eab MDEV-10954: MariaDB Galera: wsrep_sst_common: line 120: which: command not found
Add 'which' to REQUIRES list.
2016-12-12 08:51:50 -05:00
Olivier Bertrand
0e06a8357b - MDEV-11295: developing handling files contained in ZIP file.
A first experimental and limited implementation.
  Add NOCRYPT preprocessor definition to avoid compiling error
  modified:   storage/connect/CMakeLists.txt
2016-12-12 00:49:31 +01:00
Elena Stepanova
5d9ca52219 Updated the list of unstable tests after the merge 2016-12-12 00:59:40 +02:00
Olivier Bertrand
9afa90090a - MDEV-11295: developing handling files contained in ZIP file.
A first experimental and limited implementation.
  modified:   storage/connect/CMakeLists.txt
  modified:   storage/connect/filamap.cpp
  new file:   storage/connect/filamzip.cpp
  new file:   storage/connect/filamzip.h
  modified:   storage/connect/ha_connect.cc
  new file:   storage/connect/ioapi.c
  new file:   storage/connect/ioapi.h
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/plgdbsem.h
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabfmt.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
  new file:   storage/connect/tabzip.cpp
  new file:   storage/connect/tabzip.h
  new file:   storage/connect/unzip.c
  new file:   storage/connect/unzip.h
  new file:   storage/connect/zip.c
2016-12-11 23:47:15 +01:00
Sergei Golubchik
2f20d297f8 Merge branch '10.0' into 10.1 2016-12-11 09:53:42 +01:00
Elena Stepanova
a629b5172e Updated the list of unstable tests 2016-12-10 23:04:41 +02:00
Vicențiu Ciorbaru
eb4f2e063c MDEV-11533: Roles with trailing white spaces are not cleared correctly
Role names with trailing whitespaces are truncated in length as of
956e92d908 to fix MDEV-8609. The problem
is that the code that creates role mappings expects the string to be null
terminated.

Add the null terminator to account for that as well. In the future
the rest of the code can be cleaned up to never assume c style strings
but only LEX_STRINGS.
2016-12-10 22:23:25 +02:00