Commit graph

16801 commits

Author SHA1 Message Date
Olivier Bertrand
8a154ecde0 Add Json_Get_Item (and Bson_File?) functions
modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
2015-09-07 18:53:25 +02:00
Olivier Bertrand
7915abffbf Add experimental Bson_Array function (not documented)
Change names of functions not returning Json.
  modified:   storage/connect/json.cpp
  modified:   storage/connect/json.h
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
  modified:   storage/connect/mysql-test/connect/r/json_udf.result
  modified:   storage/connect/plugutil.c
  modified:   storage/connect/value.cpp
  modified:   storage/connect/value.h
2015-09-06 15:51:48 +02:00
Olivier Bertrand
175ef097e2 Handle is_null and error arguments
Fix wrong calling sequence for RESULT_INT and RESULT_REAL functions.
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
2015-08-22 18:11:42 +02:00
Olivier Bertrand
f741fcc9e5 Handle constant function and argument
modified:   storage/connect/jsonudf.cpp

Record result of json test
  modified:   storage/connect/mysql-test/connect/r/json.result
2015-08-22 12:13:37 +02:00
Olivier Bertrand
ffc0f5b3de Add new UDF noconst.
modified:   storage/connect/noconst.c

Fix a few bugs in json udf's.
  modified:   storage/connect/jsonudf.cpp
2015-08-19 17:52:33 +02:00
Olivier Bertrand
69ce20c4bd Add new json UDF Json_Object_List.
modified:   storage/connect/json.cpp
  modified:   storage/connect/json.h
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
2015-08-18 12:03:29 +02:00
Olivier Bertrand
55cb3d8b44 Add new json UDFs and make possible to use a json file name as json item.
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/t/json.test
  modified:   storage/connect/tabjson.cpp

Fix wrong calculation of Estimated Length when the table has virtual or special columns
  modified:   storage/connect/reldef.h
  modified:   storage/connect/tabdos.cpp

Fix wrong handling of null values in ODBCCOL::ReadColumn
  modified:   storage/connect/tabodbc.cpp

Fix crash when SetValue_char is called with a negative length value.
This can happen in odbconn.cpp when SQLFetch returns SQL_NO_TOTAL (-4) as length.
  modified:   storage/connect/odbconn.cpp
  modified:   storage/connect/value.cpp
2015-08-14 17:07:50 +02:00
Olivier Bertrand
3b040a06ed Fix (?) retrieving integer arguments in JSON UDF's
modified:   storage/connect/jsonudf.cpp
2015-07-22 15:49:38 +02:00
Olivier Bertrand
a392c79552 Fix and Enhance remote indexing:
- Apply to ODBC tables as well as MYSQL tables
- Fix and enhance the CheckCond routine
  Make ReadKey and MakeKeyWhere handle all conditions
  modified:   storage/connect/.gitattributes
  modified:   storage/connect/.gitignore
  modified:   storage/connect/connect.cc
  modified:   storage/connect/connect.h
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/ha_connect.h
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/tabmysql.cpp
  modified:   storage/connect/tabmysql.h
  modified:   storage/connect/tabodbc.cpp
  modified:   storage/connect/tabodbc.h
  modified:   storage/connect/xobject.cpp
  modified:   storage/connect/xobject.h
  modified:   storage/connect/xtable.h

Add some new tests:
  storage/connect/mysql-test/connect/r/endian.result
  storage/connect/mysql-test/connect/r/mysql_index.result
  storage/connect/mysql-test/connect/t/endian.test
  storage/connect/mysql-test/connect/t/mysql_index.test
2015-07-16 11:05:20 +02:00
Olivier Bertrand
3a9a3b98b7 Fix test txt files line endings 2015-06-08 00:03:52 +02:00
Olivier Bertrand
7482f073ae Commit od last modifications made for version 10.0 2015-06-06 19:23:06 +02:00
Olivier Bertrand
1c756512b0 Commit win and CONNECT resolved files 2015-06-05 23:54:19 +02:00
Olivier Bertrand
f8fa5fe1bc Commit merge resolve 2015-06-05 23:24:39 +02:00
Olivier Bertrand
2b2c61cc79 Commit changes to json_udf.inc 2015-06-05 17:21:04 +02:00
Jan Lindström
f7002c05ae MDEV-8250: InnoDB: Page compressed tables are not compressed and compressed+encrypted tables cause crash
Analysis: Problem is that both encrypted tables and compressed tables use
FIL header offset FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION to store
required metadata. Furhermore, for only compressed tables currently
code skips compression.

