Commit graph

32309 commits

Author SHA1 Message Date
Sergei Golubchik
269f0a6871 MDEV-6619 SHOW PROCESSLIST returns empty result set after KILL QUERY
don't send an OK packet if the SHOW PROCESSLIST was killed
2014-09-12 08:41:35 +02:00
Sergei Golubchik
6b720ae4cb MDEV-6605 Multiple Clients Inserting Causing Error: Failed to read auto-increment value from storage engine
* handler::get_auto_increment() was not expecting any errors from the storage engine.
  That was wrong, errors could happen.
* ha_partition::get_auto_increment() was doing index lookups in partition under a mutex.
  This was redundant (engine transaction isolation was covering that anyway)
  and harmful (causing deadlocks).
2014-09-08 18:38:13 +02:00
Sergei Golubchik
6389fd3c79 MDEV-6673 I_S.SESSION_VARIABLES shows global values
only look at lex->option_type if it's a SHOW command, not a SELECT
2014-08-31 19:55:11 +02:00
Sergei Golubchik
dd25e7f0ad MDEV-6601 Assertion `!thd->in_active_multi_stmt_transa ction() || thd->in_multi_stmt_transaction_mode()' failed on executing a stored procedure with commit
Don't restore the whole of thd->server_status after a routine invocation,
only restore SERVER_STATUS_CURSOR_EXISTS and SERVER_STATUS_LAST_ROW_SENT,
as --ps --embedded needs.
In particular, don't restore SERVER_STATUS_IN_TRANS.
2014-08-25 16:58:19 +02:00
Sergei Golubchik
04eec20000 MDEV-5706 MariaDB does not build on hurd-i386
Followup. Don't compile threadpool_unix.cc when thread pool is disabled
2014-08-12 16:39:12 +02:00
Sergei Golubchik
50e192a04f Bug#17638477 UNINSTALL AND INSTALL SEMI-SYNC PLUGIN CAUSES SLAVES TO BREAK
Fix the bug properly (plugin cannot be unloaded as long as it's locked).
Enable and fix the test case.
Significantly reduce number of LOCK_plugin locks for semisync
(practically all locks were removed)
2014-08-03 12:45:14 +02:00
Sergei Golubchik
1c6ad62a26 mysql-5.5.39 merge
~40% bugfixed(*) applied
~40$ bugfixed reverted (incorrect or we're not buggy)
~20% bugfixed applied, despite us being not buggy
(*) only changes in the server code, e.g. not cmakefiles
2014-08-02 21:26:16 +02:00
Sergei Golubchik
4b4de01fae 5.3 merge 2014-08-01 16:51:12 +02:00
unknown
a270e8abc4 MDEV-6441: memory leak
mysql_derived_prepare() was executed on the statement memory.
Now it is executed on the runtime memory.
All bugs induced by this were fixed.
2014-07-31 10:11:10 +03:00
Sergei Golubchik
c1c6f6f161 MDEV-5924 MariaDB could crash after changing the query_cache size with SET GLOBAL
* remove incorrect assertion (it didn't take into account concurrent clients)
* fix the comment
2014-07-29 12:05:58 +02:00
Alexander Barkov
5b452ae027 MDEV-4511 Assertion `scale <= precision' fails on GROUP BY TIMEDIFF with incorrect types
MDEV-6302 Wrong result set when using GROUP BY FROM_UNIXTIME(...)+0
Fixed.
2014-07-28 13:47:55 +04:00
Alexander Barkov
c57c5be12a MDEV-5745 analyze MySQL fix for bug#12368495 2014-07-28 12:47:14 +04:00
Sergei Golubchik
a6071cc596 MDEV-6082 Assertion `0' fails in TC_LOG_DUMMY::log_and_order on DML after installing TokuDB at runtime on server with disabled InnoDB
We don't support changing tc_log implementation at run time.
If the first XA-capable engine is loaded with INSTALL PLUGIN - disable its
XA capabilities with a warning
2014-07-27 21:02:00 +02:00
Sergei Golubchik
be667b8c42 MDEV-5706 MariaDB does not build on hurd-i386
backport from 10.0 the fix for:
  MDEV-5756 CMake option to build without thread pool
2014-07-25 14:15:33 +02:00
Sergei Golubchik
4e6e720160 MDEV-6290 Crash in KILL HARD QUERY USER x@y when slave threads are running
KILL USER should ignore system threads where sctx->user=sctx->host=NULL
2014-07-23 19:36:15 +02:00
Sergei Golubchik
1907bf042a MDEV-6409 CREATE VIEW replication problem if error occurs in mysql_register_view
fix by Sriram Patil
2014-07-23 12:01:05 +02:00
Sergey Petrunya
06655a192d MDEV-6322: The PARTITION engine can return wrong query results
MySQL Bug#71095: Wrong results with PARTITION BY LIST COLUMNS()
MySQL Bug#72803: Wrong "Impossible where" with LIST partitioning
MDEV-6240: Wrong "Impossible where" with LIST partitioning
- Backprot the fix from MySQL Bug#71095.
2014-07-23 22:48:31 +04:00
Sergey Petrunya
6b353dd1de MDEV-6289 : Unexpected results when querying information_schema
- When traversing JOIN_TABs with first_linear_tab/next_linear_tab(), don't forget
  to enter the semi-join nest when it is the first table in the join order.
  Failure to do so could cause e.g. I_S tables not to be filled.
2014-07-23 19:53:29 +04:00
Alexander Barkov
07cb53c58b Merge 5.3->5.5 2014-07-23 14:59:23 +04:00
Alexander Barkov
80708da138 MDEV-5750 Assertion `ltime->year == 0' fails on a query with EXTRACT DAY_MINUTE and TIME column
Item_func_min_max::get_date() did not clear ltime->year when returning a TIME value.
2014-07-23 13:38:48 +04:00
Ashish Agarwal
e9b2f5bf15 WL#7219: Reverting the wl#7219 patch in mysql-5.5.39-release branch 2014-07-19 11:24:21 +05:30
Ashish Agarwal
e892e71969 WL#7219: Pushing it to release 5.5.39-release branch 2014-07-17 19:21:56 +05:30
Venkata Sidagam
9406108356 Bug #17357528 BACKPORT BUG#16513435 TO 5.5 AND 5.6
Description: Backporting BUG#16513435 to 5.5 and 5.6
This is a fix for REMOTE PREAUTH USER ENUMERATION FLAW bug
2014-06-30 19:24:25 +05:30
Praveenkumar Hulakund
14aa44bb8f Bug#18903155: BACKPORT BUG-18008907 TO 5.5+ VERSIONS.
Backporting patch committed for bug 18008907 to 5.5
and 5.6.
2014-06-27 17:04:08 +05:30
Raghav Kapoor
cdf72d51c6 BUG#17665767 - FAILING ASSERTION: PRIMARY_KEY_NO == -1 || PRIMARY_KEY_NO == 0
BACKGROUND:
This bug is a followup on Bug#16368875.
The assertion failure happens because in SQL layer the key
does not get promoted to PRIMARY KEY but InnoDB takes it
as PRIMARY KEY.

