Commit graph

69309 commits

Author SHA1 Message Date
Sergey Vojtovich
9c16284758 BUG#12611785 - AUDIT INTERFACE STRICT-ALIASING WARNINGS
The types mysql_event_general/mysql_event_connection are
being cast to the incompatible type mysql_event. The way
mysql_event and the other types are designed are prone to
strict aliasing violations and can break things depending
on how compilers optimizes this code.

This patch fixes audit interface, so it confirms to strict-
aliasing rules. It introduces incompatible changes to audit
interface:
- mysql_event type has been removed;
- event_class has been removed from mysql_event_generic and
  mysql_event_connection types;
- st_mysql_audit::event_notify() second argument is event_class;
- st_mysql_audit::event_notify() third argument is event of type
  (const void *).

"Writing Audit Plugins" section of manual should be updated:
http://dev.mysql.com/doc/refman/5.5/en/writing-audit-plugins.html
2011-06-03 11:27:11 +04:00
Jimmy Yang
bd708b4240 Implement worklog #5743 InnoDB: Lift the limit of index key prefixes.
With this change, the index prefix column length lifted from 767 bytes
to 3072 bytes if "innodb_large_prefix" is set to "true".

rb://603 approved by Marko
2011-05-31 02:12:32 -07:00
Marko Mäkelä
942cd5fd18 Bug#12606344 - ADD VALGRIND DIAGNOSTICS TO MTR_START, MTR_COMMIT
mtr_start(): Declare the mtr memory area uninitialized in Valgrind
before initializing the fields.

mtr_commit(): Declare everything uninitialized except
mtr->start_lsn, mtr->end_lsn and mtr->state.
2011-05-31 10:55:29 +03:00
Davi Arnaut
322dfc9d11 Bug#11766349 - 59443: query_cache_debug.test is occasionally very slow
The test case problem stemmed from the fact that a debug sync
signal is a global variable that persists until overwritten
by a new signal. This means that if two different signals
are raised in sequence, a thread waiting for the first signal
might miss it if the second signal sets the global variable
before the thread wakes up.

