Commit graph

170835 commits

Author SHA1 Message Date
Sergey Vojtovich
727da9c8ec MDEV-8379 - SUSE mariadb patches
Fixed unclean prototype declaration. According to ISO/IEC 9899:TC2:
...
10. The special case of an unnamed parameter of type void as the only item in
    the list specifies that the function has no parameters.
...
14. An identifier list declares only the identifiers of the parameters of the
    function. An empty list in a function declarator that is part of a
    definition of that function specifies that the function has no parameters.
    The empty list in a function declarator that is not part of a definition of
    that function specifies that no information about the number or types of the
    parameters is supplied. 124)
...
6.11.6 Function declarators

The use of function declarators with empty parentheses (not prototype-format
parameter type declarators) is an obsolescent feature.
...

Patch contributed by Michal Hrusecky.
2015-10-01 13:04:59 +04:00
Jan Lindström
006acf7454 Bug #68148: drop index on a foreign key column leads to missing table
MDEV-8845: Table disappear after modifying FK

Added test case.
2015-09-30 10:49:45 +03:00
Jan Lindström
a95711e45d MDEV-8855: innodb.innodb-fk-warnings fails on Windows
Fixed incorrect access to freed memory.
2015-09-29 08:39:54 +03:00
Oleksandr Byelkin
02a38fd27e MDEV-8624: MariaDB hangs on query with many logical condition
Made no_rows_in_result()/restore_to_before_no_rows_in_result() not looking
annecessary deep with walk() method.
2015-09-28 11:56:33 +02:00
Elena Stepanova
f804b74fd4 MDEV-8154 rpl.show_status_stop_slave_race-7126 sporadically causes internal check failure
The patch was pushed into 10.0, but it needs to be applied to 5.5 as well
2015-09-28 03:40:29 +03:00
Elena Stepanova
ce7d8c5ee8 MDEV-7330 plugins.feedback_plugin_send fails sporadically in buildbot
The test restarts the server and expects that the feedback plugin
will send a report on shutdown, and will write about it in the error
log. But the server is only given 10 sec to shut down properly,
which is not always enough.
Added a parameter to restart_mysqld.inc, and set it to a bigger
value in feedback_plugin_send
2015-09-27 18:01:47 +03:00
Elena Stepanova
bdcf370765 MDEV-7933 plugins.feedback_plugin_send depends on being executed after plugins.feedback_plugin_load
The culprit is the feedback_plugin_load test, which is run both separately
and from inside feedback_plugin_send.test. The test queries I_S.FEEDBACK,
and every time it does, 'FEEDBACK used' value is increased.
Fixed by checking that the value is increased instead of recording the actual
value in the result file.
2015-09-27 16:00:48 +03:00
Elena Stepanova
256360956f Increased the version number 2015-09-26 02:51:29 +03:00
Elena Stepanova
86ed494aef MDEV-8849 rpl.rpl_innodb_bug30888 sporadically fails in buildbot with testcase timeout
The test would take really long if it was run without --mem.
Fixed by adding --innodb-flush-log-at-trx-commit=2
2015-09-26 02:48:55 +03:00
Elena Stepanova
dca4ab92b8 MDEV-8841 innodb_zip.innodb-create-options fails in buildbot
The real problem is that when innodb.xa_recovery test intentionally
crashes the server, system tables can be opened and marked as crashed,
and the next test in line gets blamed for the error which appears
in the error log.
Fixed by flushing the tables before crashing the server
2015-09-24 21:24:28 +03:00
Oleksandr Byelkin
5cc149feba The compiler warnings fixed. 2015-09-24 10:28:47 +02:00
Kristian Nielsen
fea156813a Fix sporadic test failure in rpl_gtid_mdev4820.test
Use sync_with_master_gtid.inc instead of --sync_with_master. The latter is
not correct because the test case uses RESET MASTER; this invalidates the
existing binlog positions on the slave.