Fixes:
- Only encrypted pages store key_version to FIL header offset FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
  no need to fix
- Only compressed pages store compression algorithm to FIL header offset FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
  no need to fix as they have different page type FIL_PAGE_PAGE_COMPRESSED
- Compressed and encrypted pages now use a new page type FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED and
  key_version is stored on FIL header offset FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION and compression
  method is stored after FIL header similar way as compressed size, so that first
  FIL_PAGE_COMPRESSED_SIZE is stored followed by FIL_PAGE_COMPRESSION_METHOD
- Fix buf_page_encrypt_before_write function to really compress pages if compression is enabled
- Fix buf_page_decrypt_after_read function to really decompress pages if compression is used
- Small style fixes
2015-06-04 09:47:06 +03:00
Olivier Bertrand
2a3166feff 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:54:11 +02:00
Olivier Bertrand
36d2bd6a15 Handle ODBC table null values modified: tabodbc.cpp 2015-06-03 16:58:42 +02:00
Sergei Golubchik
432b78c903 just like tempfiles: use key id 2 for temp Aria tables
introduce ENCRYPTION_KEY_SYSTEM_DATA and
ENCRYPTION_KEY_TEMPORARY_DATA constants; use them everywhere.
2015-06-02 18:53:37 +02:00
Sergei Golubchik
d9340d6c8e MDEV-8126 encryption for temp files
IO_CACHE tempfiles encryption
2015-06-02 18:53:37 +02:00
Sergei Golubchik
318c826e93 always use my_b_pread() instead of mysql_file_pread()
when working with IO_CACHE's, don't access IO_CACHE::file directly
2015-06-02 18:53:37 +02:00
Sergei Golubchik
196e852983 misc IO_CACHE cleanups
* remove unused (and not implemented) WRITE_NET type
* remove cast in my_b_write() macro. my_b_* macros are
  function-like, casts are responsibility of the caller
* replace hackish _my_b_write(info,0,0) with the explicit
  my_b_flush_io_cache() in my_b_write_byte()
* remove unused my_b_fill_cache()
* replace pbool -> my_bool
* make internal IO_CACHE functions static
* reformat comments, correct typos, remove obsolete comments (ISAM)
* assert valid cache type in init_functions()
* use IO_ROUND_DN() macro where appropriate
* remove unused DBUG_EXECUTE_IF in _my_b_cache_write()
* remove unnecessary __attribute__((unused))
* fix goto error in parse_file.cc
* remove redundant reinit_io_cache() in uniques.cc
* don't do reinit_io_cache() if the cache was not initialized
  in ma_check.c
* extract duplicate functionality from various _my_b_*_read
  functions into a common wrapper. Same for _my_b_*_write
* create _my_b_cache_write_r instead of having if's in
  _my_b_cache_write (similar to existing _my_b_cache_read and
  _my_b_cache_read_r)
* don't call mysql_file_write() from my_b_flush_io_cache(),
  call info->write_function() instead
