Commit graph

71578 commits

Author SHA1 Message Date
Marko Mäkelä
3d264bb1e9 Bug#16720368 INNODB IGNORES *.IBD FILE BREAKAGE AT STARTUP
After a clean shutdown, InnoDB will not check the *.ibd file headers,
for maximum performance. This is unchanged before and after this
patch.

What this fix addresses is the case when crash recovery is
needed. Previously, InnoDB could load a corrupted tablespace file.

buf_page_is_corrupted(): Add the parameter check_lsn.

fil_check_first_page(): New function, to perform a consistency check
on the first page of a file. This can be overridden by setting
innodb_force_recovery.

fil_read_first_page(), fil_open_single_table_tablespace(),
fil_load_single_table_tablespace(): Invoke fil_check_first_page().

open_or_create_data_files(): Check the status of
fil_open_single_table_tablespace().

rb#2352 approved by Jimmy Yang
2013-04-30 13:39:50 +03:00
Bill Qu
975968e245 Bug #13004581 BLACKHOLE BINARY LOG WITH ROW IGNORES UPDATE AND DELETE STATEMENTS
When logging to the binary log in row, updates and deletes to a BLACKHOLE
engine table are skipped.
  
It is impossible to log binary log in row format for updates and deletes to
a BLACKHOLE engine table, as no row events can be generated in these cases.
After fix, generate a warning for UPDATE/DELETE statements that modify a
BLACKHOLE table, as row events are not logged in row format.
2013-04-27 16:04:54 +08:00
Venkatesh Duggirala
2557f2c4ca BUG#16698172-CANNOT DO POINT-IN-TIME RECOVERY FOR
SINGLE DATABASE; MYSQLBINLOG
      