ANALYSIS:
Here we are trying to create an index on POINT (GEOMETRY)
data type which is a type of BLOB (since GEOMETRY is a
subclass of BLOB).
In general, we can't create an index over GEOMETRY family
type field unless we specify the length of the
keypart (similar to BLOB fields).
Only exception is the POINT field type. The POINT column
max size is 25. The problem is that the field is not treated
as PRIMARY KEY when we create a index on POINT column using
its max column size as key part prefix. The fix would allow
index on POINT column to be treated as PRIMARY KEY.

FIX:
Patch for Bug#16368875 is extended to take into account
GEOMETRY datatype, POINT in particular to consider it
as PRIMARY KEY in SQL layer.
2014-06-25 18:06:28 +05:30
Nisha Gopalakrishnan
d63645c890 BUG#18405221: SHOW CREATE VIEW OUTPUT INCORRECT
Fix:
---
The issue reported is same as the BUG#14117018.
Hence backporting the patch from mysql-trunk
to mysql-5.5 and mysql-5.6
2014-06-25 16:33:04 +05:30
Gopal Shankar
119984db0c Bug#18776592 INNODB: FAILING ASSERTION: PRIMARY_KEY_NO == -1 ||
PRIMARY_KEY_NO == 0 

This bug is a backport of the following revision of 5.6 source tree:
# committer: Gopal Shankar <gopal.shankar@oracle.com>
# branch nick: priKey56
# timestamp: Wed 2013-05-29 11:11:46 +0530
# message:
#   Bug#16368875 INNODB: FAILING ASSERTION:
2014-06-25 09:50:17 +05:30
Sergey Vojtovich
ec4f1d197d MDEV-6313 - mysqld --log-bin=no-such-dir/master crashes during
server initialization

