Commit graph

181432 commits

Author SHA1 Message Date
Sergei Golubchik
485325e7e3 don't allow TIMESTAMP(6) versioning and FK with CASCADE or SET NULL 2018-02-24 01:28:50 +01:00
Sergei Golubchik
794f71cbc4 create a reusable function that tells what FK actions can write
and few indentation changes
2018-02-24 01:28:50 +01:00
Sergei Golubchik
17f8e0ecdf unify error messages a bit 2018-02-24 01:28:45 +01:00
Sergei Golubchik
5282d0dce1 cleanup: use enum, not uint, for enum variables 2018-02-24 00:50:58 +01:00
Elena Stepanova
d717fe76e1 Adjust test results to reflect the new system table 2018-02-24 00:50:58 +01:00
Sergei Golubchik
f3088112cb MDEV-14645: AS OF TIMESTAMP is misused as TRX_ID
Remove 1668efb722 that introduced a special magic
behavior for UNIX_TIMESTAMP() in the AS OF context
2018-02-24 00:50:58 +01:00
Sergei Golubchik
33366b1098 remove @@system_versioning_innodb_algorithm_simple
and delete few garbage-in-garbage-out tests
2018-02-24 00:50:57 +01:00
Sergei Golubchik
b9c70b889c remove always-false variable 2018-02-24 00:50:57 +01:00
Aleksey Midenkov
5fb08323e1 Tests: versioning.foreign check row_end after constraint execution 2018-02-24 00:50:57 +01:00
Sergei Golubchik
052668f500 simplify versioning tests 2018-02-24 00:50:57 +01:00
Aleksey Midenkov
dd7d169593 MDEV-14767 system_versioning_alter_history breaks ALTER replication
Vers SQL: force VERS_ALTER_HISTORY_KEEP behavior in the slave thread
2018-02-24 00:50:57 +01:00
Aleksey Midenkov
3f4d03b0dd Tests: partitioning cases for duplicate bugs
MDEV-15191 Assertion `bit < (map)->n_bits' failed in bitmap_is_set
upon INSERT

MDEV-15036 Assertion `!is_set() || (m_status == DA_OK_BULK
&& is_bulk_op())' in Diagnostics_area::set_ok_status or unexpected
ER_RANGE_NOT_INCREASING_ERROR
2018-02-24 00:50:56 +01:00
Eugene Kosov
68c994436a MDEV-15168 Unexpected ER_VERS_ENGINE_UNSUPPORTED upon dropping versioning on a partitioned table
Vers_parse_info::fix_alter_info(): disallow DROP SYSTEM VERSIONING
for system_time partitioned tables.
2018-02-24 00:50:56 +01:00
Sergei Golubchik
f685604aaa MDEV-15103 Assertion in ha_partition::part_records() for updating VIEW
add a test case
2018-02-24 00:50:56 +01:00
Sergei Golubchik
62b5427394 cannot rotate both by INTERVAL and LIMIT 2018-02-24 00:50:56 +01:00
Sergei Golubchik
dfb6f96eaf MDEV-15190 Bad error for non-versioned table PARTITION BY SYSTEM_TIME 2018-02-24 00:50:56 +01:00
Eugene Kosov
edeeaac451 MDEV-14829 Assertion `0' failed in Protocol::end_statement upon concurrent UPDATE
vers_insert_history_row(): do not insert rows with zero or negative lifetime.

mysql_update(): properly handle error from vers_insert_history_row()
2018-02-24 00:50:55 +01:00
Aleksey Midenkov
75afaa7e00 MDEV-15001 no tests for system_versioning_innodb_algorithm_simple
Vers SQL: TRT fix getting TRX_ID by COMMIT_TS

Fixed wrong assumption that records are ordered by COMMIT_TS.
This is anyway a quick hack until tempesta-tech#314 is done.

See also FIXME and TODO in TR_table::query(MYSQL_TIME, bool).

Test: SEES case for trx_id.test [closes #456]
2018-02-24 00:50:55 +01:00
Sergei Golubchik
e36c5ec0a5 PARTITION BY SYSTEM_TIME INTERVAL ...
Lots of changes:
* calculate the current history partition in ::external_lock(),
  not in ::write_row() or ::update_row()
* remove dynamically collected per-partition row_end stats
* no full table scan in open_table_from_share to calculate these
  stats, no manual MDL/thr_locks in open_table_from_share
* no shared stats in TABLE_SHARE = no mutexes or condition waits when
  calculating current history partition
* always compare timestamps, don't convert them to MYSQL_TIME
  (avoid DST ambiguity, and it's faster too)
* correct interval handling, 1 month = 1 month, not 30 * 24 * 3600 seconds
* save/restore first partition start time, and count intervals from there
* only allow to drop first partitions if INTERVAL
* when adding new history partitions, split the data in the last history
  parition, if it was overflowed
* show partition boundaries in INFORMATION_SCHEMA.PARTITIONS
2018-02-23 19:17:48 +01:00
Sergei Golubchik
7961bc4b89 helper append_interval(String*) 2018-02-23 15:33:24 +01:00
Sergei Golubchik
7e2c686b3f remove partition-specific methods from the base handler class 2018-02-23 15:33:23 +01:00
Sergei Golubchik
4ff089489b create ROW_START/ROW_END columns NOT NULL 2018-02-23 15:33:23 +01:00
Sergei Golubchik
c4c81a5b04 cleanup: partition_info::check_constants
partition_info had a bunch of function pointers to avoid if()'s
when invoking part_type specific functionality (like get_part_id, etc).
But check_range_constants() and check_list_constants() were still
invoked conditionally, with if()'s.

Create partition_info::check_constants function pointer, get rid
of if()'s

Also remove alloc argument of check_range_constants(), added
in 26a3ff0a22. Broken system versioning will be fixed in
following commits.
2018-02-23 15:33:23 +01:00
Sergei Golubchik
f38ef43013 cleanup: remove *.opt files from the versioning suite
use include/have_xxx.inc when some feature needs to be present
(because --xxx in the opt file will fail if the xxx is not compiled in)

set variables in the test, not on the command line, to avoid unnecessary
server restarts (they're must slower than SET).
2018-02-23 15:33:23 +01:00
Aleksey Midenkov
f1bd02d994 MDEV-15004 parser greedily parses AS OF TIMESTAMP
* TIMESTAMP precedence fixed.
2018-02-23 15:33:23 +01:00
Aleksey Midenkov
e2f70d6e10 Vers SQL: Refactoring: better init of vers_conditions
Unit-based history point (vers_history_point_t; Vers_history_point).
2018-02-23 15:33:22 +01:00
Aleksey Midenkov
df0e1817c7 Vers SQL: partition rotation by INTERVAL fix
Update partition stats on ha_partition::write_row()
2018-02-23 15:33:22 +01:00
Sergei Golubchik
45e1c9bb6d cleanup: remove a pretty formatting function from a test 2018-02-23 15:33:22 +01:00
Sergei Golubchik
9fa715b84d MDEV-14798 Add, drop system versioning semantic and syntax
SQL: DROP PERIOD FOR SYSTEM_TIME syntax

and remove ER_VERS_SYS_FIELD_EXISTS

originally by: Eugene Kosov
2018-02-23 15:33:22 +01:00
Sergei Golubchik
9f6a7ed2d7 SQL: Truncate history of partitioned table [fixes #399, closes #403]
also, don't rotate versioning partitions for DELETE HISTORY

originally by: Aleksey Midenkov
2018-02-23 15:33:21 +01:00
Sergei Golubchik
187a163c78 cleanup: ha_partition::update_row/delete_row
implement log-term TODO item, convert redundant if()-s into asserts.
2018-02-23 15:33:21 +01:00
Sergei Golubchik
221d010f3e MDEV-14789 Creating federated table on versioned table fails
don't allow to discover WITH SYSTEM VERSIONING clause

originally by: Aleksey Midenkov
2018-02-23 15:33:21 +01:00
Sergei Golubchik
5f6b3f9c07 MDEV-13982 Server crashes in in ha_partition::engine_name
table might be NULL in ha_partition::engine_name()
(test case pushed into 5.5)
2018-02-23 09:26:29 +01:00
Sergei Golubchik
ce0e2c82af Fix a typo 2018-02-23 09:26:29 +01:00
Sergei Golubchik
2732fcc608 Merge branch 'bb-10.2-ext' into 10.3 2018-02-23 08:43:34 +01:00
Sergey Vojtovich
131d9a5d0c Allocate lock_sys statically
There is only one lock_sys. Allocate it statically in order to avoid
dereferencing a pointer whenever accessing it. Also, align some
members to their own cache line in order to avoid false sharing.

lock_sys_t::create(): The deferred constructor.

lock_sys_t::close(): The early destructor.
2018-02-23 08:18:18 +02:00
Marko Mäkelä
59dd0464a9 MDEV-11455 shutdown or abort during innodb buffer pool load (from file) causing incomplete save
Merge pull request #622
2018-02-23 08:17:23 +02:00
Sergei Golubchik
b8af22af15 Merge branch '10.2' into bb-10.2-ext 2018-02-22 19:29:52 +01:00
Igor Babaev
907b236112 Fixed MDEV-14883 Usage of EXCEPT and INTERSECT in recursive CTE
is not supported

Allowed to use recursive references in derived tables.
As a result usage of recursive references in operands of
INTERSECT / EXCEPT is now supported.
2018-02-22 10:26:56 -08:00
Sergei Golubchik
e92cc09765 MDEV-15345 Compilation fails to build my_addr_resolve.c
fix the compilation error.
no support for plugins yet.
2018-02-22 16:46:11 +01:00
Sergei Golubchik
e4a73acc63 Merge branch '10.1' into 10.2 2018-02-22 16:46:02 +01:00
Sergei Golubchik
a04e4f531a Merge branch '10.0' into 10.1 2018-02-22 14:12:02 +01:00
Jan Lindström
504beb1325 Add supressions for possible warning. 2018-02-22 14:22:44 +02:00
Sergey Vojtovich
988ec800ed MDEV-15155 - ReadView::is_open() assertion failure
ReadView::is_open() was supposed to be called by view owner thread
exclusively. Use ReadView::get_state() instead.
2018-02-22 12:26:18 +04:00
Sergei Golubchik
b728641e86 Merge branch '5.5' into 10.0 2018-02-22 09:22:03 +01:00
Marko Mäkelä
a8656d58d4 Fix the startup with innodb_force_recovery=5
At innodb_force_recovery=5 or bigger, trx_lists_init_at_db_start()
no longer initialises the purge_sys. Adjust an assertion accordingly.
2018-02-22 09:49:50 +02:00
Sergei Golubchik
e119799a92 fix compilation wih -DPLUGIN_PARTITION=NO
rocksdb and spider
2018-02-22 08:40:54 +01:00
Sergei Golubchik
2daa005800 Merge branch '10.1' into 10.2 2018-02-22 08:39:24 +01:00
Marko Mäkelä
fb335b48b5 Allocate purge_sys statically
There is only one purge_sys. Allocate it statically in order to avoid
dereferencing a pointer whenever accessing it. Also, align some
members to their own cache line in order to avoid false sharing.

purge_sys_t::create(): The deferred constructor.

purge_sys_t::close(): The early destructor.

undo::Truncate::create(): The deferred constructor.
Because purge_sys.undo_trunc is constructed before the start-up
parameters are parsed, the normal constructor would copy a
wrong value of srv_purge_rseg_truncate_frequency.

TrxUndoRsegsIterator: Do not forward-declare an inline constructor,
because the static construction of purge_sys.rseg_iter would not have
access to it.
2018-02-22 09:30:41 +02:00
Marko Mäkelä
a3a2b898a0 Cleanup: Do not pass globals as parameters
trx_purge(): Remove the parameter limit or batch_size, which is
always passed as srv_purge_batch_size.

trx_purge_attach_undo_recs(): Remove the parameters purge_sys, batch_size.
Refer to srv_purge_batch_size.

trx_purge_wait_for_workers_to_complete(): Remove the parameter purge_sys.
2018-02-22 09:18:53 +02:00