Problem: If last subevent inside a RBR event
is skipped while replaying a binary log
using mysqlbinlog with --database=... option,
generated output is missing end marker('/*!*/;)
for that RBR event. Thence causing syntax error
while replaying the generated output.
      
Fix: Append end marker ('/*!*/;) if the last 
subevent is getting skipped.
Append end marker if the last 
subevent is getting skipped.

client/mysqlbinlog.cc:
  Append end marker if the last 
  subevent is getting skipped.
2013-04-25 11:56:26 +05:30
Georgi Kodinov
4297893ccc Bug #16680313: CLIENT DOESN'T READ PLUGIN-DIR FROM MY.CNF SET BY
MYSQL_READ_DEFAULT_FILE
Parsing of the plugin-dir config file option was not working due to a typo.
Fixed the typo. No test case can be added due to lack of support for 
defaults-exitra-file testing in mysql-test-run.pl.
Thanks to Sinisa for contributing the fix.
2013-04-24 17:21:42 +03:00
unknown
26a976a83d 2013-04-24 13:34:11 +05:30
unknown
37e044c2cd 2013-04-24 13:31:10 +05:30
Annamalai Gurusami
e421ccb459 Null merge from mysql-5.1 to mysql-5.5 2013-04-24 08:48:34 +02:00
Annamalai Gurusami
19f93f6bd8 Bug #15973904 INNODB PARTITION CODE HOLDS LOCK_OPEN AND SLEEPS WHILE
OPENING MISSING PARTITION

In the ha_innobase::open() call, for normal tables, there is no retry logic.
But for partitioned tables, there is a retry logic introduced as fix for:

http://bugs.mysql.com/bug.php?id=33349  
https://support.mysql.com/view.php?id=21080

The Bug#33349, does not provide sufficient information to analyze the original
problem.  The original problem reported by bug#33349 is also minor (just an
annoyance and no loss of functionality).  Most importantly, the retry logic
has been introduced without any associated test case.

So we are removing the retry logic for partitioned tables.  When the original
problem occurs, a different solution will be explored.
2013-04-24 08:47:30 +02:00
Annamalai Gurusami
1b892c7759 Merge from mysql-5.1 to mysql-5.5 2013-04-24 08:42:59 +02:00
Murthy Narkedimilli
86b824effb Upmerge of the 5.1.69 build 2013-04-22 14:30:47 +02:00
unknown
6b476a09e6 Merge from mysql-5.1.69-release 2013-04-22 14:01:07 +02:00
Neeraj Bisht
d5cb664920 Bug#16073689 : CRASH IN ITEM_FUNC_MATCH::INIT_SEARCH
Problem:
In query like
select 1 from .. order by match .. against ...;
causes a debug assert failue.

Analysis:
In union type query like

(select * from order by a) order by b;
or
(select * from order by a) union (select * from order by b);

We skip resolving of order by a for 1st query and order by of a and b in 
2nd query.


This means that, in case when our order by have Item_func_match class, 
we skip resolving it.
But we maintain a ft_func_list and at the time of optimization, when we 
Perform FULLTEXT search before all regular searches on the bases of the 
list we call Item_func_match::init_search() which will cause debug assert 
as the item is not resolved.


Solution:
We will skip execution if the item is not fixed and we will not 
fix index(Item_func_match::fix_index()) for which 
Item_func_match::fix_field() is not called so that on later changes 
we can check the dependency on fix field.
bz

sql/item_func.cc:
  skiping execution, if item is not resolved.
2013-04-20 12:36:11 +05:30
Neeraj Bisht
89b1b50844 Bug#16073689 : CRASH IN ITEM_FUNC_MATCH::INIT_SEARCH
Problem:
In query like
select 1 from .. order by match .. against ...;
causes a debug assert failue.

Analysis:
In union type query like

(select * from order by a) order by b;
or
(select * from order by a) union (select * from order by b);

We skip resolving of order by a for 1st query and order by of a and b in 
2nd query.


This means that, in case when our order by have Item_func_match class, 
we skip resolving it.
But we maintain a ft_func_list and at the time of optimization, when we 
Perform FULLTEXT search before all regular searches on the bases of the 
list we call Item_func_match::init_search() which will cause debug assert 
as the item is not resolved.


Solution:
We will skip execution if the item is not fixed and we will not 
fix index(Item_func_match::fix_index()) for which 
Item_func_match::fix_field() is not called so that on later changes 
we can check the dependency on fix field.


sql/item_func.cc:
  skiping execution, if item is not resolved.
2013-04-20 12:28:22 +05:30
unknown
bb70b07d98 Merge from mysql-5.5.31-release 2013-04-18 12:52:59 +02:00
Tor Didriksen
c94ca7d9cf Bug#16626742 IN MY_MD5FINAL IN MYSYS/MD5.C, CTX IS NOT PROPERLY ZEROED AS INTENDED
Zero out the entire struct, rather than the first sizeof(void*) bytes.
2013-04-17 09:26:51 +02:00
sayantan dutta
899b219e05 Bug #16632543 - INCORRECT VALUE OF BOGOMIPS IN MYSQLTEST 2013-04-16 16:26:45 +05:30
Murthy Narkedimilli
abd76285da Merging the changes for Bug 16633169 - MYSQL.INFO CONTAINS OUTDATED INFORMATION. 2013-04-16 12:17:18 +02:00
Murthy Narkedimilli
7c384a9333 Bug 16633169 - MYSQL.INFO CONTAINS OUTDATED INFORMATION. 2013-04-16 12:12:18 +02:00
Chaithra Gopalareddy
51555d2ae3 Merge from 5.1 to 5.5
sql/sql_class.h:
  Parsing for group_concat's order by  is made independent.
  As a result, add_order_to_list cannot be used anymore.
2013-04-14 08:09:56 +05:30
Chaithra Gopalareddy
2d83663380 Bug#16347426:ASSERTION FAILED: (SELECT_INSERT &&
!TABLES->NEXT_NAME_RESOLUTION_TABLE) || !TAB
      
Problem:
The context info of select query gets corrupted when a query
with group_concat having order by is present in an order by
clause of the select query. As a result, server crashes with
an assert.
      
Analysis:
While parsing order by for group_concat, it is presumed that
it is always present before the actual order by for the
select query.
As a result, parser uses select->order_list to populate the
order by items of group_concat and creates a select->gorder_list
to which select->order_list is copied onto. Once this is done,
it empties the select->order_list.
In the case presented in the bugpage, as order by is already
parsed when group_concat's order by is encountered, parser
presumes that it is the second order by in the select query
and creates fake_lex_unit which results in the change of
context info.
      
Solution:
Make group_concat's order by parsing independent of the select


sql/item_sum.cc:
  Change the argument as, select->gorder_list is not pointer anymore
sql/item_sum.h:
  Change the argument as, select->gorder_list is not pointer anymore
sql/mysql_priv.h:
  Parsing for group_concat's order by is made independent.
  As a result, add_order_to_list cannot be used anymore.
sql/sql_lex.cc:
  Parsing for group_concat's order by is made independent.
  As a result, add_order_to_list cannot be used anymore.
sql/sql_lex.h:
  Parsing for group_concat's order by is made independent.
  As a result, add_order_to_list cannot be used anymore.
sql/sql_yacc.yy:
   Make group_concat's order by parsing independent of the select
  queries order by.