ER() macro was used during server initialization. It refers to
current_thd, which is not available that early.

Print error to error log in "lc-messages" locale.
Avoid duplicate error message during server initialization.
2014-06-24 11:41:35 +04:00
Nisha Gopalakrishnan
24756e8e3f BUG#18618561: FAILED ALTER TABLE ENGINE CHANGE WITH PARTITIONS
CORRUPTS FRM

Analysis:
---------
ALTER TABLE on a partitioned table resulted in the wrong
engine being written into the table's FRM file and displayed
in SHOW CREATE TABLE.

The prep_alter_part_table() modifies the partition_info object
for TABLE instance representing the old version of table.
If the ALTER TABLE ENGINE statement fails, the partition_info
object for the TABLE contains the altered storage engine name.
The SHOW CREATE TABLE uses the TABLE object to display the table
information, hence displays incorrect storage engine for the table.
Also a subsequent successful ALTER TABLE operation will write the
incorrect engine information into the FRM file.

Fix:
---
A copy of the partition_info object is created before modification so
that any changes would not cause the the original partition_info object
to be modified if the ALTER TABLE fails.(Backported part of the code
provided as fix for bug#14156617 in mysql-5.6.6).
2014-06-24 10:15:53 +05:30
Gleb Shchepa
01fd5d0d0e Bug #18978946: BACKPORT TO 5.6: BUGFIX FOR 18017820 "BISON 3 BREAKS MYSQL BUILD"
Backport of the fix:

: Bug 18017820: BISON 3 BREAKS MYSQL BUILD
: ========================================    
: 
: The source of the reported problem is a removal of a few deprecated
: things from Bison 3.x: 
: * YYPARSE_PARAM macro (use the %parse-param bison directive instead),
: * YYLEX_PARAM macro (use %lex-param instead),
: 
: The fix removes obsolete macro calls and introduces use of
: %parse-param and %lex-param directives.
2014-06-23 19:59:15 +04:00
Jon Olav Hauglid
879fec69fc WL#7436: Deprecate and remove timed_mutexes system variable
This is the 5.5/5.6 version of the patch.

Add deprecation warning for timed_mutexes.
2014-06-19 16:47:41 +02:00
Sergey Vojtovich
3375e137f8 MDEV-6351 - --plugin=force has no effect for built-in plugins
mysqld didn't fail to start if a compiled-in plugin failed to initialize
(--xxx=FORCE behaving as --xxx=ON)
2014-06-17 13:03:26 +04:00
Sergey Petrunya
c714073bfd MDEV-6434: Wrong result (extra rows) with ORDER BY, multiple-column index, InnoDB
- Part #2. Fix obvious problems in the previous patch.
2014-07-22 19:32:58 +04:00
Sergey Petrunya
07c0b1d8d0 MDEV-6434: Wrong result (extra rows) with ORDER BY, multiple-column index, InnoDB
- Filesort has an optmization where it reads only columns that are 
  needed before the sorting is done.
- When ref(_or_null) is picked by the join optimizer, it may remove parts
  of WHERE clause that are guaranteed to be true.
- However, if we use quick select, we must put all of the range columns into the 
  read set. Not doing so will may cause us to fail to detect the end of the range.
2014-07-22 15:52:49 +04:00
unknown
081926f3d8 MDEV-6188: master_retry_count (ignored if disconnect happens on SET master_heartbeat_period)
That particular part of slave connect to master was missing code to handle
retry in case of network errors. The same problem is present in MySQL 5.5, but
fixed in MySQL 5.6.

Fixed with this patch, by adding the code (mostly identical to MySQL 5.6), and
also adding a test case.

I checked other queries done towards master during slave connect, and they now
all seem to handle reconnect in case of network failures.
2014-06-17 14:10:13 +02:00
Sujatha Sivakumar
14544cefc9 Bug#18432495:RBR REPLICATION SLAVE CRASHES WHEN DELETE
NON-EXISTS RECORDS

Problem:
========
In RBR replication, master deletes a record but the record
don't exist on slave. when slave tries to apply the
Delete_row_log_event from master, it will result in an
assert on slave.

Analysis:
========
This problem exists not only with Delete_rows event but also
with Update_rows event as well. Trying to update a non
existing row on the slave from the master will cause the
same assert.  This assert occurs only for the tables that
doesn't have primary keys and which basically require
sequential scan to be done to locate a record. This bug
occurs only with innodb engine not with myisam.

When update or delete rows is executed on a slave on a table
which doesn't have primary key the updated record is stored
in a buffer named table->record[0] and the same is copied to
table->record[1] so that during sequential scan
table->record[0] can reloaded with fetched data from the
table and compared against table->record[1].  In a special
case where there is no record on the slave side scan will
result in EOF in that case we reinit the scan and we try to
compare record[0]  with record[1] which are basically the
same. This comparison is incorrect. Since they both are the
same record_compare() will report that record is found and
we try to go ahead and try to update/delete non existing
row. Ideally if the scan results in EOF means no data found
hence no need to do a record_compare() at all.

Fix:
===
Avoid comparision of records on EOF.

sql/log_event.cc:
  Avoid record comparison on end of file.
sql/log_event_old.cc:
  Avoid record comparison on end of file.
2014-06-16 10:06:44 +05:30
Sergey Vojtovich
a4aa1f852d MDEV-6329 - Buffer overrun in find_uniq_filename
Merged WebScaleSQL fix:
bce9eddc1d
2014-06-11 16:23:20 +04:00
Tor Didriksen
f88e362fbc Bug#18786138 SHA/MD5 HASHING FUNCTIONS DIE WITH "FILENAME" CHARACTER SET
For charsets with no binary collation: use my_charset_bin.
2014-06-06 16:49:25 +02:00
Sergey Petrunya
c7e5a1f70d MDEV-6105: Emoji unicode character string search query makes mariadb performance down
- When range optimizer cannot the lookup value into [VAR]CHAR(n) column,
  it should produce:
  = "Impossible range" for equality
  = "no range" for non-equalities.
2014-06-05 19:18:35 +04:00
Alexander Barkov
7d3a67a976 Merge 5.3->5.5 2014-06-05 09:15:25 +04:00
Alexander Barkov
30b007a1ab Fixing a valgrind warning introduced in the previous changeset:
"have_warnings" was set to an uninialized value when converting
a negative number to datetime.
2014-06-05 09:01:05 +04:00
Alexander Barkov
284479c085 Merge 5.3->5.5 2014-06-04 21:53:15 +04:00
Alexander Barkov
661daf16f1 MDEV-4858 Wrong results for a huge unsigned value inserted into a TIME column
MDEV-6099 Bad results for DATE_ADD(.., INTERVAL 2000000000000000000.0 SECOND)
MDEV-6097 Inconsistent results for CAST(int,decimal,double AS DATETIME)
MDEV-6100 No warning on CAST(9000000 AS TIME)
2014-06-04 20:32:57 +04:00
unknown
55bfabf971 MDEV-6163: Error while executing an update query that has the same table in a sub-query
We have to run the derived table prepare before the unique table check to mark the derived table (in this case the unique table check can turn that table to materialized one).
2014-06-04 10:10:19 +03:00
Sergei Golubchik
5d16592d44 mysql-5.5.38 merge 2014-06-03 09:55:08 +02:00
Sergei Golubchik
e5daa0946f 5.3 merge 2014-06-02 19:08:59 +02:00
unknown
0fbe91b45b MDEV-6251: SIGSEGV in query optimizer (in set_check_materialized with MERGE view)
mysql_derived_merge() made correctly working with views.
2014-06-02 15:36:06 +03:00
Sergey Petrunya
d533a64bf3 MDEV-6239: Partition pruning is not working as expected in an inner query
- Make partition pruning work for tables inside semi-join nests
  (the new condition is the same that range optimizer uses so 
   it should be ok)
2014-05-29 02:25:37 +04:00
Sergey Petrunya
dedc76b7d9 MDEV-6263: Wrong result when using IN subquery with order by
- When the optimizer chose LooseScan, make_join_readinfo() should
  use the index that was chosen for LooseScan, and should not try 
  to find a better (shortest) index.
2014-05-28 17:32:43 +04:00
Tor Didriksen
ab8bd02b9b Bug#18315770 BUG#12368495 FIX IS INCOMPLETE
Item_func_ltrim::val_str did not handle multibyte charsets.
Fix: factor out common code for Item_func_trim and Item_func_ltrim.
2014-05-16 10:18:43 +02:00