summaryrefslogtreecommitdiff
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.0' into 10.1Sergei Golubchik2016-08-2532-180/+386
|\
| * MDEV-10563 Crash during shutdown in Master_info_index::any_slave_sql_runningVicențiu Ciorbaru2016-08-235-19/+26
| | | | | | | | | | | | | | | | | | In well defined C code, the "this" pointer is never NULL. Currently, we were potentially dereferencing a NULL pointer (master_info_index). GCC v6 removes any "if (!this)" conditions as it assumes this is always a non-null pointer. In order to prevent undefined behaviour, check the pointer before dereferencing and remove the check within member functions.
| * Fixed compiler error and some warnings on windowsMonty2016-08-233-3/+3
| |
| * Minor cleanupsMonty2016-08-222-3/+1
| | | | | | | | | | - Remove impossible test in test_quick_select - Ensure that is_fatal_error is set if we run out of stack space
| * MDEV-10630 rpl.rpl_mdev6020 fails in buildbot with timeoutMonty2016-08-222-7/+19
| | | | | | | | | | | | | | | | | | | | The issue was that when running with valgrind the wait for master_pos_Wait() was not long enough. This patch also fixes two other failures that could affect rpl_mdev6020: - check_if_conflicting_replication_locks() didn't properly check domains - 'did_mark_start_commit' was after signals to other threads was sent which could get the variable read too early.
| * Fixed "Packets out of order" warning message on stdout in clients,Monty2016-08-212-32/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compiled for debugging, when the server goes down This happens in the following scenario: - Server gets a shutdown message - Servers sends error ER_CONNECTION_KILLED to the clients connection - The client sends a query to the server, before the server has time to close the connection to the client - Client reads the ER_CONNECTION_KILLED error message In the above case, the packet number for the reply is one less than what the client expected and the client prints "Packets out of order". Fixed the following way: - The client accepts now error packages with a packet number one less than expected. - To ensure that this issue can be detected early in my_real_read(), error messages sent to the client are not compressed, even when compressed protocol is used.
| * Added new status variables to make it easier to debug certain problems:Monty2016-08-217-3/+27
| | | | | | | | | | | | - Handler_read_retry - Update_scan - Delete_scan
| * Cleanups and minor fixesMonty2016-08-214-18/+3
| | | | | | | | | | | | | | | | - Fixed typos - Added --core-on-failure to mysql-test-run - More DBUG_PRINT in viosocket.c - Don't forget CLIENT_REMEMBER_OPTIONS for compressed slave protocol - Removed not used stage variables
| * Merge branch 'bb-10.0-serg' into 10.0Sergei Golubchik2016-08-1414-125/+190
| |\
| | * Merge branch '5.5' into 10.0Sergei Golubchik2016-08-1014-125/+190
| | |\
| | | * MDEV-10465 general_log_file can be abusedSergei Golubchik2016-08-091-0/+4
| | | | | | | | | | | | | | | | Windows!
| | | * MDEV-10465 general_log_file can be abusedSergei Golubchik2016-08-081-7/+7
| | | | | | | | | | | | | | | | followup
| | | * MDEV-9304: MariaDB crash with specific queryVicențiu Ciorbaru2016-08-081-0/+6
| | | | | | | | | | | | | | | | | | | | tmp_join may get its tables freed twice during JOIN cleanup. Set them to NULL when the tmp_join is different than the current join.
| | | * MDEV-10468 Assertion `nr >= 0.0' failed in Item_sum_std::val_real()Alexander Barkov2016-08-081-0/+2
| | | |
| | | * MDEV-10500 CASE/IF Statement returns multiple values and shifts further ↵Alexander Barkov2016-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | result values to the next column We assume all around the code that null_value==true is in sync with NULL value returned by val_str()/val_decimal(). Item_sum_sum::val_decimal() erroneously returned a non-NULL value together with null_value set to true. Fixing to return NULL instead.
| | | * Merge branch 'bb-5.5-serg' into 5.5Sergei Golubchik2016-08-044-34/+74
| | | |\
| | | | * MDEV-10465 general_log_file can be abusedSergei Golubchik2016-08-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | This issue was discovered by Dawid Golunski (http://legalhackers.com)
| | | | * trivial cleanupSergei Golubchik2016-08-031-4/+6
| | | | |
| | | | * MDEV-6581 Writing to TEMPORARY TABLE not possible in read-onlySergei Golubchik2016-08-031-1/+2
| | | | | | | | | | | | | | | | | | | | don't mark transactions read-write if no real storage engine is affected (only binlog writes).
| | | | * Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-08-032-29/+59
| | | | |\ | | | | | | | | | | | | | | | | | | without a fix for Bug#12818255 (MDEV-6581)
| | | | | * BUG#23080148 - BACKPORT BUG 14653594 AND BUG 20683959 TOThayumanavar S2016-06-201-28/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MYSQL-5.5 The bug asks for a backport of bug#1463594 and bug#20682959. This is required because of the fact that if replication is enabled, master transaction can commit whereas slave can't commit due to not exact 'enviroment'. This manifestation is seen in bug#22024200.
| | | | | * Bug #23279858: MYSQLD GOT SIGNAL 11 ON SIMPLE SELECTSreeharsha Ramanavarapu2016-05-241-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NAME_CONST QUERY ISSUE: ------ Using NAME_CONST with a non-constant negated expression as value can result in incorrect behavior. SOLUTION: --------- The problem can be avoided by checking whether the argument is a constant value. The fix is a backport of Bug#12735545.
| | | | | * BUG#21142859: FUNCTION UPDATING A VIEW FAILS TO FIND TABLEKarthik Kamath2016-05-181-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | THAT ACTUALLY EXISTS ANALYSIS: ========= Stored functions updating a view where the view table has a trigger defined that updates another table, fails reporting an error that the table doesn't exist. If there is a trigger defined on a table, a variable 'trg_event_map' will be set to a non-zero value after the parsed tree creation. This indicates what triggers we need to pre-load for the TABLE_LIST when opening an associated table. During the prelocking phase, the variable 'trg_event_map' will not be set for the view table. This value will be set after the processing of triggers defined on the table. During the processing of sub-statements, 'locked_tables_mode' will be set to 'LTM_PRELOCKED' which denotes that further locking of tables/functions cannot be done. This results in the other table not being locked and thus further processing results in an error getting reported. FIX: ==== During the prelocking of view, the value of 'trg_event_map' of the view is copied to 'trg_event_map' of the next table in the TABLE_LIST. This results in the locking of tables associated with the trigger as well.
| | | | | * Bug#23251517: SEMISYNC REPLICATION HANGINGSujatha Sivakumar2016-05-135-101/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert following bug fix: Bug#20685029: SLAVE IO THREAD SHOULD STOP WHEN DISK IS FULL Bug#21753696: MAKE SHOW SLAVE STATUS NON BLOCKING IF IO THREAD WAITS FOR DISK SPACE This fix results in a deadlock between slave IO thread and SQL thread.
| | | | | * Bug#12818255: READ-ONLY OPTION DOES NOT ALLOWSujatha Sivakumar2016-05-044-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INSERTS/UPDATES ON TEMPORARY TABLES Bug#14294223: CHANGES NOT ALLOWED TO TEMPORARY TABLES ON READ-ONLY SERVERS Problem: ======== Running 5.5.14 in read only we can create temporary tables but can not insert or update records in the table. When we try we get Error 1290 : The MySQL server is running with the --read-only option so it cannot execute this statement. Analysis: ========= This bug is very specific to binlog being enabled and binlog-format being stmt/mixed. Standalone server without binlog enabled or with row based binlog-mode works fine. How standalone server and row based replication work: ===================================================== Standalone server and row based replication mark the transactions as read_write only when they are modifying non temporary tables as part of their current transaction. Because of this when code enters commit phase it checks if a transaction is read_write or not. If the transaction is read_write and global read only mode is enabled those transaction will fail with 'server is read only mode' error. In the case of statement based mode at the time of writing to binary log a binlog handler is created and it is always marked as read_write. In case of temporary tables even though the engine did not mark the transaction as read_write but the new transaction that is started by binlog handler is considered as read_write. Hence in this case when code enters commit phase it finds one handler which has a read_write transaction even when we are modifying temporary table. This causes the server to throw an error when global read-only mode is enabled. Fix: ==== At the time of commit in "ha_commit_trans" if a read_write transaction is found, we should check if this transaction is coming from a handler other than binlog_handler. This will ensure that there is a genuine read_write transaction being sent by the engine apart from binlog_handler and only then it should be blocked.
| | | * | | MDEV-10365 - Race condition in error handling of INSERT DELAYEDSergey Vojtovich2016-08-041-1/+1
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shared variables of Delayed_insert may be updated without mutex protection when delayed insert thread gets an error. Re-acquire mutex earlier, so that shared variables are protected.
| | | * | MDEV-10010 - potential deadlock on windows due to recursiveVladislav Vaintroub2016-08-033-65/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SRWLock acquisition Backport patch from 10.1
| | | * | MDEV-10467 Assertion `nr >= 0.0' failed in Item_sum_std::val_real()Alexander Barkov2016-08-031-0/+3
| | | | | | | | | | | | | | | | | | | | Backporting MDEV-5781 from 10.0.
| | | * | MDEV-10383 Named pipes : multiple servers can listen on the same pipenameVladislav Vaintroub2016-08-021-20/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Use FILE_FLAG_FIRST_PIPE_INSTANCE with the first CreateNamedPipe() call to make sure the pipe does not already exist.
| | | * | MDEV-10419: crash in mariadb 10.1.16-MariaDB-1~trustyOleksandr Byelkin2016-07-302-5/+8
| | | | | | | | | | | | | | | | | | | | Fixed initialization and usage of THD reference in subselect engines.
| | | * | MDEV-10228: Delete missing rows with OR conditionsSergei Petrunia2016-07-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix get_quick_keys(): When building range tree from a condition in form keypart1=const AND (keypart2 < 0 OR keypart2>=0) the SEL_ARG for keypart2 represents an interval (-inf, +inf). However, the logic that sets UNIQUE_RANGE flag fails to recognize this, and sets UNIQUE_RANGE flag if (keypart1, keypart2) covered a unique key. As a result, range access executor assumes the interval can have at most one row and only reads the first row from it.
| * | | | With parallel replication we have had a couple of bugs where DDL'sMonty2016-08-125-22/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (like DROP TABLE) has been scheduled before conflicting DDL's (like INSERT) are commited. What makes these bugs hard to detect is that in most cases any wrong schduling are caught by MDL locks. It's only when there are timing issues that the bugs (usually deadlocks) are noticed. This patch adds a DBUG_ASSERT() that detects, in parallel replication, if a DDL is scheduled before any depending DML'S are commited. It does this be checking if there are any conflicting replication locks when the DDL is about to wait for getting it's MDL lock. I also did some minor code cleanups in sql_base.cc to make this code similar to other related code.
| * | | | MDEV-10455: libmariadbclient18 + MySQL-python leaks memory on failed connectionsOleksandr Byelkin2016-08-111-1/+1
| | | | | | | | | | | | | | | | | | | | Support of CLIENT_REMEMBER_OPTIONS and freeing options added.
| * | | | Update contributorsiangilfillan2016-07-271-11/+10
| | | | |
| * | | | MDEV-8569 build_table_filename() doesn't support temporary tables.Alexey Botchkov2016-07-184-7/+38
| |/ / / | | | | | | | | | | | | Temporary tables support added for RENAME and ALTER TABLE.
* | | | MDEV-10553: Semi-sync replication hangs when master opens new binlog fileKristian Nielsen2016-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the AFTER_SYNC case, semi-sync was taking the binlog file name from the wrong place, so around binlog rotation it could be using the new name with a position belonging to the previous binlog file name. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
* | | | MDEV-10478: Trx abort does not work in autocommit modeNirbhay Choubey2016-08-011-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | THD's statement transaction handle (st_transactions::stmt) should also be looked for registered htons while serving a request to abort a transaction.
* | | | MDEV-10429: sys_vars.sysvars_wsrep fails in buildbot on host 'work' ↵Nirbhay Choubey2016-07-281-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (valgrind builder) - Fixed the test - Improved comment for wsrep_drupal_282555_workaround
* | | | MDEV-10389: Query returns different results on a debug vs non-debug buildSergei Petrunia2016-07-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was caused by a merged semi-join, which contained a non-merged semi-join, which used references to the top-level query in the left_expr. When moving non-merged semi-join from the subquery to its parent, do not forget to call fix_after_pullout for its Item_subselect. We need to do that specifically, because non-merged semi-joins do not have their IN-equality in the WHERE clause at this stage.
* | | | MDEV-10045: Server crashes in Time_and_counter_tracker::incr_loopsOleksandr Byelkin2016-07-223-34/+42
| | | | | | | | | | | | | | | | Do not set 'optimized' flag until whole optimization procedure is finished.
* | | | MDEV-10314 : wsrep_client_thread was not set in threadpool.Vladislav Vaintroub2016-07-191-2/+1
| | | | | | | | | | | | | | | | | | | | Fixed threadpool_add_connection to use thd_prepare_connection() to match thread-per-conection flow.
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2016-07-131-1/+22
|\ \ \ \ | |/ / /
| * | | [MDEV-9127] Crash reporter often fails to show the query that crashedVicențiu Ciorbaru2016-07-121-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Addreses are not necessarily between heap_start && heap_end. Malloc calls using mmap can place pointers outside these bounds. In this case, we'll warn the user that the query pointer is potentially invalid. However, we'll attempt to print the data anyway after we're done printing everything else.
* | | | MDEV-8580 For some BOOLEAN or ENUM sysvars list of valid values is not generatedSergei Golubchik2016-07-131-0/+2
| | | | | | | | | | | | | | | | set the 'typelib' member for plugin boolean sysvars
* | | | cleanupSergei Golubchik2016-07-134-4/+2
| | | |
* | | | MDEV-10360: Extended keys: index properties depend on index orderSergei Petrunia2016-07-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TABLE_SHARE::init_from_binary_frm_image has a rule: if an index has a partially-covered column (like in "KEY(col(N))" ), then dont provide "Extended Keys" feature for this index. The problem was that due to coding error Extended Keys feature was disabled for *ALL* subsequent indexes. Fixed the error.
* | | | MDEV-10325: Queries examines all rows of a tables when it should notSergei Petrunia2016-07-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was introduced by 1859caf60b725f81f2ac6091eb44cb848a4a439a: MDEV-10175: range optimizer calls records_in_range() for full extended keys Make the range optimizer not call records_in_range() when it would not give any benefit. that patch used an incorrect way to check for full extended key. Now fixing the check.
* | | | MDEV-10010 - Recursive call to mysql_rwlock_rdlock for ↵Sergey Vojtovich2016-07-083-60/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | LOCK_system_variables_hash Avoid recursive LOCK_system_variables_hash acquisition in intern_sys_var_ptr() by pre-syncing dynamic session variables.
* | | | MDEV-10324: Server crash in get_sel_arg_for_keypart or AssertionSergei Petrunia2016-07-051-55/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crash was caused by this problem: get_best_group_min_max() tries to construct query plans for keys that are not processed by the range optimizer. This wasn't a problem as long as SEL_TREE::keys was an array of MAX_KEY elements. However, now it is a Mem_root_array and only has elements for the used keys, and get_best_group_min_max attempts to address beyond the end of the array. The obvious way to fix the crash was to port (and improve) a part of 96fcfcbd7b5120e8f64fd45985001eca8d36fbfb from mysql-5.7. This makes get_best_group_min_max not to consider indexes that Mem_root_arrays have no element for. After that, I got non-sensical query plans (see MDEV-10325 for details). Fixed that by making get_best_group_min_max to check if the index is in table->keys_in_use_for_group_by bitmap.
* | | | Removing class Item_func_integer. It's not used since MySQL-5.0.Alexander Barkov2016-07-052-16/+0
| | | |