In this particular case, there was a small window where --sync_with_master
could trigger too early (on the old position), causing the test case to miss
one event.
2015-09-22 13:35:23 +02:00
Sergei Petrunia
81727cd774 Backport to 10.0: MDEV-8779: mysqld got signal 11 in sql/opt_range_mrr.cc:100(step_down_to)
Post fix: initialize a variable
2015-09-22 12:54:01 +03:00
Sergei Petrunia
8d0d4451d3 Backport to 10.0: MDEV-8779: mysqld got signal 11 in sql/opt_range_mrr.cc:100(step_down_to)
The crash was caused by range optimizer using RANGE_OPT_PARAM::min_key
(and max_key) to store keys. Buffer size was a good upper bound for
range analysis and partition pruning, but not for EITS selectivity
calculations.

Fixed by making these buffers variable-size. The sizes are calculated
from [pseudo]indexes used for range analysis.
2015-09-21 17:32:37 +03:00
Robert Golebiowski
b9768521bd Updated yassl to yassl-2.3.8
(cherry picked from commit 7f9941eab55ed672bfcccd382dafbdbcfdc75aaa)
2015-09-18 16:13:38 +02:00
Robert Golebiowski
0243a2d432 Bug #21025377 CAN'T CONNECT TO SSL ENABLED SERVER FIRST 30 SEC AFTER
INITIAL STARTUP

Updated yassl to yassl-2.3.7e

(cherry picked from commit 6e21c8c04b922bdb60b6a7c174709d2e1bdd3618)
2015-09-18 16:13:18 +02:00
Oleksandr Byelkin
abd31ca2b6 MDEV-7990: ERROR 1526 when procedure executed for second time ALTER TABLE partition ... pMAX values less than MAXVALUE
Made dipper copy of the lists, so now one execution has no influence on the
other.
2015-09-14 09:56:17 +02:00
Kristian Nielsen
39e8dc9d28 Merge. 2015-09-12 00:43:31 +02:00
Kristian Nielsen
528729fc5d MDEV-8193: UNTIL clause in START SLAVE is sporadically disobeyed by parallel replication
Adjust the test case to try and avoid some sporadic failures on loaded test
hosts.

