summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-5924: MariaDB could crash after changing the query_cache sizebb-5.5-MDEV-5924Oleksandr Byelkin2019-05-223-3/+50
| | | | | The real problem was that attempt to roll back cahnes after end of memory in QC was made incorrectly and lead to using uninitialized memory. (bug has nothing to do with resize operation, it is just lack of resources erro processed incorrectly)
* MDEV-18896 Crash in convert_join_subqueries_to_semijoins : CorrectionIgor Babaev2019-05-195-1/+12
| | | | | | | | | | | | | This patch complements the original patch for MDEV-18896 that prevents conversions to semi-joins in tableless selects used in INSERT statements in post-5.5 versions of the server. The test case was corrected as well to ensure that potential conversion to jtbm semi-joins is also checked (the problem was that one of the preceeding testcases in subselect_sj.test did not restore the state of the optimizer switch leaving the 'materialization' in the state 'off' and so blocking this check). Noticed an inconsistency in the state of select_lex::table_list used in INSERT statements and left a comment about this.
* Update FSF AddressVicențiu Ciorbaru2019-05-114079-4102/+4102
| | | | * Update wrong zip-code
* Follow-up to changing FSF addressVicențiu Ciorbaru2019-05-11165-167/+167
| | | | | | | | | | Some places didn't match the previous rules, making the Floor address wrong. Additional sed rules: sed -i -e 's/Place.*Suite .*, Boston/Street, Fifth Floor, Boston/g' sed -i -e 's/Suite .*, Boston/Fifth Floor, Boston/g'
* Update FSF addressMichal Schorm2019-05-10217-227/+227
| | | | | | | | | | | | | | | This commit is based on the work of Michal Schorm, rebased on the earliest MariaDB version. Th command line used to generate this diff was: find ./ -type f \ -exec sed -i -e 's/Foundation, Inc., 59 Temple Place, Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \ -exec sed -i -e 's/Foundation, Inc. 59 Temple Place.* Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \ -exec sed -i -e 's/MA.*.....-1307.*USA/MA 02110-1335 USA/g' {} \; \ -exec sed -i -e 's/Foundation, Inc., 59 Temple/Foundation, Inc., 51 Franklin/g' {} \; \ -exec sed -i -e 's/Place, Suite 330, Boston, MA.*02111-1307.*USA/Street, Fifth Floor, Boston, MA 02110-1335 USA/g' {} \; \ -exec sed -i -e 's/MA.*.....-1307/MA 02110-1335/g' {} \;
* MDEV-19349 mysql_install_db: segfault at tmp_file_prefix checkAleksey Midenkov2019-05-012-7/+10
|
* bump the VERSIONDaniel Bartholomew2019-04-291-1/+1
|
* MDEV-15772: Clean up the testmariadb-5.5.64Marko Mäkelä2019-04-262-0/+2
| | | | | | Before killing the server, we must issue FLUSH TABLES in order to cleanly close any MyISAM system tables, to avoid warnings about them when restarting.
* fix the test for embeddedSergei Golubchik2019-04-261-0/+2
|
* Bug#28986737: RENAMING AND REPLACING MYSQL.USER TABLE CAN LEAD TO A SERVER CRASHSergei Golubchik2019-04-253-0/+26
|
* test case for a previous commitSergei Golubchik2019-04-252-0/+41
|
* ProblemVenkatesh Venugopal2019-04-252-21/+24
| | | | | | | | | | | ------- MySQL abnormally exits on KILL command. Fix --- The abnormal exit has been fixed. RB: 20971, 21129, 21237
* MDEV-15907 ASAN heap-use-after-free in strnmov / .. / ↵Sergei Golubchik2019-04-243-4/+7
| | | | | | | | fill_effective_table_privileges on concurrent GRANT and CREATE VIEW rename a test file. Closes #1253
* MDEV-15907 ASAN heap-use-after-freeRobert Bindar2019-04-244-3/+10
| | | | | | | | | | | | | This patch fixes an invalid read in fill_effective_table_privileges triggered by a grant_version increase between a PREPARE for a statement creating a view from I_S and EXECUTE. A tmp table was created and free'd while preparing the statement, TABLE_LIST::table_name was set to point to the tmp table TABLE_SHARE::table_name which no longer existed after preparing was done. The grant version increase made fill_effective_table_privileges called during EXECUTE to try fetch the updated grant info and this is where the dangling table name was used.
* MDEV-18507 can't update temporary table when joined with table with triggers ↵Sergei Golubchik2019-04-247-7/+82
| | | | | | | | | | | | | | | | | | on read-only triggers are opened and tables used in triggers are prelocked in open_tables(). But multi-update can detect what tables will actually be updated only later, after all main tables are opened. Meaning, if a table is used in multi-update, but is not actually updated, its on-update treggers will be opened and tables will be prelocked, even if it's unnecessary. This can cause more tables to be write-locked than needed, causing read_only errors, privilege errors and lock waits. Fix: don't open/prelock triggers unless table->updating is true. In multi-update after setting table->updating=true, do a second open_tables() for newly added tables, if any.
* bugfix: multi-update checked privileges on views incorrectlySergei Golubchik2019-04-246-13/+20
| | | | | | | | | | it always required UPDATE privilege on views, not being able to detect when a views was not actually updated in multi-update. fix: instead of marking all tables as "updating" by default, only set "updating" on tables that will actually be updated by multi-update. And mark the view "updating" if any of the view's tables is.
* MDEV-18241 Downgrade from 10.4 to 10.3 crashesSergei Golubchik2019-04-243-0/+30
| | | | | privilege tables can never be views or temporary tables, don't even try to open them, if they are.
* cleanupSergei Golubchik2019-04-247-92/+119
|
* MDEV-18923 Assertion `!lex_string_cmp(system_charset_info, ↵Sergei Golubchik2019-04-243-9/+34
| | | | | | | fk_info->referenced_table, &table->s->table_name)' failed in fk_truncate_illegal_if_parent don't assert the correctness of FK constraints, as it can be broken under `SET FOREIGN_KEY_CHECKS= OFF`
* MDEV-15772 Potential list overrun during XA recoveryThirunarayanan Balathandayuthapani2019-04-2415-71/+481
| | | | | | | | | | | | | | | | | InnoDB could return the same list again and again if the buffer passed to trx_recover_for_mysql() is smaller than the number of transactions that InnoDB recovered in XA PREPARE state. We introduce the transaction state TRX_PREPARED_RECOVERED, which is like TRX_PREPARED, but will be set during trx_recover_for_mysql() so that each transaction will only be returned once. Because init_server_components() is invoking ha_recover() twice, we must reset the state of the transactions back to TRX_PREPARED after returning the complete list, so that repeated traversals will see the complete list again, instead of seeing an empty list. Without this tweak, the test main.tc_heuristic_recover would hang in MariaDB 10.1.
* MDEV-17260: Memory leaks in mysqlbinlogSujatha Sivakumar2019-04-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======== The mysqlbinlog tool is leaking memory, causing failures in various tests when compiling and testing with AddressSanitizer or LeakSanitizer like this: cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_ASAN:BOOL=ON /path/to/source make -j$(nproc) cd mysql-test ASAN_OPTIONS=abort_on_error=1 ./mtr --parallel=auto rpl.rpl_row_mysqlbinlog CURRENT_TEST: rpl.rpl_row_mysqlbinlog Direct leak of 112 byte(s) in 1 object(s) allocated from: #0 0x4eff87 in __interceptor_malloc (/dev/shm/5.5/client/mysqlbinlog+0x4eff87) #1 0x60eaab in my_malloc /mariadb/5.5/mysys/my_malloc.c:41:10 #2 0x5300dd in Log_event::read_log_event(char const*, unsigned int, char const**, Format_description_log_event const*, char) /mariadb/5.5/sql/log_event.cc:1568: #3 0x564a9c in dump_remote_log_entries(st_print_event_info*, char const*) /mariadb/5.5/client/mysqlbinlog.cc:1978:17 Analysis: ======== 'mysqlbinlog' tool is being used to read binary log events from a remote server. While reading binary log, if a fake rotate event is found following actions are taken. If 'to-last-log' option is specified, then fake rotate event is processed. In the absence of 'to-last-log' skip the fake rotate event. In this skipped case the fake rotate event object is not getting cleaned up resulting in memory leak. Fix: === Cleanup the fake rotate event. This issues is already fixed in MariaDB 10.0.23 and higher versions as part of commit c3018b0ff4fb02c029787d03867adf0530607bab
* MDEV-18139 ALTER IGNORE ... ADD FOREIGN KEY causes bogus errorMarko Mäkelä2019-04-234-10/+78
| | | | | | | | dict_create_foreign_constraints_low(): Tolerate the keywords IGNORE and ONLINE between the keywords ALTER and TABLE. We should really remove the hacky FOREIGN KEY constraint parser from InnoDB.
* Fix the linking of async_exampleMarko Mäkelä2019-04-231-2/+2
|
* MDEV-17610 Unexpected connection abort after certain operations from within ↵Vladislav Vaintroub2019-04-043-7/+34
| | | | | | | | | | stored procedure Always set SERVER_MORE_RESULTS_EXIST when executing stored procedure statements If statements produce a result, EOF packet needs this flag (SP ends with an OK packet). IF statetement does not produce a result, affected rows count are part of the final OK packet.
* MDEV-14784: Slave crashes in show_status_array upon running a trigger withSujatha Sivakumar2019-03-273-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | select from I_S Problem: ======== When applier thread tries to access 'variable_name' of INFORMATION_SCHEMA.SESSION_VARIABLES table through triggers, it results in an abnormal exit of slave server. Analysis: ======== At the time of replication of stored routines and triggers, their associated security context will be sent by the master. The applier thread on the slave server will use this information to set the required security context for the execution of stored routines and triggers. This is achieved as follows. ->The stored routine object has a member named 'm_security_ctx' which holds the security context received from master. ->The applier thread's security_ctx is stored into a 'backup' object. ->Set the applier thread's security_ctx to 'm_security_ctx'. ->Upon the completion of stored routine execution restore the original security context of applier thread from the backup. During the above process the 'm_security_ctx' object is not initialized properly. Hence the 'external_user' of 'm_security_ctx' has invalid value for this variable and accessing this variable results in abnormal exit of server. Fix: === Invoke the Security_context::init() call from the constructor of stored routine so that 'm_security_ctx' gets initialized properly.
* Fixed ps-protocol thread_pool_server_audit failureSergey Vojtovich2019-03-261-0/+2
| | | | By applying 7bd258c.
* Fix tests in 2020Bernhard M. Wiedemann2019-03-2610-423/+423
| | | | | unfortunately, the year 2038 problem prevented me from pushing the deadline even further into the future.
* Fix for MDEV-17449, typo in error message (#1146)Chris Calender2019-03-248-54/+54
|
* Fix for MDEV-18276, typo in error message + all other occurrences of referingChris Calender2019-03-233-3/+3
|
* MDEV-17119 replicate_rewrite_db does not work for single chardatabase namesachin2019-03-224-2/+41
| | | | Fixed issue in logic.
* Fix for MDEV-15538, '-N' Produce html output wrongchriscalender2019-03-223-1/+12
|
* MDEV-18896 Crash in convert_join_subqueries_to_semijoinsIgor Babaev2019-03-144-1/+25
| | | | | | | | | | | | If an IN-subquery is used in a table-less select the current code should never consider it as candidate for semi-join optimizations. Yet the function check_and_do_in_subquery_rewrites() improperly checked the property "to be a table-less select". As a result such select in IN subquery was used in INSERT .. SELECT then the IN subquery by mistake was registered as a semi-join subquery and convert_subq_to_sj() was called for it. However the code of this function does not assume that the parent select of the subquery could be a table-less select.
* MDEV-18272 InnoDB fails to rollback after exceeding FOREIGN KEY recursion depthMarko Mäkelä2019-03-072-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | row_mysql_handle_errors(): Correct the wrong error handling for the code DB_FOREIGN_EXCEED_MAX_CASCADE that was introduced in https://github.com/mysql/mysql-server/commit/c0923d396aef46799883390e9dcf7bbf173e4a03 commit 35f5429eda94f2ce87e453653cd22298d5851cfa Author: Jimmy Yang <jimmy.yang@oracle.com> Date: Wed Oct 6 06:55:34 2010 -0700 Manual port Bug #Bug #54582 "stack overflow when opening many tables linked with foreign keys at once" from mysql-5.1-security to mysql-5.5-security again. rb://391 approved by Heikki No known test case exists for repeating the bug before MariaDB 10.2. The scenario should be that DB_FOREIGN_EXCEED_MAX_CASCADE is returned, then InnoDB wrongly skips the rollback to the start of the current row operation, and finally the SQL layer commits the transaction. Normally the SQL layer would roll back either the entire transaction or to the start of the statement. In the faulty scenario, InnoDB would leave the transaction in an inconsistent state, and the SQL layer could commit the transaction.
* MDEV-17055: Server crashes in find_order_in_list upon 2nd (3rd) execution of ↵Oleksandr Byelkin2019-02-288-15/+104
| | | | | | | SP with UPDATE 1. Always drop merged_for_insert flag on cleanup (there could be errors which prevent TABLE to be assigned) 2. Make more precise cleanup of select parts which was touched
* A cleanup in derived table handling: removing duplicate code from ↵Alexander Barkov2019-02-287-44/+31
| | | | | | | | | | | st_select_lex::handle_derived() st_select_lex::handle_derived() and mysql_handle_list_of_derived() had exactly the same implementations. - Adding a new method LEX::handle_list_of_derived() instead - Removing public function mysql_handle_list_of_derived() - Reusing LEX::handle_list_of_derived() in st_select_lex::handle_derived()
* MDEV-18506 MSI can't be built if MFC package is not installed with Visual StudioVladislav Vaintroub2019-02-071-2/+3
| | | | | | | | candle.exe's preprocessor flags (-dHaveUpgradeWizard=0 -DHaveInnodb=1) were not passed correctly to EXECUTE_PROCESS Fix is to make a list out of the EXTRA_WIX_PREPROCESSOR_FLAGS string, and use the preprocessor flags list in EXECUTE_PROCESS.
* bump the VERSIONDaniel Bartholomew2019-01-301-1/+1
|
* MDEV-15950: LOAD DATA INTO compex_view crashedVarun Gupta2019-01-303-0/+62
| | | | | For multi-table views with LOAD, updates are not allowed, so we should just throw an error.
* MDEV-15744: Assertion `derived->table' failed in mysql_derived_merge_for_insertVarun Gupta2019-01-293-2/+41
| | | | | For singe-table views, we need to find the bottom most base table in the embedded views and then update that table
* disable an old testSergei Golubchik2019-01-281-0/+1
| | | | | @@open_files_limit now behaves differenly and cannot be used to skip the test anymore.
* Crude "auto-load-data-local-infile" modemariadb-5.5.63Sergei Golubchik2019-01-279-11/+90
| | | | | | | Disable LOAD DATA LOCAL INFILE suport by default and auto-enable it for the duration of one query, if the query string starts with the word "load". In all other cases the application should enable LOAD DATA LOCAL INFILE support explicitly.
* MDEV-18360 Prevent set_max_open_files from allocating too many filesVicențiu Ciorbaru2019-01-271-4/+3
| | | | | | | If the rlimit.rlim_cur value returned by getrlimit is not the RLIM_INFINITY magic constant, but a *very* large number, we can allocate too many open files. Restrict set_max_open_files to only return at most max_file_limit, as passed via its parameter.
* MDEV-16658 Memory leak in mysqltest on connect failureEugene Kosov2019-01-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Close connection handler on connection failure. This fixes 14 failing tests in main suite under clang+ASAN build. ASAN report for main.connect looks like this: ================================================================= ==25495==ERROR: LeakSanitizer: detected memory leaks Direct leak of 146280 byte(s) in 115 object(s) allocated from: #0 0x4fba47 in calloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:138 #1 0x5a7a02 in mysql_init /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:977:26 #2 0x570a7a in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6096:26 #3 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9 #4 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 Indirect leak of 7065600 byte(s) in 115 object(s) allocated from: #0 0x4fb80f in __interceptor_malloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:129 #1 0x637a83 in my_context_init /work/mariadb/libmariadb/libmariadb/ma_context.c:367:23 #2 0x59fd16 in mysql_optionsv /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:2738:9 #3 0x5bc1d4 in mysql_options /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:3242:10 #4 0x570b94 in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6103:7 #5 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9 #6 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 Indirect leak of 940240 byte(s) in 115 object(s) allocated from: #0 0x4fb80f in __interceptor_malloc /fun/cpp_projects/llvm_toolchain/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:129 #1 0x64386e in ma_init_dynamic_array /work/mariadb/libmariadb/libmariadb/ma_array.c:49:31 #2 0x649ead in _hash_init /work/mariadb/libmariadb/libmariadb/ma_hash.c:52:7 #3 0x5a3080 in mysql_optionsv /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:2938:13 #4 0x5bc20c in mysql_options4 /work/mariadb/libmariadb/libmariadb/mariadb_lib.c:3248:10 #5 0x56f63b in connect_n_handle_errors(st_command*, st_mysql*, char const*, char const*, char const*, char const*, int, char const*) /work/mariadb/client/mysqltest.cc:5874:3 #6 0x57146b in do_connect(st_command*) /work/mariadb/client/mysqltest.cc:6193:7 #7 0x584c39 in main /work/mariadb/client/mysqltest.cc:9321:9 #8 0x7fd15514db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 ... Closes #809
* MDEV-18059 `support-files/mysql.server.sh stop` must run as rootSergei Golubchik2019-01-231-1/+5
| | | | don't run `su - mysql` is $USER is already mysql
* Bug #28499924: INCORRECT BEHAVIOR WITH UNION IN SUBQUERYSergei Golubchik2019-01-232-0/+42
| | | | test case
* Bug #28499924: INCORRECT BEHAVIOR WITH UNION IN SUBQUERYSreeharsha Ramanavarapu2019-01-231-10/+12
| | | | | | | | | | | | | | | | | | | | | | Issue: ------ When a subquery contains UNION the count of the number of subquery columns is calculated incorrectly. Only the first query block in the subquery's UNION is considered and an array indexing goes out-of-bounds, and this is caught by an assert. Solution: --------- Sum up the columns from all query blocks of the query expression. Change specific to 5.6/5.5: --------------------------- The "child" points to the last query block of the UNION (as opposed to 5.7+ where it points to the first member of UNION). So "child->master_unit()->first_select()" is used to reach the first query block of UNION.
* Bug #28178776 COMPARISON OF UNINITAILIZED MEMORY IN LOG_IN_USEAditya A2019-01-232-6/+6
| | | | | | | | | | | | PROBLEM ------- Memory sanitizer reports uninitialized comparisons in log_in_use(), because strings are compared with memcmp() instead of strncmp. FIX --- Use strncmp() to compare strings
* MDEV-18349 InnoDB file size changes are not safe when file system crashesMarko Mäkelä2019-01-232-2/+6
| | | | | fil_extend_space_to_desired_size(): Invoke fsync() after posix_fallocate() in order to durably extend the file in a crash-safe file system.
* MDEV-14580: mysql_install_db elements based on dirname of mysql_install_dbSergei Golubchik2019-01-211-4/+7
| | | | | | | | Avoid introducing new dependencies or new syntax. That is, don't use $(...) and don't assume dirname is present. And remove unsighty /foo/bar/../xyz from the path. Use dirname instead of ../
* MDEV-14580: mysql_install_db elements based on dirname of mysql_install_dbDaniel Black2019-01-211-0/+11
| | | | Closes #1086