summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-20804 Speed up main.index_merge_innodbMarko Mäkelä2019-10-119-272/+83
| | | | | | | | | | | | | | | | | | | | | The test main.index_merge_innodb is taking very much time, especially on later versions (10.2 and 10.3). Some of this could be attributed to the use of INSERT...SELECT, which is time-consumingly creating explicit record locks in InnoDB for the locking read in the SELECT part. In 10.3 and later, some slowness can be attributed to MDEV-12288, which makes the InnoDB purge thread spend time to reset transaction identifiers in the inserted records. If we prevent purge from running before all tables are dropped, the test seems to be 10% faster on an unoptimized debug build on 10.5. (A proper fix would be to implement MDEV-515 and stop writing row-level undo log records for inserts into an empty table or partition.) At the same time, it should not hurt to make main.index_merge_myisam to use the sequence engine. Not only could it be a little faster, but the test would be slightly more readable.
* Merge 5.5 into 10.1Marko Mäkelä2019-10-082-22/+0
|\
| * Remove orphan declaration buf_flush_wait_batch_end_wait_only()Marko Mäkelä2019-10-072-22/+0
| | | | | | | | | | The function was declared but not defined in commit 9d6d1902e091c868bb288e0ccf9f975ccb474db9
* | MDEV-19536 - Server crash or ASAN heap-use-after-free in is_temporary_table /Sergey Vojtovich2019-10-075-64/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | read_statistics_for_tables_if_needed Regression after 279a907, read_statistics_for_tables_if_needed() was called after open_normal_and_derived_tables() failure. Fixed by moving read_statistics_for_tables() call to a branch of get_schema_stat_record() where result of open_normal_and_derived_tables() is checked. Removed THD::force_read_stats, added read_statistics_for_tables() instead. Simplified away statistics_for_command_is_needed().
* | Cleanup EITSSergey Vojtovich2019-10-023-47/+34
| | | | | | | | | | Moved EITS allocation inside read_statistics_for_tables_if_needed(). Removed redundant is_safe argument.
* | Merge remote-tracking branch 'origin/5.5' into 10.1Alexander Barkov2019-10-013-8/+50
|\ \ | |/
| * MDEV-20704 An index on a double column erroneously uses prefix compressionAlexander Barkov2019-10-013-8/+50
| |
* | MDEV-20645: Replication consistency is broken as workers miss the error ↵Sujatha2019-09-306-0/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | notification from an earlier failed group. Analysis: ======== In general if there are three groups. 1 - Inserts 32 which fails due to local entry '32' on slave. 2 - Inserts 33 3 - Inserts 34 Each group considers itself as a waiter and it waits for prior group 'waitee'. This is done in 'register_wait_for_prior_event_group_commit'. If there is no other parallel group being scheduled then no waitee will be there. Let us assume 3 groups are being scheduled in parallel. 3-> waits for 2-> waits for->1 '1' upon completion it checks is there any registered subsequent waiter. If so it wakes up the subsequent waiter with its execution status. This execution status is stored in wakeup_error. If '1' failed then it sends corresponding wakeup_error to 2. Then '2' aborts and it propagates error to '3'. So all further commits are aborted. This mechanism works only when all transactions reach a stage where they are waiting for their prior commit to complete. In case of optimistic following scenario occurs. 1,2,3 are scheduled in parallel. 3 - Reaches group_commit_code waits for 2 to complete. 1 - errors out sets stop_on_error_sub_id=1. When a group execution results in error its corresponding sub_id is set to 'stop_on_error_sub_id'. Any new groups queued for execution will check if their sub_id is > stop_on_error_sub_id. If it is true their execution will be skipped as prior group execution failed. 'skip_event_group=1' will be set. Since the execution of SQL thread is about to stop we just skip execution of all the following event groups. We still do all the normal waiting and wakeup processing between the event groups as a simple way to ensure that everything is stopped and cleaned up correctly. Upon error '1' transaction checks for registered waiters. Since no one is there it simply goes away. 2 - Starts the execution. It checks do I have a waitee. Since wait_commit_sub_id == entry->last_committed_sub_id no waitee is set. Secondly: 'entry->stop_on_error_sub_id' is set by '1'st execution. Now 'handle_parallel_thread' code checks if the current group 'sub_id' is greater than the 'sub_id' set within 'stop_on_error_sub_id'. Since the above is true 'skip_event_group=true' is set. Simply call 'wait_for_prior_commit' to wakeup all waiters. Group '2' didn't had any waitee and its execution is skipped. Hence its wakeup_error=0.It sends a positive wakeup signal to '3'. Which commits. This results in a missed transaction. i.e 33 is missed and 34 is committed. Fix: === When a worker learns that an earlier transaction execution has failed, and it should not proceed for further execution, it should mark its own execution status as failed so that it alerts its followers to abort as well.
* | chkconfig in RPM server scriptletsSergei Golubchik2019-09-271-1/+1
| | | | | | | | | | | | | | chkconfig --add and --del [might] invoke /sbin/insserv and even if chkconfig exists, insserv might not (SLES15). Ignore chkconfig --del errors - it's a "best effort" cleanup anyway
* | MDEV-20614: Syntax error, and option put in wrong placeJulius Goryavsky2019-09-261-2/+3
| | | | | | | | | | | | A syntax error in the mysqld_multi.sh script has been fixed here + a "--defaults-group-suffix" option has been moved to the top of the mysqld options list.
* | Speed up main.sum_distinct-bigMarko Mäkelä2019-09-252-71/+17
| | | | | | | | | | | | | | | | Eliminate one InnoDB table with 128*16384 rows, and use the sequence engine instead. Also, run everything in a single transaction, to prevent purge from running concurrently unnecessarily. (Starting with MariaDB Server 10.3, purge would reset the DB_TRX_ID after INSERT.)
* | Merge remote-tracking branch 'origin/5.5' into 10.1Alexander Barkov2019-09-2433-44/+257
|\ \ | |/
| * MDEV-20495 Assertion `precision > 0' failed in decimal_bin_size upon CREATE ↵Alexander Barkov2019-09-2411-7/+222
| | | | | | | | | | | | | | | | | | | | | | | | .. SELECT with zerofilled decimal Also fixes: MDEV-20560 Assertion `precision > 0' failed in decimal_bin_size upon SELECT with MOD short unsigned decimal Changing the way how Item_func_mod calculates its max_length. It now uses decimal_precision(), decimal_scale() and unsigned_flag of its arguments, like all other Item_num_op descendants do.
| * Update mysqld_safe.sh - introduce defaults-group-suffix handlingrantal2019-09-211-1/+4
| | | | | | | | "--defaults-group-suffix" must be be given as the first argument on the command-line of mysqld
| * MDEV-4968 Old advices in mysql-log-rotate scriptchriscalender2019-09-211-5/+5
| | | | | | | | | | | | | | * Change the comments in mysql-log-rotate.sh to refer to mysqld, not mysqld_safe as that's what most distros are using. * Change err-log to log-error as err-log is no longer valid. * Convert tab to space for consistency.
| * Fix spelling mistakes in MyISAM code commentsIan Gilfillan2019-09-2019-29/+29
| |
| * MDEV-20596 Configure fails with newer CMakeRyan Coe2019-09-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix build error with newer cmake Fixes the following build error: CMake Error at cmake/os/Linux.cmake:29 (STRING): STRING sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): CMakeLists.txt:101 (INCLUDE) CMake Error at cmake/os/Linux.cmake:29 (STRING): STRING sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): CMakeLists.txt:101 (INCLUDE) The error happens when CMAKE_SHARED_LINKER_{LANG}_FLAGS is not set. Force the variable to be set to "" as input to prevent this. Signed-off-by: Ryan Coe <bluemrp9@gmail.com> Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
* | MDEV-18094: Query with order by limit picking index scan over filesortVarun Gupta2019-09-216-9/+62
| | | | | | | | | | | | In the function test_if_cheaper_ordering we make a decision if using an index is better than using filesort for ordering. If we chose to do range access then in test_quick_select we should make sure that cost for table scan is set to DBL_MAX so that it is not picked.
* | MDEV-19207 systemd service: add instance name in descriptionChristian Hesse2019-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | The unit files made systemd print: systemd[1]: Started MariaDB 10.3.13 database server (multi-instance). Let's add the instance name, so starting mariadb@foo.service makes it print: systemd[1]: Started MariaDB 10.3.13 database server (multi-instance foo).
* | MDEV-19211 Fix mysqld_safe --dry-runVicențiu Ciorbaru2019-09-211-1/+7
| | | | | | | | | | | | | | | | | | mysqld_safe --dry-run needs to either call exit or return, depending if it is being sourced or not, otherise return can lead to the error: return: can only `return' from a function or sourced script The original fix suggestion was proposed by FaramosCZ <mschorm@centrum.cz>
* | Deb: Implement proper version detection in maintainer scriptsOtto Kekäläinen2019-09-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Fixes bug introduced in commit 5415002. Using script run-time filename does not always work. One cannot assume that the filename is always the same as there might be temporary file names used by dpkg in certain situations. See Debian #920415. The same fix has been successfully in use in Debian official packages since February 2019: https://salsa.debian.org/mariadb-team/mariadb-10.3/commit/6440c0d6e75
* | MDEV-19529 InnoDB hang on DROP FULLTEXT INDEXThirunarayanan Balathandayuthapani2019-09-1826-490/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======= During dropping of fts index, InnoDB waits for fts_optimize_remove_table() and it holds dict_sys->mutex and dict_operaiton_lock even though the table id is not present in the queue. But fts_optimize_thread does wait for dict_sys->mutex to process the unrelated table id from the slot. Solution: ======== Whenever table is added to fts_optimize_wq, update the fts_status of in-memory fts subsystem to TABLE_IN_QUEUE. Whenever drop index wants to remove table from the queue, it can check the fts_status to decide whether it should send the MSG_DELETE_TABLE to the queue. Removed the following functions because these are all deadcode. dict_table_wait_for_bg_threads_to_exit(), fts_wait_for_background_thread_to_start(),fts_start_shutdown(), fts_shudown().
* | MDEV-19647 Server hangs after dropping full text indexes and restartThirunarayanan Balathandayuthapani2019-09-174-6/+27
| | | | | | | | | | - There is no need to add the table in fts_optimize_wq if there is no fts indexes associated with it.
* | Adjusted test results after the change of a test caseIgor Babaev2019-09-131-1/+1
| |
* | Post fix after the patch for MDEV-20576.Igor Babaev2019-09-135-17/+17
| | | | | | | | Adjusted test results.
* | MDEV-20576 A new assertion added to check validity of calculatedIgor Babaev2019-09-128-4/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | selectivity values fails After having set the assertion that checks validity of selectivity values returned by the function table_cond_selectivity() a test case from order_by.tesst failed. The failure occurred because range optimizer could return as an estimate of the cardinality of the ranges built for an index a number exceeding the total number of records in the table. The second bug is more subtle. It may happen when there are several indexes with same prefix defined on the first joined table t accessed by a constant ref access. In this case the range optimizer estimates the number of accessed records of t for each usable index and these estimates can be different. Only the first of these estimates is taken into account when the selectivity of the ref access is calculated. However the optimizer later can choose a different index that provides a different estimate. The function table_condition_selectivity() could use this estimate to discount the selectivity of the ref access. This could lead to an selectivity value returned by this function that was greater that 1.
* | Merge 5.5 into 10.1Marko Mäkelä2019-09-112-2/+2
|\ \ | |/ | | | | Null merge the MDEV-14383 fix; it affects 5.5 only.
| * MDEV-14383 tokudb_bugs. tests failed in buildbot, lost connection to serverSergei Golubchik2019-09-016-0/+18
| | | | | | | | | | don't run tokudb tests under tcmalloc, this is not a supported combination.
| * MDEV-19837 and MDEV-19816: Change some commentsStephen Long2019-08-212-2/+2
| |
* | MDEV-16594 ALTER DATA DIRECTORY in PARTITIONS of InnoDB storage does nothing ↵Alexey Botchkov2019-09-095-0/+323
| | | | | | | | | | | | | | | | silently InnoDB intentionally (it's a documented behavior) ignores changing of DATA DIRECTORY and INDEX DIRECTORY for partitions. Though we should issue warning when this happens.
* | MDEV-20137 rpl.mdev_17588 fails in buildbot with "Table doesn't exist"Sachin2019-09-042-17/+18
| | | | | | | | Fix the test case.
* | MDEV-17683 sys_vars.delayed_insert_limit_func fails in buildbot with wrong ↵Alexey Botchkov2019-09-032-33/+11
| | | | | | | | | | | | result. Test fixed to be deterministic.
* | MDEV-17610 - fix result, for the case when test runs with userstat=onVladislav Vaintroub2019-09-032-2/+2
| |
* | Improved handling of subdirectories in the xtrabackup-v2 SST scripts ↵Julius Goryavsky2019-08-282-8/+35
| | | | | | | | (similar to MDEV-18863) for more predictable test results (related to xtrabackup-v2 SST)
* | fix clang warningsEugene Kosov2019-08-282-2/+2
| |
* | Enable galera_sst_mysqldump_with_key test case.Jan Lindström2019-08-271-1/+0
| |
* | MDEV-19699 Server crashes in Item_null_result::field_type upon SELECT with ↵Alexander Barkov2019-08-276-0/+147
| | | | | | | | | | | | | | | | ROLLUP on constant table Also fixes: MDEV-20431 GREATEST(int_col,date_col) returns wrong results in a view
* | MDEV-20420: SST failed after MDEV-18863 in some test configurationsJulius Goryavsky2019-08-266-57/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | After applying MDEV-18863, in some test configurations, SST may fails due to duplication of some parameters (in particular "--port") in the main part of the command line and after "--mysqld-args", as well as due to incorrect interpretation of the parameter "--port" passed after "--mysqld-args" when the SST script is invoked without explicitly specifying a port for SST. In addition, it is necessary to correctly handle spaces, quotation marks and special characters when copying original arguments from the argv[] array to a new command line (after "--mysqld-args"). This patch resolves these shortcomings.
* | MDEV-20188: binlog.binlog_stm_drop_tmp_tbl fails in buildbot with Unknown ↵Sujatha2019-08-263-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | table on exec Analysis: ======== As part of BUG#28642318 fix, two new test cases were added. The first test case tests a scenario where two sessions are present, in which the first session has a regular table named 't1' and another session has a temporary table named 't1'. Test executes a DELETE statement on regular table. These statements are captured from binary log and replayed back on new client connection to prove that DELETE statement is applied successfully. Note that the binlog contains only CREATE TEMPORARY TABLE part hence a temporary table gets created in new connection. This replaying logic is implemented by using '--exec $MYSQL' command. If the new connection gets disconnected within the scope of first test case the test passes, i.e the temporary table gets dropped as part thread cleanup. But on slow platforms the connection gets closed at the time of execution of test case 2. When the temporary table is dropped as part thread cleanup a "DROP TEMPORARY TABLE t1" is written into the binary log. In test case two the same sessions continue to exist and and table names are reused to test a new bug scenario. The additional "DROP TEMPORARY TABLE" command drops second test specific tables which results in "Unknown table" error. Fix: ==== Rename the second case specific table to 't2'. Even if the close connection from test case one happens later the drop command with has 'DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`' will not result in an error.
* | row_undo_mod_remove_clust_low(): Remove duplicated codeMarko Mäkelä2019-08-221-31/+1
| | | | | | | | | | | | Some code was duplicated near the start of the function, only for InnoDB, not XtraDB. This was noticed by comparing the InnoDB between MariaDB and MySQL.
* | Fix -Wstringop-truncationMarko Mäkelä2019-08-222-6/+8
| | | | | | | | | | For the Sphinx storage engine, this is a functional change (bug fix): we will ensure that the message buffer is always NUL-terminated.
* | Bash-specific operator replaced by a universal oneJulius Goryavsky2019-08-211-1/+1
| |
* | ensure that pam plugin is present in release packagesSergei Golubchik2019-08-201-0/+1
| |
* | really make CPACK_RPM_DEBUGINFO_PACKAGE configurableSergei Golubchik2019-08-201-1/+2
| |
* | MDEV-18863: Fix -Wsign-compareMarko Mäkelä2019-08-201-3/+3
| |
* | Merge 5.5 into 10.1Marko Mäkelä2019-08-203-28/+460
|\ \ | |/
| * MDEV-20265 Unknown column in field listIgor Babaev2019-08-193-28/+460
| | | | | | | | | | | | | | | | | | This patch corrects the fix of the patch for mdev-19421 that resolved the problem of parsing some embedded join expressions such as t1 join t2 left join t3 on t2.a=t3.a on t1.a=t2.a. Yet the patch contained a bug that prevented proper context analysis of the queries where such expressions were used together with comma separated table references in from clauses.
* | MDEV-19034 ASAN unknown-crash in get_date_time_separator with ↵Alexander Barkov2019-08-203-1/+26
| | | | | | | | PAD_CHAR_TO_FULL_LENGTH
* | MDEV-18863: Galera SST scripts can't read [mysqldN] option groupsJulius Goryavsky2019-08-196-15/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some users and some scripts (for example, mysqld_multi.sh) use special option groups with names like [mysqld1], [mysqld2], ..., [mysqldN]. But SST scripts can't currently fully support these option groups. The only option group-related value it gets from the server is --defaults-group-suffix, if that option was set for mysqld when the server was started. However, the SST scripts does not get told by the server to read these option groups, so this means that the SST script will fail to read options like innodb-data-home-dir when it is in a option group like [mysqld1]...[mysqldN]. Moreover, SST scripts ignore many parameters that can be passed to them explicitly and cannot transfer them further, for example, to the input of mariabackup utility. Ideally, we want to transfer all the parameters of the original mysqld call to utilities such as mariabackup, however the SST script does not receive these parameters from the server and therefore cannot transfer them to mariabackup. To correct these shortcomings, we need to transfer to the scripts all of the parameters of the original mysqld call, and in the SST scripts themselves provide for the transfer all of these parameters to utilities such as mariabackup. To prevent these parameters from mixing with the script's own parameters, they should be transferred to SST script after the special option "--mysqld-args", followed by the string argument with the original parameters, as it received by the mysqld call at the time of launch (further all these parameters will be passed to mariabackup, for example). In addition, the SST scripts themselves must be refined so that they can read the parameters from the user-selected group, not just from the global mysqld configuration group. And also so that they can receive the parameters (which important for their work) as command-line arguments.
* | Merge remote-tracking branch 'origin/5.5' into 10.1Alexander Barkov2019-08-163-2/+70
|\ \ | |/