Commit graph

173973 commits

Author SHA1 Message Date
Sergei Petrunia
5a5a54f7b4 MDEV-8989: ORDER BY optimizer ignores equality propagation
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.
2016-06-01 23:43:11 +03:00
Sergei Petrunia
a85f6533f1 MDEV-8989: ORDER BY optimizer ignores equality propagation
Post-fix: add comments, remove dead-code.
2016-05-27 15:16:08 +03:00
Sergei Petrunia
99cd5a962c MDEV-8989: ORDER BY optimizer ignores equality propagation
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.
2016-05-23 21:17:18 +03:00
Alexander Barkov
9c9747fed3 Updating uca-dump.c to be able to dump weights outside of BMP. 2016-05-18 12:35:38 +04:00
Sergei Petrunia
9eaf9345a5 Update test result after the last commit 2016-05-17 14:01:16 +03:00
Sergei Petrunia
5c68bc2c32 MDEV-10006: optimizer doesn't convert outer join to inner on views with WHERE clause
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.
2016-05-11 15:55:14 +03:00
Daniel Bartholomew
4388cb42f5 bump the VERSION 2016-05-10 09:28:00 -04:00
Elena Stepanova
ee0695b807 Fix 32-bit sysvars test 2016-05-08 13:37:12 +03:00
Sergei Golubchik
234efb1d28 update 32-bit rdiff results 2016-05-08 08:21:57 +02:00
Sergei Golubchik
af93c02510 MDEV-10034 Embedded server crashes on CREATE TABLE in PS protocol
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)
2016-05-07 09:12:48 +02:00
Jan Lindström
5534d81430 Merged following change from MySQL 5.6 to MariaDB 10.1 XtraDB
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
2016-05-06 13:56:25 +03:00
Nirbhay Choubey
1512078a7a MDEV-9851: CREATE USER w/o IDENTIFIED BY clause causes crash when using cracklib plugin
Do not allow NULL password to pass directly to password
validation plugin.
2016-05-05 09:19:40 -04:00
Nirbhay Choubey
edbd0cedda MDEV-9171: innodb.innodb_uninstall Test Failure
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.
2016-05-05 09:19:40 -04:00
Nirbhay Choubey
9a5c75a073 MDEV-9853: WSREP says it cannot get fake InnoDB transaction ID followed by segmentation fault
Ha_trx_info should not be reset in ha_fake_trx_id() as it is
later used during commit.
2016-05-05 09:19:39 -04:00
Nirbhay Choubey
9b2151f6af metadata_lock_info: Add compile time assertions
This is to ensure that the list of valid values for
METADATA_LOCK_INFO fields is always kept in sync with
the parent MDL types.
2016-05-05 09:19:39 -04:00
Nirbhay Choubey
7abb570756 MDEV-6211: MariaDB-Galera-server uses 'socat', but 'socat' is not in the dependency list
Xtrabackup-based SST method uses socat. Move it from
Suggests to Depends list.
2016-05-05 09:19:39 -04:00
Nirbhay Choubey
0a1c2a2051 Merge branch '10.0-galera' into 10.1 2016-05-05 09:15:04 -04:00
Alexander Barkov
a87507eec3 MDEV-9712 Performance degradation of nested NULLIF
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.
2016-05-05 15:39:04 +04:00
Sergei Golubchik
19c4d22a1e skip debug_sync test in release builds 2016-05-05 12:35:12 +02:00
Sergei Golubchik
4025251efd fix rpm installation issues on Fedoras 2016-05-05 12:29:40 +02:00
Alexey Botchkov
3a88adc3b2 MDEV-717 LP:1003679 - Wrong binlog order on concurrent DROP schema and
CREATE function.

         Test case added.
