Commit graph

62954 commits

Author SHA1 Message Date
sunanda
1c87c8b1ee Backport into build-201006221614-5.1.46sp1
> ------------------------------------------------------------
> revno: 3392.1.1
> revision-id: gshchepa@mysql.com-20100521184732-0jvpzinv0uwyvr2d
> parent: sven.sandberg@sun.com-20100520153801-yyhujm1qqa4eyfn0
> committer: Gleb Shchepa <gshchepa@mysql.com>
> branch nick: 53804-5.1
> timestamp: Fri 2010-05-21 22:47:32 +0400
> message:
>   Bug #53804: serious flaws in the alter database .. upgrade
>               data directory name command
>   
>   The check_db_name function has been modified to validate tails of
>   #mysql50#-prefixed database names for compliance with MySQL 5.0
>   database name encoding rules (the check_table_name function call
>   has been reused).
2010-06-23 12:22:05 +02:00
sunanda
12c4c7a0ee Backport into build-201006221614-5.1.46sp1
> ------------------------------------------------------------
> revno: 3386
> revision-id: sergey.glukhov@sun.com-20100518082821-yajhvbv1ghmlpu1n
> parent: aelkin@mysql.com-20100516170332-x8priwrdjwolc065
> committer: Sergey Glukhov <Sergey.Glukhov@sun.com>
> branch nick: mysql-5.1-bugteam
> timestamp: Tue 2010-05-18 13:28:21 +0500
> message:
>   Bug#48729 SELECT ... FROM INFORMATION_SCHEMA.ROUTINES causes memory to grow
>   Analysis showed that in case of accessing I_S table
>   ROUTINES we perform unnecessary allocations
>   with get_field() function for every processed row that
>   in their turn causes significant memory growth.
>   the fix is to avoid use of get_field().
2010-06-23 12:14:23 +02:00
sunanda
c658c3ed34 Backport into build-201006221614-5.1.46sp1
> ------------------------------------------------------------
> revno: 3367 [merge]
> revision-id: joro@sun.com-20100504140328-srxf3c088j2twnq6
> parent: kristofer.pettersson@sun.com-20100503172109-f9hracq5pqsaomb1
> parent: joro@sun.com-20100503151651-nakknn8amrapmdp7
> committer: Georgi Kodinov <joro@sun.com>
> branch nick: B53371-5.1-bugteam
> timestamp: Tue 2010-05-04 17:03:28 +0300
> message:
>   Bug #53371: COM_FIELD_LIST can be abused to bypass table level grants.
>   
>   This is the 5.1 merge and extension of the fix.
>   The server was happily accepting paths in table name in all places a table
>   name is accepted (e.g. a SELECT). This allowed all users that have some 
>   privilege over some database to read all tables in all databases in all
>   mysql server instances that the server file system has access to.
>   Fixed by :
>   1. making sure no path elements are allowed in quoted table name when
>   constructing the path (note that the path symbols are still valid in table names
>   when they're properly escaped by the server).
>   2. checking the #mysql50# prefixed names the same way they're checked for
>   path elements in mysql-5.0.
> ------------------------------------------------------------
> Use --include-merges or -n0 to see merged revisions.
2010-06-23 12:03:22 +02:00
Jimmy Yang
95586f2c83 Port fix for "bug #54044 Create temporary tables and using innodb crashes"
to 5.1 plugin codeline.

rb://378, approved by Marko
2010-06-22 19:39:20 -07:00
Jimmy Yang
1ac84a45df Fix bug #54044, Create temporary tables and using innodb crashes. Screen
out NULL type columns, and return without creating the table.

rb://378 approved by Marko
2010-06-22 19:04:31 -07:00
MySQL Build Team
a0a850318b Backport into build-201006221614-5.1.46sp1
> ------------------------------------------------------------
> revno: 3351.41.1
> revision-id: alexey.kopytov@sun.com-20100430111048-jdls6ofn4kkmpt09
> parent: sergey.glukhov@sun.com-20100329134249-03wyhzp5k92dzhcb
> committer: Alexey Kopytov <Alexey.Kopytov@Sun.com>
> branch nick: my51-bug48419
> timestamp: Fri 2010-04-30 15:10:48 +0400
> message:
>   Bug #48419: another explain crash..
>   
>   WHERE predicates containing references to empty tables in a
>   subquery were handled incorrectly by the optimizer when
>   executing EXPLAIN. As a result, the optimizer could try to
>   evaluate such predicates rather than just stop with
>   "Impossible WHERE noticed after reading const tables" as 
>   it would do in a non-subquery case. This led to valgrind 
>   errors and crashes.
>   
>   Fixed the code checking the above condition so that subqueries
>   are not excluded and hence are handled in the same way as top
>   level SELECTs.
2010-06-22 22:53:01 +02:00
MySQL Build Team
fb8791e2bc Backport into build-201006221614-5.1.46sp1
> ------------------------------------------------------------
> revno: 1810.3987.14
> revision-id: davi.arnaut@sun.com-20100429132816-ictyul6d75itek22
> parent: ramil@mysql.com-20100429044232-f0pkyx8fnpszf142
> committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
> branch nick: 50974-5.0
> timestamp: Thu 2010-04-29 10:28:16 -0300
> message:
>   Bug#50974: Server keeps receiving big (> max_allowed_packet) packets indefinitely.
>   
>   The server could be tricked to read packets indefinitely if it
>   received a packet larger than the maximum size of one packet.
>   This problem is aggravated by the fact that it can be triggered
>   before authentication.
>   
>   The solution is to no skip big packets for non-authenticated
>   sessions. If a big packet is sent before a session is authen-
>   ticated, a error is returned and the connection is closed.

> ------------------------------------------------------------
> revno: 3363 [merge]
> revision-id: davi.arnaut@sun.com-20100429231819-i3anwzrdasjmezvt
> parent: davi.arnaut@sun.com-20100401131522-895y8uzvv8ag44gs
> parent: davi.arnaut@sun.com-20100429132816-ictyul6d75itek22
> committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
> branch nick: mysql-5.1-bugteam
> timestamp: Thu 2010-04-29 20:18:19 -0300
> message:
>   Manual merge.
> ------------------------------------------------------------
> Use --include-merges or -n0 to see merged revisions.
2010-06-22 22:51:35 +02:00
MySQL Build Team
01490413d2 Backport into build-201006221614-5.1.46sp1
> ------------------------------------------------------------
> revno: 1810.3987.13
> revision-id: ramil@mysql.com-20100429044232-f0pkyx8fnpszf142
> parent: alexey.kopytov@sun.com-20100426200600-op06qy98llzpzgl1
> committer: Ramil Kalimullin <ramil@mysql.com>
> branch nick: b53237-5.0-bugteam
> timestamp: Thu 2010-04-29 08:42:32 +0400
> message:
>   Fix for bug #53237: mysql_list_fields/COM_FIELD_LIST stack smashing
>   
>   Problem: "COM_FIELD_LIST is an old command of the MySQL server, before there was real move to only
>   SQL. Seems that the data sent to COM_FIELD_LIST( mysql_list_fields() function) is not
>   checked for sanity. By sending long data for the table a buffer is overflown, which can
>   be used deliberately to include code that harms".
>   
>   Fix: check incoming data length.

The patch did not apply cleanly:
- Line numbers are completely off, roughly it is 2030 -> 1313
- What is called "pend" in the patch, is "arg_end" in the source.
2010-06-22 22:34:48 +02:00
MySQL Build Team
4f066e5269 Backport into 5.1.46sp1:
> revno: 3351.14.56
> committer: Marko Mdkeld <marko.makela@oracle.com>
> branch nick: 5.1-innodb
> timestamp: Mon 2010-04-26 14:08:56 +0300
> message:
>   Add a test case for Bug #52745.
2010-06-22 22:09:31 +02:00
MySQL Build Team
f5a0316a39 Backport into build-201006221614-5.1.46sp1
> ------------------------------------------------------------
> revno: 3351.14.47
> revision-id: marko.makela@oracle.com-20100421095033-0acvzxb8um8cms0a
> parent: marko.makela@oracle.com-20100421094032-ir4glqk46qvg2ywn
> committer: Marko Mäkelä <marko.makela@oracle.com>
> branch nick: 5.1-innodb
> timestamp: Wed 2010-04-21 12:50:33 +0300
> message:
>   dtuple_convert_big_rec(): Store locally any fields whose maximum length
>   is less than 256 bytes. (Bug #52745)
>   Add related comments and debug assertions to the "offsets"
>   functions in rem0rec.c.
>   Approved by Sunny Bains
2010-06-22 21:59:35 +02:00
MySQL Build Team
e87a2d917b Backport into build-201006221614-5.1.46sp1
> ------------------------------------------------------------
> revno: 3351.47.2
> revision-id: marko.makela@oracle.com-20100511104910-nim8kgguawpis7zo
> parent: marko.makela@oracle.com-20100511104500-c6kzd0bg5s42p8e9
> committer: Marko Mäkelä <marko.makela@oracle.com>
> branch nick: mysql-5.1-innodb2
> timestamp: Tue 2010-05-11 13:49:10 +0300
> message:
>   btr_page_split_and_insert(): Add an assertion
>   suggested by Sunny Bains when reviewing Bug #52964.
2010-06-22 21:56:18 +02:00
MySQL Build Team
1cab479221 Backport into build-201006221614-5.1.46sp1
> ------------------------------------------------------------
> revno: 3351.47.1
> revision-id: marko.makela@oracle.com-20100511104500-c6kzd0bg5s42p8e9
> parent: vasil.dimov@oracle.com-20100510132852-cz457uqvj8iiy9mm
> committer: Marko Mäkelä <marko.makela@oracle.com>
> branch nick: mysql-5.1-innodb2
> timestamp: Tue 2010-05-11 13:45:00 +0300
> message:
>   Remove a stray expression. Spotted by Sunny Bains.
2010-06-22 21:54:41 +02:00
MySQL Build Team
65379cccc8 Backport into build-201006221614-5.1.46sp1
> ------------------------------------------------------------
> revno: 3351.14.74
> revision-id: marko.makela@oracle.com-20100504093128-44v6glupe1dsh0ug
> parent: marko.makela@oracle.com-20100503122859-k73bl51re93o0mt4
> committer: Marko Mäkelä <marko.makela@oracle.com>
> branch nick: 5.1-innodb
> timestamp: Tue 2010-05-04 12:31:28 +0300
> message:
>   btr_page_split_and_insert(): Correct the fix of Bug #52964.
>   When split_rec==NULL, choose the correct node pointer key (first_rec).
2010-06-22 21:52:43 +02:00
MySQL Build Team
d2c104fd12 Backport into build-201006221614-5.1.46sp1
> ------------------------------------------------------------
> revno: 3351.14.50
> revision-id: marko.makela@oracle.com-20100421185359-8qaxoa2yyrpzwdd7
> parent: marko.makela@oracle.com-20100421102723-0i80uezbyu0ekj5d
> committer: Marko Mäkelä <marko.makela@oracle.com>
> branch nick: 5.1-innodb
> timestamp: Wed 2010-04-21 21:53:59 +0300
> message:
>   btr_page_split_and_insert(): Avoid an infinite loop. (Bug #52964)
>   
>   btr_page_tuple_smaller(): New function, refactored from
>   btr_page_split_and_insert().
>   
>   btr_page_get_split_rec(): Renamed from btr_page_get_sure_split_rec().
>   Note that a NULL return may mean that the tuple is to be inserted into
>   either the lower or upper page, to be determined by btr_page_tuple_smaller().
>   
>   btr_page_split_and_insert(): When btr_page_get_split_rec() returns NULL,
>   invoke btr_page_tuple_smaller() to determine which half-page the tuple
>   belongs to.
>   
>   Reviewed by Sunny Bains
2010-06-22 21:50:47 +02:00
MySQL Build Team
eea50ea20d Backport into build-201006221614-5.1.46sp1
> ------------------------------------------------------------
> revno: 3362
> revision-id: davi.arnaut@sun.com-20100401131522-895y8uzvv8ag44gs
> parent: ramil@mysql.com-20100429045409-r7r5lcyiruis15v7
> committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
> branch nick: 50755-5.1
> timestamp: Thu 2010-04-01 10:15:22 -0300
> message:
>   Bug#50755: Crash if stored routine def contains version comments
>   
>   The problem was that a syntactically invalid trigger could cause
>   the server to crash when trying to list triggers. The crash would
>   happen due to a mishap in the backup/restore procedure that should
>   protect parser items which are not associated with the trigger. The
>   backup/restore is used to isolate the parse tree (and context) of
>   a statement from the load (and parsing) of a trigger. In this case,
>   a error during the parsing of a trigger could cause the improper
>   backup/restore sequence.
>   
>   The solution is to properly restore the original statement context
>   before the parser is exited due to syntax errors in the trigger body.
2010-06-22 21:42:14 +02:00
Alexey Kopytov
0e6560398c Bug#54477: Crash on IN / CASE with NULL arguments
Incorrect handling of NULL arguments could lead to a crash on
the IN or CASE operations when either NULL arguments were
passed explicitly as arguments (IN) or implicitly generated by
the WITH ROLLUP modifier (both IN and CASE).

Item_func_case::find_item() assumed all necessary comparators
to be instantiated in fix_length_and_dec(). However, in the
presence of WITH ROLLUP modifier, arguments could be
substituted with an Item_null leading to an "unexpected"
STRING_RESULT comparator being invoked.

In addition to the problem identical to the above,
Item_func_in::val_int() could crash even with explicitly passed
NULL arguments due to an optimization in fix_length_and_dec()
leading to NULL arguments being ignored during comparators
creation.


mysql-test/r/func_in.result:
  Test cases for bug#54477.
mysql-test/t/func_in.test:
  Test cases for bug#54477.
sql/item_cmpfunc.cc:
  Added additional checks for Item_nulls in 
  Item_func_case::find_item() and Item_func_in::val_int().
2010-06-22 22:53:08 +04:00
unknown
ebdd528382 Set version number for mysql-5.1.46sp1 release 2010-06-22 19:21:25 +02:00
Vasil Dimov
d17ee9f8ec Merge mysql-5.1-innodb from bk-internal to my local tree 2010-06-22 20:12:05 +03:00
Vasil Dimov
e42ab1af8d Add ChangeLog entry for the fix of Bug#47991 2010-06-22 20:04:54 +03:00
Vasil Dimov
ba04d53826 Fix Bug#47991 InnoDB Dictionary Cache memory usage increases indefinitely
when renaming tables

Allocate the table name using ut_malloc() instead of table->heap because
the latter cannot be freed.

Adjust dict_sys->size calculations all over the code.

Change dict_table_t::name from const char* to char* because we need to
ut_malloc()/ut_free() it.

Reviewed by:	Inaam, Marko, Heikki (rb://384)
Approved by:	Heikki (rb://384)
2010-06-22 19:30:43 +03:00
Marko Mäkelä
31939e0d14 ChangeLog for Bug#54686 "field->col->mtype == type" assertion error at row/row0sel.c 2010-06-22 14:59:49 +03:00
Marko Mäkelä
a1ac083fc3 Bug#54686 "field->col->mtype == type" assertion error at row/row0sel.c
ha_innobase::index_read(), ha_innobase::records_in_range(): Check that
the index is useable before invoking row_sel_convert_mysql_key_to_innobase().

This fix is based on a suggestion by Yasufumi Kinoshita.
2010-06-22 14:52:15 +03:00
Georgi Kodinov
3b0bf67343 merge 2010-06-21 14:49:37 +03:00
Sergey Glukhov
b36a028224 Bug#50389 Using intersect does not return all rows
In process of record search it is not taken into account
that inital quick->file->ref value could be inapplicable
to range interval. After proper row is found this value is
stored into the record buffer and later the record is
filtered out at condition evaluation stage.
The fix is store a refernce of found row to the handler ref field.


mysql-test/r/innodb_mysql.result:
  test case
mysql-test/std_data/intersect-bug50389.tsv:
  test case
mysql-test/t/innodb_mysql.test:
  test case
sql/opt_range.cc:
  store a refernce of found row to the handler ref field.
2010-06-21 15:09:58 +04:00
Georgi Kodinov
5e22f73ad3 tree name change 2010-06-21 14:09:23 +03:00
Georgi Kodinov
0251b868ac Switched the mailing lists 2010-06-21 14:06:14 +03:00
Marko Mäkelä
a6c1d93e02 Bug#54658: Add ChangeLog entry 2010-06-21 12:51:48 +03:00
Marko Mäkelä
aebf6c06c4 Bug #54658: InnoDB: Warning: allocated tablespace %lu, old maximum was 0
dict_check_tablespaces_and_store_max_id(): Initialize max_space_id
and fil_system->max_assigned_id from DICT_HDR_MAX_SPACE_ID.

fil_space_create(): Suppress the warning unless !recv_recovery_on
(do not complain while applying the redo log).
2010-06-21 12:40:08 +03:00
Ramil Kalimullin
1614c3c128 Fix for bug #54575: crash when joining tables with unique set column
Problem: a flaw (derefencing a NULL pointer) in the LIKE optimization
code may lead to a server crash in some rare cases.

Fix: check the pointer before its dereferencing.


mysql-test/r/func_like.result:
  Fix for bug #54575: crash when joining tables with unique set column
    - test result.
mysql-test/t/func_like.test:
  Fix for bug #54575: crash when joining tables with unique set column
    - test case.
sql/item_cmpfunc.cc:
  Fix for bug #54575: crash when joining tables with unique set column
    - check res2 buffer pointer before its dereferencing 
  as it may be NULL in some cases.
2010-06-20 02:02:58 +04:00
Ramil Kalimullin
5088fb1394 Fix for bug #54393: crash and/or valgrind errors in
mysql_client_binlog_statement

Problem: server may read from unassigned memory performing
"wrong" BINLOG queries.

Fix: never read from unassigned memory.


mysql-test/suite/binlog/r/binlog_base64_flag.result:
  Fix for bug #54393: crash and/or valgrind errors in
  mysql_client_binlog_statement
    - test result.
mysql-test/suite/binlog/t/binlog_base64_flag.test:
  Fix for bug #54393: crash and/or valgrind errors in
  mysql_client_binlog_statement
    - test case.
sql/sql_binlog.cc:
  Fix for bug #54393: crash and/or valgrind errors in
  mysql_client_binlog_statement
    - coded_len should not count trailing '/0';
    - never read from unassigned memory.
2010-06-18 21:32:23 +04:00
Vasil Dimov
c66ce15fe3 Merge mysql-5.1-innodb from bk-internal to my local repo 2010-06-18 11:51:55 +03:00
Vasil Dimov
40c13ca9bd Increment InnoDB Plugin version from 1.0.9 to 1.0.10, after
1.0.9 has been released with MySQL 5.1.48.
2010-06-18 10:00:01 +03:00
Jimmy Yang
4d446d4c10 Check in fix for Bug #52814 InnoDB: Use the new ha_data interfaces
rb://290, approved by Sunny
2010-06-17 22:38:22 -07:00
Joerg Bruehe
10d0786cd4 Bug#54590 "make_binary_distribution" fails because a command
line exceeds the limit

Upmerge the fix from 5.0 to 5.1
2010-06-17 19:55:21 +02:00
Joerg Bruehe
609e65ba54 Bug#54590 "make_binary_distribution" fails because a command
line exceeds the limit

The number and/or names of our files for the main test suite
(contents of "mysql-test/t/") now exceeds the command line
length limit on AIX.
Solve the problem by using separate "cp" commands for the
various file name extensions.
2010-06-17 19:47:38 +02:00
Jimmy Yang
69bc6dd01c Fix an overly asserted assertion during previous checkin for bug #54330. 2010-06-17 10:33:03 -07:00
Joerg Bruehe
ae47e257e3 Automerge the fix for bug#27072 into 5.1-bugteam 2010-06-17 13:07:33 +02:00
Jimmy Yang
3c0be2c7b3 Fix Bug #54330 Broken fast index creation. Add additional array to
account for each merge run's start offset, so correct offsets are
paired up for multiple merge runs.

rb://377 approved by Marko
2010-06-16 19:12:04 -07:00
Alfranio Correia
cdc4e9ebce merge mysql-5.1-bugteam (local) --> mysql-5.1-bugteam 2010-06-17 01:25:07 +01:00
Joerg Bruehe
b3eac87c3c Fix bug#27072: RPM autostarts the server
This is the fix for 5.1, where only the behaviour on upgrade is changed:
If the server was stopped when the upgrade begins, we assume the
administrator is taking manual action, so we do not start the (new)
server at the end of the upgrade.
We still install the start/stop script, so it will be started on reboot.


support-files/mysql.spec.sh:
  In the "pre" section of the spec file, check the server status, and write
  the result to a file.
  In the "post" section, evaluate the status file, and start the server if
  it was running during status analysis.
  In 5.1, we start the server if there is no status file (which will happen
  on first installation, when there is no data directory yet).
2010-06-15 22:27:48 +02:00
Alexey Kopytov
d2e58e4e49 Backport of the patch for bug52208 to 5.1 since the
root cause of 52208 resulted in another test failure
in 5.1.
2010-06-15 18:29:53 +04:00
Jimmy Yang
8e7ce2e9d8 Add checkin description for bug #47622 to ChangeLog. 2010-06-15 02:33:26 -07:00
Bjorn Munch
6537d79e45 null upmerge 53424, irrelevant for 5.1 2010-06-15 11:03:52 +02:00
Bjorn Munch
8d253fe2f8 Bug #53424 Certain combination of flags give internal error
Reorder code breaks when finding tests skipped due to --skip-rpl etc.
Add simple test that master_opt is non-empty
2010-06-15 11:00:02 +02:00
Vasil Dimov
3170aa677d Adjust suite/innodb/r/innodb_mysql.result after the merge 2010-06-14 13:35:15 +03:00
Vasil Dimov
6996ef1380 Merge mysql-5.1 -> mysql-5.1-innodb
(innodb_mysql.result needs to be adjusted after this commit)
2010-06-14 12:43:02 +03:00
Bjorn Munch
ec1d665c64 Upmerge and port 46882 2010-06-14 11:31:22 +02:00
Bjorn Munch
b18902fd59 Bug #46882 Suite timeout doesn't kill stray processes
Kill mysqltest and call mtr_kill_leftovers() before terminating
2010-06-14 11:26:42 +02:00
Alexey Kopytov
41c3732a75 Addendum for the fix for bug #42064:
In Prepared_statement::prepare() bail out as soon as
parser_state.init() fails, trying to continue leads to crashes.
2010-06-12 09:52:31 +04:00
Alexey Kopytov
2400e54a12 Automerge. 2010-06-11 23:44:01 +04:00