The wait for SQL thread to stop may complete before worker threads
have completed.
2015-09-12 00:42:21 +02:00
Kristian Nielsen
244f043e6e Merge MDEV-8193 into 10.0 2015-09-11 12:03:04 +02:00
Kristian Nielsen
51eaa7fe53 MDEV-8193: UNTIL clause in START SLAVE is sporadically disobeyed by parallel replication
The code was using the wrong variable when comparing the binlog name
for the UNTIL position. This could cause the comparison to fail after
binlog rotation, in turn causing the UNTIL clause to not trigger slave
stop.
2015-09-11 10:51:56 +02:00
Oleksandr Byelkin
29ac245dd0 MDEV-8473: mysqlbinlog -v does not properly decode DECIMAL values in an RBR log
Backport of upstream patch. revno: 5696
2015-09-07 13:13:52 +02:00
Oleksandr Byelkin
0ce0b88080 MDEV-8450: PATCH] Wrong macro expansion in Query_cache::send_result_to_client()
Expression in macro protected by ()
2015-09-06 22:26:33 +02:00
Oleksandr Byelkin
102a85f9f3 MDEV-8663: IF Statement returns multiple values erroneously (or Assertion `!null_value' failed in Item::send(Protocol*, String*))
Postreview addons by Bar

Fix: keeping contract: NULL value mean NULL pointer in val_str and val_deciman.
2015-09-04 15:56:58 +02:00
Jan Lindström
9abf426ee7 MDEV-8443: mysql-test - innodb.innodb_simulate_comp_failures 'innodb_plugin' is failing
Reduce the number of rounds and operations to avoid testcase timeout.
2015-09-04 13:35:31 +03:00
Oleksandr "Sanja" Byelkin
bd8ffe7018 Merge pull request #87 from pivanof/qplan_macros
Add parenthesis in macro definitions to prevent order of operation problems
2015-09-03 09:39:57 +02:00
Kristian Nielsen
83c7b1e95b Merge MDEV-8725 into 10.0 2015-09-02 10:40:34 +02:00
Kristian Nielsen
09bfaf3a13 Fix a potential lost wakeup for binlog_commit_wait_usec
If a transaction T1 needs to wait for a transaction T2, T2's commit will
skip the normal binlog_commit_wait_usec delay, in order not to needlessly
stall throughput.

This works by checking if T2 is already ready to commit. If so, it is woken
up. If not, we set a flag in T2 so that when it gets ready to commit, it
will do so immediately.

But there was a potential race due to insufficient locking, if T2 gets ready
to commit just at the point where T1 does the check. If the race hits, the
wakeup (and early commit) of T2 might be lost.

The race is only theoretical (from code inspection, no known test case), but
seems best to fix it anyway, by properly locking LOCK_prepare_ordered around
the check.
2015-09-02 10:08:09 +02:00
Kristian Nielsen
999c43aeb7 MDEV-8725: Assertion `!(thd->rgi_slave && thd-> rgi_slave->did_mark_start_commit)' failed in ha_rollback_trans
The assertion is there to catch cases where we rollback while
mark_start_commit() is active. This can allow following event groups
to be replicated too early, causing conflicts.

But in this case, we have an _explicit_ ROLLBACK event in the binlog,
which should not assert.

We fix this by delaying the mark_start_commit() in the explicit
ROLLBACK case. It seems safest to delay this in ROLLBACK case anyway,
and there should be no reason to try to optimise this corner case.
2015-09-02 09:57:18 +02:00
Oleksandr Byelkin
4b41e3c7f3 MDEV-6219: Server crashes in Bitmap<64u>::merge (this=0x180, map2=...) on 2nd execution of PS with INSERT .. SELECT, derived_merge
Problem: Not all permanent Item_direct_view_ref was in permanent list of used items of the view.

Solution: Detect creating permenent view/derived table reference and put them in the permanent list at once.
2015-08-31 18:40:24 +02:00
Balasubramanian Kandasamy
b1895fb8c9 Bug#21527467 - RPM SCRIPTS FAIL WITH MULTIPLE DATADIR 2015-08-26 19:29:00 +02:00
Nisha Gopalakrishnan
e414cbffad BUG#20449914: HANDLE_FATAL_SIGNAL (SIG=11) IN
FIELD_ITERATOR_TABLE::END_OF_FIELDS

Note: This a backport of the patch for bug#19894987
      to MySQL-5.5
2015-08-25 14:25:46 +05:30
Elena Stepanova
b66455f67d Increase the version number 2015-08-24 01:41:12 +03:00
Elena Stepanova
aef8bfdc82 MDEV-8670 main.mdev-504 fails on Windows (in buildbot and outside)
Test failed because it hit net_write_timeout. It might happen in
different circumstances, and that's not what the testcase tests,
so the timeout is now set to a bigger value.
2015-08-24 01:37:21 +03:00
Arun Kuruvila
f4ff086abe Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO
PROBLEMS

Description:- Server variable "--lower_case_tables_names"
when set to "0" on windows platform which does not support
case sensitive file operations leads to problems. A warning
message is printed in the error log while starting the
server with "--lower_case_tables_names=0". Also according to
the documentation, seting "lower_case_tables_names" to "0"
on a case-insensitive filesystem might lead to index
corruption.

Analysis:- The problem reported in the bug is:-
Creating an INNODB table 'a' and executing a query, "INSERT
INTO a SELECT a FROM A;" on a server started with
"--lower_case_tables_names=0" and running on a
case-insensitive filesystem leads innodb to flat spin.
Optimizer thinks that "a" and "A" are two different tables
as the variable "lower_case_table_names" is set to "0". As a
result, optimizer comes up with a plan which does not need a
temporary table. If the same table is used in select and
insert, a temporary table is needed. This incorrect
optimizer plan leads to infinite insertions.

Fix:- If the server is started with
"--lower_case_tables_names" set to 0 on a case-insensitive
filesystem, an error, "The server option
'lower_case_table_names'is configured to use case sensitive
table names but the data directory is on a case-insensitive
file system which is an unsupported combination. Please
consider either using a case sensitive file system for your
data directory or switching to a case-insensitive table name
mode.", is printed in the server error log and the server
exits.
2015-08-21 08:35:42 +05:30
Lars Tangvald
75f43c5f6a Small change to default config for Docker-specific rpm package
Syncs "official" and our own Docker images
2015-08-19 14:18:42 +02:00
Sergei Petrunia
9b475ee3c1 MDEV-8289: Semijoin inflates number of rows in query result
- Make semi-join optimizer not to choose LooseScan
  when 1) the index is not covered and 2) full index
  scan will be required.