2015-06-02 18:53:37 +02:00
Sergei Golubchik
1841557e40 myisam/aria: don't mess with IO_CACHE::file
that is, don't create a "temporary" IO_CACHE with file==-1
and manually swap it later to the valid file descriptor.
2015-06-02 18:53:36 +02:00
Sergei Golubchik
91dab5ddb6 fix cmake dependencies
perfschema after 5.6 merge depends on sql_yacc.h
2015-06-02 18:09:53 +02:00
Sergei Golubchik
72d01f2426 remove few #ifdefs in innodb/xtradb 2015-06-02 17:46:05 +02:00
Olivier Bertrand
e8ea671c25 Commit changes pulled from ob-10.0 2015-06-02 10:34:51 +02:00
Sergei Golubchik
0d54cb12eb compilation failure on windows 2015-06-01 21:35:02 +02:00
Sergei Golubchik
d602574542 Merge remote-tracking branch 'github/10.1' into 10.1 2015-06-01 16:01:42 +02:00
Sergei Golubchik
5091a4ba75 Merge tag 'mariadb-10.0.19' into 10.1 2015-06-01 15:51:25 +02:00
Jan Lindström
13235a549d Fix compiler warning. 2015-05-31 07:53:20 +03:00
Jan Lindström
59815a268b MDEV-7484: Log Time not consistent with InnoDB errors nor with MySQL error log time format 2015-05-30 20:45:17 +03:00
Oleksandr Byelkin
0f01bf2676 MDEV-8241: Debug build on Windows is broken: error LNK2019: unresolved external symbol pthread_detach referenced in function ma_checkpoint_init
pthread_detach() replaced with pthread_detach_this_thread()

pthread_detach_this_thread() definition fixed
2015-05-29 23:07:49 +02:00
Sergei Golubchik
34e01f80e4 restore innodb_encrypt_tables validation function
that was apparently lost in 20c23048:

  commit 20c23048c1
  Author: Jan Lindström <jan.lindstrom@mariadb.com>
  Date:   Sun May 17 14:14:16 2015 +0300

      MDEV-8164: Server crashes in pfs_mutex_enter_func after fil_crypt_is_closing

This also reverts 8635c4b4:

  commit 8635c4b4e6
  Author: Jan Lindström <jan.lindstrom@mariadb.com>
  Date:   Thu May 21 11:02:03 2015 +0300

      Fix test failure.
2015-05-28 14:41:48 +02:00
Jan Lindström
a25ccd4f83 MDEV-8238: Tables with encryption=yes using file_key_management plugin are not encrypted
Analysis: Problem was that encryption was skipped.

Fixed by making sure that tables with ENCRYPTED=YES are encrypted.
2015-05-27 16:52:36 +03:00
Jan Lindström
2bea4bd9ed MDEV-8233: InnoDB: Assertion failure in fil_page_decompress with encrypted tables
Analysis: Problem was that used compression method needs to be stored
to the page.

Fixed by storing compression method after key_version to the page.
2015-05-27 15:34:10 +03:00
Jan Lindström
8c0ea281bf MDEV-8213: encryption.encryption_force, encryption.encrypt_and_grep fail with valgrind warnings (Invalid read)
Analysis: Problem was that code used old pointer.

Fixed by using correct pointer.
2015-05-26 16:09:36 +03:00
Jan Lindström
536112dd30 MDEV-8195: InnoDB: Error: trying to access tablespace 11262 page no. 7, InnoDB: but the tablespace does not exist or is just being dropped.
Analysis: Problem was that we did try to read from tablespace
that was being dropped.

Fixed by introducing a new function to find a tablespace only
if it is not being dropped currently and adding this check
before trying to read pages from tablespace.
2015-05-21 15:32:49 +03:00
Jan Lindström
137ba7d6f9 Fix compiler error. 2015-05-21 08:14:35 +03:00
Jan Lindström
925b64124a MDEV-8182: Failing assertion: 1 == UT_LIST_GET_LEN(space->chain)
Analysis: At fil_spage_get_space there is small change that space
is found from tablespace list but we have not yet created node
for it (and added it to space->chain) and as we hold fil_system
mutex here fil_node_create can't continue.

Fixed by allowing UT_LIST_GET_LEN(space->chain) == 0|| 1 and
introducint two new functions that access filespace list
and before returning space check that node is also created.
2015-05-20 20:32:10 +03:00
Jan Lindström
3e55ef26d4 MDEV-8173: InnoDB; Failing assertion: crypt_data->type == 1
Make sure that when we publish the crypt_data we access the
memory cache of the tablespace crypt_data. Make sure that
crypt_data is stored whenever it is really needed.

All this is not yet enough in my opinion because:

sql/encryption.cc has DBUG_ASSERT(scheme->type == 1) i.e.
crypt_data->type == CRYPT_SCHEME_1

