Commit graph

66823 commits

Author SHA1 Message Date
Alexander Nozdrin
f703a7779f Auto-merge from mysql-5.5-stage (used to be mysql-5.5-bugfixing). 2010-10-02 22:08:31 +04:00
Alexander Nozdrin
76f4cfde66 Empty merge from mysql-5.5. 2010-09-28 19:42:45 +04:00
Alexander Nozdrin
fab555ce76 Auto-merge from mysql-5.5-merge. 2010-09-28 19:34:59 +04:00
Alexander Nozdrin
a79093cd94 Auto-merge from mysql-5.5-merge. 2010-09-28 19:15:58 +04:00
Alexey Botchkov
4a2dd398e2 log_tables_debug.test fix.
per-file comments:
  mysql-test/t/log_tables_debug.test
        This test shouldn't be run at the embedded server.
2010-09-27 15:18:10 +05:00
Marc Alff
6a707718b9 Added missing paterns 2010-09-27 18:23:54 -06:00
Davi Arnaut
657f07151a Merge of mysql-5.1-bugteam into mysql-5.5-merge. 2010-09-24 19:19:30 -03:00
Davi Arnaut
d47e8991cb Bug#45288: pb2 returns a lot of compilation warnings on linux
Use UNINIT_VAR workaround instead of LINT_INIT. The former can
also be used to silence false-positives in non-debug builds as
it actually does not cause new code to be generated.
2010-09-24 19:13:51 -03:00
Davi Arnaut
5713e1398c Bug#45288: pb2 returns a lot of compilation warnings on linux
Use UNINIT_VAR workaround instead of LINT_INIT. The former is
also used in non-debug builds as it doesn't cause changes.
2010-09-24 17:04:36 -03:00
Dmitry Lenev
afa568c24b Fix compile warning about passing NULL to non-pointer
argument of inline_mysql_mutex_init in sql_base.cc.

When initializing LOCK_dd_owns_lock_open mutex pass
correct PSI key instead of NULL value.
2010-09-24 20:26:24 +04:00
Konstantin Osipov
5b06699029 Merge 5.5 -> 5.5-merge. 2010-09-24 17:18:45 +04:00
Davi Arnaut
2044c80745 Merge of mysql-5.1-bugteam into mysql-5.5-merge. 2010-09-24 10:03:17 -03:00
Davi Arnaut
77a0ae9a9a Bug#45288: pb2 returns a lot of compilation warnings on linux
Temporarily disable strict aliasing warnings in order to get
wider coverage for optimized builds. Once the violations are
fixed and false-positives silenced, this flag should be removed.
2010-09-24 09:36:31 -03:00
Dmitry Shulga
e1b299ed02 Merged changes from 5.1-bugteam for bug#42503. 2010-09-24 19:12:09 +07:00
Dmitry Shulga
f14d8c2896 Follow-up for Bug#42503: fix a compilation warning. 2010-09-24 19:03:28 +07:00
Mats Kindahl
246b7b0b7d Merging into mysql-5.5-bugfixing. 2010-09-23 14:38:24 +02:00
Dmitry Shulga
7cc604561c Auto-merge from mysql-5.1-bugteam for bug#56821. 2010-09-22 20:11:40 +07:00
Dmitry Shulga
c7ccc7265e Fixed bug#56821 - failure to start the MySQL Service. 2010-09-22 19:53:06 +07:00
Mats Kindahl
48ac52a861 Merging into mysql-5.5-bugfixing. 2010-09-21 23:24:29 +02:00
Ingo Struewing
56d205c904 Bug#46339 - crash on REPAIR TABLE merge table USE_FRM
Null-merge from 5.1
2010-09-21 16:47:41 +02:00
Ingo Struewing
386d50478c Bug#46339 - crash on REPAIR TABLE merge table USE_FRM
Merge from saved bundle.
2010-09-21 16:37:18 +02:00
Evgeny Potemkin
cd8710fe8a Auto-merged. 2010-09-21 13:37:31 +04:00
Joerg Bruehe
9141bb5878 Merge 5.5.6-rc to the main tree. 2010-09-19 22:01:12 +02:00
Davi Arnaut
be348787eb Bug#52419: x86 assembly based atomic CAS causes test failures
The problem was that the x86 assembly based atomic CAS
(compare and swap) implementation could copy the wrong
value to the ebx register, where the cmpxchg8b expects
to see part of the "comparand" value. Since the original
value in the ebx register is saved in the stack (that is,
the push instruction causes the stack pointer to change),
a wrong offset could be used if the compiler decides to
put the source of the comparand value in the stack.

The solution is to copy the comparand value directly from
memory. Since the comparand value is 64-bits wide, it is
copied in two steps over to the ebx and ecx registers.
2010-09-17 17:34:15 -03:00
Alfranio Correia
c316b68146 merge mysql-5.1-bugteam --> mysql-5.5-merge 2010-09-17 21:22:34 +01:00
Marc Alff
fa4c505eda Bug#50557 checksum table crashes server when used in performance_schema
CHECKSUM TABLE for performance schema tables could cause uninitialized
memory reads.

