Commit graph

180326 commits

Author SHA1 Message Date
Marko Mäkelä
3fdd9c1ccc Correct a comment 2017-11-28 11:32:11 +03:00
Alexander Barkov
590400f743 MDEV-14517 Cleanup for Item::with_subselect and Item::has_subquery() 2017-11-28 06:25:14 +04:00
Aleksey Midenkov
86b590c064 SQL: hide system fields from PK [#361] 2017-11-27 21:44:34 +03:00
Aleksey Midenkov
f9d875d212 SQL: disable engine change [fixes #358] 2017-11-27 19:48:36 +03:00
Aleksey Midenkov
ababd6a935 SQL: destroy Vers_min_max_stats [#346] 2017-11-27 18:28:56 +03:00
Vladislav Vaintroub
1c4968f2f3 Fix warnings 2017-11-27 14:43:24 +00:00
Sergey Vojtovich
1029b22feb MDEV-13728 - Import MySQL 5.7 atomic operations for MSVC and Solaris
gcc_sync.h, solaris.h, generic-msvc.h copied verbatim.
2017-11-27 18:35:53 +04:00
Aleksey Midenkov
941e8b7b0b Tests: suppression for innodb.log_corruption 2017-11-27 16:38:43 +03:00
Marko Mäkelä
9b6a790660 Use the FORCE to avoid trouble with vtmd_template [#356] 2017-11-27 16:32:01 +03:00
Aleksey Midenkov
1e3620cc39 Tests: commit_id, truncate for Windows fix [#307] 2017-11-27 16:31:18 +03:00
Aleksey Midenkov
aeee150656 SQL: switch_defaults_to_nullable_trigger_fields() fix [#355] 2017-11-27 15:07:35 +03:00
Aleksey Midenkov
7fab5ecabb Tests: enable disabled tests [closes #341] 2017-11-27 15:07:34 +03:00
Eugene Kosov
01a8bad897 SQL: allow PERIOD as identifier [fixes #331] 2017-11-27 15:07:34 +03:00
Eugene Kosov
62470fc787 SQL: recreate PRIMARY KEY on DROP SYSTEM VERSIONING [#348] 2017-11-27 15:07:34 +03:00
Aleksey Midenkov
0c571f8c4e SQL: versioning_alter_history ERROR mode [closes #350]
Disabled DROP and SURVIVE modes.
2017-11-27 15:07:34 +03:00
Aleksey Midenkov
7320c683b9 Parser: disable SV for tmp tables [closes #344] 2017-11-27 15:07:33 +03:00
Marko Mäkelä
86e57eaaa3 Remove upd_node_t::versioned 2017-11-27 15:07:33 +03:00
Marko Mäkelä
0b89a42ffc Remove the flag vers_update_trt
THD::vers_update_trt, trx_t::vers_update_trt, trx_savept_t::vers_update_trt:
Remove. Instead, determine from trx_t::mod_tables whether versioned
columns were affected by the transaction.

handlerton::prepare_commit_versioned: Replaces vers_get_trt_data.
Return the transaction start ID and also the commit ID, in case
the transaction modified any system-versioned columns (0 if not).

TR_table::store_data(): Remove (merge with update() below).

TR_table::update(): Add the parameters start_id, end_id.

ha_commit_trans(): Remove a condition on SQLCOM_ALTER_TABLE.
If we need something special for ALTER TABLE...ALGORITHM=INPLACE,
that can be done inside InnoDB by modifying trx_t::mod_tables.

innodb_prepare_commit_versioned(): Renamed from innodb_get_trt_data().
Check trx_t::mod_tables to see if any changes to versioned columns
are present.

trx_mod_table_time_t: A pair of logical timestamps, replacing the
undo_no_t in trx_mod_tables_t. Keep track of not only the first
modification to a persistent table in each transaction, but also
the first modification of a versioned column in a table.

dtype_t, dict_col_t: Add the accessor is_any_versioned(), to check
if the type refers to a system-versioned user or system column.

upd_t::affects_versioned(): Check if an update affects a versioned
column.

trx_undo_report_row_operation(): If a versioned column is affected
by the update, invoke trx_mod_table_time_t::set_versioned().

trx_rollback_to_savepoint_low(): If all changes to versioned columns
were rolled back, invoke trx_mod_table_time_t::rollback_versioned(),
so that trx_mod_table_time_t::is_versioned() will no longer hold.
2017-11-27 15:07:33 +03:00
Marko Mäkelä
03fbfeef66 Identify system-versioned columns in the InnoDB dictionary
Both bits DATA_VERSIONED will be set in prtype if the column
is system-versioned. The bits will be 0 for normal unversioned
columns. For the special columns identifying the logical start
and end times of versions, only one bit will be set:
DATA_VERS_START or DATA_VERS_END.

create_table_info_t::create_table_def(),
prepare_inplace_alter_table_dict(): Set prtype |= DATA_VERSIONED
for system-versioned columns.

dfield_t::is_version_historical_end(): Determine if a data tuple
field is_version_end() and contains a timestamp in the past
(not TRX_ID_MAX).

dtype_t, dict_col_t: Add the accessors
is_versioned(), is_version_start(), is_version_end().

trx_id_max_bytes[]: The bit pattern of TRX_ID_MAX, for use with
memcmp().
2017-11-27 15:07:33 +03:00
Eugene Kosov
0cdc1164dc SQL, IB: various refactoring [#337] 2017-11-27 15:07:32 +03:00
Marko Mäkelä
4dd8736c15 Cleanup: removed unused variable in sql_yacc 2017-11-27 15:07:32 +03:00
Elena Stepanova
77872e4519 Additions to the list of unstable tests for 10.2.11 2017-11-27 12:04:51 +02:00
Marko Mäkelä
62fb022110 Adjust the result diffs for innodb.instant_alter 2017-11-27 11:20:04 +02:00
Marko Mäkelä
447cd7b1af Test MDL with a more generic ALTER TABLE statement 2017-11-27 11:20:04 +02:00
Vladislav Vaintroub
414d3a3e17 Fix warning. 2017-11-24 17:33:53 +00:00
Sergey Vojtovich
4cc20c88df Fixed build failure with PFS disabled
mariabackup fails to builds with PFS disabled. The reason was missing include,
which was included by PFS otherwise.
2017-11-24 17:30:40 +00:00
Vladislav Vaintroub
9cefffdab1 Merge remote-tracking branch 'origin/10.1' into 10.2
# Conflicts:
#	storage/innobase/include/os0file.h
2017-11-24 17:30:26 +00:00
Vladislav Vaintroub
40756c9151 Fix Windows build with -DPLUGIN_PERFSCHEMA=NO 2017-11-24 16:55:20 +00:00
Marko Mäkelä
f1cc6e3874 Merge 10.1 into 10.2 2017-11-24 17:17:16 +02:00
Marko Mäkelä
6979d20426 MDEV-14499 Mariabackup 10.2 fails to back up a multi-file InnoDB system tablespace
When Mariabackup is invoked on an instance that uses a multi-file
InnoDB system tablespace, it may fail to other files of the system
tablespace than the first one.
This was revealed by the MDEV-14447 test case.
The offending code is assuming that the first page of each data file
is page 0. But, in multi-file system tablespaces that is not the case.

xb_fil_cur_open(): Instead of re-reading the first page of the file,
rely on the fil_space_t metadata that already exists in memory.

xb_get_space_flags(): Remove.
2017-11-24 17:12:38 +02:00
Michael Widenius
ab63290c35 Removed "deprecated" warning from explicit_defaults_for_timestamp 2017-11-24 16:26:44 +02:00
Vladislav Vaintroub
59150361c3 Update C/C to fix unit tests with clang 2017-11-24 14:39:38 +01:00
Sergey Vojtovich
abf61fd91f Fixed build failure with PFS disabled
mariabackup fails to builds with PFS disabled. The reason was missing include,
which was included by PFS otherwise.
2017-11-24 15:01:55 +04:00
Sergey Vojtovich
17529785f1 Fix hang in buf_flush_set_page_cleaner_thread_cnt
Running mysqld with innodb-buffer-pool-instances > 1 hangs on startup.

On startup wrong variables was being used to detect number of page cleaner
threads. As a result no threads were actually started. And subsequent code
waits for threads to start forever.

Fixed by using page_cleaner->n_workers, which holds number of page cleaner
threads (0 at startup) instead of srv_n_page_cleaners, which holds number
of requested page cleaner threads (4 by default).
2017-11-24 15:01:55 +04:00
Alexander Barkov
6aedbf40e0 MDEV-14494 Move set_param_xxx() in sql_prepare.cc to methods in Item_param and Type_handler
- sql_prepare.cc: Moving functions set_param_xxx() as
  methods to Item_param

- Replacing a pointer to a function Item_param::set_param_func
  to Type_handler based implementation:
  Item_param::value now derives from Type_handler_hybrid_field_type.
  Adding new virtual methods Type_handler::Item_param_setup_conversion()
  and Type_handler::Item_param_set_param_func()

- Moving declaration of some Item_param members  from "public:" to "private:"
  (CONVERSION_INFO, value, decimal_value)

- Adding a new method Item_param::set_limit_clause_param(),
  to share duplicate code, as well as to encapsulate
  Item_param::value.

- Adding Item_param::setup_conversion_string() and
  Item_param::setup_conversion_blob() to share
  the code for binding from a client value
  (mysql_stmt_bind_param), and for binding from
  an expression (Item).

- Removing two different functions set_param_str_or_null()
  and set_param_str(). Adding a common method Item_param::set_param_str().
  Item_param::m_empty_string_is_null, used by Item_param::set_param_str().

- Removing the call for setup_one_conversion_function() from
  insert_params_from_actual_params_with_log(). It's not needed,
  because the call for ps_param->save_in_param() makes sure
  to initialized all data type dependent members properly,
  by calling setup_conversion_string() from
  Type_handler_string_result::Item_param_set_from_value()
  and by calling setup_conversion_blob() from
  Type_handler_blob_common::Item_param_set_from_value()

- Cleanup: removing multiplication to MY_CHARSET_BIN_MB_MAXLEN
  in a few places. It's 1 anyway, and will never change.
2017-11-24 12:40:00 +04:00
Vladislav Vaintroub
c5fffb33a4 MDEV-14483 Export _mysl_client_plugin_declaration from auth_gssapi_client.so
Update C/C to include fix for this bug.
2017-11-24 00:30:51 +00:00
Vladislav Vaintroub
316f0d8fe3 MDEV-14447 mariabackup incremental incorrectly extends system tablespace
for multi-file innodb_data_file_path.

Use fil_extend_space_to_desired_size() to correctly extend system
tablespace. Make sure to get tablespace size from the first tablespace
part.
2017-11-24 00:01:29 +00:00
Elena Stepanova
e6d6b0c08c Updated list of unstable tests for 10.2.11 2017-11-24 01:38:38 +02:00
Andrei Elkin
c666ca7b1b MDEV-12012. Post-push attempt to catch failure in rpl_gtid_delete_domain failing on P8. The test is made more verbose. 2017-11-23 22:10:31 +02:00
Aleksey Midenkov
6e0b2c7fe0 System Versioning 1.0pre2
Merge branch '10.3' into trunk
2017-11-23 19:41:44 +03:00
Aleksey Midenkov
cbe93291e4 SQL,IB: add auto_inc copy mode fix [#347]
Related to #212.

Extra update of sys_trx_start removed [#87].
2017-11-23 18:31:55 +03:00
Marko Mäkelä
b612f3baa2 Tests: more fine-grained TRT check 2017-11-23 17:44:47 +03:00
Aleksey Midenkov
5aae304fa0 SQL: low timer resolution hack for THD::start_time [#307]
Windows platform is suffered with this problem.
2017-11-23 17:44:47 +03:00
Aleksey Midenkov
3d51315912 Tests: disabled DDL survival tests [#196] 2017-11-23 17:44:39 +03:00
Marko Mäkelä
1773116fe0 Use ST_AsText() to get textual result 2017-11-23 15:02:26 +02:00
Sergey Vojtovich
84ee7a1000 Less code to depend on ut_crc32_init() 2017-11-23 15:55:51 +04:00
Sergey Vojtovich
aaf5ee85f3 Removed HW acceleration for big endian checksum
Big endian checksum is needed to workaround 10+ years old bug, where checksum
was calculated incorrectly on big endian hardware. We can still checksum such
tablespaces using software implementation of CRC32.
2017-11-23 15:55:51 +04:00
Sergey Vojtovich
62ce8ce75f Removed ut_crc32_byte_by_byte: never used 2017-11-23 15:55:51 +04:00
Monty
e69466d023 Improve performance of heap tables
- make hp_mask an inline function (short and called 16 times)
- Simplify hp_search. Biggest benefit is for doing key lookup
  without a matching row. Matching rows may be a bit slower, but
  is offseted by having hp_mask inlined.
2017-11-23 10:04:12 +02:00
Marko Mäkelä
d8ada08152 MDEV-14477 InnoDB update_time is wrongly updated after partial rollback or internal COMMIT
The non-persistent UPDATE_TIME for InnoDB tables was not being
updated consistently at transaction commit.

If a transaction is partly rolled back so that in the end it will
not modify a table that it intended to modify, the update_time will
be updated nevertheless. This will also happen when InnoDB fails
to write an undo log record for the intended modification.

If a transaction is committed internally in InnoDB, instead of
being committed from the SQL interface, then the trx_t::mod_tables
will not be applied to the update_time of the tables.

trx_t::mod_tables: Replace the std::set<dict_table_t*>
with std::map<dict_table_t*,undo_no_t>, so that the very first
modification within the transaction is identified.

trx_undo_report_row_operation(): Update mod_tables for every operation
after the undo log record was successfully written.

trx_rollback_to_savepoint_low(): After partial rollback, erase from
trx_t::mod_tables any tables for which all changes were rolled back.

trx_commit_in_memory(): Tighten some assertions and simplify conditions.
Invoke trx_update_mod_tables_timestamp() if persistent tables were
affected.

trx_commit_for_mysql(): Remove the call to
trx_update_mod_tables_timestamp(), as it is now invoked at the
lower level, in trx_commit_in_memory().

trx_rollback_finish(): Clear mod_tables before invoking trx_commit(),
because the trx_commit_in_memory() would otherwise wrongly process
mod_tables after a full ROLLBACK.
2017-11-23 09:54:24 +02:00