Commit graph

17910 commits

Author SHA1 Message Date
Olivier Bertrand
0149f9c2a1 Add MONGO table type
new file:   storage/connect/tabmgo.cpp
  new file:   storage/connect/tabmgo.h
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/plgdbsem.h

Fix crash when dbname is null forJSON MGO tables
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
2017-04-17 10:44:51 +02:00
Olivier Bertrand
95af77b1f7 Comment out in CMakeLists.txt 2017-04-14 12:58:47 +02:00
Olivier Bertrand
ff704368c0 Add mongoDB access to json tables.
Finalize replacement of longjmp by 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/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/plgdbsem.h
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/plugutil.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmysql.cpp
  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-04-13 23:52:39 +02:00
Olivier Bertrand
9262ae65fc Add mongoDB access to json tables.
Filalize replacement oflongjmp by 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/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/plgdbsem.h
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/plugutil.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmysql.cpp
  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-04-13 21:30:33 +02:00
Olivier Bertrand
2c16792995 Fix bug. Date value was null when retrieved from a json expanded array.
modified:   storage/connect/tabjson.cpp

Assume timestamp is in milliseconds when it is a big integer
that is multiple of 1000.
  modified:   storage/connect/value.cpp
2017-04-06 19:45:19 +02:00
Olivier Bertrand
fcfcd99e64 Commit resolved files 2017-04-06 00:44:53 +02:00
Olivier Bertrand
332c617690 Export TDBJSN class so it can be used by EOM tables
modified:   storage/connect/filamtxt.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
2017-04-05 10:22:58 +02:00
Daniel Black
a7bb9e8fdb xtradb: fil_crypt_rotate_page, space_id should be compared to TRX_SYS_SPACE not space
like 9a218f4fb8 fil_crypt_rotate_page
 - space_id should be compared to TRX_SYS_SPACE not space

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-04-05 16:29:08 +10:00
Jan Lindström
85239bdfeb Merge pull request #350 from grooverdan/10.1-TRX_SYS_PAGE_NO
fil_crypt_rotate_page - space_id should be compared to TRX_SYS_SPACE not space
2017-04-05 08:40:47 +03:00
Daniel Black
9a218f4fb8 fil_crypt_rotate_page - space_id should be compared to TRX_SYS_SPACE not space
Fixes compile error that highlights problem:

/source/storage/innobase/fil/fil0crypt.cc: In function 'void fil_crypt_rotate_page(const key_state_t*, rotate_thread_t*)':
/source/storage/innobase/fil/fil0crypt.cc:1770:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  if (space == TRX_SYS_SPACE && offset == TRX_SYS_PAGE_NO) {

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-04-04 15:47:21 +10:00
Marko Mäkelä
9505c96839 MDEV-12428 SIGSEGV in buf_page_decrypt_after_read() during DDL
Also, some MDEV-11738/MDEV-11581 post-push fixes.

In MariaDB 10.1, there is no fil_space_t::is_being_truncated field,
and the predicates fil_space_t::stop_new_ops and fil_space_t::is_stopping()
are interchangeable. I requested the fil_space_t::is_stopping() to be added
in the review, but some added checks for fil_space_t::stop_new_ops were
not replaced with calls to fil_space_t::is_stopping().

buf_page_decrypt_after_read(): In this low-level I/O operation, we must
look up the tablespace if it exists, even though future I/O operations
have been blocked on it due to a pending DDL operation, such as DROP TABLE
or TRUNCATE TABLE or other table-rebuilding operations (ALTER, OPTIMIZE).
Pass a parameter to fil_space_acquire_low() telling that we are performing
a low-level I/O operation and the fil_space_t::is_stopping() status should
be ignored.
2017-04-03 22:09:28 +03:00
Olivier Bertrand
8bd1f06c5a Return to original version of jdbc.test 2017-03-27 15:51:39 +02:00
Olivier Bertrand
efe9982873 Fix crash when a line is not ended by \n.
modified:   storage/connect/filamap.cpp

Add specifying a password when reading zipped tables.
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filamzip.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h

Try Vaintroub suggestion
  modified:   storage/connect/mysql-test/connect/t/jdbc.test
2017-03-27 15:40:07 +02:00
Vladislav Vaintroub
d7c35a9992 Fix compiler error 2017-03-23 19:28:36 +00:00
Vladislav Vaintroub
e5b67a46bc MDEV-12345 Performance : replace calls to clock() inside trx_start_low() by THD::start_utime 2017-03-23 11:50:22 +00:00
Sergei Golubchik
09a2107b1b Merge branch '10.0' into 10.1 2017-03-21 19:20:44 +01:00
Olivier Bertrand
cf1ca74736 Typo 2017-03-18 12:42:46 +01:00
Olivier Bertrand
d9b7433c98 Fix MDEV-12220: add MODE_READX to permissible index read
modified:   storage/connect/connect.cc
2017-03-18 10:40:51 +01:00
Olivier Bertrand
932a4401f0 Fix MDEV-12220: Crash when doing UPDATE or DELETE on an external
table (ODBC, JDBC, MYSQL) with a WHERE clause on an indexed column.
Also fix a bugs in TDBEXT::MakeCommand (use of uninitialised Quote)
Add in this function the eventual Schema (database) prefixing.
  modified:   storage/connect/connect.cc
  modified:   storage/connect/tabext.cpp
2017-03-17 19:00:30 +01:00
Jan Lindström
b1ec35b903 Add assertions when key rotation list is used. 2017-03-16 17:30:13 +02:00
Sergei Golubchik
2c2bd8c155 MDEV-12261 build failure without P_S
restore mysql_file_delete_with_symlink() but let it use
new my_handler_delete_with_symlink() mysys helper.
2017-03-15 17:48:30 +01:00
Jan Lindström
50eb40a2a8 MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing
MDEV-11581: Mariadb starts InnoDB encryption threads
when key has not changed or data scrubbing turned off

Background: Key rotation is based on background threads
(innodb-encryption-threads) periodically going through
all tablespaces on fil_system. For each tablespace
current used key version is compared to max key age
(innodb-encryption-rotate-key-age). This process
naturally takes CPU. Similarly, in same time need for
scrubbing is investigated. Currently, key rotation
is fully supported on Amazon AWS key management plugin
only but InnoDB does not have knowledge what key
management plugin is used.

This patch re-purposes innodb-encryption-rotate-key-age=0
to disable key rotation and background data scrubbing.
All new tables are added to special list for key rotation
and key rotation is based on sending a event to
background encryption threads instead of using periodic
checking (i.e. timeout).

fil0fil.cc: Added functions fil_space_acquire_low()
to acquire a tablespace when it could be dropped concurrently.
This function is used from fil_space_acquire() or
fil_space_acquire_silent() that will not print
any messages if we try to acquire space that does not exist.
fil_space_release() to release a acquired tablespace.
fil_space_next() to iterate tablespaces in fil_system
using fil_space_acquire() and fil_space_release().
Similarly, fil_space_keyrotation_next() to iterate new
list fil_system->rotation_list where new tables.
are added if key rotation is disabled.
Removed unnecessary functions fil_get_first_space_safe()
fil_get_next_space_safe()

fil_node_open_file(): After page 0 is read read also
crypt_info if it is not yet read.

btr_scrub_lock_dict_func()
buf_page_check_corrupt()
buf_page_encrypt_before_write()
buf_merge_or_delete_for_page()
lock_print_info_all_transactions()
row_fts_psort_info_init()
row_truncate_table_for_mysql()
row_drop_table_for_mysql()
    Use fil_space_acquire()/release() to access fil_space_t.

buf_page_decrypt_after_read():
    Use fil_space_get_crypt_data() because at this point
    we might not yet have read page 0.

fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly
to functions needing it and store fil_space_t* to rotation state.
Use fil_space_acquire()/release() when iterating tablespaces
and removed unnecessary is_closing from fil_crypt_t. Use
fil_space_t::is_stopping() to detect when access to
tablespace should be stopped. Removed unnecessary
fil_space_get_crypt_data().

fil_space_create(): Inform key rotation that there could
be something to do if key rotation is disabled and new
table with encryption enabled is created.
Remove unnecessary functions fil_get_first_space_safe()
and fil_get_next_space_safe(). fil_space_acquire()
and fil_space_release() are used instead. Moved
fil_space_get_crypt_data() and fil_space_set_crypt_data()
to fil0crypt.cc.

fsp_header_init(): Acquire fil_space_t*, write crypt_data
and release space.

check_table_options()
	Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_*

i_s.cc: Added ROTATING_OR_FLUSHING field to
information_schema.innodb_tablespace_encryption
to show current status of key rotation.
2017-03-14 16:23:10 +02:00
Marko Mäkelä
9dc10d5851 Merge 10.0 into 10.1 2017-03-13 19:17:34 +02:00
Olivier Bertrand
e5f5457b6f Also order the result of multiple=1 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-11 14:10:34 +01:00
iangilfillan
f0ec34002a Correct FSF address 2017-03-10 18:21:29 +01:00
Sergei Golubchik
2a0ae1c90a MDEV-11965 -Werror should not appear in released tarballs 2017-03-10 18:21:29 +01:00
Sergei Golubchik
aa51b559ab typo fixed 2017-03-10 18:21:25 +01:00
Sergei Golubchik
b6a1d6538b compiler warnings 2017-03-10 18:21:22 +01:00
Marko Mäkelä
032678ad18 MDEV-12091 Shutdown fails to wait for rollback of recovered transactions to finish
In the 10.1 InnoDB Plugin, a call os_event_free(buf_flush_event) was
misplaced. The event could be signalled by rollback of resurrected
transactions while shutdown was in progress. This bug was caught
by cmake -DWITH_ASAN testing. This call was only present in the
10.1 InnoDB Plugin, not in other versions, or in XtraDB.

That said, the bug affects all InnoDB versions. Shutdown assumes the
cessation of any page-dirtying activity, including the activity of
the background rollback thread. InnoDB only waited for the background
rollback to finish as part of a slow shutdown (innodb_fast_shutdown=0).
The default is a clean shutdown (innodb_fast_shutdown=1). In a scenario
where InnoDB is killed, restarted, and shut down soon enough, the data
files could become corrupted.

logs_empty_and_mark_files_at_shutdown(): Wait for the
rollback to finish, except if innodb_fast_shutdown=2
(crash-like shutdown) was requested.

trx_rollback_or_clean_recovered(): Before choosing the next
recovered transaction to roll back, terminate early if non-slow
shutdown was initiated. Roll back everything on slow shutdown
(innodb_fast_shutdown=0).

srv_innodb_monitor_mutex: Declare as static, because the mutex
is only used within one module.

After each call to os_event_free(), ensure that the freed event
is not reachable via global variables, by setting the relevant
variables to NULL.
2017-03-10 18:54:29 +02:00
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
Marko Mäkelä
0094b6581d Merge 10.0 into 10.1 2017-03-10 15:16:13 +02: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
Marko Mäkelä
5aacb861f2 WSREP: Use TRX_ID_FMT for trx_id_t in messages. 2017-03-09 15:11:24 +02:00
Marko Mäkelä
b28adb6a62 Fix an error introduced in the previous commit.
fil_parse_write_crypt_data(): Correct the comparison operator.
This was broken in commit 498f4a825b
which removed a signed/unsigned mismatch in these comparisons.
2017-03-09 15:09:44 +02:00
Marko Mäkelä
1b2b209519 Use correct integer format with printf-like functions. 2017-03-09 11:28:07 +02:00
Marko Mäkelä
2158de8865 Remove unused variables. 2017-03-09 11:26:36 +02:00
Marko Mäkelä
498f4a825b Fix InnoDB/XtraDB compilation warnings on 32-bit builds. 2017-03-09 08:54:07 +02:00
Marko Mäkelä
ad0c218a44 Merge 10.0 into 10.1
Also, implement MDEV-11027 a little differently from 5.5 and 10.0:

recv_apply_hashed_log_recs(): Change the return type back to void
(DB_SUCCESS was always returned).

Report progress also via systemd using sd_notifyf().
2017-03-09 08:53:08 +02: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
Marko Mäkelä
74fe0e03d5 Remove unused declarations. 2017-03-08 11:46:34 +02:00
Marko Mäkelä
47396ddea9 Merge 5.5 into 10.0
Also, implement MDEV-11027 a little differently from 5.5:

recv_sys_t::report(ib_time_t): Determine whether progress should
be reported.

recv_apply_hashed_log_recs(): Rename the parameter to last_batch.
2017-03-08 11:40:43 +02:00
Marko Mäkelä
9c47beb8bd MDEV-11027 InnoDB log recovery is too noisy
Provide more useful progress reporting of crash recovery.

recv_sys_t::progress_time: The time of the last report.

recv_scan_print_counter: Remove.

log_group_read_log_seg(): After after each I/O request,
report progress if needed.

recv_apply_hashed_log_recs(): At the start of each batch,
if there are pages to be recovered, issue a message.
2017-03-08 10:07:50 +02:00
Marko Mäkelä
1fd3cc8c1f Fix a compiler warning. 2017-03-08 10:06:34 +02:00
Marko Mäkelä
17a1b194e2 Fix some GCC 6.3.0 warnings in MyISAM and Maria.
The C++ standard does not allow references to be NULL.
Assign the return value of THD::alloc() to a pointer,
not to a reference.
2017-03-08 10:03:35 +02:00
Sergey Vojtovich
fa137476ff MDEV-11941 - Lintian complains about executable bits
Revoked executable bit from files that are not supposed to be executed directly.
Removed interpreted from files that are not supposed to be executed directly.
Added interpreter to files that are supposed to be executed directly.
2017-03-07 22:28:33 +04:00
Vicențiu Ciorbaru
c4f3e64c23 Merge branch 'bb-10.0-vicentiu' into 10.0 2017-03-06 21:50:42 +02:00
Vicențiu Ciorbaru
dc1c9e69d0 Make tokudb report ENOENT when renaming table to nonexistant DB 2017-03-06 19:25:22 +02:00
Marko Mäkelä
68d632bc5a Replace some functions with macros.
This is a non-functional change.

On a related note, the calls fil_system_enter() and fil_system_exit()
are often used in an unsafe manner. The fix of MDEV-11738 should
introduce fil_space_acquire() and remove potential race conditions.
2017-03-06 10:02:01 +02:00