2013-04-14 07:30:49 +05:30
Balasubramanian Kandasamy
e5055e22f1 Updated mysql.spec.sh for rpm-uln 2013-04-12 12:11:38 +02:00
Venkatesh Duggirala
0fe3128c94 BUG#16615117 MYSQLDUMP PRODUCES A CHANGE MASTER STATEMENT
WITH A PORT NUMBER ENCLOSED IN QUOTES

Problem: mysqldump --dump-slave --include-master-host-port
prints the CHANGE MASTER command in the generated logical
backup. The PORT number that is generated with this command
is a string and should be an integer.

Fix: Remove the Enclosed quotes for port number.
2013-04-12 14:18:21 +05:30
Jorgen Loland
2c780b461d Bug#16540042: WRONG QUERY RESULT WHEN USING RANGE OVER
PARTIAL INDEX

Consider the following table definition:

CREATE TABLE t (
  my_col CHAR(10),
  ...
  INDEX my_idx (my_col(1))
)

The my_idx index is not able to distinguish between rows with
equal first-character my_col-values (e.g. "f", "foo", "fee").

Prior to this CS, the range optimizer would translate

"WHERE my_col NOT IN ('f', 'h')" into (optimizer trace syntax)

"ranges": [
  "NULL < my_col < f",
  "f < my_col"
]

But this was not correct because the rows with values "foo" 
and "fee" would not belong to any of those ranges. However, the
predicate "my_col != 'f' AND my_col != 'h'" would translate
to 

"ranges": [
  "NULL < my_col"
]

because get_mm_leaf() changes from "<" to "<=" for partial
keyparts. This CS changes the range optimizer implementation 
for NOT IN to behave like a conjunction of NOT EQUAL: it 
replaces "<" with "<=" for all but the first range when the
keypart is partial.
2013-04-12 09:39:56 +02:00
unknown
d20ec0f5ba Bug :#16005310 FIx bug - INNODB_ROW_LOCK_TIME_MAX SEEMS TO HAVE AN OVERFLOW
Solution:Set diff_time to 0 if finish_time < start_time
2013-04-11 10:50:50 +08:00
Tor Didriksen
6b9233fbb2 Bug#16395606 SCRIPTS MISSING EXECUTE BIT
Add execute bit for scripts:
 - in build directory
 - in install directory
2013-04-10 16:43:09 +02:00
Thayumanavar
348d14c7e2 BUG#16402143 - STACK CORRUPTION IN DBUG_EXPLAIN
DESCRIPTION AND FIX:
DBUG_EXPLAIN result in buffer overflow when the
DEBUG variable values length exceed 255.
In _db_explain_ function which call macro str_to_buf
incorrectly passes the length of buf avaliable to
strnmov as len+1. The fix calculates the avaliable
space in buf and passes it to strnxmov.
2013-04-10 11:50:41 +05:30
Nirbhay Choubey
b350990a11 local merge. 2013-04-09 14:03:35 +05:30
Nirbhay Choubey
4ad004c2b4 Backporting patch for bug#15852074. 2013-04-09 14:00:05 +05:30
Gopal Shankar
90738111ff null merge 2013-04-08 18:53:24 +05:30
unknown
6777c3fa3f 2013-04-08 18:48:57 +05:30
unknown
944ea996d1 2013-04-08 18:14:06 +05:30
unknown
dc7af6e66e 2013-04-08 18:12:39 +05:30
Raghav Kapoor
0d67ea374f BUG#15978766 - TEST VALGRIND_REPORT FAILS INNODB TESTS
BACKGROUND:
The testcase i_innodb.innodb_bug14036214 when run under valgrind
leaks memory.

ANALYSIS:
In the code path of mysql_update, a temporary file is opened
using open_cached_file().
When an error has occured in that code path, this temporary
file was not closed since call to close_cached_file() was 
missing.
This problem exists in 5.5 but it does not exists in 5.6 and 
trunk. 
This is because in 5.6 and trunk, when we issue the update
statement in the test case, it does not take the same code path
as in 5.5. The code path is different because a different plan 
is chosen by optimizer. 
See Bug#14036214 for details.
However, the problem can still be examined in 5.6 and trunk
by code inspection.