2016-05-05 11:28:35 +04:00
Sergei Golubchik
46973bb3ad Merge branch 'bb-10.1-merge' into 10.1 2016-05-05 08:47:17 +02:00
Sergei Golubchik
153259874b MDEV-9155 Enabling Defragmenting in 10.1.8 still causes OPTIMIZE TABLE to take metadatalocks
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.
2016-05-05 01:05:05 +02:00
Sergei Golubchik
5ef0ce4131 comments 2016-05-05 01:05:05 +02:00
Sergei Golubchik
92e47c393f test for group by pushdown with a view 2016-05-05 01:05:05 +02:00
Sergei Golubchik
ea195d372b MDEV-9949 Connect Engine: long SRCDEF leads to broken table
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
2016-05-05 01:05:05 +02:00
Sergei Golubchik
09464ddec4 small parser cleanup
* 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
2016-05-05 01:05:05 +02:00
Sergei Golubchik
bf9404d3a4 protect against corrupted frms
when reading table options
2016-05-05 01:05:05 +02:00
Sergei Golubchik
bba3d42a1f MDEV-9926 probes_mysql.h includes nonexisting files
install private generated files
2016-05-05 01:05:05 +02:00
Sergei Golubchik
4db2ebb1fe MDEV-9940 CREATE ROLE blocked by password validation plugin 2016-05-05 01:05:05 +02:00
Sergei Golubchik
357f4d832b Merge branch 'connect/10.1' into 10.1 2016-05-05 01:04:05 +02:00
Sergei Golubchik
404056563e fixes for buildbot 2016-05-04 20:28:20 +02:00
Oleksandr Byelkin
fba385e3b1 MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops with UNION in ALL subquery
Do not mark subquery as inexpensive when it is not optimized.
2016-05-04 19:46:29 +02:00
Sergei Golubchik
87e3e67f43 Merge branch '10.0' into 10.1 2016-05-04 15:23:26 +02:00
Alexey Botchkov
a02d4023db MDEV-9618 solaris sparc build fails on 10.1.
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'.
2016-05-04 11:42:39 +04:00
Jan Lindström
5dd0c77e92 MDEV-9362: InnoDB tables using DATA_DIRECTORY created using
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.
2016-05-03 21:35:41 +03:00
Sergei Golubchik
80da57cc4f remove the forgotten PARENT_SCOPE 2016-05-03 20:13:58 +02:00
Vladislav Vaintroub
67723e9618 Move MYSQL_ADD_PLUGIN outside of IF(OQGRAPH_OK) condition,
otherwise the plugin does not get compiled if
cmake is called multiple times.
2016-05-03 15:23:34 +02:00
Vladislav Vaintroub
673efd0648 MDEV-10015 Fix oqgraph compilation on Windows 2016-05-03 15:18:55 +02:00
Alexey Botchkov
94cd0f6c9b MDEV-9898 SET ROLE NONE can crash mysqld.
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.
2016-05-02 12:58:57 +04:00
Monty
ad4239cc3d Fixed assert if user table was mailformed.
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
2016-05-01 18:52:13 +03:00
Daniel Bartholomew
cee9ab9d85 bump the VERSION 2016-04-30 11:23:46 -04:00
Nirbhay Choubey
c0238be6cf Merge branch '5.5-galera' into 10.0-galera 2016-04-29 16:59:25 -04:00
Nirbhay Choubey
8a1efa1bdd Merge branch '10.0' into 10.0-galera 2016-04-29 16:50:58 -04:00
Jan Lindström
037b78e5ec MDEV-9242: Innodb reports Assertion failure in file buf0dblwr.cc line 579
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.
2016-04-29 13:47:49 +03:00
Vladislav Vaintroub
9eba34f086 Fix crash due to heap corruption in main.shm 2016-04-28 22:18:15 +02:00
Sergey Vojtovich
94bad73dd1 MDEV-9988 - Insert cast to suppress -Wdynamic-class-memaccess
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.
2016-04-28 22:04:41 +04:00
Monty
d5822a3ad0 Fixed some galera tests 2016-04-28 16:30:34 +03:00
Monty
d62b758522 Moved mysqld_server_initialized to before galera is initialized. 2016-04-28 16:30:34 +03:00
Jan Lindström
ea83c1d7c6 MDEV-9977: Crash when accessing large (>4G) InnoDB table on
MariaDB 10.1.x 32-bit binaries.

Problem was the fact that tablespace size was incorrectly
rounded to next extent size (1M).
2016-04-28 15:22:27 +03:00