The root cause is a design flaw in the implementation of
mysql_checksum_table(), which do not honor null fields.

However, fixing this bug in CHECKSUM TABLE is risky, as it can cause the
checksum value to change.

This fix implements a work around, to systematically reset fields values
even for null fields, so that the field memory representation is always
initialized with a known value.
2010-09-17 13:03:09 -06:00
Marc Alff
ba7dec4a2d local merge 2010-09-17 10:21:53 -06:00
Alfranio Correia
6baf9d5a61 merge mysql-5.1-bugteam (local) --> mysql-5.1-bugteam 2010-09-17 14:55:23 +01:00
Alfranio Correia
77dcf9bec7 merge mysql-5.5-bugfixing (local) --> mysql-5.5-bugfixing 2010-09-17 12:58:27 +01:00
Marc Alff
fd6497b3d8 Bug#56832 perfschema.server_init test output not consistent
Before this fix, the test output for perfschema.server_init would
vary between executions, because some of the objects tested were
not guaranteed to exist in all configurations / code paths.

This fix removes these weak tests.

Also, comments referring to abandonned code have been cleaned up.
2010-09-16 19:04:34 -06:00
Sergey Glukhov
dcad3feb1c 5.1-bugteam->5.5-merge 2010-09-16 16:20:35 +04:00
Sergey Glukhov
86d7cbd450 Bug#50402 Optimizer producing wrong results when using Index Merge on InnoDB
Subselect executes twice, at JOIN::optimize stage
and at JOIN::execute stage. At optimize stage
Innodb prebuilt struct which is used for the
retrieval of column values is initialized in.
ha_innobase::index_read(), prebuilt->sql_stat_start is true.
After QUICK_ROR_INTERSECT_SELECT finished his job it
restores read_set/write_set bitmaps with initial values
and deactivates one of the handlers used by
QUICK_ROR_INTERSECT_SELECT in JOIN::cleanup
(it's the case when we reuse original handler as one of
 handlers required by QUICK_ROR_INTERSECT_SELECT object).
On second subselect execution inactive handler is activated
in  QUICK_RANGE_SELECT::reset, file->ha_index_init().
In ha_index_init Innodb prebuilt struct is reinitialized
with inappropriate read_set/write_set bitmaps. Further
reinitialization in ha_innobase::index_read() does not
happen as prebuilt->sql_stat_start is false.
It leads to partial retrieval of required field values
and we get a mix of field values from different records
in the record buffer.
The fix is to reset
read_set/write_set bitmaps as these values
are required for proper intialization of
internal InnoDB struct which is used for
the retrieval of column values
(see build_template(), ha_innodb.cc)
2010-09-16 16:13:53 +04:00
Magne Mahre
327eb7b680 Merge from 5.1-bugteam 2010-09-16 13:00:53 +02:00
Magne Mahre
f43d6c2b73 Bug #54606 innodb fast alter table + pack_keys=0 prevents
adding new indexes

A fast alter table requires that the existing (old) table
and indices are unchanged (i.e only new indices can be
added).  To verify this, the layout and flags of the old
table/indices are compared for equality with the new.

The PACK_KEYS option is a no-op in InnoDB, but the flag
exists, and is used in the table compare.  We need to
check this (table) option flag before deciding whether an 
index should be packed or not.  If the table has
explicitly set PACK_KEYS to 0, the created indices should
not be marked as packed/packable.
2010-09-16 12:51:08 +02:00
Dmitry Shulga
a684f8df20 Auto-merge from mysql-5.1-bugteam for bug#42503. 2010-09-16 17:38:13 +07:00
Dmitry Shulga
be794bc5eb Fixed bug#42503 - "Lost connection" errors when using
compression protocol.

The loss of connection was caused by a malformed packet
sent by the server in case when query cache was in use.
When storing data in the query cache, the query  cache
memory allocation algorithm had a tendency to reduce
the amount of memory block necessary to store a result
set, up to finally storing the entire result set in a single
block. With a significant result set, this memory block
could turn out to be quite large - 30, 40 MB and on.
When such a result set was sent to the client, the entire
memory block was compressed and written to network as a
single network packet. However, the length of the
network packet is limited by 0xFFFFFF (16MB), since
the packet format only allows 3 bytes for packet length.
As a result, a malformed, overly large packet
with truncated length would be sent to the client
and break the client/server protocol.

The solution is, when sending result sets from the query
cache, to ensure that the data is chopped into
network packets of size <= 16MB, so that there
is no corruption of packet length. This solution,
however, has a shortcoming: since the result set
is still stored in the query cache as a single block,
at the time of sending, we've lost boundaries of individual
logical packets (one logical packet = one row of the result
set) and thus can end up sending a truncated logical
packet in a compressed network packet.