FIX:
The file opened by open_cached_file() has been closed by calling
close_cached_file() when an error occurs so that it does not 
results in a memory leak.
2013-04-08 15:25:45 +05:30
sayantan dutta
a24ca4153e Bug #16401597 - MTR V1 RETURNS INCORRECT PATH TO VARIABLE @@BASEDIR 2013-04-04 14:54:16 +05:30
Murthy Narkedimilli
b9e98c660f Bug 16534721 - MYSQL_INSTALL_DB RUNS AGAIN DURING UPGRADE EVEN DATA DIRECTORY EXISTS 2013-04-03 18:09:37 +02:00
Tor Didriksen
7a4bd32efb merge 5.1 => 5.5 2013-04-02 16:20:49 +02:00
Tor Didriksen
b432e3da11 Bug#14700180 CRASH IN COPY_FUNCS
This is a backport of the fix for
Bug#13966809 CRASH IN COPY_FUNCS WHEN GROUPING BY OUTER QUERY BLOB FIELD IN SUBQUERY
2013-04-02 16:05:10 +02:00
Tor Didriksen
24b1ef8dae Bug#11765629 CMAKE: CAN SUPPRESS INSTALLATION OF SQL-BENCH, BUT NOT MYSQL-TEST
Don't try to install anything into INSTALL_MYSQLTESTDIR
if it is explicitly set empty on the cmake command line.
2013-04-02 11:14:39 +02:00
unknown
ba0f8ee240 2013-04-02 11:17:06 +05:30
unknown
68624a3160 2013-04-02 11:16:26 +05:30
unknown
b42e89e6f3 2013-04-01 13:45:27 +05:30
unknown
796bb7cb82 2013-04-01 12:26:55 +05:30
Chaithra Gopalareddy
911934db18 Merge from 5.1 to 5.5 2013-03-31 06:52:16 +05:30
Chaithra Gopalareddy
cfb3bbac27 Bug #16347343 : CRASH, GROUP_CONCAT, DERIVED TABLES
Problem:
A select query inside a group_concat function having an 
outer reference results in a crash.
      
Analysis:
In function Item_group_concat::add, we do not check if 
return value of get_tmp_table_field can be NULL for 
a non-const item. This can happen for a query with a 
outer reference.
While resolving the outer reference in the query present
inside group_concat function, we set the "const_item_cache" 
to false. As a result in the call to const_item() from 
Item_func_group_concat::add, it returns false and goes on 
to check if this can be NULL resulting in the crash.
get_tmp_table_field does not return NULL for Items of type 
Item_field, Item_result_field and Item_ref. 
For all other items, it returns NULL. 
     
Solution:
Check for the return value of get_tmp_table_field before we 
access field contents.

sql/item_sum.cc:
  Check for the return value of get_tmp_table_field before accessing
2013-03-31 06:48:30 +05:30
Chaithra Gopalareddy
d8c9cd7079 Bug#14261010: ON DUPLICATE KEY UPDATE CRASHES THE SERVER
Problem:
Insert with 'on duplicate key update' on a view,
crashes the server.
      
Analysis:
During an insert on to a view, we do the following:
      
For insert fields and values -
1. Resolve insert values.
2. Resolve insert fields.
3. Check if the fields and values are all from a 
   single table of a view in case of INSERT VALUES.
   Do not check the same in case of INSERT SELECT,
   as the values can be read from different table than
   that of the view.
      
For the update fields (if DUP UPDATE is used)
1. Create a name resolution context with 'table_list' only.
2. Resolve update fields in this context.
3. Check if update fields and values are from the same
   table as the insert fields.
4. Get the next name resolution context. Concatinate this
   with the previous one.
5. Resolve update values in this context as we can refer
   to other tables in the values clause.
      
Note that at step 3(of update fields), we check for
'used_tables map' of update values, without resolving them
first. Hence the crash.
      
Fix:
At step 3, do not pass the update values to check if its a
single table view update, as update values can refer other table.
      
Code has been re-organized to function like check_insert_fields.


sql/sql_insert.cc:
  Do not pass update_values as they are not resolved yet.
2013-03-30 19:24:54 +05:30
Annamalai Gurusami
036787a919 Merge from mysql-5.1 to mysql-5.5 2013-03-29 22:11:33 +05:30
Annamalai Gurusami
27277df73b Bug #16244691 SERVER GONE AWAY ERROR OCCURS DEPENDING ON THE NUMBER OF
TABLE/KEY RELATIONS

The DICT_FK_MAX_RECURSIVE_LOAD was reduced from 250 to 33 in rb#2058.
But in optimized build, this recursive depth is still too deep and
resulted in stack overflow.  So reducing this depth to 20 now.
2013-03-29 22:01:10 +05:30
sayantan dutta
924c2c6f04 Bug #16402124 - MTR PROCESSES CERTAIN ASSIGNED VARDIR VALUES WRONG 2013-03-29 16:33:33 +05:30
unknown
79c5c5d663 2013-03-29 15:14:38 +05:30
unknown
a6890cce66 2013-03-29 15:09:14 +05:30