summaryrefslogtreecommitdiff
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* typo fixed: s/MSYQL/MYSQL/Sergei Golubchik2016-12-031-7/+7
|
* MDEV-11171 Assertion `m_cpp_buf <= ptr && ptr <= m_cpp_buf + m_buf_length' ↵Alexander Barkov2016-11-281-1/+1
| | | | failed in Lex_input_stream::body_utf8_append(const char*, const char*)
* Restore MY_WME flag for my_pread in read_ddl_log_entry, fix errors in buildbotVladislav Vaintroub2016-11-141-1/+1
|
* Fixed bug mdev-11161.Igor Babaev2016-11-111-0/+2
| | | | | | | The flag TABLE_LIST::fill_me must be reset to false at the prepare phase for any materialized derived table used in the executed query. Otherwise if the optimizer decides to generate a key for such a table it is generated only for the first execution of the query.
* MDEV-11248 Fix passing offset parameter to my_file_pread in ↵Vladislav Vaintroub2016-11-101-2/+2
| | | | read_ddl_log_file_entry
* MDEV-9409 Windows - workaround VS2015 CRT bug that makesVladislav Vaintroub2016-10-271-0/+6
| | | | | | | | | | | mysqldump/mysql_install_db.exe fail The bug is described in https://connect.microsoft.com/VisualStudio/Feedback/Details/1902345 When reading from a pipe in text mode, using CRT function such as fread(), some newlines may be lost. Workaround is to use binary mode on reading side and if necessary, replace \r\n with \n.
* MDEV-10441 Document the server_audit_loc_info variableSergei Golubchik2016-09-261-84/+67
| | | | | fix PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT plugin thdvars to work. use that for server_audit_loc_info
* report correct write error on log writesSergei Golubchik2016-09-261-1/+1
|
* MDEV-10725 Server 10.1.17 fails to build using clang with c++11Sergei Golubchik2016-09-261-3/+3
| | | | | my_offsetof() returns a difference of two pointers, it must use the appropriate return type (my_ptrdiff_t, not size_t)
* fix BIGINT+MEDIUMINT type aggregationmariadb-5.5.52Sergei Golubchik2016-09-121-1/+1
|
* don't use my_copystat in the serverSergei Golubchik2016-09-121-0/+1
| | | | | | | it was supposed to be used in command-line tools only. Different fix for 4e5473862e: Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE
* missing element in prelocked_mode_name[] arraySergei Golubchik2016-09-122-1/+4
| | | | | | different fix for a63a250d40: BUG#23509275 :DBUG_PRINT in THD::decide_logging_format prints incorrectly, access out-of-bound
* Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-09-113-7/+5
|\ | | | | | | 80% reverted
| * Bug#24388753: PRIVILEGE ESCALATION USING MYSQLD_SAFESivert Sorumgard2016-08-254-11/+131
| | | | | | | | | | | | | | | | | | | | | | | | [This is the 5.5/5.6 version of the bugfix]. The problem was that it was possible to write log files ending in .ini/.cnf that later could be parsed as an options file. This made it possible for users to specify startup options without the permissions to do so. This patch fixes the problem by disallowing general query log and slow query log to be written to files ending in .ini and .cnf.
| * Bug #19984392 : MEDIUMINT: STACK BUFFER OVERFLOW IN PROTOCOL_TEXT::STORE_LONGKailasnath Nagarkar2016-08-041-1/+1
| | | | | | | | Reverting the patch due to some issues.
| * Bug #19984392 : MEDIUMINT: STACK BUFFER OVERFLOW IN PROTOCOL_TEXT::STORE_LONGKailasnath Nagarkar2016-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ISSUE: Queries with mediumint as column when operated with long long type of data results in buffer overflow in store_long function. The merging rule specified for (MYSQL_TYPE_LONGLONG MYSQL_TYPE_INT24) is MYSQL_TYPE_LONG. Due to this store_long function was getting called which resulted in buffer overflow. SOLUTION: The correct merging rule for (MYSQL_TYPE_LONGLONG, MYSQL_TYPE_INT24) should be MYSQL_TYPE_LONGLONG. So, instead of function store_long, function store_longlong is called which correctly handles the type MYSQL_TYPE_LONGLONG. External Bug #23645238 is a duplicate of this issue.
| * Bug #24380263: INCORRECT BEHAVIOR WITH PARAMETER ANDSreeharsha Ramanavarapu2016-08-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DERIVED TABLE IN JOIN ISSUE: ------ This problem occurs under the following conditions: 1) A parameter is used in the select-list of a derived table. 2) The derived table is part of a JOIN. SOLUTION: --------- When a derived table is materialized, a temporary table is created. This temporary table creates a field each for the items in the select-list of the derived table. This set of fields is later used to setup the join. Currently no field is created in the temporary table if a parameter is used in the select-list. Create a field for the parameter. By default Item_param's result type in a prepared statement is set to STRING_RESULT. This can change during the execute phase depending on the user variable. But since the execute phase creates its own temporary table, it will be handled separately. This is a backport of the fix for BUG#22392374.
| * BUG#23509275 :DBUG_PRINT in THD::decide_logging_format prints incorrectly, ↵Neha Kumari2016-07-252-10/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | access out-of-bound Problem: In debug builds, there is a chance that an out-of-bounds read is performed when tables are locked in LTM_PRELOCKED_UNDER_LOCK_TABLES mode. It can happen because the debug code uses enum values as index for an array of mode descriptions, but it only takes into consideration 3 out of 4 of the enum values. Fix: This patch fixes it by implementing a getter for the enum which returns a string representation of the enum, effectively removing the out-of-bounds read. Moreover, it also fixes the lock mode descriptions that would be print out in debug builds.
| * BUG#23703568 - IS CLIENT LIBRARY SUPPOSED TO RETRY EINTR INDEFINITELY OR NOTThayumanavar S2016-07-251-5/+6
| | | | | | | | | | | | | | | | Commit#ebd24626ca38e7fa1e3da2acdcf88540be70fabe obsoleted the THREAD and THREAD_SAFE_CLIENT preprocessor symbols. This is not removed in the sql/net_serv.cc thereby the code that retries on EINTR became dead code. Remove the THREAD_SAFE_CLIENT preprocessor directive form sql/net_serv.cc. Also check errno for EINTR only if there is an error in preceding read call.
| * Bug #23295288: HANDLE_FATAL_SIGNAL (SIG=11) INArun Kuruvila2016-07-221-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | GET_SERVER_FROM_TABLE_TO_CACHE Description:- Server received SIG11 in the function, "get_server_from_table_to_cache()". Analysis:- Defining a server with a blank name is not handled properly. Fix:- Modified "get_server_from_table_to_cache()" to take care of blank server name.
| * Bug #23280699: MYSQLD GOT SIGNAL 11 IN IS_NULL ON SELECTSreeharsha Ramanavarapu2016-07-221-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FROM I_S Issue: ------ There is a difference in the field type created when the following DDLs are used: 1) CREATE TABLE t0 AS SELECT NULL; 2) CREATE TABLE t0 AS SELECT GREATEST(NULL,NULL); The first statement creates field of type Field_string and the second one creates a field of type Field_null. This creates a problem when the query mentioned in this bug is used. Since the null_ptr is calculated differently for Field_null. Solution: --------- When there is a function returning null in the select list as mentioned above, the field should be of type Field_string. This was fixed in 5.6+ as part of Bug#14021323. This is a backport to mysql-5.5. An incorrect comment in innodb_bug54044.test has been corrected in all versions.
| * Bug#23280059: ITEM_ROW::ILLEGAL_METHOD_CALL(CONST CHAR*):Chaithra Gopalareddy2016-07-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | ASSERTION `0' FAILED ON SELECT AREA Problem: Optimizer tries to get the points to calculate area without checking the return value of uint4korr for 0 "points". As a result server exits. Solution: Check the return value from uint4korr().
* | MDEV-8833 Crash of server on prepared statement with conversion to semi-joinOleksandr Byelkin2016-09-021-2/+21
| | | | | | | | Correct context chain made to allow outer fields pullout.
* | DEV-10595 MariaDB daemon leaks memory with specific queryMonty2016-08-252-6/+28
| | | | | | | | | | The issue was that in some extreme cases when doing GROUP BY, buffers for temporary blobs where not properly cleared.
* | MDEV-10424 - Assertion `ticket == __null' failed in MDL_request::set_typeSergey Vojtovich2016-08-171-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | Reexecution of prepared "ANALYZE TABLE merge_table, table" may miss to reinitialize "table" for subsequent execution and trigger assertion failure. This happens because MERGE engine may adjust table->next_global chain, which gets cleared by close_thread_tables()/ha_myisammrg::detach_children() later. Since reinitilization iterates next_global chain, it won't see tables following merge table. Fixed by appending saved next_global chain after merge children.
* | 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.
* | MDEV-10050: Crash in subselectOleksandr Byelkin2016-06-242-42/+50
| | | | | | | | thd should not be taken earlier then fix_field and reset on fix_fields if it is needed.
* | MDEV-10043 - main.events_restart fails sporadically in buildbot (crashes uponSergey Vojtovich2016-06-201-26/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shutdown) There was race condition between shutdown thread and event worker threads. Shutdown thread waits for thread_count to become 0 in close_connections(). It may happen so that event worker thread was started but didn't increment thread_count by this time. In this case shutdown thread may miss wait for this working thread and continue deinitialization. Worker thread in turn may continue execution and crash on deinitialized data. Fixed by incrementing thread_count before thread is actually created like it is done for connection threads. Also let event scheduler not to inc/dec running threads counter for symmetry with other "service" threads.
* | MDEV-8328 Evaluation of two "!" operators depends on space in beetweenSergei Golubchik2016-06-143-56/+53
| | | | | | | | | | fix the lexer to backtrack when parsing "<=", "<>", "!=", ">=", "<<", ">>", "<=>".
* | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-06-1410-43/+104
|\ \