summaryrefslogtreecommitdiff
path: root/sql/handler.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.1' into 10.2Sergei Golubchik2019-03-151-1/+1
|\
| * fix gcc 8 compiler warningsSergei Golubchik2019-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two newly enabled warnings: 1. cast for a function pointers. Affected sql_analyse.h, mi_write.c and ma_write.cc, mf_iocache-t.cc, mysqlbinlog.cc, encryption.cc, etc 2. memcpy/memset of nontrivial structures. Fixed as: * the warning disabled for InnoDB * TABLE, TABLE_SHARE, and TABLE_LIST got a new method reset() which does the bzero(), which is safe for these classes, but any other bzero() will still cause a warning * Table_scope_and_contents_source_st uses `TABLE_LIST *` (trivial) instead of `SQL_I_List<TABLE_LIST>` (not trivial) so it's safe to bzero now. * added casts in debug_sync.cc and sql_select.cc (for JOIN) * move assignment method for MDL_request instead of memcpy() * PARTIAL_INDEX_INTERSECT_INFO::init() instead of bzero() * remove constructor from READ_RECORD() to make it trivial * replace some memcpy() with c++ copy assignments
* | MDEV-16849 Extending indexed VARCHAR column should be instantaneousThirunarayanan Balathandayuthapani2019-01-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: ======== Increasing the length of the indexed varchar column is not an instant operation for innodb. Fix: === - Introduce the new handler flag 'Alter_inplace_info::ALTER_COLUMN_INDEX_LENGTH' to indicate the index length differs due to change of column length changes. - InnoDB makes the ALTER_COLUMN_INDEX_LENGTH flag as instant operation. This is a port of Mysql fix. commit 913071c0b16cc03e703308250d795bc381627e37 Author: Nisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com> Date: Wed May 30 14:54:46 2018 +0530 BUG#26848813: INDEXED COLUMN CAN'T BE CHANGED FROM VARCHAR(15) TO VARCHAR(40) INSTANTANEOUSLY
* | Backport INFORMATION_SCHEMA.CHECK_CONSTRAINTSAnel Husakovic2019-01-161-0/+1
| | | | | | | | | | | | | | | | | | Implement according to standard SQL specification 2008. The check_constraints table is used for fetching metadata about the constraints defined for tables in all databases. There were some result files which failed after running mtr. These files are updated with newly create record with mtr --record.
* | Merge branch '10.1' into 10.2mariadb-10.2.21Sergei Golubchik2018-12-301-3/+9
|\ \ | |/
| * Merge branch '10.0' into 10.1Sergei Golubchik2018-12-291-3/+9
| |\
| | * MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) fieldbb-10.0-varunVarun Gupta2018-12-191-3/+9
| | | | | | | | | | | | | | | | | | Create a new constant MAX_DATA_LENGTH_FOR_KEY. Replace the value of MAX_KEY_LENGTH to also include the LENGTH and NULL BYTES of a field.
* | | MDEV-16429: Assertion `!table || (!table->read_set || ↵Nikita Malyavin2018-12-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bitmap_is_set(table->read_set, field_index))' fails upon attempt to update virtual column on partitioned versioned table When using buffered sort in `UPDATE`, keyread is used. In this case, `TABLE::update_virtual_field` should be aborted, but it actually isn't, because it is called not with a top-level handler, but with the one that is actually going to access the disk. Here the problemm is issued with partitioning, so the solution is to recursively mark for keyread all the underlying partition handlers. * ha_partition: update keyread state for child partitions Closes #800
* | | Merge 10.1 into 10.2Marko Mäkelä2018-08-031-2/+2
|\ \ \ | |/ /
| * | Fix -Wclass-memaccess in WSREP,InnoDB,XtraDBMarko Mäkelä2018-08-031-2/+2
| | |
* | | Merge 10.1 into 10.2Marko Mäkelä2018-06-261-1/+9
|\ \ \ | |/ /
| * | Merge 10.0 into 10.1Marko Mäkelä2018-06-261-1/+9
| |\ \ | | |/
| | * MDEV-15242 Poor RBR update performance with partitioned tablesAndrei Elkin2018-06-251-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Observed and described partitioned engine execution time difference between master and slave was caused by excessive invocation of base_engine::rnd_init which was done also for partitions uninvolved into Rows-event operation. The bug's slave slowdown therefore scales with the number of partitions. Fixed with applying an upstream patch. References: ---------- https://bugs.mysql.com/bug.php?id=73648 Bug#25687813 REPLICATION REGRESSION WITH RBR AND PARTITIONED TABLES
* | | Merge 10.1 into 10.2Marko Mäkelä2018-04-241-1/+1
|\ \ \ | |/ /
| * | Merge 10.0 into 10.1Marko Mäkelä2018-04-241-1/+1
| |\ \ | | |/
| | * Merge branch '5.5' into 10.0Sergei Golubchik2018-04-201-1/+1
| | |\
* | | \ Merge 10.1 to 10.2Marko Mäkelä2017-12-191-0/+7
|\ \ \ \ | |/ / / | | | | | | | | | | | | Follow-up fix to MDEV-14008: Let Field_double::val_uint() silently return 0 on error
| * | | Merge 10.0 into 10.1Marko Mäkelä2017-12-181-0/+7
| |\ \ \ | | |/ /
| | * | MDEV-14641 Incompatible key or row definition between the MariaDB .frm file ↵Sergei Golubchik2017-12-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and the information in the storage engine make sure that mysql_create_frm_image() and fast_alter_partition_table() use the same code to derive HA_OPTION_PACK_RECORD from create_info->row_type.
* | | | MDEV-13384 - misc Windows warnings fixedVladislav Vaintroub2017-09-281-3/+3
| | | |
* | | | MDEV-13847 Allow ALTER TABLE…ADD SPATIAL INDEX…ALGORITHM=INPLACEMarko Mäkelä2017-09-201-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-13851 Always check table options in ALTER TABLE…ALGORITHM=INPLACE In the merge of MySQL 5.7.9 to MariaDB 10.2.2, some code was included that prevents ADD SPATIAL INDEX from being executed with ALGORITHM=INPLACE. Also, the constant ADD_SPATIAL_INDEX was introduced as an alias to ADD_INDEX. We will remove that alias now, and properly implement the same ADD SPATIAL INDEX restrictions as MySQL 5.7 does: 1. table-rebuilding operations are not allowed if SPATIAL INDEX survive it 2. ALTER TABLE…ADD SPATIAL INDEX…LOCK=NONE is not allowed ha_innobase::prepare_inplace_alter_table(): If the ALTER TABLE requires actions within InnoDB, enforce the table options (MDEV-13851). In this way, we will keep denying ADD SPATIAL INDEX for tables that use encryption (MDEV-11974), even if ALGORITHM=INPLACE is used.
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-07-051-0/+14
|\ \ \ \ | |/ / /
| * | | MDEV-8075: DROP TEMPORARY TABLE not marked as ddl, causing optimistic ↵Kristian Nielsen2017-07-031-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parallel replication to fail CREATE/DROP TEMPORARY TABLE are not safe to optimistically replicate in parallel with other transactions, so they need to be marked as "ddl" in the binlog. This was already done for stand-alone CREATE/DROP TEMPORARY. But temporary tables can also be created and dropped inside a BEGIN...END transaction, and such transactions were not marked as ddl. Nor was the DROP TEMPORARY TABLE statement emitted implicitly when a client connection is closed. So this patch adds such ddl mark for the missing cases. The difference to Kristian's original patch is mainly a fix in mysql_trans_commit_alter_copy_data() to remember the unsafe_rollback_flags over the temporary commit.
* | | | Remove the unnecessary method handlerton::release_temporary_latches()Marko Mäkelä2017-06-161-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sole purpose of handlerton::release_temporary_latches and its wrapper function was to release the InnoDB adaptive hash index latch (btr_search_latch). When the btr_search_latch was split into an array of latches in MySQL 5.7.8 as part of the Oracle Bug#20985298 fix, the "caching" of the latch across storage engine API calls was removed. As part of that, the function trx_search_latch_release_if_reserved() was changed to an assertion and the function trx_reserve_search_latch_if_not_reserved() was removed, and handlerton::release_temporary_latches() practically became a no-op. Note: MDEV-12121 replaced the function trx_search_latch_release_if_reserved() with the more appropriately named macro trx_assert_no_search_latch().
* | | | MDEV-12293 Assertion `table->no_keyread || ↵Sergei Golubchik2017-04-301-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | !table->covering_keys.is_set(tab->index) || table->file->keyread == tab->index' failed sometimes the optimizer starts a keyread on some index and later (but before any actual index accesses) changes it to a keyread on a different index
* | | | move rocksdb specific changes into rocksdbSergei Golubchik2017-03-311-1/+0
| | | |
* | | | remove DB_TYPE_ROCKSDBSergei Golubchik2017-03-311-2/+1
| | | |
* | | | Merge branch '10.2' of github.com:MariaDB/server into bb-10.2-mariarocksSergei Petrunia2017-03-111-81/+97
|\ \ \ \
| * | | | Fix many -Wconversion warnings.Marko Mäkelä2017-03-071-78/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define my_thread_id as an unsigned type, to avoid mismatch with ulonglong. Change some parameters to this type. Use size_t in a few more places. Declare many flag constants as unsigned to avoid sign mismatch when shifting bits or applying the unary ~ operator. When applying the unary ~ operator to enum constants, explictly cast the result to an unsigned type, because enum constants can be treated as signed. In InnoDB, change the source code line number parameters from ulint to unsigned type. Also, make some InnoDB functions return a narrower type (unsigned or uint32_t instead of ulint; bool instead of ibool).
| * | | | cleanup: handler::key_readSergei Golubchik2017-02-131-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rename to "keyread" (to avoid conflicts with tokudb), * change from bool to uint and store the keyread index number there * provide a bool accessor to check if keyread is enabled
| * | | | MDEV-11836 vcol.vcol_keys_myisam fails in buildbot and outsideSergei Golubchik2017-02-131-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | move TABLE::key_read into handler. Because in index merge and DS-MRR there can be many handlers per table, and some of them use key read while others don't. "keyread" is really per handler, not per TABLE property.
* | | | | MariaRocks port: Remove handler::init_with_fieldsSergei Petrunia2017-01-211-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - It turns out, ha_rocksdb::table_flags() can return HA_PRIMARY_KEY_IN_READ_INDEX for all kinds of tables (as its meaning is "if there is a PK, PK columns contribute to the secondary index tuple". There is no assumption that a certain PK column can be decoded from the secondary index. (Should probably be fixed in the upstream, too, but I was unable to construct a testcase showing this is necessary). - Following the above, we can undo the init_with_fields() changes in table.cc. MyRocks calls init_with_fields() from ha_rocksdb::open() which sets index-only read capabilities properly.
* | | | | Merge branch '10.2' of github.com:MariaDB/server into 10.2-mariarocksSergei Petrunia2017-01-021-59/+66
|\ \ \ \ \ | |/ / / / | | | | | | | | | | and a few trivial test result updates
| * | | | cleanup: remove unused handler table flagSergei Golubchik2016-12-121-1/+1
| | | | |
| * | | | MDEV-5800 InnoDB support for indexed vcolsSergei Golubchik2016-12-121-38/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove old 5.2+ InnoDB support for virtual columns * enable corresponding parts of the innodb-5.7 sources * copy corresponding test cases from 5.7 * copy detailed Alter_inplace_info::HA_ALTER_FLAGS flags from 5.7 - and more detailed detection of changes in fill_alter_inplace_info() * more "innodb compatibility hooks" in sql_class.cc to - create/destroy/reset a THD (used by background purge threads) - find a prelocked table by name - open a table (from a background purge thread) * different from 5.7: - new service thread "thd_destructor_proxy" to make sure all THDs are destroyed at the correct point in time during the server shutdown - proper opening/closing of tables for vcol evaluations in + FK checks (use already opened prelocked tables) + purge threads (open the table, MDLock it, add it to tdc, close when not needed) - cache open tables in vc_templ - avoid unnecessary allocations, reuse table->record[0] and table->s->default_values - not needed in 5.7, because it overcalculates: + tell the server to calculate vcols for an on-going inline ADD INDEX + calculate vcols for correct error messages * update other engines (mroonga/tokudb) accordingly
| * | | | cleanup: unused handler::check_if_supported_virtual_columns()Sergei Golubchik2016-12-121-12/+0
| | | | |
| * | | | cleanup: unused open_table_from_share() flagsSergei Golubchik2016-12-121-7/+0
| | | | |
| * | | | cleanup: extra_rec_buf_lengthSergei Golubchik2016-12-121-1/+0
| | | | |
* | | | | Merge remote-tracking branch 'mergetrees/merge-myrocks' into 10.2-mariarocksSergei Petrunia2017-01-011-1/+1
| | | | |
* | | | | MariaRocks port: Return correct value of HA_PRIMARY_KEY_IN_READ_INDEX flagSergei Petrunia2016-12-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cset just re-uses the approach from facebook/mysql-5.6 (Perhaps we will have something different for MariaDB in the end). For now this is: Port this fix dd7eeae69503cb8ab6ddc8fd9e2fef451cc31a32 Issue#250: MyRocks/Innodb different output from query with order by on table with index and decimal type Summary: Make open_binary_frm() set TABLE_SHARE::primary_key before it computes Also add the patch for https://github.com/facebook/mysql-5.6/issues/376
* | | | | MariaRocks port: fix rocksdb.handler_basic testSergei Petrunia2016-10-301-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySQL has each storage engine to increment Handler_XXX counters, while MariaDB has handler::ha_XXX() methods to do the increments. MariaDB's solution doesn't work for storage engines that implement handler::read_range_first(), though. Make ha_rocksdb::read_range_first increment the counter (when it is calling handler::ha_XXX() function that will)
* | | | | MariaRocks port: temporarily disable gap lock checkingSergei Petrunia2016-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | Also provide handler::is_using_full_key
* | | | | MariaRocks: add DB_TYPE_ROCKSDB into legacy_db_type enumSergei Petrunia2016-10-091-1/+2
|/ / / /
* | | | Use sql_mode_t for sql_mode.Monty2016-10-051-0/+2
| | | | | | | | | | | | | | | | This fixed several cases where we where using just ulong for sql_mode
* | | | Merge branch '10.2' into bb-10.2-janSergei Golubchik2016-09-191-0/+1
|\ \ \ \
| * \ \ \ Merge branch '10.1' into 10.2Sergei Golubchik2016-09-091-0/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.0' into 10.1Sergei Golubchik2016-08-251-0/+1
| | |\ \ \ | | | |/ /
| | | * | Added new status variables to make it easier to debug certain problems:Monty2016-08-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Handler_read_retry - Update_scan - Delete_scan
* | | | | misc after-merge changes:Sergei Golubchik2016-09-101-35/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove new InnoDB-specific ER_ and HA_ERR_ codes * renamed few old ER_ and HA_ERR_ error messages to be less MyISAM-specific * remove duplicate enum definitions (durability_properties, icp_result) * move new mysql-test include files to their owner suite * rename xtradb.rdiff files to *-disabled * remove mistakenly committed helper perl module * remove long obsolete handler::ha_statistic_increment() method * restore the standard C xid_t structure to not have setters and getters * remove xid_t::reset that was cleaning too much * move MySQL-5.7 ER_ codes where they belong * fir innodb to include service_wsrep.h not internal wsrep headers * update tests and results
* | | | | Merge InnoDB 5.7 from mysql-5.7.9.Jan Lindström2016-09-021-3/+35
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contains also MDEV-10547: Test multi_update_innodb fails with InnoDB 5.7 The failure happened because 5.7 has changed the signature of the bool handler::primary_key_is_clustered() const virtual function ("const" was added). InnoDB was using the old signature which caused the function not to be used. MDEV-10550: Parallel replication lock waits/deadlock handling does not work with InnoDB 5.7 Fixed mutexing problem on lock_trx_handle_wait. Note that rpl_parallel and rpl_optimistic_parallel tests still fail. MDEV-10156 : Group commit tests fail on 10.2 InnoDB (branch bb-10.2-jan) Reason: incorrect merge MDEV-10550: Parallel replication can't sync with master in InnoDB 5.7 (branch bb-10.2-jan) Reason: incorrect merge