The solution is to deliver a subsequent signal only after the
waiting thread has received it.
2011-05-30 12:17:22 -03:00
Bjorn Munch
cc04a608f6 Bug #12604711 MTR SHOULD READ PLUGIN.DEFS FILES FROM IMPORTED FEATURE TREES
Added reading from plugin.defs files under plugins/*
2011-05-30 15:55:44 +02:00
Davi Arnaut
95dbf0539b Merge of mysql-5.1 into mysql-5.5. 2011-05-30 08:14:38 -03:00
Davi Arnaut
c20552e1c7 Bug#12563279: REGRESSION IN HANDLING PRE-4.1 AUTHENTICATION PACKET
The problem is that clients implementing the 4.0 version of the
protocol (that is, mysql-4.0) do not null terminate a string
at the end of the authentication packet. These clients denote
the end of the string with the end of the packet.

Although this goes against the documented (see MySQL Internals
ClientServer Protocol wiki) description of the protocol, these
old clients still need to be supported.

The solution is to support the documented and actual behavior
of the clients. If a client is using the pre-4.1 version of
the protocol, the end of a string in the authentication packet
can either be denoted with a null character or by the end of
the packet. This restores backwards compatibility with old
clients implementing either the documented or actual behavior.
2011-05-30 07:42:30 -03:00
Davi Arnaut
cb7abb9702 Null merge of mysql-5.1 into mysql-5.5. 2011-05-27 13:56:23 -03:00
Bjorn Munch
41a3b52660 Bug #12598603 HAVE COLLECTIONS FILES IN FEATURE TREES AUTO-APPENDED TO COMMON FILES
Do this in the common plugin.cmake but only if running in PB2
  (If done in manual builds it would create a bzr diff)
2011-05-27 14:43:15 +02:00
Dmitry Shulga
3b58613275 Manual-merge of patch for bug#12546938 from mysql-5.1->mysql-5.5 2011-05-27 18:42:28 +07:00
Davi Arnaut
79de9c7188 BUG 11763056 - 55721: AIX 5.1.50 build failing, cannot locate bzero
The problem is that although AIX implements bzero, its prototype
is not declared by default. Since AC_CHECK_FUNC(bzero) succeeds
even though a prototype is not declared, this breaks compilation
in C++ files where a prototype is required.

The solution is to only use bzero if a prototype is also declared.
2011-05-27 08:09:25 -03:00
Tatjana Azundris Nuernberg
c111ca4e52 build fixes for -Werror (11745920) 2011-05-27 11:02:10 +01:00
Dmitry Shulga
8bb8385f02 Fixed bug#12546938 (formerly known as 61005) - CREATE IF NOT EXIST EVENT
will create multiple running events.

A CREATE IF NOT EXIST on an event that existed and was enabled caused
multiple instances of the event to run. Disabling the event didn't  help.
If the event was  dropped, the event stopped running, but when created
again, multiple instances of the event were still running. The only way
to get out of this situation was  to restart the server.

The problem was that Event_db_repository::create_event() didn't return
enough information to discriminate between situation when event didn't
exist and was created and when event did exist and was not created
(but a warning was emitted). As result in the latter case event
was added to in-memory queue of events second time. And this led to
unwarranted multiple executions of the same event.

The solution is to add out-parameter to Event_db_repository::create_event()
method which will signal that event was not created because it already
exists and so it should not be added to the in-memory queue.
2011-05-27 16:23:08 +07:00
Anitha Gopi
6a95f23bd2 Automerge : Updating local tree 2011-05-27 10:22:00 +05:30
Dmitry Lenev
c61e346f51 Fix for bug #11762012 - "54553: INNODB ASSERTS IN
HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".

Attempt to update an InnoDB temporary table under LOCK TABLES
led to assertion failure in both debug and production builds
if this temporary table was explicitly locked for READ. The
same scenario works fine for MyISAM temporary tables.

The assertion failure was caused by discrepancy between lock
that was requested on the rows of temporary table at LOCK TABLES
time and by update operation. Since SQL-layer requested a
read-lock at LOCK TABLES time InnoDB engine assumed that upcoming
statements which are going to be executed under LOCK TABLES will
only read table and therefore should acquire only S-lock.
An update operation broken this assumption by requesting X-lock.

Possible approaches to fixing this problem are:

1) Skip locking of temporary tables as locking doesn't make any
   sense for connection-local objects.
2) Prohibit changing of temporary table locked by LOCK TABLES ...
   READ.

Unfortunately both of these approaches have drawbacks which make
them unviable for stable versions of server.

So this patch takes another approach and changes code in such way
that LOCK TABLES for a temporary table will always request write
lock. In 5.5 version of this patch switch from read lock to write
lock is done on SQL-layer.
2011-05-26 19:50:06 +04:00
Dmitry Lenev
f93dfd750c Null-merged 5.1 version of fix for bug #11762012 - "54553:
INNODB ASSERTS IN HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE,
TABLE LOCK" into 5.5 tree. 5.5 version of fix will be
committed and pushed separately.
2011-05-26 19:09:16 +04:00
Dmitry Lenev
d076be2a32 Fix for bug #11762012 - "54553: INNODB ASSERTS IN
HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".

Attempt to update an InnoDB temporary table under LOCK TABLES
led to assertion failure in both debug and production builds
if this temporary table was explicitly locked for READ. The 
same scenario works fine for MyISAM temporary tables.

The assertion failure was caused by discrepancy between lock 
that was requested on the rows of temporary table at LOCK TABLES
time and by update operation. Since SQL-layer requested a 
read-lock at LOCK TABLES time InnoDB engine assumed that upcoming
statements which are going to be executed under LOCK TABLES will 
only read table and therefore should acquire only S-lock.
An update operation broken this assumption by requesting X-lock.

Possible approaches to fixing this problem are:

1) Skip locking of temporary tables as locking doesn't make any
   sense for connection-local objects.
2) Prohibit changing of temporary table locked by LOCK TABLES ... 
   READ.

Unfortunately both of these approaches have drawbacks which make 
them unviable for stable versions of server.

So this patch takes another approach and changes code in such way
that LOCK TABLES for a temporary table will always request write
lock. In 5.1 version of this patch switch from read lock to write
lock is done inside of InnoDBs handler methods as doing it on 
SQL-layer causes compatibility troubles with FLUSH TABLES WITH
READ LOCK.
2011-05-26 17:14:47 +04:00
Tatjana Azundris Nuernberg
cc694af17b auto-merge Bug#11745920 2011-05-26 13:33:21 +01:00
Sven Sandberg
6ffc69e0c8 Merged BUG#12574820 from 5.1 to 5.5
Two conflicts resolved manually:
Text conflict in sql/log.cc
Text conflict in sql/mysqld.cc
2011-05-26 12:56:17 +02:00
Sven Sandberg
b76c277a8f BUG#12574820: binlog.binlog_tmp_table timing out in daily and weekly trunk run
Problem: MYSQL_BIN_LOG::reset_logs acquires mutexes in wrong order.
The correct order is first LOCK_thread_count and then LOCK_log. This function
does it the other way around. This leads to deadlock when run in parallel
with a thread that takes the two locks in correct order. For example, a thread
that disconnects will take the locks in the correct order.
Fix: change order of the locks in MYSQL_BIN_LOG::reset_logs:
first LOCK_thread_count and then LOCK_log.
2011-05-26 12:50:43 +02:00
Sergey Glukhov
f52ff493e8 5.1 -> 5.5 merge 2011-05-26 14:09:25 +04:00
Sergey Glukhov
aa0c8235a4 Bug#12392636 ASSERTION FAILED: SCALE >= 0 && PRECISION > 0 && SCALE <= PRECISION
Assertion happens due to missing NULL value check in
Item_func_round::fix_length_and_dec() function.
The fix: added NULL value check for second parameter.
2011-05-26 14:06:39 +04:00
Bjorn Munch
edcb3b083a merge from 5.5-mtr 2011-05-26 10:18:21 +02:00
Tor Didriksen
fa86ab02cf Don't check for FIONREAD on windows.
Execution of platforms tests are slow/flaky when building on windows.
in PB:mysql-next-mr-opt-team on 2011-05-18 for win x86 debug_max, i see:
-- Looking for FIONREAD
-- Looking for FIONREAD - found
and the build fails.
2011-05-26 09:54:19 +02:00
Anitha Gopi
a1343a34e2 Bug#11759877 - Bug closed. Remove test from experimental group 2011-05-26 12:35:46 +05:30
Dmitry Shulga
abd7a283b8 Follow-up for patch for bug#11749345. 2011-05-25 23:44:08 +07:00
Bjorn Munch
e75292dbee Increase test timeout for rpl.rpl_typeconv
Not for test itself but because it procuces large number of warnings,
  and this may take >90s to filter on slow boxes
2011-05-25 16:39:39 +02:00
Anitha Gopi
f4454a134a Fixed formatting in disabled.def 2011-05-25 19:39:24 +05:30
Bjorn Munch
850b27ccdb Bug #12590770 TEST SPECIFIC TIMEOUT SETTING DOES NOT APPLY TO "CHECK" OR "WARNINGS"
Replace global check_timeout with one that calls testcase_timeout for the test
2011-05-25 16:07:16 +02:00
Anitha Gopi
e8db7d12bb Bug#12584161 : Test is failing consistently. Move nack to disabled list 2011-05-25 16:27:48 +05:30
Bjorn Munch
eb85862366 Bug #12586211 ENABLE GCOV BUILDS WITH CMAKE, INCLUDING PLUGINS
Added --with-gcov option to configure.pl and use that from SETUP.sh
2011-05-25 12:39:11 +02:00
Mikael Ronström
4c95c5d8f6 BUG#12578441, reintroduced thd->cleanup() in unlink_thd, removed by mistake, added private interface to this function 2011-05-25 12:17:27 +02:00
Bjorn Munch
d7334d8d85 Bug #11750043 40340: USE GZIPPED CORE FILES TO SAVE SPACE
Use [g]zip on core file if available, ignore if not
Skip if running named test, and print a line saying what it compressed.
2011-05-25 10:58:33 +02:00
Marko Mäkelä
63c6303657 Bug#12584374 LOCK_VALIDATE TRIPS ASSERTION !BLOCK->PAGE.FILE_PAGE_WAS_FREE
Fix a deadlock in the initial patch. lock_validate() must not hold the
lock system mutex while s-latching a block, because some functions,
such as lock_rec_convert_impl_to_expl(), may be already holding an x-latch
on the block that lock_validate() is interested in while attempting to
acquire the lock system mutex.

This deadlock was not caught by UNIV_SYNC_DEBUG because of
buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK).
2011-05-24 23:08:22 +03:00
Anitha Gopi
e6aa9227b6 Autocommit - Updating local tree 2011-05-24 21:57:55 +05:30
Marko Mäkelä
5b25a69ee3 Bug#12584374 LOCK_VALIDATE TRIPS ASSERTION !BLOCK->PAGE.FILE_PAGE_WAS_FREED
lock_clust_rec_some_has_impl(), row_get_rec_trx_id(),
lock_rec_queue_validate(), lock_table_other_has_incompatible(),
lock_table_has_to_wait_in_queue(), lock_table_queue_validate():
Add const qualifiers.

row_get_trx_id_offset(): Add const qualifiers. Keep the parameter rec
only in UNIV_DEBUG builds. Inline the function.

lock_rec_validate_page(): Take the buffer block as a parameter, to
avoid a buf_page_get_gen() call in most cases.

lock_rec_validate_page_low(): A version of lock_rec_validate_page()
that assumes that the lock system mutexes are already being held.

lock_rec_get_next_on_page_const(): A const variant of
lock_rec_get_next_on_page().

lock_validate(): Do not release the lock system mutex while
buffer-fixing the block for the lock_rec_validate_page() call.
Releasing the mutex apparently caused the assertion failure.

rb:665 approved by Sunny Bains
2011-05-24 14:11:21 +03:00
Anitha Gopi
74d923fea3 Automerge from mysql-5.1 2011-05-24 15:47:52 +05:30
Anitha Gopi
90df87e46c BUG#12371924 # Bug is fixed. Move test out of experimental group 2011-05-24 15:46:14 +05:30
Bjorn Munch
829a418a53 merge from 5.5 main 2011-05-24 11:18:55 +02:00
Horst.Hunger
96b770d808 Merge of this test from trunk to 5.5 to have a successful weekly test on Windows. 2011-05-24 11:16:34 +02:00
Bjorn Munch
b0a74097f1 Bug#11831031: MTR SHOULD FIND TEST SUITES FROM FEATURE TREES OUTSIDE MYSQL-TEST
Backported from trunk-mtr
2011-05-24 10:54:34 +02:00
Marko Mäkelä
b2270aedd6 Backport an InnoDB Bug #58815 (Bug #11765812) work-around from mysql-trunk:
------------------------------------------------------------
revno 2876.244.305
revision id marko.makela@oracle.com-20110413082211-e6ouhjz5rmqxcqap
parent  marko.makela@oracle.com-20110413075948-kvytmc37ye1nt7d9
committer  Marko Mäkelä <marko.makela@oracle.com>
branch nick 5.6-innodb
timestamp Wed 2011-04-13 11:22:11 +0300
message:
  Suppress the Bug #58815 (Bug #11765812) assertion failure.

  buf_page_get_gen(): Introduce BUF_GET_POSSIBLY_FREED for suppressing the
  check that the file page must not have been freed.

  btr_estimate_n_rows_in_range_on_level(): Pass BUF_GET_POSSIBLY_FREED and
  explain in the comments why this is needed and why it should be mostly
  harmless to ignore the problem. If InnoDB had always initialized all
  unused fields in data files, no problem would exist.

  This change does not fix the bug, it just "shoots the messenger".

  rb:647 approved by Jimmy Yang
2011-05-24 11:41:31 +03:00
Anitha Gopi
b181649229 Null merge from mysql-5.1 2011-05-24 12:10:38 +05:30
Anitha Gopi
5c0e022590 Changed to Oracle bug numbers 2011-05-24 12:08:13 +05:30
Anitha Gopi
3ed16ba797 Upmerge from 5.1 2011-05-24 10:25:56 +05:30
Anitha Gopi
4f816f7842 Bug#11756699: Move test from disabled to experimental group 2011-05-24 10:22:00 +05:30
Anitha Gopi
63304799b1 Bug#12584161 - Up merge from 5.1 2011-05-24 10:03:59 +05:30
Anitha Gopi
607c95c013 Bug#12584161 - Moved test from disabled to experimental group 2011-05-24 09:56:24 +05:30
Luis Soares
ad826d2221 BUG#12558519
Automerged bzr bundle from bug report into latest mysql-5.5.
2011-05-24 00:33:55 +01:00
Luis Soares
d0f6fde3de BUG#12558519: RPL_TYPECONV PRODUCES VALGRIND STACK
In RBR and in case of converting blob fields, the space allocated
while unpacking into the conversion field was not freed after
copying from it into the real field.

We fix this by freeing the conversion field when the conversion
table is not needed anymore (on close_tables_to_lock).
2011-05-23 23:46:51 +01:00