Commit graph

66220 commits

Author SHA1 Message Date
Sunny Bains
442ba20a92 Fix bug#54583. This change reverses rsvn:1350 by getting rid of a bogus assertion
and clarifies the invariant in dict_table_get_on_id().
      
In Mar 2007 Marko observed a crash during recovery, the crash resulted from
an UNDO operation on a system table. His solution was to acquire an X lock on
the data dictionary, this in hindsight was an overkill. It is unclear what
caused the crash, current hypothesis is that it was a memory corruption.
      
The X lock results in performance issues by when undoing changes due to
rollback during normal operation on regular tables.
      
Why the change is safe:
======================
The InnoDB code has changed since the original X lock change was made. In the
new code we always lock the data dictionary in X mode during startup when
UNDOing operations on the system tables (this is a given). This ensures that
the crash Marko observed cannot happen as long as all transactions that update
the system tables follow the standard rules by setting the appropriate DICT_OP
flag when writing the log records when they make the changes.
      
If transactions violate the above mentioned rule then during recovery (at
startup) the rollback code (see trx0roll.c) will not acquire the X lock
and we will see the crash again.  This will however be a different bug.
2010-06-25 18:18:41 +10:00
Vasil Dimov
93abdd67e5 Merge a lost changeset inaam.rana@oracle.com-20100624124843-m7ouqwe5zqcqapn1
(no changed files)
2010-06-25 11:10:44 +03:00
Sergey Glukhov
8241532516 5.1-bugteam->trunk-merge merge 2010-06-25 12:08:54 +04:00
Vasil Dimov
011e57d24c Merge a lost changeset inaam.rana@oracle.com-20100624124450-2m3mg1238ewvakgx 2010-06-25 11:08:52 +03:00
Vasil Dimov
182a7b57d8 Merge a lost changeset marko.makela@oracle.com-20100624104820-p4ojmxcmq8qeos6d 2010-06-25 11:06:02 +03:00
Vasil Dimov
15c0777d71 Merge a lost changeset marko.makela@oracle.com-20100624104620-pklunowaigv7quu9 2010-06-25 11:03:38 +03:00
Vasil Dimov
ff9159f7d1 Merge a lost changeset jimmy.yang@oracle.com-20100624021010-oh2hnp8e1xbaax6u 2010-06-25 11:02:31 +03:00
Sergey Glukhov
700f8add12 Bug#54422 query with = 'variables'
During creation of the table list of
processed tables hidden I_S table 'VARIABLES'
is erroneously added into the table list.
it leads to ER_UNKNOWN_TABLE error in
TABLE_LIST::add_table_to_list() function.
The fix is to skip addition of hidden I_S
tables into the table list.
2010-06-25 12:01:47 +04:00
Jon Olav Hauglid
80af13189f Bug #50124 Rpl failure on DROP table with concurrent txn/non-txn
DML flow and SAVEPOINT

The problem was that replication could break if a transaction involving
both transactional and non-transactional tables was rolled back to a
savepoint. It broke if a concurrent connection tried to drop a
transactional table which was locked after the savepoint was set.
This DROP TABLE completed when ROLLBACK TO SAVEPOINT was executed as the
lock on the table was dropped by the transaction. When the slave later
tried to apply the binlog, it would fail as the table would already
have been dropped.

The reason for the problem is that transactions involving both
transactional and non-transactional tables are written fully to the
binlog during ROLLBACK TO SAVEPOINT. At the same time, metadata locks
acquired after a savepoint, were released during ROLLBACK TO SAVEPOINT.
This allowed a second connection to drop a table only used between
SAVEPOINT and ROLLBACK TO SAVEPOINT. Which caused the transaction binlog
to refer to a non-existing table when it was written during ROLLBACK
TO SAVEPOINT.

