Post-fix #2:
- Update test results
- Make the optimization conditional under @@optimizer_switch flag.
- The optimization is now disabled by default, so .result files
are changed back to be what they were before the MDEV-8989 patch.
Variant #4 of the fix.
Make ORDER BY optimization functions take into account multiple
equalities. This is done in several places:
- remove_const() checks whether we can sort the first table in the
join, or we need to put rows into temp.table and then sort.
- test_if_order_by_key() checks whether there are indexes that
can be used to produce the required ordering
- make_unireg_sortorder() constructs sort criteria for filesort.
When simplify_joins() converts an outer join to an inner, it should
reset the value of TABLE::dep_tables. This is needed, because the
function may have already set TABLE::dep_tables according to the outer
join dependency.
don't use MY_THREAD_SPECIFIC on the client side
in embedded:
1. server memory accounting does not track client
side memory
2. in not embedded builds, this still *might* be
useful for plugins (handlersocket, connect, etc)
including the test case:
https://github.com/mysql/mysql-server/commit/520aedfe
INNODB: "DATA DIRECTORY" OPTION OF CREATE TABLE FAILS WITH PWRITE() OS
ERROR 22
Fix for version mysql-5.6
PROBLEM
========
For version mysql-5.6.27 onwards InnoDB fails to create a table
with explicit 'data directory' option when Innodb_flush_method
is set to O_DIRECT.While creating link file we get a a pwrite
error 22 due to the alignment restrictions imposed by O_DIRECT
flag which is being set for the link file created.
FIX
===
Fixed the above issue by making use of file IO functions while
creating the link file that wouldn't let the O_DIRECT flag
restrictions arise.
Reviewed-by: Kevin Lewis <kevin.lewis@oracle.com>
Reviewed-by: Shaohua Wang <shaohua.wang@oracle.com>
RB: 11387
An additional warning saying "tc-log cannot be enabled"
is emitted when InnoDB is installed at runtime on mysqld
built with wsrep-patch (-DWITH_WSREP=ON).
This happens because, installing InnoDB increments the
total number of 2pc-capable engines and with wsrep-patch
already enabled - the total count goes >1. Even though,
this condition is sufficient to enable tc-logging, it is
not permitted at runtime, and thus the warning.
Updated the testcase to avoid the warning.
10.1 introduced a problem:
Execution time for various recursive stages
(walk, update_used_table, and propagate_equal_fields)
in NULLIF is O(recursion_level^2), because complexity is
doubled on every recursion level when we copy args[0] to args[2].
This change fixes to avoid unnecessary recursion in:
- Item_func_nullif::walk
- Item_func_nullif::update_used_tables
- Item_func_nullif::propagate_equal_fields
when possible.
take MDL_SHARED_WRITE instead of MDL_SHARED_NO_READ_WRITE
for OPTIMIZE TABLE. For engines that need a stronger
lock (like MyISAM), reopen the table with
MDL_SHARED_NO_READ_WRITE.
Two bugs here:
* the server could create an frm (with a long attribute
value) that it could not read back
* Connect engine opened files from inside DROP TABLE
and was ignoring the error (correctly) but was not
hiding it from the server (incorrectly). This caused
a crash later when DROP TABLE was finishing successfully
while stmt_da already have seen an error.
Also added a text case for
MDEV-7935 CREATE TABLE ... AS SELECT ... can cause a Server crash (Assertion `0' in Protocol::end_statement)
because Connect stopped clearing the error status
in stmt_da as a fix for MDEV-7935
* my_yyabort_error() helper
* s/lex->thd/thd/
* remove 'else' after MYSQL_YYABORT (for consistency,
95% of the parser did not use 'else' in this case)
* simplify ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
Compiler there is strict about the C/C++ call model
mixing in function variable assumptions.
Fixed by adding some 'extern "C"' and changing
'?' operator with 'if'.
MySQL 5.6 do not work with MariaDB 10.1
Analysis: Problem is that tablespace flags bit DATA_DIR
is on different position on MySQL 5.6 compared to
MariaDB 10.1.
Fix: If we detect that there is difference between dictionary
flags and tablespace flags we remove DATA_DIR flag and compare
again. Remote tablespace is tried to locate even in case
when DATA_DIR flag is not set.
The check_user_can_set_role() used find_user_exact() to get the
permissions for the SET ROLE NONE command. Which returned NULL too often,
for instance when user authenticated as 'user'@'%'.
Now we use find_user_wild() instead.
Added mysql_to_mariadb.sql script, to change mysql.user tables from
MySQL 5.7 to MariaDB.
After this script is run, one can get the other tables fixed by running
mysql_upgrade
Analysis: When pages in doublewrite buffer are analyzed compressed
pages do not have correct checksum.
Fix: Decompress page before checksum is compared. If decompression
fails we still check checksum and corrupted pages are found.
If decompression succeeds, page now contains the original
checksum.
Clang warns on this code because it is memsetting over a vtable contained in a
struct in the best_positions array. The diagnostic text is:
mariadb/sql/sql_select.cc:24462:10: error: destination for this 'memset' call is
a pointer to class containing a dynamic class 'Duplicate_weedout_picker'; vtable
pointer will be overwritten [-Werror,-Wdynamic-class-memaccess]
memset(best_positions, 0, sizeof(POSITION) * (table_count + 1));
~~~~~~ ^
Patch contributed by David Gow.