summaryrefslogtreecommitdiff
path: root/storage
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-11487 Revert InnoDB internal temporary tables from WL#7682bb-10.2-mdev-11487Marko Mäkelä2016-12-0741-3479/+414
| | | | | | | | | | WL#7682 in MySQL 5.7 introduced the possibility to create light-weight temporary tables in InnoDB. These are called 'intrinsic temporary tables' in InnoDB, and in MySQL 5.7, they can be created by the optimizer for sorting or buffering data in query processing. In MariaDB 10.2, the optimizer temporary tables cannot be created in InnoDB, so we should remove the dead code and related data structures.
* Merge pull request #263 from grooverdan/10.2-MDEV-11451-isfiniteMarko Mäkelä2016-12-053-5/+6
|\ | | | | MDEV-11451: isinf || isnan -> !isfinite
| * MDEV-11451: isinf || isnan -> !isfiniteDaniel Black2016-12-053-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | There are only 3 logical states for a number. The isfinite is a single function call rather than multiple leaving scope for compiler /architecture optimization. Changed the logic as follows in a few files. my_isinf(square) || my_isnan(square) -> !isfinite(square) Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
* | MDEV-11233 CREATE FULLTEXT INDEX with a token longer than 127 bytesMarko Mäkelä2016-12-0510-105/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | crashes server This bug is the result of merging the Oracle MySQL follow-up fix BUG#22963169 MYSQL CRASHES ON CREATE FULLTEXT INDEX without merging the base bug fix: Bug#79475 Insert a token of 84 4-bytes chars into fts index causes server crash. Unlike the above mentioned fixes in MySQL, our fix will not change the storage format of fulltext indexes in InnoDB or XtraDB when a character encoding with mbmaxlen=2 or mbmaxlen=3 and the length of a word is between 128 and 84*mbmaxlen bytes. The Oracle fix would allocate 2 length bytes for these cases. Compatibility with other MySQL and MariaDB releases is ensured by persisting the used maximum length in the SYS_COLUMNS table in the InnoDB data dictionary. This fix also removes some unnecessary strcmp() calls when checking for the legacy default collation my_charset_latin1 (my_charset_latin1.name=="latin1_swedish_ci"). fts_create_one_index_table(): Store the actual length in bytes. This metadata will be written to the SYS_COLUMNS table. fts_zip_initialize(): Initialize only the first byte of the buffer. Actually the code should not even care about this first byte, because the length is set as 0. FTX_MAX_WORD_LEN: Define as HA_FT_MAXCHARLEN * 4 aka 336 bytes, not as 254 bytes. row_merge_create_fts_sort_index(): Set the actual maximum length of the column in bytes, similar to fts_create_one_index_table(). row_merge_fts_doc_tokenize(): Remove the redundant parameter word_dtype. Use the actual maximum length of the column. Calculate the extra_size in the same way as row_merge_buf_encode() does.
* | MDEV-11168: InnoDB: Failing assertion: !other_lock || ↵Jan Lindström2016-12-021-16/+1
| | | | | | | | | | | | wsrep_thd_is_BF(lock->trx->mysql_thd, FALSE) || wsrep_thd_is_BF(other_lock->trx->mysql_thd, FALSE) Merge fix from 10.1.
* | MDEV-11236 Failing assertion: state == TRX_STATE_NOT_STARTEDMarko Mäkelä2016-12-026-10/+44
| | | | | | | | | | | | | | | | | | | | | | trx_state_eq(): Add the parameter bool relaxed=false, to allow trx->state==TRX_STATE_NOT_STARTED where a different state is expected, if an error has been reported. trx_release_savepoint_for_mysql(): Pass relaxed=true to trx_state_eq(). That is, allow the transaction to be idle when ROLLBACK TO SAVEPOINT is attempted after an error has been reported to the client.
* | Merge pull request #262 from ↵Marko Mäkelä2016-12-011-5/+0
|\ \ | | | | | | | | | | | | grooverdan/10.2-MDEV-9451-remove-innodb_buffer_pool_populate MDEV-9451: Remove innodb_buffer_pool_populate from xtradb (10.2)
| * | MDEV-9451: Remove innodb_buffer_pool_populate from xtradbDaniel Black2016-12-011-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | innodb_buffer_pool_populate has not had an effect since 10.0.23 in commit 1e270d504d56cb015efe060b319e3a5b9bc6513f when its functionality was removed. As we've only just enabled LIBNUMA in MDEV-10829 it isn't logical to have innodb_buffer_pool_populate aliasing for innodb_numa_interleave this late in the game. So the simpliest way is just to remove innodb_buffer_pool_populate. Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
* | | MDEV-11426 Remove InnoDB INFORMATION_SCHEMA.FILES implementationMarko Mäkelä2016-12-015-250/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySQL 5.7 introduced WL#7943: InnoDB: Implement Information_Schema.Files to provide a long-term alternative for accessing tablespace metadata. The INFORMATION_SCHEMA.INNODB_* views are considered internal interfaces that are subject to change or removal between releases. So, users should refer to I_S.FILES instead of I_S.INNODB_SYS_TABLESPACES to fetch metadata about CREATE TABLESPACE. Because MariaDB 10.2 does not support CREATE TABLESPACE or CREATE TABLE…TABLESPACE for InnoDB, it does not make sense to support I_S.FILES either. So, let MariaDB 10.2 omit the code that was added in MySQL 5.7. After this change, I_S.FILES will report the empty result, unless some other storage engine in MariaDB 10.2 implements the interface. (The I_S.FILES interface was originally created for the NDB Cluster.)
* | | MDEV-11168: InnoDB: Failing assertion: !other_lock || ↵Jan Lindström2016-12-011-3/+5
| | | | | | | | | | | | | | | | | | | | | wsrep_thd_is_BF(lock->trx->mysql_thd, FALSE) || wsrep_thd_is_BF(other_lock->trx->mysql_thd, FALSE) Problem was that we moved lock request to head of lock queue even when lock request has to wait.
* | | MDEV-11432 Change the informational redo log format tag to "MariaDB 10.2.3"Marko Mäkelä2016-12-011-1/+5
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MariaDB 10.2 incorporates MySQL 5.7. MySQL 5.7.9 (the first GA release of the series) introduced an informational field to the InnoDB redo log header, which identifies the server version where the redo log files were created (initialized, resized or updated), in WL#8845: InnoDB: Redo log format version identifier. The informational message would be displayed to the user, for example if someone tries to start up MySQL 8.0 after killing a MariaDB 10.2 server. In the current MariaDB 10.2 source code, the identifier string would misleadingly say "MySQL 5.7.14" (using the hard-coded version number in univ.i) instead of "MariaDB 10.2.3" (using the contents of the VERSION file, the build system copies to config.h and my_config.h). This is only a cosmetic change. The compatibility check is based on a numeric identifier. We should probably also change the numeric identifier and some logic around it. MariaDB 10.2 should refuse to recover from a crashed MySQL 5.7 instance, because the redo log might contain references to shared tablespaces, which are not supported by MariaDB 10.2. Also, when MariaDB 10.2 creates an encrypted redo log, there should be a redo log format version tag that will prevent MySQL 5.7 or 8.0 from starting up.
* | MDEV-11005: Incorrect error message when using ONLINE alter table with GISJan Lindström2016-12-011-5/+2
|/ | | | | Corrected error message when ONLINE alter table with GIS indexes is used on InnoDB.
* Remove tablespace code from InnoDB compilation as it is not used.Jan Lindström2016-11-301-0/+4
|
* MDEV-11041 Innodb_gis/ tests taken from MySQL fail.Alexey Botchkov2016-11-291-0/+4
| | | | | Some fixes made in innodb and item_create.cc. Adapted Innodb-GIS tests moved to MariaDB.
* Merge branch '10.2_warnings' of https://github.com/kevgs/server into ↵Marko Mäkelä2016-11-258-17/+5
|\ | | | | | | | | | | | | | | | | | | kevgs-10.2_warnings Revert the XtraDB changes, because 10.2 does not currently build with XtraDB. Also omit some changes that need further investigation. Ensure that all callers of partition_info::get_clone() are passing this!=NULL.
| * fix build and some warningskevg2016-11-2414-34/+22
| |
* | MDEV-11349 (2/2) Fix some bogus-looking Valgrind warningsMarko Mäkelä2016-11-254-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | buf_block_init(): Initialize buf_page_t::flush_type. For some reason, Valgrind 3.12.0 would seem to flag some bits in adjacent bitfields as uninitialized, even though only the two bits of flush_type were left uninitialized. Initialize the field to get rid of many warnings. buf_page_init_low(): Initialize buf_page_t::old. For some reason, Valgrind 3.12.0 would seem to flag all 32 bits uninitialized when buf_page_init_for_read() invokes buf_LRU_add_block(bpage, TRUE). This would trigger bogus warnings for buf_page_t::freed_page_clock being uninitialized. (The V-bits would later claim that only "old" is initialized in the 32-bit word.) Perhaps recent compilers (GCC 6.2.1 and clang 4.0.0) generate more optimized x86_64 code for bitfield operations, confusing Valgrind? mach_write_to_1(), mach_write_to_2(), mach_write_to_3(): Rewrite the assertions that ensure that the most significant bits are zero. Apparently, clang 4.0.0 would optimize expressions of the form ((n | 0xFF) <= 0x100) to (n <= 0x100). The redundant 0xFF was added in the first place in order to suppress a Valgrind warning. (Valgrind would warn about comparing uninitialized values even in the case when the uninitialized bits do not affect the result of the comparison.)
* | MDEV-11349 (1/2) Fix some clang 4.0 warningsMarko Mäkelä2016-11-2520-79/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In functions that declare pointer parameters as nonnull, remove nullness checks, because GCC would optimize them away anyway. Use #ifdef instead of #if when checking for a configuration flag. Clang says that left shifts of negative values are undefined. So, use ~0U instead of ~0 in a number of macros. Some functions that were defined as UNIV_INLINE were declared as UNIV_INTERN. Consistently use the same type of linkage. ibuf_merge_or_delete_for_page() could pass bitmap_page=NULL to buf_page_print(), conflicting with the __attribute__((nonnull)).
* | MDEV-11296 - InnoDB stalls under OLTP RW on P8Sergey Vojtovich2016-11-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Threads may fall asleep forever while acquiring InnoDB rw-lock on Power8. This regression was introduced along with InnoDB atomic operations fixes. The problem was that proper memory order wasn't enforced between "writers" store and "lock_word" load: my_atomic_store32((int32*) &lock->waiters, 1); ... local_lock_word = lock->lock_word; Locking protocol is such that store to "writers" must be completed before load of "lock_word". my_atomic_store32() was expected to enforce memory order because it issues strongest MY_MEMORY_ORDER_SEQ_CST memory barrier. According to C11: - any operation with this memory order is both an acquire operation and a release operation - for atomic store order must be one of memory_order_relaxed memory_order_release or memory_order_seq_cst. Otherwise the behavior is undefined. That is it doesn't say explicitly that this expectation is wrong, but there are indications that acquire (which is actually supposed to guarantee memory order in this case) may not be issued along with MY_MEMORY_ORDER_SEQ_CST. A good fix for this is to encode waiters into lock_word, but it is a bit too intrusive. Instead we change atomic store to atomic fetch-and-store, which does memory load and is guaranteed to issue acquire.
* | MDEV-11296 - InnoDB stalls under OLTP RW on P8Sergey Vojtovich2016-11-253-136/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify away recursive flag: it is not necessary for rw-locks to operate properly. Now writer_thread != 0 means recursive. As we only need correct value of writer_thread only in writer_thread itself it is rather safe to load and update it non-atomically. This patch also fixes potential reorder of "writer_thread" and "recursive" loads (aka MDEV-7148), which was reopened along with InnoDB thread fences simplification. Previous versions are unaffected, because they have os_rmb in rw_lock_lock_word_decr(). It wasn't observed at the moment of writing though.
* | MDEV-11296 - InnoDB stalls under OLTP RW on P8Sergey Vojtovich2016-11-254-95/+2
| | | | | | | | Clean-up INNODB_RW_LOCKS_USE_ATOMICS: it is always set.
* | MDEV-11296 - InnoDB stalls under OLTP RW on P8Sergey Vojtovich2016-11-255-69/+10
| | | | | | | | | | Simplified away rw_lock_get_waiters(), rw_lock_set_waiter_flag(), rw_lock_reset_waiter_flag(). Let waiters have predictable data type.
* | MDEV-11296 - InnoDB stalls under OLTP RW on P8Sergey Vojtovich2016-11-252-39/+3
|/ | | | Simplified away rw_lock_lock_word_incr().
* Mark spider tests bigSergey Vojtovich2016-11-172-0/+2
| | | | | | | | | Due to high memory reqirements spider tests fail often on automated testing VM's due to rather limited resource allocation. For example with 10.2 spider needs at least 200M * 8 mysqld instances = 1.6Gb RAM per mtr instance. With --parallel=4 it needs 6.4Gb, while appropriate hosts have just 3Gb.
* MDEV-9143 JSON_xxx functions.Alexey Botchkov2016-11-151-0/+1
| | | | | The rest of mysql/json functions implemented. CAST AS JSON implemented.
* InnoDB cleanupsSergey Vojtovich2016-11-152-10/+1
| | | | | | - added missing backslash - removed duplicate definition of UT_LOW_PRIORITY_CPU/UT_RESUME_PRIORITY_CPU - removed duplicate UT_RESUME_PRIORITY_CPU call
* MDEV-11250: mtflush threads stall on shutdownJan Lindström2016-11-101-6/+6
| | | | Code calling mtflush threads to exit was too late.
* MDEV-10692: InnoDB: Failing assertion: lock->trx->lock.wait_lock == lockJan Lindström2016-11-091-2/+3
| | | | | When we enter here wait_lock could be already gone i.e. NULL, that should be allowed.
* MDEV-10692: InnoDB: Failing assertion: lock->trx->lock.wait_lock == lockJan Lindström2016-11-092-2/+48
| | | | This is not a fix, this is instrumentation to find the bug.
* MDEV-10041: Server crashes sporadically during bootstrap while running wsrep ↵Nirbhay Choubey2016-11-071-1/+2
| | | | | | | | | tests The crash is caused due to a race condition where wsrep startup threads invoke ha_maria::implicit_commit() method while maria_hton is partially initialized. The fix is to skip this method if plugins are uninitialized.
* Merge pull request #255 from rasmushoj/MDEV-9820Jan Lindström2016-11-072-2/+14
|\ | | | | MDEV-9820 Added server variable compression_default, which if 1/ON sets compres…
| * Added server variable compression_default, which if 1/ON sets compression on ↵Rasmus Johansson2016-11-042-2/+14
| | | | | | | | for all new InnoDB/XtraDB tables by default by setting PAGE_COMPRESSED=1
* | MDEV-10986 sphinx.union-5539 and sphinx.sphinx fail in buildbot and outsideElena Stepanova2016-11-071-1/+1
| | | | | | | | Do not include the suite into the default list until the tests are stable
* | Merge pull request #253 from grooverdan/10.2-MDEV-11195-numa-buildVladislav Vaintroub2016-11-042-10/+2
|\ \ | | | | | | MDEV-11195: Correct enablement of NUMA in innodb/xtradb
| * | MDEV-11195: Simplify enablement of NUMA in innodb/xtradbDaniel Black2016-11-022-10/+0
| | | | | | | | | | | | Move common parts of {innodb,xtradb}/CmakeLists.txt to the macro.
| * | MDEV-11195: Correct enablement of NUMA in innodb/xtradbDaniel Black2016-11-012-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No -DHAVE_LIBNUMA=1 was passed to the source compile (and the global include/my_config.h wasn't used). This also is Linux only so corrected the cmake macro. Fixed indenting in cmake macro. Removed NUMA defination from include/my_config.h as its only in the storage engine. Thanks Elena Stepanova and Vladislav Vaintroub for the detailed list of bugs/questions. Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
* | | Scalability bottleneck in ha_innodb::general_fetchSergey Vojtovich2016-11-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | With "WL#6047 - Do not allocate trx id for read-only transactions" m_prebuilt->trx->id is always 0 for read-only transactions. This makes it useless as an index for fuzzy counters. Use server thread id instead similarly to MySQL.
* | | MDEV-7660 - MySQL WL#6671 "Improve scalability by not using thr_lock.c locksSergey Vojtovich2016-11-035-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for InnoDB tables" Don't use thr_lock.c locks for InnoDB tables. Below is list of changes that were needed to implement this: - HANDLER OPEN acquireis MDL_SHARED_READ instead of MDL_SHARED - HANDLER READ calls external_lock() even if SE is not going to be locked by THR_LOCK - InnoDB lock wait timeouts are now honored which are much shorter by default than server lock wait timeouts (1 year vs 50 seconds) - with @@autocommit= 1 LOCK TABLES disables autocommit implicitely, though user still sees @@autocommt= 1 - the above starts implicit transaction - transactions started by LOCK TABLES are now rolled back on disconnect (previously everything was committed due to autocommit) - transactions started by LOCK TABLES are now rolled back by ROLLBACK (previously everything was committed due to autocommit) - it is now impossible to change BINLOG_FORMAT under LOCK TABLES (at least to statement) due to running transaction - LOCK TABLES WRITE is additionally handled by MDL - ...in contrast LOCK TABLES READ protection against DML is pure InnoDB - combining transactional and non-transactional tables under LOCK TABLES may cause rolled back changes in transactional table and "committed" changes in non-transactional table - user may disable innodb_table_locks, which will cause LOCK TABLES to be noop basically Removed tests for BUG#45143 and BUG#55930 which cover InnoDB + THR_LOCK. To operate properly these tests require code flow to go through THR_LOCK debug sync points, which is not the case after this patch. These tests are removed by WL#6671 as well. An alternative is to port them to different storage engine.
* | | MDEV-9114: Bulk operations (Array binding)Oleksandr Byelkin2016-11-021-0/+2
| | | | | | | | | | | | (+ default values)
* | | Bug#23631471 BUF_BLOCK_ALIGN() MAKES INCORRECT ASSUMPTIONS ABOUT CHUNK SIZEDarshan M N2016-11-021-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue: ====== Currently the approach we take to find the chunk corresponding to a given pointer uses srv_buf_pool_chunk_unit based on the assumption that srv_buf_pool_chunk_unit is the total size of all pages in a buffer pool chunk. We first step back by srv_buf_pool_chunk_unit bytes and use std::map::upper_bound() to find the first chunk in the map whose key >= the resulting pointer. However, the real size of a chunk (and thus, the total size of its pages) may differ from the value configured with innodb_buffer_pool_chunk_size due to rounding up to the OS page size. So, in some cases the above logic gives us the wrong chunk. Fix: ==== We find out the chunk corresponding to the give pointer without using srv_buf_pool_chunk_unit. This is done by using std::map::upper_bound() to find the next chunk in the map which appears right after the pointer and decrementing the iterator, which would give us the chunk the pointer belongs to. Contribution by Alexey Kopytov. RB: 13347 Reviewed-by: Debarun Banerjee <debarun.banerjee@oracle.com>
* | | Merge pull request #251 from ottok/ok-debpkg-10.2Otto Kekäläinen2016-11-013-3/+0
|\ \ \ | |/ / |/| | MDEV-6284 - Partially merge downstream Debian/Ubuntu packaging into upstream MariaDB
| * | MDEV-6284: Remove CMakeLists.txt hack that mangled the server install fileOtto Kekäläinen2016-10-273-3/+0
| |/ | | | | | | | | | | For Debian the rules file is the main makefile and assuming that a upstream makefile will mangle the Debian packaging files creates false alerts from static analysis tools and other problems.
* | MDEV-8791 - AIX: Unresolved Symbols during linkingSergey Vojtovich2016-10-314-4/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | Clean-up nolock.h: it doesn't serve any purpose anymore. Appropriate code moved to x86-gcc.h and my_atomic.h. If gcc sync bultins were detected, we want to make use of them independently of __GNUC__ definition. E.g. XLC simulates those, but doesn't define __GNUC__. HS/Spider: According to AIX manual alloca() returns char*, which cannot be casted to any type with static_cast. Use explicit cast instead. MDL: Removed namemangling pragma, which didn't let MariaDB build with XLC. WSREP: _int64 seem to be conflicting name with XLC, replaced with _integer64. CONNECT: RTLD_NOLOAD is GNU extention. Removed rather meaningless check if library is loaded. Multiple dlopen()'s of the same library are permitted, and it never gets closed anyway. Except for error, which was a bug: it may close library, which can still be referenced by other subsystems. InnoDB: __ppc_get_timebase() is GNU extention. Only use it when __GLIBC__ is defined. Based on contribution by flynn1973.
* Set new scheduling algorithm VATS for lock waits as a default.Jan Lindström2016-10-251-1/+1
|
* Merge pull request #248 from sensssz/10.2-vatsJan Lindström2016-10-245-37/+454
|\ | | | | MDEV-11039 - Add new scheduling algorithm for reducing tail latencies (for 10.2)
| * Undo changes to XtraDB.sensssz2016-10-235-465/+53
| |
| * Remove duplicated comments.sensssz2016-10-231-5/+1
| |
| * Change all space indentions to tab.sensssz2016-10-233-280/+278
| |
| * Style fixes.sensssz2016-10-232-13/+12
| |
| * Remove unnecessary changes. Apply changes to XtraDB.sensssz2016-10-224-36/+90
| |