This patch fixes the problem by not releasing metadata locks when
ROLLBACK TO SAVEPOINT is executed if binlogging is enabled.
2010-06-25 09:32:24 +02:00
Jimmy Yang
7f1e5a37a0 Moved fix for Bug#54044 to security branch. Undo revno:3116 2010-06-24 22:14:20 -07:00
Sunny Bains
fce131ccee Fix bug#54583. This change reverses r1530 by getting rid of a bogus assertion
and clarifies the invariant in dict_table_get_on_id().
  
In Mar 2007 Marko observed a crash during recovery, the crash resulted from
an UNDO operation on a system table. His solution was to acquire an X lock on
the data dictionary, this in hindsight was an overkill. It is unclear what
caused the crash, current hypothesis is that it was a memory corruption.
  
The X lock results in performance issues by when undoing changes due to
rollback during normal operation on regular tables.
  
Why the change is safe:
======================
The InnoDB code has changed since the original X lock change was made. In the
new code we always lock the data dictionary in X mode during startup when
UNDOing operations on the system tables (this is a given). This ensures that
the crash Marko observed cannot happen as long as all transactions that update
the system tables follow the standard rules by setting the appropriate DICT_OP
flag when writing the log records when they make the changes.
  
If transactions violate the above mentioned rule then during recovery (at
startup) the rollback code (see trx0roll.c) will not acquire the X lock
and we will see the crash again.  This will however be a different bug.
2010-06-25 12:59:37 +10:00
Luis Soares
16141e0c85 BUG#54509: rpl_show_slave_running crashes the server sporadically
Problem: SQL and IO thread were racing for the IO_CACHE. The former to
flush it, the latter to close it. In some cases this would cause the
SQL thread to lock an invalid IO_CACHE mutex (it had been destroyed by
IO thread). This would happen when SQL thread was initializing the
master.info

