Commit graph

180026 commits

Author SHA1 Message Date
Aleksey Midenkov
56adced376 SQL,IB: REPLACE semantics [#365 bug 8] 2017-12-04 13:19:37 +03:00
Marko Mäkelä
f489865558 SQL: Clarify a FIXME comment on TR_table in ha_commit_trans() 2017-12-04 10:57:24 +03:00
Marko Mäkelä
92d6bd7208 Minor InnoDB cleanup (follow-up to #337) 2017-12-04 10:50:33 +03:00
Aleksey Midenkov
5bf14f93a4 Tests: fix combinations 2017-12-04 00:49:44 +03:00
Aleksey Midenkov
68e160fb25 Tests: removed common.inc from results 2017-12-04 00:49:44 +03:00
Aleksey Midenkov
ce78bafe7a MTR: MTR_COMBINATIONS envvar for tests
MTR_COMBINATIONS contains comma-separated list of currently applied
combinations "x,y,...". MTR_COMBINATION_X, MTR_COMBINATION_Y, ... are
set to 1 for this list of combinations.

Fixed dead check: non-existent element $tinfo->{combination}.

Better use this clause:

use warnings FATAL => 'uninitialized';

But this must be very well tested.
2017-12-04 00:49:24 +03:00
Aleksey Midenkov
36c0bec2c7 IB: remove alloc on update 2017-12-03 17:58:56 +03:00
Aleksey Midenkov
70b82f641c SQL: duplicate of historical row fix [#365 bug 7]
Tests affected (forced mode):

main.type_timestamp
2017-12-02 19:52:27 +03:00
Eugene Kosov
a3802ecb58 IB: assertion failure on delete with foreign [#366] 2017-12-02 12:54:32 +03:00
Aleksey Midenkov
5c820a7125 SQL: create_like_table strip versioning for tmp tables [#365 bug 6]
Tests affected (forced versioning):

rpl.rpl_row_merge_engine
2017-12-01 12:21:49 +03:00
Aleksey Midenkov
b9225bb52c SQL: outdated select_lex->where fix [#365 bug 5]
Affected tests (forced mode):

main.index_merge_myisam

After optimization versioning AND takes operands from WHERE AND
leaving `select_lex->where` as empty dangling AND.
2017-11-30 23:23:21 +03:00
Aleksey Midenkov
e4b86780ae SQL: optimized transformer fix [#365 bug 4]
Affected tests (forced mode):

main.win
main.selectivity_innodb
main.subselect_cache
main.analyze_stmt_orderby

Related to #226 (909867d014).
2017-11-30 08:31:38 +03:00
Aleksey Midenkov
2305666a05 SQL: insert delayed fix [#365 bug 3]
Affected tests (forced mode): rpl.rpl_timezone
2017-11-29 11:58:18 +03:00
Aleksey Midenkov
8d548f8e86 SQL: fill_record() field-value inconsistency fix [#365 bug 2]
Affected tests (forced mode): binlog_encryption.encrypted_slave
2017-11-29 10:48:14 +03:00
Aleksey Midenkov
47ea526efa IB: get template with virtual columns [#365 bug 1]
Affected tests (forced mode): binlog_encryption.encrypted_slave
2017-11-29 10:48:10 +03:00
Aleksey Midenkov
f924a94d2f SQL: disable versioned DML for transaction_registry=off [closes #364] 2017-11-28 18:38:54 +03:00
Eugene Kosov
dcc00d2be3
IB: combine is_delete, vers_delete into enum [closes #337] 2017-11-28 15:03:25 +03:00
Aleksey Midenkov
f826f1249b Tests: suppress tinyint error for ppc64le [#347] 2017-11-28 14:21:00 +03:00
Eugene Kosov
8eac050440
Tests: revert unneded changes 2017-11-28 11:40:13 +03:00
Marko Mäkelä
219280392e Cleanup: Do not add a parameter to row_update_for_mysql()
row_prebuilt_t::versioned_write: Cache the value of TABLE::versioned_write()
in ha_innobase::build_template()
2017-11-28 11:32:12 +03:00
Marko Mäkelä
3fdd9c1ccc Correct a comment 2017-11-28 11:32:11 +03: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
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
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
Marko Mäkelä
fda4fabe9c Correct a comment 2017-11-23 09:54:24 +02:00