As a result, on the client we may require more memory than 
max_allowed_packet to keep, both, the truncated
last logical packet, and the compressed next packet.
This never (or in practice never) happens without compression,
since without compression it's very unlikely that
a) a truncated logical packet would remain on the client
when it's time to read the next packet
b) a subsequent logical packet that is being read would be
so large that size-of-new-packet + size-of-old-packet-tail >
max_allowed_packet.
To remedy this issue, we send data in 1MB sized packets,
that's below the current client default of 16MB for
max_allowed_packet, but large enough to ensure there is no
unnecessary overhead from too many syscalls per result set.
2010-09-16 17:24:27 +07:00
Mikael Ronstrom
723e7c16a5 merge updates of build_mccge.sh and check-cpu 2010-09-16 10:04:10 +02:00
Mikael Ronstrom
f601c035c5 Updated build_mccge.sh and added support for more cpu's in check-cpu 2010-09-16 08:53:58 +02:00
Marc Alff
2e4717ffcd Bug#56761 Segfault on CHECKSUM TABLE performance_schema.EVENTS_WAITS_HISTORY EXTENDED
Before this fix, the server could crash inside a memcpy when reading data
from the EVENTS_WAITS_CURRENT / HISTORY / HISTORY_LONG  tables.

The root cause is that the length used in a memcpy could be corrupted,
when another thread writes data in the wait record being read.
Reading unsafe data is ok, per design choice, and the code does sanitize
the data in general, but did not sanitize the length given to memcpy.

The fix is to also sanitize the schema name / object name / file name
length when extracting the data to produce a row.
2010-09-15 12:20:48 -06:00
Olav Sandstaa
93e7e5f9d9 Fix for Bug#54478 "mysqld crashes during boot when running mtr with --debug option"
The crash during boot was caused by a DBUG_PRINT statement in fill_schema_schemata() (in
sql_show.cc). This DBUG_PRINT statement contained several instances of %s in the format 
string and for one of these we gave a NULL pointer as the argument. This caused the
call to vsnprintf() to crash when running on Solaris.
      
The fix for this problem is to replace the call to vsnprintf() with my_vsnprintf()
which handles that a NULL pointer is passed as argumens for %s.

This patch also extends my_vsnprintf() to support %i in the format string.
2010-09-15 13:33:22 +02:00
Marc Alff
3e70a34f30 Local merge 2010-09-14 15:40:50 -06:00
Mattias Jonsson
9cb34e683b post push patch, fixing test result for bug#53806/46754. 2010-09-14 10:56:11 +02:00
Marc Alff
651d597e2f Bug#53102 perfschema.pfs_upgrade fails when executed direct after mysql_upgrade
Implemented post review comments.

Added --force to the mysql_upgrade command in the test scripts,
so that the test output does not depends on whether other tests involving an
upgrade have been executed or not in the same test suite execution.
2010-09-13 17:19:39 -06:00
Mattias Jonsson
061769d7b6 merge 2010-09-13 16:07:50 +02:00
Mattias Jonsson
640454b373 merge 2010-09-13 15:56:56 +02:00
Mattias Jonsson
99e507e8a4 merge 2010-09-13 15:14:17 +02:00
Martin Hansson
c09489ebb2 Merge of fix for Bug#50394. 2010-09-13 14:46:55 +02:00
Martin Hansson
20bdf7636b Bug #50394: Regression in EXPLAIN with index scan, LIMIT, GROUP BY and
ORDER BY computed col
      
GROUP BY implies ORDER BY in the MySQL dialect of SQL. Therefore, when an
index on the first table in the query is used, and that index satisfies
ordering according to the GROUP BY clause, the query optimizer estimates the
number of tuples that need to be read from this index. If there is a LIMIT
clause, table statistics on tables following this 'sort table' are employed.

There may be a separate ORDER BY clause however, which mandates reading the
whole 'sort table' anyway. But the previous estimate was left untouched.

Fixed by removing the estimate from EXPLAIN output if GROUP BY is used in
conjunction with an ORDER BY clause that mandates using a temporary table.
2010-09-13 13:33:19 +02:00
Joerg Bruehe
91392cd893 Selective transfer of a bugfix patch into 5.5.6-rc.
The first part is the functional change,
the second is needed as a compile fix on Windows
(header file order).

| committer: Marc Alff <marc.alff@oracle.com>
| branch nick: mysql-5.5-bugfixing-56521
| timestamp: Thu 2010-09-09 14:28:47 -0600
| message:
|   Bug#56521 Assertion failed: (m_state == 2), function allocated_to_free, pfs_lock.h (138)
|
|   Before this fix, it was possible to build the server:
|   - with the performance schema
|   - with a dummy implementation of my_atomic (MY_ATOMIC_MODE_DUMMY).
|
|   In this case, the resulting binary will just crash,
|   as this configuration is not supported.
|
|   This fix enforces that the build will fail with a compilation error in this
|   configuration, instead of resulting in a broken binary.

| committer: Tor Didriksen <tor.didriksen@oracle.com>
| branch nick: 5.5-bugfixing-56521
| timestamp: Fri 2010-09-10 11:10:38 +0200
| message:
|   Header files should be self-contained
2010-09-13 12:14:48 +02:00
Gleb Shchepa
83c5552b4f manual merge 5.1-bugteam --> 5.5-merge (bug 55779) 2010-09-13 11:30:10 +04:00