Solution: We solve this by locking the log and checking if it is
hot. If it is we keep the log while seeking. Otherwise we release it
right away, because a log can get from hot to cold, but not from cold
to hot.
2010-06-24 19:03:23 +01:00
Ramil Kalimullin
56dc363dbc Automerge. 2010-06-24 21:19:25 +04:00
Ramil Kalimullin
479d24a213 Accidentally pushed test changes (#54459) removed. 2010-06-24 21:13:08 +04:00
Martin Hansson
0611703f62 Merge of fix for Bug#41660. 2010-06-24 16:01:17 +02:00
Martin Hansson
dac59fa9c3 Bug#41660: Sort-index_merge for non-first join table may
require O(#scans) memory

When an index merge operation was restarted, it would
re-allocate the Unique object controlling the duplicate row
ID elimination. Fixed by making the Unique object a member
of QUICK_INDEX_MERGE_SELECT and thus reusing it throughout
the lifetime of this object.
2010-06-24 15:21:23 +02:00
Inaam Rana
39dfb2b810 merge 2010-06-24 08:48:43 -04:00
Inaam Rana
dfed638267 Add ChangeLog for bug#39168 2010-06-24 08:44:50 -04:00
Ramil Kalimullin
346098549a Automerge. 2010-06-24 15:29:53 +04:00
Ramil Kalimullin
a08780df98 Automerge. 2010-06-24 15:26:14 +04:00
Marko Mäkelä
da8daa3679 Merge Bug #54679 fix from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3523
revision-id: marko.makela@oracle.com-20100624104620-pklunowaigv7quu9
parent: jimmy.yang@oracle.com-20100624021010-oh2hnp8e1xbaax6u
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Thu 2010-06-24 13:46:20 +0300
message:
  Bug#54679: alter table causes compressed row_format to revert to compact

  ha_innobase::create(): Add the local variable row_type = form->s->row_type.
  Adjust it to ROW_TYPE_COMPRESSED when ROW_FORMAT is not specified or inherited
  but KEY_BLOCK_SIZE is. Observe the inherited ROW_FORMAT even when it is not
  explicitly specified.

  innodb_bug54679.test: New test, to test the bug and to ensure that there are
  no regressions. (The only difference in the test result without the patch
  applied is that the first ALTER TABLE changes ROW_FORMAT to Compact.)
2010-06-24 14:06:52 +03:00
Joerg Bruehe
6eaa73ab77 Automerge the bug fix 54739 into the 5.5.5-m3 release clone. 2010-06-24 13:02:50 +02:00
Alexey Kopytov
fce42b01c9 Automerge. 2010-06-24 14:49:19 +04:00
Marko Mäkelä
1910056fdc Add ChangeLog entry for Bug#54679 2010-06-24 13:48:20 +03:00
Alexey Kopytov
c34caf25e3 Automerge. 2010-06-24 14:47:48 +04:00
Alexey Kopytov
8b9e56b773 Automerge. 2010-06-24 14:47:09 +04:00
Marko Mäkelä
d2dfe0b8be Bug#54679: alter table causes compressed row_format to revert to compact
ha_innobase::create(): Add the local variable row_type = form->s->row_type.
Adjust it to ROW_TYPE_COMPRESSED when ROW_FORMAT is not specified or inherited
but KEY_BLOCK_SIZE is. Observe the inherited ROW_FORMAT even when it is not
explicitly specified.

innodb_bug54679.test: New test, to test the bug and to ensure that there are
no regressions. (The only difference in the test result without the patch
applied is that the first ALTER TABLE changes ROW_FORMAT to Compact.)
2010-06-24 13:46:20 +03:00
Alexey Kopytov
1f74e5f3a8 Automerge. 2010-06-24 14:43:39 +04:00
Jimmy Yang
ed1e0232f0 Port fix for bug #54044 from mysql-5.1-security to mysql-trunk-security:
------------------------------------------------------------
revno: 3438
committer: Jimmy Yang <jimmy.yang@oracle.com>
branch nick: mysql-5.1-security
timestamp: Thu 2010-06-24 01:20:25 -0700
message:
  Fix Bug #54044 Create temporary tables and using innodb crashes.
2010-06-24 01:49:22 -07:00
Ramil Kalimullin
389c68a8d4 Automerge. 2010-06-24 12:34:05 +04:00
Ramil Kalimullin
0d7eb317b5 Accidentally pushed test changes (#54459) removed. 2010-06-24 12:31:01 +04:00
Jimmy Yang
c7afb80fe0 Fix Bug #54044 Create temporary tables and using innodb crashes. 2010-06-24 01:20:25 -07:00
Ramil Kalimullin
e233dc2bfd Fix for bug #54459: Assertion failed: param.sort_length,
file .\filesort.cc, line 149 (part II)

Problem: the server didn't disregard sort order 
for some zero length tuples.

Fix: skip sort order in such a case 
(zero length NOT NULL string functions).
2010-06-24 12:00:48 +04:00
Marko Mäkelä
3f81c310dc trx_undo_parse_page_header(): Silence a bogus warning. 2010-06-24 10:21:40 +03:00
Marko Mäkelä
ae029e13c9 After-review cleanup of Bug#57428: replace the dulint struct with a 64-bit int
trx_undo_build_roll_ptr(): Clarify the assertion on is_insert being 0 or 1.

TRX_SYS_FILE_FORMAT_TAG: Remove "extra" space after period in the comment.
See also http://desktoppub.about.com/cs/typespacing/a/onetwospaces.htm
2010-06-24 09:09:29 +03:00
Marko Mäkelä
2f7fd13135 mach_ull_parse_compressed(): Move to .ic file to silence a GCC warning
about trx_id being possibly uninitialized in trx_undo_parse_page_header().
The warning remains when UNIV_DEBUG or UNIV_MUST_NOT_INLINE is enabled.
2010-06-24 09:08:42 +03:00
Marko Mäkelä
bc3deeb269 ut_ull_create(): Fix a typo in ut_ad(): ULINT32_MASK instead of ULINT32_MAX. 2010-06-24 09:01:46 +03:00
Jimmy Yang
1b5d6a33b6 Move the fix for bug #54044 to security branch, and revert commit -r3520:3521. 2010-06-23 19:10:10 -07:00
Georgi Kodinov
c38864d426 Bug #53814: NUMERIC_PRECISION for unsigned bigint field is 19,
should be 20

Fixed the numeric precision of the unsigned BIGINT column to 
be 20 instead of 19.
2010-06-23 19:25:31 +03:00
Joerg Bruehe
7f0b7faa68 Merge bug fix. 2010-06-23 16:32:03 +02:00
Joerg Bruehe
f1cc08433e Fix Bug #54739
Accidental change in compile-time definitions for FreeBSD


Revert the accidental setting of "HAVE_BROKEN_REALPATH"
on current versions of FreeBSD,

do it for both autotools ("configure.in")
and cmake ("cmake/os/FreeBSD.cmake").
2010-06-23 16:19:19 +02:00
Jonathan Perkin
fd4797e0d5 Remove storage/ndb from dist sources. 2010-06-23 13:36:19 +01:00
Marko Mäkelä
d26a9ed0d3 Bug#54728: Replace the dulint struct with a 64-bit integer. 2010-06-23 14:06:59 +03:00
Luis Soares
44acc95929 WL#5408: adding skip-test-list to mysql-trunk.push and mysql-next-mr.push
collections. Originally, they had only been added to default.push, so
trees named after mysql-[trunk|next-mr] would not skip those tests.
2010-06-23 11:58:24 +01:00
Kent Boortz
24b3962d51 CMakeLists.txt
cmake/build_configurations/mysql_release.cmake
 - Corrected spelling ENABLE_LOCAL_INFILE => ENABLED_LOCAL_INFILE
 - In addition to "RelWithDebInfo", set target "Release" and "Debug"
 - Set Debug flags
 - Enabled SSL on Mac OS X
 - For gcc builds, set RELEASE and DEBUG flags as well
 - For g++ builds, added "-fno-implicit-templates"
 - Use "-O" (gcc -O1) for optimized binaries, as "DEBUG" in out case
   is more about enabling trace support to the server, no optimization
   makes binaries too slow to be practical to reproduce problems

cmake/os/WindowsCache.cmake
 - Removed unused HAVE_SYS_IOCTL

config.h.cmake
 - Added header checks and missing defines
 - Removed unused HAVE_SYS_IOCTL
 - Grouped and uncommented some HAVE_* that are really not
   defines, but internal variables used in the CMake setup,
 - Added hard coded flags for HP-UX and Mac OS X

configure.cmake
 - Added header checks and missing defines
 - Removed unused HAVE_SYS_IOCTL
 - "sys/dir.h" test needs "sys/types.h"
 - Corrected syntax for "sys/ptem.h" test
 - Don't exclude test for some types if Mac OS X, harmless
   to do the test and we want the HAVE_<type> settings
 - Added hard coded flags for HP-UX and Mac OS X

extra/yassl/CMakeLists.txt
extra/yassl/taocrypt/CMakeLists.txt
 - Added missing source file "template_instnt.cpp"
2010-06-23 12:56:22 +02:00
Jimmy Yang
e9c542b05e Merge Bug#54044 fix from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3520
committer: Jimmy Yang <jimmy.yang@oracle.com>
branch nick: mysql-5.1-innodb
timestamp: Tue 2010-06-22 19:04:31 -0700
message:
  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-23 03:46:57 -07:00
Luis Soares
5d14217497 WL#5408: automerged original bzr bundles into mysql-trunk-bugfixing. 2010-06-23 11:21:00 +01:00
Luis Soares
ae95721663 WL 5408: automerged incremental bzr bundle from original commit. 2010-06-23 11:19:09 +01:00
Luis Soares
d09b73c8b8 WL 5408: automerged bzr bundle from original commit. 2010-06-23 11:17:59 +01:00
Vasil Dimov
0a7d579992 Enable InnoDB's UNIV_DEBUG if MySQL's WITH_DEBUG[_FULL] is defined
This will make PB2 test InnoDB with UNIV_DEBUG on its *_debug platforms

Discussed with:	Marko (on IRC)
2010-06-23 13:02:49 +03:00