summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-14474 information_schema.check_constraintsbb-10.3-anel-check-constraintAnel Husakovic2018-05-069-1/+334
| | | | | | Implement according to standard SQL specification 2008. The check_constraints table is used for fetching metadata about the constraints defined for tables in all databases.
* MDEV-13695: INTERSECT precedence is not in line with Oracle even in ↵Oleksandr Byelkin2018-04-253-1/+100
| | | | | | SQL_MODE=Oracle Switch off automatic INTERSECT priority for ORACLE MODE
* MDEV-15079: Parameter array operation inserts wrong values in autoincrement ↵Oleksandr Byelkin2018-04-251-0/+54
| | | | | | field if indicator was specified test added (bug is fixed)
* Merge 10.2 into 10.3Marko Mäkelä2018-04-254-3/+12
|\
| * Changed the test case for MDEV-15571Igor Babaev2018-04-243-2/+12
| | | | | | | | | | | | | | It has been done to demonstrate that the fix of this bug is good for 10.3 as well. The previous test case is not good for this purpose because 10.2 and 10.3 use different rules for determining the types of recursive CTEs.
* | Remove trx_t::undo_rseg_spaceMarko Mäkelä2018-04-256-78/+0
| | | | | | | | | | | | The field undo_rseg_space was only used in a debug check. trx_roll_check_undo_rec_ordering(): Remove.
* | Merge 10.2 into 10.3Marko Mäkelä2018-04-24101-257/+705
|\ \ | |/
| * MDEV-15030 Add ASAN instrumentation to trx_t PoolMarko Mäkelä2018-04-242-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | Pool::mem_free(): Poison the freed memory. Assert that it was fully initialized, because the reuse of trx_t objects will assume that the objects were previously initialized. Pool::~Pool(), Pool::get(): Unpoison the allocated memory, and mark it initialized. trx_free(): After invoking Pool::mem_free(), unpoison trx_t::mutex and trx_t::undo_mutex, because MutexMonitor will access these even for freed trx_t objects.
| * Pull request #522: Remove C++ register keywordMarko Mäkelä2018-04-2441-132/+126
| |\
| | * register keyword c++17 warningEugene Kosov2018-04-2411-19/+19
| | |
| | * Remove most 'register' use in C++Marko Mäkelä2018-04-2433-113/+107
| |/ | | | | | | | | | | | | | | Modern compilers (such as GCC 8) emit warnings that the 'register' keyword is deprecated and not valid C++17. Let us remove most use of the 'register' keyword. Code in 'extra/' is not touched.
| * Remove unused function FixNull()Marko Mäkelä2018-04-241-6/+0
| |
| * MDEV-15865 Crash in dict_index_set_merge_threshold() on CREATE TABLEMarko Mäkelä2018-04-241-2/+1
| | | | | | | | | | | | Apply the contributed patch from MySQL Bug #89126 create table panic on innobase_parse_hint_from_comment by Yan Huang.
| * Merge 10.1 into 10.2Marko Mäkelä2018-04-2470-269/+687
| |\
| | * Merge 10.0 into 10.1Marko Mäkelä2018-04-2463-250/+644
| | |\
| | | * MDEV-15723 Crash in INFORMATION_SCHEMA.INNODB_SYS_TABLES when accessing ↵Marko Mäkelä2018-04-232-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | corrupted record dict_load_table_low(): When flagging an error, assign *table = NULL. Failure to do so could cause a crash if an error was flagged when accessing INFORMATION_SCHEMA.INNODB_SYS_TABLES.
| | | * Remove the "register" keywordMarko Mäkelä2018-04-232-20/+14
| | | |
| | | * Fix -Wimplicit-fallthroughMarko Mäkelä2018-04-232-0/+4
| | | |
| | | * MDEV-15937 Assertion failure 'key->flags & 1' on ALTER TABLEMarko Mäkelä2018-04-234-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the test case crashes a MariaDB 10.2 debug build only, let us apply the fix to the earliest applicable MariaDB series (10.0) to avoid any data corruption on a table-rebuilding ALTER TABLE using ALGORITHM=INPLACE. innobase_create_key_defs(): Use altered_table->s->primary_key when a new primary key is being created.
| | | * MDEV-10824 - Crash in CREATE OR REPLACE TABLE t1 AS SELECT spfunc()Sergei Golubchik2018-04-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | followup for a3c980b381ea same change in Locked_tables_list::unlink_from_list(), otherwise thd->locked_tables_list will keep pointers to a free'd TABLE if prelocked under lock tables. This fixes a crash in main.create_or_replace on debug Win builds after bcb36ee21e25
| | | * mysqltest: use do_stmt_close() not mysql_stmt_close()Sergei Golubchik2018-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | do_stmt_close() is embedded-aware. this fixes the failure of innodb.innodb_bug48024 --ps --embed
| | | * Merge branch '5.5' into 10.0Sergei Golubchik2018-04-2042-58/+421
| | | |\
| | | | * Merge branch 'merge/merge-xtradb-5.5' into 5.5mariadb-5.5.60Sergei Golubchik2018-04-202-3/+3
| | | | |\
| | | | | * 5.5.59-38.11Sergei Golubchik2018-04-202-8/+11
| | | | | |
| | | | * | Bug#25471090: MYSQL USE AFTER FREESergei Golubchik2018-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | in a specially crafted invalid packet, one can get end_pos < pos here
| | | | * | BUG#27216817: INNODB: FAILING ASSERTION: ↵Sergei Golubchik2018-04-196-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PREBUILT->TABLE->N_MYSQL_HANDLES_OPENED == 1 disable online alter add primary key for innodb, if the table is opened/locked more than once in the current connection (see assert in ha_innobase::add_index())
| | | | * | BUG#26881798: SERVER EXITS WHEN PRIMARY KEY IN MYSQL.PROC IS DROPPEDSergei Golubchik2018-04-192-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | test case
| | | | * | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2018-04-1921-34/+190
| | | | |\ \
| | | | | * | BUG#27216817: INNODB: FAILING ASSERTION:mysql-5.5.60Nisha Gopalakrishnan2018-02-267-20/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PREBUILT->TABLE->N_MYSQL_HANDLES_OPENED == 1 ANALYSIS: ========= Adding unique index to a InnoDB table which is locked as mutliple instances may trigger an InnoDB assert. When we add a primary key or an unique index, we need to drop the original table and rebuild all indexes. InnoDB expects that only the instance of the table that is being rebuilt, is open during the process. In the current scenario we have opened multiple instances of the table. This triggers an assert during table rebuild. 'Locked_tables_list' encapsulates a list of all instances of tables locked by LOCK TABLES statement. FIX: === We are now temporarily closing all the instances of the table except the one which is being altered and later reopen them via Locked_tables_list::reopen_tables().
| | | | | * | Bug#27538614 DROP EXTRA CHANGELOG FILE FROM DEB/RPM PACKAGESLars Tangvald2018-02-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the file to refer to published git repository directly
| | | | | * | (no commit message)Karthik Kamath2018-02-141-1/+3
| | | | | | |
| | | | | * | Bug#25471090: MYSQL USE AFTER FREEArun Kuruvila2018-02-123-10/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description:- Mysql client crashes when trying to connect to a fake server which is sending incorrect packets. Analysis:- Mysql client crashes when it tries to read server version details. Fix:- A check is added in "red_one_row()".
| | | | | * | BUG#27448061: MYSQLD--DEFAULTS-FILE TEST FAILS FOR NDB RELEASESPavan Naik2018-02-092-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PREVIOUS TO MYSQL 8.0 Description : ------------- The mysqld--defaults-file test fails when the test suite is run from a non-canonical path, which happens when the current working directory when mysql-test-run.pl is started contains a symbolic link. The problem is that this test case uses --replace-result with $MYSQL_TEST_DIR. This variable is a potentially non-canonical path based on the current working directory when mtr is started. However, the path in the expected error message from mysqld contains a canonical path. This means it does not contain $MYSQL_TEST_DIR if mtr's working directory is not the canonical path of the working directory. Because other tests produce output that may contain non-canonical paths, making $MYSQL_TEST_DIR always canonical is not a fix. Fix : ----- Introduced a new environment variable '$ABS_MYSQL_TEST_DIR' which will contin the canonical path to the test directory and replaced $MYSQL_TEST_DIR with the new variable in main.mysqld--defaults-file test file. This is a back-port of BUG#24579973. Change-Id: I3b8df6f2d7ce2b04e188a896d76250cc1addbbc1
| | | | | * | BUG#24365972 BINLOG DECODING ISN'T RESILIENT TO CORRUPT BINLOG FILESJoao Gramacho2018-02-023-8/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem ======= When facing decoding of corrupt binary log files, server may misbehave without detecting the events corruption. This patch makes MySQL server more resilient to binary log decoding. Fixes for events de-serialization and apply =========================================== @sql/log_event.cc Query_log_event::Query_log_event: added a check to ensure query length is respecting event buffer limits. Query_log_event::do_apply_event: extended a debug print, added a check to character set to determine if it is "parseable" or not, verified if database name is valid for system collation. Start_log_event_v3::do_apply_event: report an error on applying a non-supported binary log version. Load_log_event::copy_log_event: added a check to table_name length. User_var_log_event::User_var_log_event: added checks to avoid reading out of buffer limits. User_var_log_event::do_apply_event: reported an sanity check error properly and added individual sanity checks for variable types that expect fixed (or minimum) amount of bytes to be read. Rows_log_event::Rows_log_event: added checks to avoid reading out of buffer limits. @sql/log_event_old.cc Old_rows_log_event::Old_rows_log_event: added a sanity check to avoid reading out of buffer limits. @sql/sql_priv.h Added a sanity check to available_buffer() function.
| | | | | * | BUG#27160888: MISSING FILE PRIVILEDGE CHECKS ON SOMEKarthik Kamath2018-01-111-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | STATEMENTS ANALYSIS: ========= A user not having FILE privilege is not allowed to create custom data/index directories for a table or for its partitions via CREATE TABLE but is allowed to do so via ALTER TABLE statement. ALTER TABLE ignores DATA DIRECTORY and INDEX DIRECTORY when given as table options. The issue occurs during the creation of partitions for a table via ALTER TABLE statement with the DATA DIRECTORY and/or INDEX DIRECTORY options. The issue exists because of the absence of FILE privilege check for the user. FIX: ==== A FILE privilege check has been introduced for resolving the above scenario.
| | | | | * | Bug #27021754 MYSQLTEST MAN PAGES WILL BE REMOVED, PACKAGING MUST BE PREPAREDBjorn Munch2018-01-113-25/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Followup: now that the man pages have actually been removed, we no longer need to take deliberate action to ignore them. Thus we can remove that part of the original change. RPM: drop the conditional removal DEB: remove from the exclude list
| | | | | * | (no commit message)mysql-builder@oracle.com2017-12-210-0/+0
| | | | | | |
| | | | | * | (no commit message)mysql-builder@oracle.com2017-12-210-0/+0
| | | | | | |
| | | | | * | BUG#26881798: SERVER EXITS WHEN PRIMARY KEY IN MYSQL.PROCKarthik Kamath2017-12-056-9/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IS DROPPED ANALYSIS: ========= It is advised not to tamper with the system tables. When primary key is dropped from a system table, certain operations on the table which tries to access the table key information may lead to server exit. FIX: ==== An appropriate error is now reported in such a case.
| | | | | * | Bug#26585560 - MYSQL DAEMON SHOULD CREATE ITS PID FILE ASShishir Jaiswal2017-12-025-3/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ROOT DESCRIPTION =========== If the .pid file is created at a world-writable location, it can be compromised by replacing the server's pid with another running server's (or some other non-mysql process) PID causing abnormal behaviour. ANALYSIS ======== In such a case, user should be warned that .pid file is being created at a world-writable location. FIX === A new function is_file_or_dir_world_writable() is defined and it is called in create_pid_file() before .pid file creation. If the location is world-writable, a relevant warning is thrown. NOTE ==== 1. PID file is always created with permission bit 0664, so for outside world its read-only. 2. Ignoring the case when permission is denied to get the dir stats since the .pid file creation would fail anyway in such a case.
| | | | | * | BUG#26502135: MYSQLD SEGFAULTS INKarthik Kamath2017-11-271-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDL_CONTEXT::TRY_ACQUIRE_LOCK_IMPL ANALYSIS: ========= Server sometimes exited when multiple threads tried to acquire and release metadata locks simultaneously (for example, necessary to access a table). The same problem could have occurred when new objects were registered/ deregistered in Performance Schema. The problem was caused by a bug in LF_HASH - our lock free hash implementation which is used by metadata locking subsystem in 5.7 branch. In 5.5 and 5.6 we only use LF_HASH in Performance Schema Instrumentation implementation. So for these versions, the problem was limited to P_S. The problem was in my_lfind() function, which searches for the specific hash element by going through the elements list. During this search it loads information about element checked such as key pointer and hash value into local variables. Then it confirms that they are not corrupted by concurrent delete operation (which will set pointer to 0) by checking if element is still in the list. The latter check did not take into account that compiler (and processor) can reorder reads in such a way that load of key pointer will happen after it, making result of the check invalid. FIX: ==== This patch fixes the problem by ensuring that no such reordering can take place. This is achieved by using my_atomic_loadptr() which contains compiler and processor memory barriers for the check mentioned above and other similar places. The default (for non-Windows systems) implementation of my_atomic*() relies on old __sync intrisics and implements my_atomic_loadptr() as read-modify operation. To avoid scalability/performance penalty associated with addition of my_atomic_loadptr()'s we change the my_atomic*() to use newer __atomic intrisics when available. This new default implementation doesn't have such a drawback.
| | | | | * | Raise version number after cloning 5.5.59Balasubramanian Kandasamy2017-11-271-1/+1
| | | | | | |
| | | | * | | MDEV-14515 ifnull result depends on number of rows in joined tableIgor Babaev2018-04-163-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Any expensive WHERE condition for a table-less query with implicit aggregation was lost. As a result the used aggregate functions were calculated over a non-empty set of rows even in the case when the condition was false.
| | | | * | | defaults-group-suffix in print_defaultsDaniel Black2018-04-132-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also clarify which --{no-,}default* options, must be first. Sample output: $ client/mysql --help client/mysql Ver 15.1 Distrib 5.5.59-MariaDB, for Linux (x86_64) using readline 5.1 Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Usage: client/mysql [OPTIONS] [database] Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf The following groups are read: mysql client client-server client-mariadb The following options may be given as the first argument: --print-defaults Print the program argument list and exit. --no-defaults Don't read default options from any option file. The following specify which files/groups are read (specified before other options): --defaults-file=# Only read default options from the given file #. --defaults-extra-file=# Read this file after the global files are read. --defaults-group-suffix=# Additionally read default groups with # appended as a suffix. tests running from build directory: TEST: print defaults ignored as not first $ sql/mysqld --no-defaults --print-defaults --lc-messages-dir=${PWD}/sql/share TEST: no startup occurs as --print-defaults specified $ sql/mysqld --print-defaults --lc-messages-dir=${PWD}/sql/share sql/mysqld would have been started with the following arguments: --lc-messages-dir=/home/dan/repos/build-mariadb-5.5/sql/share TEST: default args can't be anywhere $ client/mysql --user=bob --defaults-file=/etc/my.cnf client/mysql: unknown variable 'defaults-file=/etc/my.cnf' $ client/mysql --user=bob --defaults-group-suffix=.group client/mysql: unknown variable 'defaults-group-suffix=.group' /etc/my.cnf: [client-server.group] socket=/var/lib/mysql-multi/group/mysqld.sock user=bob /etc/my.other.cnf: socket=/var/lib/mysql-other/mysqld.sock TEST: defaults file read and suffix also applied $ client/mysql --defaults-file=/etc/my.other.cnf --defaults-group-suffix=.group ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql-other/mysqld.sock' (2) TEST: defaults extra file $ client/mysql --defaults-extra-file=/etc/my.other.cnf --defaults-group-suffix=.group ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql-other/mysqld.sock' (2)
| | | | * | | MDEV-14185 CREATE TEMPORARY TABLE AS SELECT causes error 1290 with read_only ↵Alexey Botchkov2018-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and InnoDB. condition fixed.
| | | | * | | MDEV-14185 CREATE TEMPORARY TABLE AS SELECT causes error 1290 with read_only ↵Alexey Botchkov2018-04-073-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and InnoDB. handler::ha_create_handler_files shouldn't call the mark_trx_read_write() for the temporary table.
| | | | * | | MDEV-15624 Changing the default character set to utf8mb4 changes query ↵Alexander Barkov2018-04-046-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | evaluation in a very surprising way
| | | * | | | MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under ↵Sergei Golubchik2018-04-2012-15/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LOCK TABLE after ER_SAME_NAME_PARTITION ALTER TABLE ... ADD PARTITION modifies the open TABLE structure, and sets table->need_reopen=1 to reset these modifications in case of an error. But under LOCK TABLES the table isn't get reopened, despite need_reopen. Fixed by reopening need_reopen tables under LOCK TABLE.
| | | * | | | compiler warningSergei Golubchik2018-04-201-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | bad merge
| | | * | | | ASAN error in main.statistics_index_crash-7362Sergei Golubchik2018-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | one cannot do keyread on spatial indexes.