summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Extend debug_assert_on_not_freed_memorybb-10.2-monty-fixedMonty2018-05-241-1/+2
| | | | | Don't check global_memory_used if debug_assert_on_not_freed_memory is not set
* Merge remote-tracking branch 'origin/10.1' into 10.2Monty2018-05-2440-160/+822
|\
| * Add a missing dependency to a testMarko Mäkelä2018-05-241-0/+1
| |
| * Merge 10.0 into 10.1Marko Mäkelä2018-05-242-18/+38
| |\
| | * MDEV-16267 Wrong INFORMATION_SCHEMA.INNODB_BUFFER_PAGE.TABLE_NAMEMarko Mäkelä2018-05-242-18/+38
| | | | | | | | | | | | | | | i_s_innodb_buffer_page_fill(), i_s_innodb_buf_page_lru_fill(): Only invoke Field::set_notnull() if the index was found.
| * | Merge remote-tracking branch 'origin/10.0' into 10.1Monty2018-05-2431-131/+606
| |\ \ | | |/
| | * Fixed ASAN heap-use-after-free handler::ha_index_or_rnd_endMonty2018-05-233-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | MDEV-16123 ASAN heap-use-after-free handler::ha_index_or_rnd_end MDEV-13828 Segmentation fault on RENAME TABLE Problem was that destructor called methods for closed table. Fixed by removing code in destructor.
| | * MDEV-15308 Assertion `ha_alter_info->alter_info->drop_list.elementsbb-10.0-montyMonty2018-05-223-4/+118
| | | | | | | | | | | | | | | Problem was that handle_if_exists_options() didn't correct alter_info->flags when things was removed from the list.
| | * MDEV-16229 Replication aborts with ER_VIEW_SELECT_TMPTABLE after half-failed ↵Monty2018-05-228-7/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RENAME Problem was that detection of temporary tables was all wrong for RENAME TABLE. (Temporary tables where opened by top level call to open_temporary_tables(), which can't detect if a temporary table was renamed to something and then reused). Fixed by adding proper parsing of rename list to check against the current name of a table at each rename stage. Also change do_rename_temporary() to check against the current state of temporary tables, not according to the state of start of RENAME TABLE.
| | * Fixes for Aria transaction handling with lock tablesMonty2018-05-2217-120/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-10130 Assertion `share->in_trans == 0' failed in storage/maria/ma_close.c MDEV-10378 Assertion `trn' failed in virtual int ha_maria::start_stmt The problem was that maria_handler->trn was not properly reset at commit/rollback and ha_maria::exernal_lock() could get confused because. There was some old code in ha_maria::implicit_commit() that tried to take care of this, but it was not bullet proof. Fixed by adding list of all tables that is part of the maria transaction to TRN. A nice side effect was of the fix is that loops in ha_maria::implict_commit() got to be much simpler. Other things: - Fixed a bug in mysql_admin_table() where argument open_for_modify was wrongly reset for the next table in the chain - rollback admin command also in case of fatal error. - Split _ma_set_trn_for_table() to three version to simplify code and debugging. - Several new asserts to detect the original problem (that file was not properly removed from trn before calling ma_close())
| * | MDEV-10259 mysqld crash with certain statement length and...sachin2018-05-225-3/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | order with Galera and encrypt-tmp-files=1 Problem:- If trans_cache (IO_CACHE) uses encrypted tmp file then on next DML server will crash. Case:- Lets take a case , we have a table t1 , We try to do 2 inserts in t1 1. A really long insert so that trans_cache has to use temp_file 2. Just a small insert Analysis:- Actually server crashes from inside of galera library. /lib64/libc.so.6(abort+0x175)[0x7fb5ba779dc5] /usr/lib64/galera/libgalera_smm.so(_ZN6galera3FSMINS_9TrxHandle5State... mysys/stacktrace.c:247(my_print_stacktrace)[0x7fb5a714940e] sql/signal_handler.cc:160(handle_fatal_signal)[0x7fb5a715c1bd] sql/wsrep_hton.cc:257(wsrep_rollback)[0x7fb5bcce923a] sql/wsrep_hton.cc:268(wsrep_rollback)[0x7fb5bcce9368] sql/handler.cc:1658(ha_rollback_trans(THD*, bool))[0x7fb5bcd4f41a] sql/handler.cc:1483(ha_commit_trans(THD*, bool))[0x7fb5bcd4f804] but actual issue is not in galera but in mariadb, because for 2nd insert we should never call rollback. We are calling rollback because log_and_order fails it fails because write_cache fails , It fails because after reinit_io_cache(trans_cache) , my_b_bytes_in_cache says 0 so we look into tmp_file for data , which is obviously wrong since temp was used for previous insert and it no longer exist. wsrep_write_cache_inc() reads the IO_CACHE in a loop, filling it with my_b_fill() until it returns "0 bytes read". Later MYSQL_BIN_LOG::write_cache() does the same. wsrep_write_cache_inc() assumes that reading a zero bytes past EOF leaves the old data in the cache Solution:- There is two issue in my_b_encr_read 1st we should never equal read_end to info->buffer. I mean this does not make sense read_end should always point to end of buffer. 2nd For most of the case(apart from async IO_CACHE) info->pos_in_file should be equal to info->buffer position wrt to temp file , since in this case we are not changing info->buffer it should remain unchanged.
| * | MDEV-12900: spider tests failed in buildbot with valgrindJacob Mathew2018-05-213-83/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The failures with valgrind occur as a result of Spider sometimes using the wrong transaction for operations in background threads that send requests to the data nodes. The use of the wrong transaction caused the networking to the data nodes to use the wrong thread in some cases. Valgrind eventually detects this when such a thread is destroyed before it is used to disconnect from the data node by that wrong transaction when it is freed. I have fixed the problem by correcting the transaction used in each of these cases. Author: Jacob Mathew. Reviewer: Kentoku Shiba. Cherry-Picked: Commit afe5a51 on branch 10.2
* | | Fixed archive to work with record[1]Monty2018-05-241-6/+6
| | | | | | | | | | | | | | | | | | ha_archive::max_row_length() and ha_archive::pack_row() didn't use record parameter properly. Especially testing of null was wrong for record[1]
* | | MDEV-15243 Crash with virtual fields and row based binary loggingMonty2018-05-248-49/+569
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cause of this was several different bugs: - When using binary logging with binlog_row_image=FULL the all bits in read_set was set, which caused a different (wrong) pattern for marking vcol_set. - TABLE::mark_virtual_columns_for_write() didn't in all cases mark vcol_set with the vcol_field. - TABLE::update_virtual_fields() has to update all vcol fields on REPLACE if binary logging with FULL is used. - VCOL_UPDATE_INDEXED should update all vcol fields part of an index that was not updated by VCOL_UPDATE_FOR_READ - max_row_length() calculated length of NULL and not used fields. This didn't cause any crash, but used more memory than needed.
* | | MDEV-13779 InnoDB fails to shut down purge, causing hangMarko Mäkelä2018-05-243-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | thd_destructor_proxy(): Ensure that purge actually exits, like the logic should have been ever since MDEV-14080. srv_purge_shutdown(): A new function to wait for the purge coordinator to exit. Before exiting, the purge coordinator will ensure that all purge workers have exited.
* | | MDEV-16267 Wrong INFORMATION_SCHEMA.INNODB_BUFFER_PAGE.TABLE_NAMEMarko Mäkelä2018-05-243-105/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the MariaDB 10.2 version of the patch. field_store_string(): Simplify the code. field_store_index_name(): Remove, and use field_store_string() instead. Starting with MariaDB 10.2.2, there is the predicate dict_index_t::is_committed(), and dict_index_t::name never contains the magic byte 0xff. Correct some comments to refer to TEMP_INDEX_PREFIX_STR. i_s_cmp_per_index_fill_low(): Use the appropriate value NULL to identify that an index was not found. Check that storing each column value succeeded. i_s_innodb_buffer_page_fill(), i_s_innodb_buf_page_lru_fill(): Only invoke Field::set_notnull() if the index was found. (This fixes the bug.) i_s_dict_fill_sys_indexes(): Adjust the index->name that was directly loaded from SYS_INDEXES.NAME (which can start with the 0xff byte). This was the only function that depended on the translation in field_store_index_name().
* | | MDEV-16262: rocksdb.issue255 test sometimes fails in buildbotSergei Petrunia2018-05-232-2/+2
| | | | | | | | | | | | | | | Fix an obvious typo: replace_column should be applied to SHOW TABLE STATUS, not to SELECT * FROM t1.
* | | Suppress warnings from partition_open_files_limitMonty2018-05-231-0/+4
| | |
* | | MDEV-15338 Crash in debug build when dropping column that is part of CHECKMonty2018-05-233-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | Crash happened when deleting all columns that was part of a check constraint The bug was that read map for from table was used when checking CHECK constraint and was not properly reset in copy_data_between_tables()
* | | MDEV-12439: MariaRocks produces numerous (spurious?) valgrind failuresSergei Petrunia2018-05-221-0/+3
| | | | | | | | | | | | | | | | | | Step#1: RocksDB files require a special #define when they are compiled with valgrind. Without that, valgrind fails with an 'unimplemented syscall' error for fcntl call.
* | | MDEV-12900: spider tests failed in buildbot with valgrindJacob Mathew2018-05-213-83/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The failures with valgrind occur as a result of Spider sometimes using the wrong transaction for operations in background threads that send requests to the data nodes. The use of the wrong transaction caused the networking to the data nodes to use the wrong thread in some cases. Valgrind eventually detects this when such a thread is destroyed before it is used to disconnect from the data node by that wrong transaction when it is freed. I have fixed the problem by correcting the transaction used in each of these cases. Author: Jacob Mathew. Reviewer: Kentoku Shiba. Merged: Commit 4d576d9 on branch bb-10.3-MDEV-12900
* | | Set MyRocks plugin version to StableSergei Petrunia2018-05-212-14/+14
| | |
* | | .gitignoreSergei Golubchik2018-05-201-0/+2
| | |
* | | Merge branch '10.1' into 10.2Sergei Golubchik2018-05-2036-144/+353
|\ \ \ | |/ /
| * | Merge branch '10.0' into 10.1Sergei Golubchik2018-05-1928-110/+333
| |\ \ | | |/
| | * Merge branch '5.5' into 10.0Sergei Golubchik2018-05-1914-79/+145
| | |\
| | | * MDEV-16220 MTR - do not pass UTF8 on the command line for mysql client.Vladislav Vaintroub2018-05-186-23/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It should work ok on all Unixes, but on Windows ,only worked by accident in the past, with client not being Unicode safe. It stopped working with Visual Studio 2017 15.7 update now.
| | | * MDEV-15318 CREATE .. SELECT VALUES produces invalid table structureSergei Golubchik2018-05-173-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | When Item_insert_value needs a dummy field, use zero-length Field_string, not Field_null. The latter isn't compatible with CREATE ... SELECT.
| | | * (almost) sane core handling in mtrSergey Vojtovich2018-05-161-36/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analyze core independently of max-save-datadir and max-save-core setting. Increment $num_saved_cores only if core was actually saved. "Move any core files from e.g. mysqltest" independently of max-save-datadir setting. Note: it may overwrite core from mysqld, which might not be desired (it did work this way even before).
| | | * MDEV-654 Assertion `share->now_transactional' failed in flush_log_for_bitmap ↵Monty2018-05-152-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on concurrent workload with Aria tables Problem was that we the bitmap needs to be flushed before disabling logging of redo entires, as writing the bitmap to disk by background checkpoint may cause redo entries.
| | * | MDEV-11129 CREATE OR REPLACE TABLE t1 AS SELECT spfunc() crashes if spfunc() ↵Sergei Golubchik2018-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | references t1 fix a typo that broke the main.view test followup for ef295c31e3d
| | * | MDEV-11129 CREATE OR REPLACE TABLE t1 AS SELECT spfunc() crashes if spfunc() ↵Monty2018-05-167-22/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | references t1 Fixed by extending unique_table() with a flag to not allow usage of the replaced table. I also cleaned up find_dup_table() to not use goto next. I also added more comments to the code in find_dup_table()
| | * | Fix that FLUSH TABLES FOR EXPORT also works for Aria tables.Monty2018-05-165-1/+43
| | | | | | | | | | | | | | | | - Added missing test case for MyISAM
| | * | MDEV-14943 Alter table ORDER BY bugMonty2018-05-155-8/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that if copy_data_between_tables() didn't do proper clean up in case of failures: - copy object was not properly freed - end_bulk_insert() was not called - mysql_trans_prepare_alter_copy_data() set THD->transaction.on to false which was not properly restored The last part caused a crash in Aria as Aria depends on that THD is correct. Other things: - Reset info->switched_transactional after usage (safety) - Reset bulk_insert_single_undo (safety)
| * | | MDEV-7914: spider/bg.ha, spider/bg.ha_part crash server sporadically in buildbotJacob Mathew2018-05-184-36/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crash occurs when a thread that is closing its connection attempts to access Spider transaction information when another thread has freed that memory while processing Spider plugin deinit. This occurs because Spider does not adjust the plugin's reference count when it sets a transaction information pointer for the plugin. The fix I implemented changes the way Spider sets the transaction information pointer to use thd_set_ha_data() so that Spider's plugin reference counter is adjusted as well. Author: Jacob Mathew. Reviewer: Kentoku Shiba. Merged From: Commit ab9d420 on branch 10.2
| * | | MDEV-15347: Valgrind or ASAN errors in mysql_make_view on query from ↵Oleksandr Byelkin2018-05-1511-34/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | information_schema Make each lex pointing to statement lex instead of global pointer in THD (no need store and restore the global pointer and put it on SP stack).
* | | | cleanup: specify memroot explicitly in `new Explain_xxx`Sergei Golubchik2018-05-191-3/+3
| | | |
* | | | MDEV-16153 Server crashes in Apc_target::disable, ASAN heap-use-after-free ↵Sergei Golubchik2018-05-193-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in Explain_query::~Explain_query upon/after EXECUTE IMMEDIATE Explain_query must be created in the execution arena. But JOIN::optimize_inner temporarily switches to the statement arena under `if (sel->first_cond_optimization)`. This might cause Explain_query to be allocated in the statement arena. Usually it is harmless (although technically incorrect and a waste of memory), but in case of EXECUTE IMMEDIATE, Prepared_statement object and its statement arena are destroyed before log_slow_statement() call, which uses Explain_query. Fix: 1. Create Explain_query before switching arenas. 2. Before filling earlier-created Explain_query with data, set thd->mem_root from the Explain_query::mem_root
* | | | mariabackup : Fix race condition when killing query waiting for MDLVladislav Vaintroub2018-05-191-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Itcan happen that the connection is already gone during the window between quering I_S.PROCESSLIST and KILL QUERY. Fix is to tolerate ER_NO_SUCH_THREAD returned from KILL QUERY. Add small improvement in message "Killing MDL query " to actually output the query. Also do not try to kill queries that are already in Killed state.
* | | | MDEV-12465: Server crashes in my_scan_weight_utf8_bin upon collecting stats ↵Sergei Petrunia2018-05-193-2/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | for RocksDB table Apply patch by Oleksandr Byelkin: Do not use "only index read" in analyzing indices if there is a field which present in the index only partially.
* | | | MDEV-16200: -DPLUGIN_ROCKSDB=YES leads to errors during buildSergei Petrunia2018-05-181-1/+1
| | | | | | | | | | | | | | | | Mark the plugin as dynamic-only.
* | | | MDEV-15304: Server crash in print_keydup_error / key_unpack or unexpected ↵Sergei Petrunia2018-05-184-8/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ER_DUP_KEY Fix two issues: 1. Rdb_ddl_manager::rename() loses the value of m_hidden_pk_val. new object used to get 0, which means "not loaded from the db yet". 2. ha_rocksdb::load_hidden_pk_value() uses current transaction (and its snapshot) when loading hidden PK value from disk. This may cause it to load an out-of-date value.
* | | | MDEV-15581 Incorrect result (missing row) with UNION DISTINCT in anchor partsIgor Babaev2018-05-177-4/+72
| | | | | | | | | | | | | | | | | | | | | | | | The current code does not support recursive CTEs whose specifications contain a mix of ALL UNION and DISTINCT UNION operations. This patch catches such specifications and reports errors for them.
* | | | bump the VERSIONDaniel Bartholomew2018-05-181-1/+1
| | | |
* | | | MDEV-16212 Memory leak with recursive CTE that uses global ORDER BYIgor Babaev2018-05-173-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with recursive subquery There were two problems: 1. The code did not report that usage of global ORDER BY / LIMIT clauses was not supported yet. 2. The code just reset fake_select_lex of the the unit specifying a recursive CTE to NULL and that caused memory leaks in some cases.
* | | | MDEV-7914: spider/bg.ha, spider/bg.ha_part crash server sporadically in buildbotJacob Mathew2018-05-174-36/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crash occurs when a thread that is closing its connection attempts to access Spider transaction information when another thread has freed that memory while processing Spider plugin deinit. This occurs because Spider does not adjust the plugin's reference count when it sets a transaction information pointer for the plugin. The fix I implemented changes the way Spider sets the transaction information pointer to use thd_set_ha_data() so that Spider's plugin reference counter is adjusted as well. Author: Jacob Mathew. Reviewer: Kentoku Shiba. Merged From: Commit eabfadc on branch bb-10.3-MDEV-7914
* | | | Merge branch '10.2' into bb-10.2-releaseSergei Golubchik2018-05-171-2/+12
|\ \ \ \
| * | | | MDEV-13779 InnoDB fails to shut down purge workers, causing hangMarko Mäkelä2018-05-161-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | srv_purge_coordinator_thread(): Wait for all purge worker threads to actually exit. An analysis of a core dump of a hung 10.3 server revealed that one srv_worker_thread did not exit, even though the purge coordinator had exited. This caused kill_server_thread and mysqld_main to wait indefinitely. The main InnoDB shutdown was never called, because unireg_end() was never called.
* | | | | MDEV-16183 TokuDB tests fail on Fedora 28mariadb-10.2.15Sergei Golubchik2018-05-163-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | jemalloc > 5.0.0 doesn't like to be linked with a dlopen-ed module. Don't link tokudb with jemalloc on Fedora 28, LD_PRELOAD it instead with mysqld_safe and with systemd.
* | | | | MDEV-16187 Ubuntu Bionic MariaDB has epoch version that makes 10.1 and 10.2 ↵Sergei Golubchik2018-05-161-2/+5
|/ / / / | | | | | | | | | | | | installs fail