However, for InnoDB point of view we have global crypt_data
for every tablespace. When we change variables on crypt_data
we take mutex. However, when we use crypt_data for
encryption/decryption we use pointer to this global
structure and no mutex to protect against changes on
crypt_data.

Tablespace encryption starts in fil_crypt_start_encrypting_space
from crypt_data that has crypt_data->type = CRYPT_SCHEME_UNENCRYPTED
and later we write page 0 CRYPT_SCHEME_1 and finally whe publish
that to memory cache.
2015-05-20 14:10:07 +03:00
Olivier Bertrand
893631a8c1 All the last changes made in the ob-10.0 branch including also changes of line endings of some test files 2015-05-20 12:39:17 +02:00
Oleksandr Byelkin
44cd6f22d4 MDEV-7921: main.sp_sync fails in buildbot with valgrind
Part 2: detauch service thread.
2015-05-20 11:43:44 +02:00
Jan Lindström
20c23048c1 MDEV-8164: Server crashes in pfs_mutex_enter_func after fil_crypt_is_closing or alike
Analysis: Problem was that tablespaces not encrypted might not have
crypt_data stored on disk.

Fixed by always creating crypt_data to memory cache of the tablespace.

MDEV-8138: strange results from encrypt-and-grep test

Analysis: crypt_data->type is not updated correctly on memory
cache. This caused problem with state tranfer on
encrypted => unencrypted => encrypted.

Fixed by updating memory cache of crypt_data->type correctly based on
current srv_encrypt_tables value to either CRYPT_SCHEME_1 or
CRYPT_SCHEME_UNENCRYPTED.
2015-05-18 13:28:13 +03:00
Sergei Golubchik
476dfb1603 update big tokudb test results after dd8f93195
that is, after

  commit dd8f931957
  Author: Sergei Golubchik <serg@mariadb.org>
  Date:   Fri Apr 10 02:36:54 2015 +0200

    be less annoying about sysvar-based table attributes
    do not *always* add them to the create table definition,
    but only when a sysvar value is different from a default.
    also, when adding them - don't quote numbers
2015-05-16 16:31:46 +02:00
Sergei Golubchik
54672a4f1e MDEV-8043 innodb tablespace encryption
"use after free" bug, when a thread replaces space->crypt_data
and frees the old crypt_data object while it's being used
by another thread.
2015-05-15 18:12:03 +02:00
Sergei Golubchik
e5989d52a7 InnoDB: simplify innobase_compression_algorithm_validate() 2015-05-15 18:12:03 +02:00
Sergei Golubchik
8815fb3d45 MDEV-8158 InnoDB: Failing assertion: new_state->key_version != ENCRYPTION_KEY_VERSION_INVALID on dynamic change of encryption variables
don't allow to enable srv_encrypt_tables if no
encryption plugin is loaded
2015-05-15 18:12:02 +02:00
Sergei Golubchik
8258a34800 InnoDB: check if scrubbing is enabled before scanning the tablespace 2015-05-15 18:12:02 +02:00
Sergei Golubchik
a94cabd503 MDEV-8159 InnoDB: Failing assertion: key_state->key_id
to simplify various checks, set crypt_data->key_id even
for not encrypted tablespaces
2015-05-15 18:12:02 +02:00
Sergei Golubchik
2300fe2e0e Identical key derivation code in XtraDB/InnoDB/Aria
* Extract it into the "encryption_scheme" service.
* Make these engines to use the service, remove duplicate code.
* Change MY_AES_xxx error codes, to return them safely
  from encryption_scheme_encrypt/decrypt without conflicting
  with ENCRYPTION_SCHEME_KEY_INVALID error
2015-05-15 18:12:01 +02:00
Jan Lindström
f8cacd03a7 MDEV-8143: InnoDB: Database page corruption on disk or a failed file read
Analysis: Problem was that we did create crypt data for encrypted table but
this new crypt data was not written to page 0. Instead a default crypt data
was written to page 0 at table creation.

Fixed by explicitly writing new crypt data to page 0 after successfull
table creation.
2015-05-14 11:32:24 +03:00