Commit graph

85176 commits

Author SHA1 Message Date
Aditya A
c5896384bd Bug #16051817 GOT ERROR 124 FROM STORAGE ENGINE
ON DELETE FROM A PARTITIONED TABLE

PROBLEM
-------

The user first disables all the non unique indexes
in the table and then rebuilds one partition.
During rebuild the indexes on that particular
partition are enabled. Now when we give a query 
the optimizer is unaware that on one partition 
indexes are enabled and if the optimizer selects
that index,myisam thinks that the index is not 
active and gives an error.

FIX
---

Before rebuilding a partition check whether non
unique indexes are disabled on the partitons.
If they are disabled then after rebuild disable
the index on the partition. 

[Approved by Mattiasj #rb3469]
2013-10-21 12:07:02 +05:30
Mattias Jonsson
7a524cee32 post-push fix for bug17565888. 2013-10-19 15:29:51 +02:00
Mattias Jonsson
a91fcaf460 post-push fix for bug17565888.
Too restrictive assertion, failing during purge
2013-10-18 23:49:35 +02:00
Mattias Jonsson
e6a734a7cf post-push fix for bug17565888.
Too restrictive assertion, can fail during purge
2013-10-18 23:39:15 +02:00
Mattias Jonsson
20f579ea16 Bug#17565888: UP TO 75% INCREASE IN DBT3 QUERY (Q7) EXECUTION TIME
Regression from bug#14621190 due to disabled optimistic restoration
of cursor, which required full key lookup instead of verifying
if previously positioned btree cursor could be reused.

Fixed by enable optimistic restore and adjust cursor afterward.

rb#3324 approved by Marko.
2013-10-18 19:25:59 +02:00
Anirudh Mangipudi
18079ac9b8 Bug #17357535 BACKPORT BUG#16241992 TO 5.5
Problem:
COM_CHANGE_USER allows brute-force attempts to crack a password at a very high
rate as it does not cause any significant delay after a login attempt has
failed. This issue was reproduced using John-The-Ripper password
cracking tool through which about 5000 passwords per second could be attempted.

Solution:
The non-GA version's solution was to disconnect the connection when a login
attempt failed. Now since our aim to to reduce the rate at which passwords 
are tested, we introduced a sleep(1) after every login attempt failed. This
significantly increased the delay with which the password was cracked.
2013-10-18 17:14:39 +05:30
Luis Soares
6fd6b38c71 BUG#17460821
Automerged from mysql-5.5 bug branch into latest mysql-5.5.
2013-10-18 10:50:49 +01:00
Aditya A
94630ddd32 Bug#17559867 AFTER REBUILDING , A MYISAM PARTITION ENDS UP
AS A INNODB PARTITTION.
[Merged from 5.1]
2013-10-18 13:49:03 +05:30
Aditya A
cd6f3b55da Bug#17559867 AFTER REBUILDING,A MYISAM PARTITION ENDS UP
AS A INNODB PARTITTION.

PROBLEM
-------
The correct engine_type was not being set during 
rebuild of the partition due to which the handler
was always created with the default engine,
which is innodb for 5.5+ ,therefore even if the
table was myisam, after rebuilding the partitions
ended up as innodb partitions.

FIX
---
Set the correct engine type during rebuild.  

[Approved by mattiasj #rb3599]
2013-10-18 12:26:28 +05:30
Luis Soares
863d67e3ac BUG#17460821: ASSERTION ERROR WHEN STOPPING SLAVE AFTER SEMI-SYNC ON MASTER IS DISABLED
The assertion happens when: (i) the master and slave are configured to
use the semisync plugin; (ii) the DBA disables semisync on the master;
(iii) and he also unsets the option to wait for slaves ACK even if the
semisync slave count reaches 0 during the waiting period. This
combination of factors makes the server run into an assertion as soon
as the last semisync slave disconnects and its dump thread exits.
  
The root of the problem is the fact that when the dump thread
disconnects and calls the observer hook transmit_stop, which ends up
calling ReplSemiSyncMaster::remove_slave, there is no check whether
the master has already disabled semisync or not. If it has, the then a
second call to the switch_off member function must be avoided.
  
The quick fix is to avoid calling switch_off if the DBA has disabled
the semisync plugin interactively on the master. Also, the switch_off
member function should only be called if the plugin has not been
switched off already. This is basically the pattern throughout the
rest of the semisync plugin and no other calls seem vulnerable to
similar crashes/assertions.

(This a backport of the patch to 5.5, which is also vulnerable.)
2013-10-17 17:48:26 +01:00
Anil Toshniwal
7c3d3f192e Bug#17513737 INTRODUCE CHECK TABLE...QUICK
--Implemented CHECK TABLE...QUICK.
  Introduce CHECK TABLE...QUICK that would skip the btr_validate_index()
  and btr_search_validate() call, and count the no. of records in each index.

Approved by Marko and Kevin. (rb#3567).
2013-10-17 18:09:04 +05:30
unknown
1b199c144d 2013-10-17 17:59:45 +05:30
Luis Soares
54a36531ec BUG#17508351
Merging mysql-5.5 bug branch into latest mysql-5.5.
2013-10-17 12:27:45 +01:00
Venkatesh Duggirala
633cc16e7c Bug#17234370 LAST_INSERT_ID IS REPLICATED INCORRECTLY IF
REPLICATION FILTERS ARE USED.
Merging fix from mysql-5.1
2013-10-16 22:15:59 +05:30
Venkatesh Duggirala
2b07397b20 Bug#17234370 LAST_INSERT_ID IS REPLICATED INCORRECTLY IF
REPLICATION FILTERS ARE USED.

Problem:
When Filtered-slave applies Int_var_log_event and when it
tries to write the event to its own binlog, LAST_INSERT_ID
value is written wrongly.

Analysis:
THD::stmt_depends_on_first_successful_insert_id_in_prev_stmt
is a variable which is set when LAST_INSERT_ID() is used by
a statement. If it is set, first_successful_insert_id_in_
prev_stmt_for_binlog will be stored in the statement-based
binlog. This variable is CUMULATIVE along the execution of
a stored function or trigger: if one substatement sets it
to 1 it will stay 1 until the function/trigger ends,
thus making sure that first_successful_insert_id_in_
prev_stmt_for_binlog does not change anymore and is
propagated to the caller for binlogging. This is achieved
using the following code
if(!stmt_depends_on_first_successful_insert_id_in_prev_stmt)               
{                                                                           
  /* It's the first time we read it */                                      
  first_successful_insert_id_in_prev_stmt_for_binlog=                       
  first_successful_insert_id_in_prev_stmt;                                
  stmt_depends_on_first_successful_insert_id_in_prev_stmt= 1;               
}

Slave server, after receiving Int_var_log_event event from
master, it is setting
stmt_depends_on_first_successful_insert_id_in_prev_stmt
to true(*which is wrong*) and not setting
first_successful_insert_id_in_prev_stmt_for_binlog. Because
of this problem, when the actual DML statement with
LAST_INSERT_ID() is parsed by slave SQL thread,
first_successful_insert_id_in_prev_stmt_for_binlog is not
set. Hence the value zero (default value) is written to
slave's binlog.

Why only *Filtered slave* is effected when the code is
in common place:
-------------------------------------------------------
In Query_log_event::do_apply_event,
THD::stmt_depends_on_first_successful_insert_id_in_prev_stmt
is reset to zero at the end of the function. In case of
normal slave (No Filters), this variable will be reset. 
In Filtered slave, Slave SQL thread defers all IRU events's
execution until IRU's Query_log event is received. Once it
receives Query_log_event it executes all pending IRU events
and then it executes Query_log_event. Hence the variable is
not getting reset to 0, causing this bug.

Fix: As described above, the root cause was setting 
THD::stmt_depends_on_first_successful_insert_id_in_prev_stmt
when Int_var_log_event was executed by a SQL thread. Hence
removing the problematic line from the code.
2013-10-16 22:12:23 +05:30
Alexander Barkov
11005f3413 Merge 5.3->5.5 2013-10-16 18:17:51 +04:00
Alexander Barkov
bff85079d3 Merge 5.2->5.3 2013-10-16 18:13:13 +04:00
Alexander Barkov
5064d03b80 Merge 5.3 -> 5.5. 2013-10-16 17:58:54 +04:00
Alexander Barkov
2b60ad3637 Merge 5.1->5.2 2013-10-16 17:58:15 +04:00
Alexander Barkov
049000101a Merge 5.1 -> 5.3 2013-10-16 17:48:31 +04:00
Alexander Barkov
de4ca539b8 MDEV-4890 Valgrind warnings on shutdown on a build with openSSL 2013-10-16 17:37:11 +04:00
unknown
73f8b4dac2 MDEV-4981: Account for queries handled by query-cache in USER_STATISTICS (and in HOST_STATISTICS)
fix for SP & PS
2013-10-16 16:07:25 +03:00
Venkata Sidagam
e84d48742e Bug#16900358 FIX FOR CVE-2012-5611 IS INCOMPLETE
Merging from mysql-5.1 to mysql-5.5
2013-10-16 14:16:32 +05:30
Venkata Sidagam
de0e8a02d1 Bug#16900358 FIX FOR CVE-2012-5611 IS INCOMPLETE
Description: Fix for bug CVE-2012-5611 (bug 67685) is 
incomplete. The ACL_KEY_LENGTH-sized buffers in acl_get() and 
check_grant_db() can be overflown by up to two bytes. That's 
probably not enough to do anything more serious than crashing 
mysqld.
Analysis: In acl_get() when "copy_length" is calculated it 
just adding the variable lengths. But when we are using them 
with strmov() we are adding +1 to each. This will lead to a 
three byte buffer overflow (i.e two +1's at strmov() and one 
byte for the null added by strmov() function). Similarly it 
happens for check_grant_db() function as well.
Fix: We need to add "+2" to "copy_length" in acl_get() 
and "+1" to "copy_length" in check_grant_db().
2013-10-16 14:14:44 +05:30
Sujatha Sivakumar
4522a8704f Bug#17429677:LAST ARGUMENT OF LOAD DATA ...SET ...STATEMENT
REPEATED TWICE IN BINLOG

Problem:
=======
If LOAD DATA ... SET ... is used the last argument of SET is
repeated twice in replication binlog.

Analysis:
========
LOAD DATA statements are reconstructed once again before
they are written to the binary log. When SET clauses are
specified as part of LOAD DATA statement, these SET clause
user command strings need to be stored in order to rebuild
the original user command. During parsing each column and
the value in the SET command are stored in two differenet
lists. All the values are stored in a string list.

When SET expression has more than one value as shown in the
following example:
SET a = @a, b = CONCAT(@b, '| 123456789');

Parser extracts values in the following manner i.e Item name
, value string, actual length of the value of the item with
in the string.

Item a:
Value for a:"= @a, b = CONCAT(@b, '| 123456789')
str_length = 4
Item b:
Value for b:"= CONCAT(@b, '| 123456789')
str_length = 27

During reconstructing the LOAD DATA command the above
strings are retrived as it is and appended to the LOAD DATA
statement. Hence it becomes as shown below.

SET `a`= @a, b = CONCAT(@b, '| 123456789'),
`b`= CONCAT(@b, '| 123456789')

Fix:
===
During reconstruction of SET command, retrieve exact item
value string rather than reading the entire string.

sql/sql_load.cc:
  Added code to extract the exact Item value.
2013-10-16 11:49:00 +05:30
Sreedhar.S
821249420e Fix for Bug 17584523 - LICENSE AND DOCUMENTATION FILES MISSING FROM WINDOWS MSI PACKAGE 2013-10-16 11:05:20 +05:30
Nuno Carvalho
61827c669f WL#7266: Dump-thread additional concurrency tests
Merge from mysql-5.1 into mysql-5.5.
2013-10-14 15:51:09 +01:00
Nuno Carvalho
3399194cef WL#7266: Dump-thread additional concurrency tests
This worklog aims at testing the two following scenarios:

1) Whenever the mysql_binlog_send method (dump thread)
reaches the end of file when reading events from the binlog, before
checking if it should wait for more events, there was a test to
check if the file being read was still active, i.e, it was the last
known binlog. However, it was possible that something was written to
the binary log and then a rotation would happen, after EOF was
detected and before the check for active was performed. In this
case, the end of the binary log would not be read by the dump
thread, and this would cause the slave to lose updates.
This test verifies that the problem has been fixed. It waits during
this window while forcing a rotation in the binlog.

2) Verify dump thread can send events in active file, correctly after
encountering an IO error.
2013-10-14 15:45:12 +01:00
unknown
3cc3bcfcc5 MDEV-5107:Left Join Yields All Nulls Instead of Appropriate Matches
MDEV-5034:Wrong result on LEFT JOIN with a SELECT SQ or a merge view, UNION in IN subquery

Make reset null_row same as it was set in evaluate_null_complemented_join_record().

The problem was that view firlds detect null_row by not-yet-reset table.
2013-10-11 15:57:19 +03:00
Igor Babaev
81623bdc35 Fixed bug mdev-5135.
The patch for bug mdev-5105 incorrectly counted conditions in nested joins.
2013-10-14 10:29:24 -07:00
Igor Babaev
78b580b779 Fixed bug mdev-5132.
Objects of the classes Item_func_isnull and Item_func_isnotnull
must have the flag sargable set to TRUE.
Set the value of the flag sargable only in constructors of the 
classes inherited from Item_int_func.
2013-10-11 23:24:57 -07:00
Igor Babaev
092a238864 Fixed a problem of the patch for mdev-5105 that caused valgrind complains. 2013-10-11 12:50:30 -07:00
Igor Babaev
7c87385e30 Fixed bug mdev-5105.
The bug caused a memory overwrite in the function update_ref_and_keys()
It happened due to a wrong value of SELECT_LEX::cond_count. This value
historically was calculated by the fix_fields method. Now the logic of
calling this method became too complicated and, as a result, this value
is calculated not always correctly.
The patch changes the way how and when  the values of SELECT_LEX::cond_count
and of SELECT_LEX::between_count are calculated. The new code does it just at
the beginning of update_ref_and_keys().
2013-10-10 10:08:26 -07:00
unknown
0e26893101 2013-10-09 18:42:27 +05:30
Sreedhar.S
d8bcc6215e BUG 17560050 - MYSQL_INSTALL_DB SCRIPT FAILING WITH RESOLVEIP ISSUES. 2013-10-09 17:08:45 +05:30
Praveenkumar Hulakund
c66a037dca Bug#17474166 - EXECUTING STATEMENT LIKE 'SHOW ENGINE INNODB'
AND 'KILL SESSION' LEAD TO CRASH               

Analysis:
--------
This situation occurs when the connection executes query 
"show engine innodb status" and this connection is killed by
executing statement "kill <con>" by another connection.

In function "innodb_show_status", function "stat_print"
is called to print the status but return value of function
is not checked.  After killing connection, if write to 
connection fails then error is returned and same is set
in Diagnostic area. Since FALSE is returned from
"innodb_show_status" now, assert to check no error
is set in function "set_eof_status" (called from
my_eof) is failing. 

Fix:
----
Changed code to check return value of function "stat_print"
in "innodb_show_status".
2013-10-09 13:32:31 +05:30
Sreedhar.S
c8c948ffa6 Bug 13878021 - WINDOWS PACKAGE THAT INCLUDES .PDB FILES FOR INTERMEDIATE LIBRARIES USED 2013-10-09 11:10:46 +05:30
Luis Soares
d97df1e8ff BUG#17508351: REDUNDANT CODE IN REPLSEMISYNCMASTER::UPDATESYNCHEADER
ReplSemiSyncMaster::updateSyncHeader contains redundant assignments
to the local variable sync.

This patch removes them.
2013-10-08 18:37:43 +01:00
rich prohaska
60267e61ff tokutek/ft-engine#122 set loose tokudb variables for mtr 2013-10-07 18:50:26 -04:00
rich prohaska
5a67cf2ed8 tokutek/ft-engine#122 force all mysql tests to set a new tokudb session variable to hide the default compression 2013-10-07 10:41:13 -04:00
Zardosht Kasheff
27f5720d4a refs #82, fix CMakeLists.txt 2013-10-07 10:40:40 -04:00
Rich Prohaska
8a579ebd40 #122 fix tests that need to show default row format 2013-10-07 10:35:09 -04:00
Zardosht Kasheff
4f74e29926 refs #82, remove checkpoint_1.cc for TokuDB 7.1.0, may bring it back fixed later. That is still open 2013-10-07 10:35:05 -04:00
Zardosht Kasheff
548bc646b2 refs #78 for minicrons with a period of longer than one second (checkpoints),
change minicron to count the period from the beginning of
the callback's execution and not the end. For checkpoints, this makes them
reliably start every 60 seconds.
2013-10-07 10:17:03 -04:00
Zardosht Kasheff
6e60da0886 refs #84, remove some shared variables from logger 2013-10-07 10:16:03 -04:00
Rich Prohaska
ef6add4cac #122 change default compression to zlib and add a session variable to control create info row format 2013-10-07 09:11:51 -04:00
unknown
af1082f44d 2013-10-07 18:17:26 +05:30
rich prohaska
1e46d54027 tokutek/ft-engine#94 tokutek/ft-index#80 configure an upper bound on loader memory reservations
Merge branch 'loadermem80'
2013-10-07 08:38:50 -04:00
rich prohaska
d067419ae9 tokutek/ft-index#80 tokutek/ft-engine#94 impose an upper bound on loader memory reservations 2013-10-07 08:35:52 -04:00
Kent Boortz
32ee7c9e9b Corrections of copyright headers (RE-request 45781) 2013-10-07 13:05:49 +02:00