- Make sure that the code in make_join_select() that may change
  full index scan into a range scan is not invoked when the table
  uses full scan.
2015-08-18 22:54:42 +03:00
Shishir Jaiswal
ee02650bac Bug #16171518 - LOAD XML DOES NOT HANDLE EMPTY ELEMENTS
DESCRIPTION
===========
Inability of mysql LOAD XML command to handle empty XML
tags i.e. <row><tag/></row>. Also the behaviour is wrong
and (different than above) when there is a space in empty
tag i.e. <row><tag /></row>

ANALYSIS
========
In read_xml() the case where we encounter a close tag ('/')
we're decreasing the 'level' blindly which is wrong.
Actually when its an without-space-empty-tag (succeeding
char is '>'), we need to skip the decrement. In other words
whenever we hit a close tag ('/'), decrease the 'level'
only when (i) It's not an (without space) empty tag i.e.
<tag/> or, (ii) It is of format <row col="val" .../>

FIX
===
The switch case for '/' is modified. We've removed the
blind decrement of 'level'. We do it only when its not an
without-space-empty-tag. Also we are setting 'in_tag' to
false to let program know that we're done reading current
tag (required in the case of format <row col="val" .../>)
2015-08-18 12:24:27 +05:30
Karthik Kamath
93ac0eb1c4 BUG#11754258: INCORRECT ERROR MESSAGE WHEN CREATING UNSAFE
VIEW


It appears that the code refactoring done as part of the
patch for the MySQL BUG#11749859 fixed this issue. This
issue is not reproducible on MySQL 5.5+ versions now.
As part of this patch, the test file "mysqldump.test" has
been updated to remove the comment which was referring to
the bug and also the line which suppresses the warning.
2015-08-18 10:38:06 +05:30
Mithun C Y
8fe0708808 Merge branch 'mysql-5.1' into mysql-5.5 2015-08-17 15:26:01 +05:30
Mithun C Y
557a57f3a2 Bug #21350175: SUBQUERIES IN PROCEDURE CLAUSE OF SELECT STATEMENT CAUSES SERVER FAILURES.
Analysis :
==========
During JOIN::prepare of sub-query which creates the
derived tables we call setup_procedure. Here we call
fix_fields for parameters of procedure clause. Calling
setup_procedure at this point may cause issue. If
sub-query is one of parameter being fixed it might
lead to complicated dependencies on derived tables
being prepared.

SOLUTION :
==========
In 5.6 with WL#6242, we have made procedure clause
parameters can only be NUM, so sub-queries are not
allowed as parameters. So in 5.5 we can block
sub-queries in procedure clause parameters.
This eliminates above conflicting dependencies.
2015-08-17 15:23:47 +05:30
Monty
1bfe4da1e9 Fixed mysqltest run failure:
Test did not clean up after itself properly
2015-08-13 01:28:15 +03:00
Monty
afa9cb7519 Fixed overrun in key cache if one tried to allocate a key cache
of more than 45G with a key_cache_block_size of 1024 or less.

The problem was that some of the arguments to my_multi_malloc() got to be
more than 4G.

