summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-11952 Oracle-style packages: stage#5mariadb-10.3.5bb-10.3-compatibilityAlexander Barkov2018-02-2586-279/+11065
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - CREATE PACKAGE [BODY] statements are now entirely written to mysql.proc with type='PACKAGE' and type='PACKAGE BODY'. - CREATE PACKAGE BODY now supports IF NOT EXISTS - DROP PACKAGE BODY now supports IF EXISTS - CREATE OR REPLACE PACKAGE [BODY] is now supported - CREATE PACKAGE [BODY] now support the DEFINER clause: CREATE DEFINER user@host PACKAGE pkg ... END; CREATE DEFINER user@host PACKAGE BODY pkg ... END; - CREATE PACKAGE [BODY] now supports SQL SECURITY and COMMENT clauses, e.g.: CREATE PACKAGE p1 SQL SECURITY INVOKER COMMENT "comment" AS ... END; - Package routines are now created from the package CREATE PACKAGE BODY statement and don't produce individual records in mysql.proc. - CREATE PACKAGE BODY now supports package-wide variables. Package variables can be read and set inside package routines. Package variables are stored in a separate sp_rcontext, which is cached in THD on the first packate routine call. - CREATE PACKAGE BODY now supports the initialization section. - All public routines (i.e. declared in CREATE PACKAGE) must have implementations in CREATE PACKAGE BODY - Only public package routines are available outside of the package - {CREATE|DROP} PACKAGE [BODY] now respects CREATE ROUTINE and ALTER ROUTINE privileges - "GRANT EXECUTE ON PACKAGE BODY pkg" is now supported - SHOW CREATE PACKAGE [BODY] is now supported - SHOW PACKAGE [BODY] STATUS is now supported - CREATE and DROP for PACKAGE [BODY] now works for non-current databases - mysqldump now supports packages - "SHOW {PROCEDURE|FUNCTION) CODE pkg.routine" now works for package routines - "SHOW PACKAGE BODY CODE pkg" now works (the package initialization section) - A new package body level MDL was added - Recursive calls for package procedures are now possible - Routine forward declarations in CREATE PACKATE BODY are now supported. - Package body variables now work as SP OUT parameters - Package body variables now work as SELECT INTO targets - Package body variables now support ROW, %ROWTYPE, %TYPE
* MDEV-15405 Mixed replication fails with "Could not execute Delete_rows_v1 ↵Sergei Golubchik2018-02-254-6/+66
| | | | | | | | | | | | event" upon DELETE HISTORY Allow slave thread to set time for system versioning Note that every binlog event stores now(0), while microseconds are only stored when they're actually used in the query. Meaning for unversioned->versioned replication, there will be no microseconds. Need to compensate for that.
* fix THD::system_time to follow, well, system timeSergei Golubchik2018-02-256-33/+37
| | | | | | | | | Because NOW() is set to system time, unless overriden. And both should follow big manual system time changes, while still coping with lowres system clocks. Ignoring system time changes is both confusing and breaks with restarts.
* cleanup: remove redundant vers_field->set_notnull();Sergei Golubchik2018-02-243-7/+0
| | | | as these fields are always declared NOT NULL anyway
* update server maturitySergei Golubchik2018-02-241-1/+1
|
* MDEV-15395 Wrong result or Assertion `old_part_id == m_last_part' failed in ↵Sergei Golubchik2018-02-243-4/+19
| | | | | | ha_partition::update_row on slave Revert commit fd240a10e3a and add a test case
* fixes for test failuresSergei Golubchik2018-02-243-3/+4
|
* MDEV-15336 Server crashes in handler::print_error / ↵Sergei Golubchik2018-02-243-0/+48
| | | | | | ha_partition::print_error upon query timeout set m_last_part to something meaningful when opening partitions
* omit system invisible fields from the duplicate key errorSergei Golubchik2018-02-242-1/+3
| | | | just as SHOW CREATE TABLE omits them from the index definition
* MDEV-15330 Server crash or assertion `table->insert_values' failure in ↵Sergei Golubchik2018-02-243-0/+27
| | | | | | write_record upon LOAD DATA copy the corresponding line from mysql_prepare_insert()
* MDEV-15395 Wrong result or Assertion `old_part_id == m_last_part' failed in ↵Sergei Golubchik2018-02-242-14/+5
| | | | | | | | | | | | ha_partition::update_row on slave RBR cannot work with system versioning on the master. row_end column is either system time (not @@timestamp) with microsecond precision or transaction id. Either way, it'll certainly be different on the slave. So if the master row contains row_end column, it won't match on the slave. And if we ignore row_end when comparing, then some other row might match instead.
* don't allow TIMESTAMP(6) versioning and FK with CASCADE or SET NULLSergei Golubchik2018-02-2410-119/+236
|
* create a reusable function that tells what FK actions can writeSergei Golubchik2018-02-245-19/+21
| | | | and few indentation changes
* unify error messages a bitSergei Golubchik2018-02-245-12/+36
|
* cleanup: use enum, not uint, for enum variablesSergei Golubchik2018-02-242-3/+8
|
* Adjust test results to reflect the new system tableElena Stepanova2018-02-244-12/+41
|
* MDEV-14645: AS OF TIMESTAMP is misused as TRX_IDSergei Golubchik2018-02-2411-119/+10
| | | | | Remove 1668efb722d that introduced a special magic behavior for UNIX_TIMESTAMP() in the AS OF context
* remove @@system_versioning_innodb_algorithm_simpleSergei Golubchik2018-02-2411-103/+11
| | | | and delete few garbage-in-garbage-out tests
* remove always-false variableSergei Golubchik2018-02-241-5/+2
|
* Tests: versioning.foreign check row_end after constraint executionAleksey Midenkov2018-02-242-5/+13
|
* simplify versioning testsSergei Golubchik2018-02-2422-2075/+968
|
* MDEV-14767 system_versioning_alter_history breaks ALTER replicationAleksey Midenkov2018-02-243-4/+76
| | | | Vers SQL: force VERS_ALTER_HISTORY_KEEP behavior in the slave thread
* Tests: partitioning cases for duplicate bugsAleksey Midenkov2018-02-242-0/+38
| | | | | | | | | 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
* MDEV-15168 Unexpected ER_VERS_ENGINE_UNSUPPORTED upon dropping versioning on ↵Eugene Kosov2018-02-244-2/+25
| | | | | | | a partitioned table Vers_parse_info::fix_alter_info(): disallow DROP SYSTEM VERSIONING for system_time partitioned tables.
* MDEV-15103 Assertion in ha_partition::part_records() for updating VIEWSergei Golubchik2018-02-242-0/+17
| | | | add a test case
* cannot rotate both by INTERVAL and LIMITSergei Golubchik2018-02-243-18/+25
|
* MDEV-15190 Bad error for non-versioned table PARTITION BY SYSTEM_TIMESergei Golubchik2018-02-244-5/+12
|
* MDEV-14829 Assertion `0' failed in Protocol::end_statement upon concurrent ↵Eugene Kosov2018-02-247-14/+66
| | | | | | | | UPDATE vers_insert_history_row(): do not insert rows with zero or negative lifetime. mysql_update(): properly handle error from vers_insert_history_row()
* MDEV-15001 no tests for system_versioning_innodb_algorithm_simpleAleksey Midenkov2018-02-245-20/+183
| | | | | | | | | | | 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]
* PARTITION BY SYSTEM_TIME INTERVAL ...Sergei Golubchik2018-02-2316-973/+462
| | | | | | | | | | | | | | | | | | | 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
* helper append_interval(String*)Sergei Golubchik2018-02-233-7/+83
|
* remove partition-specific methods from the base handler classSergei Golubchik2018-02-232-11/+1
|
* create ROW_START/ROW_END columns NOT NULLSergei Golubchik2018-02-232-2/+1
|
* cleanup: partition_info::check_constantsSergei Golubchik2018-02-234-439/+403
| | | | | | | | | | | | | | 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 26a3ff0a22e. Broken system versioning will be fixed in following commits.
* cleanup: remove *.opt files from the versioning suiteSergei Golubchik2018-02-239-4/+7
| | | | | | | | 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).
* MDEV-15004 parser greedily parses AS OF TIMESTAMPAleksey Midenkov2018-02-2311-31/+63
| | | | * TIMESTAMP precedence fixed.
* Vers SQL: Refactoring: better init of vers_conditionsAleksey Midenkov2018-02-234-198/+193
| | | | Unit-based history point (vers_history_point_t; Vers_history_point).
* Vers SQL: partition rotation by INTERVAL fixAleksey Midenkov2018-02-234-19/+52
| | | | Update partition stats on ha_partition::write_row()
* cleanup: remove a pretty formatting function from a testSergei Golubchik2018-02-232-25/+16
|
* MDEV-14798 Add, drop system versioning semantic and syntaxSergei Golubchik2018-02-238-29/+118
| | | | | | | | SQL: DROP PERIOD FOR SYSTEM_TIME syntax and remove ER_VERS_SYS_FIELD_EXISTS originally by: Eugene Kosov
* SQL: Truncate history of partitioned table [fixes #399, closes #403]Sergei Golubchik2018-02-235-20/+33
| | | | | | also, don't rotate versioning partitions for DELETE HISTORY originally by: Aleksey Midenkov
* cleanup: ha_partition::update_row/delete_rowSergei Golubchik2018-02-233-141/+46
| | | | implement log-term TODO item, convert redundant if()-s into asserts.
* MDEV-14789 Creating federated table on versioned table failsSergei Golubchik2018-02-233-0/+20
| | | | | | don't allow to discover WITH SYSTEM VERSIONING clause originally by: Aleksey Midenkov
* MDEV-13982 Server crashes in in ha_partition::engine_nameSergei Golubchik2018-02-231-2/+1
| | | | | table might be NULL in ha_partition::engine_name() (test case pushed into 5.5)
* Fix a typoSergei Golubchik2018-02-231-1/+1
|
* Merge branch 'bb-10.2-ext' into 10.3Sergei Golubchik2018-02-2363-517/+1137
|\
| * Merge branch '10.2' into bb-10.2-extSergei Golubchik2018-02-2247-338/+476
| |\
| | * MDEV-15345 Compilation fails to build my_addr_resolve.cSergei Golubchik2018-02-221-0/+7
| | | | | | | | | | | | | | | fix the compilation error. no support for plugins yet.
| | * Merge branch '10.1' into 10.2Sergei Golubchik2018-02-2221-245/+53
| | |\
| | | * Merge branch '10.0' into 10.1Sergei Golubchik2018-02-2219-245/+51
| | | |\