Fix:
- Inntroduced my_multi_malloc_large() that can handle big regions.
- Changed MyISAM and Aria key caches to use my_multi_malloc_large().

I didn't change the default my_multi_malloc() as this would be a too big
patch and we don't allocate 4G blocks anywhere else.
2015-08-13 01:27:23 +03:00
Aditya A
608efca4c4 Bug #21025880 DUPLICATE UK VALUES IN READ-COMMITTED (AGAIN)
PROBLEM

Whenever we insert in unique secondary index we take shared
locks on all possible duplicate record present in the table.
But while during a replace on the unique secondary index ,
we take exclusive and locks on the all duplicate record.
When the records are deleted, they are first delete marked
and later purged by the purge thread. While purging the
record we call the lock_update_delete() which in turn calls
lock_rec_inherit_to_gap() to inherit locks of the deleted
records. In repeatable read mode we inherit all the locks
from the record to the next record  but in the read commited
mode we skip inherting them as gap type locks. We make a
exception here if the lock on the records is  in shared mode
,we assume that it is set during insert for unique secondary
index and needs to be inherited to stop constraint violation.
We didnt handle the case when exclusive locks are set during
replace, we skip inheriting locks of these records and hence
causing constraint violation.

FIX

While inheriting the locks,check whether the transaction is
allowed to do TRX_DUP_REPLACE/TRX_DUP_IGNORE, if true
inherit the locks.

[ Revewied by Jimmy #rb9709]
2015-08-12 19:17:26 +05:30
Shaohua Wang
f59d68eeae BUG#21102971 data corruption on arm64
The root cause is that x86 has a stronger memory model than the ARM
processors. And the GCC builtins didn't issue the correct fences when
setting/unsetting the lock word. In particular during the mutex release.

The solution is rewriting atomic TAS operations: replace '__sync_' by
'__atomic_' if possible.

Reviewed-by: Sunny Bains      <sunny.bains@oracle.com>
Reviewed-by: Bin Su           <bin.x.su@oracle.com>
Reviewed-by: Debarun Banerjee <debarun.banerjee@oracle.com>
Reviewed-by: Krunal Bauskar   <krunal.bauskar@oracle.com>
RB: 9782
RB: 9665
RB: 9783
2015-08-10 16:31:05 +08:00
Ajo Robert
552b1c8ab6 Merge branch 'mysql-5.1' into mysql-5.5 2015-08-07 16:27:48 +05:30
Ajo Robert
f3dce250f4 Bug #20760261 mysqld crashed in materialized_cursor::
send_result_set_metadata

Analysis
--------
Cursor inside trigger accessing NEW/OLD row leads server exit.

The reason for the bug was that implementation of function
create_tmp_table() was not considering Item::TRIGGER_FIELD_ITEM
as possible alternative for type of class being instantiated.
This was resulting in a mismatch between a number of columns
in result list and temp table definition. This mismatch leads
to the failure of assertion
DBUG_ASSERT(send_result_set_metadata.elements == item_list.elements)
in the method Materialized_cursor::send_result_set_metadata
in debug mode.

Fix:
---
Added code to consider Item::TRIGGER_FIELD_ITEM as valid
type while creating fields.
2015-08-07 16:26:10 +05:30
Sergei Golubchik
0403790722 increase the VERSION 2015-08-05 20:07:46 +02:00
sayantan dutta
1d317440d6 Follow-up fix : Bug #18145121 - DEPRECATED PERL SYNTAX IN MTR
(cherry picked from commit 1bfe5f724bc4c24da635f632247e7d263aa53970)

Conflicts:
	mysql-test/lib/mtr_cases.pm
2015-08-05 15:22:57 +05:30
sayantan dutta
67be190c0b Follow up Fix: Bug #18145121 - DEPRECATED PERL SYNTAX IN MTR
(cherry picked from commit 3eb933e0eb55f962404a04741767177e12a9885f)

Conflicts:
	mysql-test/mysql-test-run.pl
2015-08-05 15:18:25 +05:30