Commit graph

57632 commits

Author SHA1 Message Date
Staale Smedseng
507af626a4 Merge from 5.1-bugteam 2009-06-26 10:46:21 +02:00
Luis Soares
26c4e642ef local merge: 5.1-bt bug branch --> 5.1-bt latest 2009-06-26 00:20:14 +01:00
Staale Smedseng
498ac0f598 Bug #34002 uninitialized Rows_examined for some admin queries
such as quit and shutdown

Logging to slow log can produce an undetermined value for
Rows_examined in special cases. In debug mode this manifests
itself as any of the various marker values used to mark
uninitialized memory on various platforms.

If logging happens on a THD object that hasn't performed any
row reads (on this or any previous connections), the
THD::examined_row_count may be uninitialized. This patch adds
initialization for this attribute.

No automated test cases are added, as for this to be
meaningful, we need to ensure that we're using a THD
fulfilling the above conditions. This is hard to do in the
mysql-test-run framework. The patch has been verified
manually, however, by restarting mysqld and running the test
included with the bug report.
2009-06-25 17:41:05 +02:00
Kristofer Pettersson
bb4faa54cd Automerge 2009-06-25 15:58:59 +02:00
Kristofer Pettersson
75ba3c6a4b Bug#45336 --enable-foobar doesn't work for any plugin foobar.
Because of a regression introduced by bug#19027 the option --enable-foobar
doesn't work anymore for any plugin 'foobar'. The reason is that plugin
names are tristate options variables with optional parameters and integer
values are not accepted. Since the 'enable' prefix attempts to assign '1'
to the option the operation fails.

This patch translates any number n assigned to a plugin variable of type ENUM
to be the corresponding enumerated item. As a side effect --enable-foobar and
--disable-foobar will also start working again.
2009-06-25 15:55:26 +02:00
Sergey Glukhov
3393fdf80a Bug#45412 SHOW CREATE TRIGGER does not require privileges to disclose trigger data
Added privilege checking to SHOW CREATE TRIGGER code.
2009-06-25 15:52:50 +05:00
Sergey Glukhov
f3f137d82c automerge 2009-06-25 14:23:21 +05:00
Satya B
da11f80aed NULL MERGE of innodb snapshot 5.0-ss5406 into 5.1 branch 2009-06-25 15:22:46 +05:30
Satya B
c417035866 Applying InnoDB snashot 5.0-ss5406, part 2. Fixes BUG#40565
BUG#40565 - Update Query Results in "1 Row Affected" But Should Be "Zero Rows"

Detailed revision comments:

r5232 | marko | 2009-06-03 14:31:04 +0300 (Wed, 03 Jun 2009) | 21 lines
branches/5.0: Merge r3590 from branches/5.1 in order to fix Bug #40565
(Update Query Results in "1 Row Affected" But Should Be "Zero Rows").

Also, add a test case for Bug #40565.

rb://128 approved by Heikki Tuuri
  ------------------------------------------------------------------------
  r3590 | marko | 2008-12-18 15:33:36 +0200 (Thu, 18 Dec 2008) | 11 lines

  branches/5.1: When converting a record to MySQL format, copy the default
  column values for columns that are SQL NULL.  This addresses failures in
  row-based replication (Bug #39648).

  row_prebuilt_t: Add default_rec, for the default values of the columns in
  MySQL format.

  row_sel_store_mysql_rec(): Use prebuilt->default_rec instead of
  padding columns.

  rb://64 approved by Heikki Tuuri
  ------------------------------------------------------------------------
2009-06-25 15:20:26 +05:30
Satya B
663e41aebd Applying InnoDB snashot 5.0-ss5406, part 1. Fixes BUG#38479
BUG#38479 - valgrind warnings in show table status for innodb tables

Detailed revision comments:

r5080 | vasil | 2009-05-22 14:45:34 +0300 (Fri, 22 May 2009) | 6 lines
branches/5.0:

Fix Bug#38479 valgrind warnings in show table status for innodb tables

by initializing prebuilt->hint_need_to_fetch_extra_cols.
2009-06-25 15:06:12 +05:30
Sergey Glukhov
cd8151ed25 test case fix 2009-06-25 13:44:50 +05:00
Sergey Glukhov
2c53a70e15 Bug#45485 replication different between master/slaver using procedure with gbk
In Item_param::set_from_user_var
value.cs_info.character_set_client is set
to 'fromcs' value. It's wrong, it should be set to
thd->variables.character_set_client.
2009-06-25 11:22:39 +05:00
Bernt M. Johnsen
a410744918 Merged from gca branch 2009-06-24 13:16:36 +02:00
Bernt M. Johnsen
8242602498 Bug#45293 Prepared on 5.1 gca branch 2009-06-24 12:55:53 +02:00
Bernt M. Johnsen
2c29e27418 Bug#45293 Supressed some warnings 2009-06-23 14:32:14 +02:00
Andrei Elkin
0ecf826a86 Bug #38240 Crash in safe_mutex_lock () thr_mutex.c line 97 on rotate_relay_log
The reason for the crash was rotate_relay_log (mi=0x0) did not verify
the passed value of active_mi.  There are more cases where active_mi
is supposed to be non-zero e.g change_master(), stop_slave(), and it's
reasonable to protect from a similar crash all of them with common
fixes.
            
Fixed with spliting end_slave() in slave threads release and slave
data clean-up parts (a new close_active_mi()). The new function is
invoked at the very end of close_connections() so that all users of
active_mi are proven to have left.
2009-06-23 12:10:04 +03:00
Martin Hansson
ecd470d190 Merge 2009-06-22 16:01:42 +02:00
Martin Hansson
2cc1134c2c Bug#44653: Server crash noticed when executing random queries with partitions.
When opening a table, it is imperative that the flag
TABLE::auto_increment_field_not_null be false. But if an error occured during
the creation of a table (e.g. the table exists already) with an auto_increment
column and a BEFORE trigger that used the INSERT ... SELECT construct, the
flag was not reset until after error checking. Thus if an error occured,
select_insert::send_data() returned immediately and it was not reset (see * in
pseudocode below).  Crash happened if the table was opened again. Fixed by
resetting the flag after error checking.

nested-loops_join():
  for each row in SELECT table {
    select_insert::send_data():
      if a values is supplied for AUTO_INCREMENT column
         table->auto_increment_field_not_null= TRUE
       else
         table->auto_increment_field_not_null= FALSE
       if (error)
         return 1; *
       if (table->auto_increment_field_not_null == FALSE)
         ...
       table->auto_increment_field_not_null == FALSE 
  }
<-- table returned to table cache and later retrieved by open_table: 
open_table():
  assert(table->auto_increment_field_not_null)
2009-06-22 14:51:33 +02:00
Georgi Kodinov
e16cdb29d4 automerge 2009-06-22 15:01:16 +03:00
Georgi Kodinov
f8c440d293 automerge 2009-06-22 14:57:51 +03:00
Georgi Kodinov
cafcd7094f automerge 2009-06-22 14:53:22 +03:00
V Narayanan
26d382f652 merging with mysql-5.1-bugteam 2009-06-22 17:23:02 +05:30
Georgi Kodinov
3acf5b887a automerge 2009-06-22 14:50:46 +03:00
Satya B
2c6d342149 Applying InnoDB snashot 5.1-ss5343, Fixes BUG#45357
1. BUG#45357 - 5.1.35 crashes with Failing assertion: index->type & DICT_CLUSTERED

2. Also fixes the compilation problem when the flag -DUNIV_MUST_NOT_INLINE

Detailed revision comments:

r5340 | marko | 2009-06-17 12:11:49 +0300 (Wed, 17 Jun 2009) | 4 lines
branches/5.1: row_unlock_for_mysql(): When the clustered index is unknown,
refuse to unlock the record.
(Bug #45357, caused by the fix of Bug #39320).
rb://132 approved by Sunny Bains.
r5339 | marko | 2009-06-17 11:01:37 +0300 (Wed, 17 Jun 2009) | 2 lines
branches/5.1: Add missing #include "mtr0log.h" so that the code compiles
with -DUNIV_MUST_NOT_INLINE.
2009-06-22 16:58:00 +05:30
V Narayanan
1b454e345c Bug#43572 Handle failures from hash_init
The merge from http://lists.mysql.com/commits/76678 caused the 
growth_size parameter to the my_init_dynamic_array function to
be ignored. This patch corrects the problem.
2009-06-22 16:40:34 +05:30
Matthias Leich
2f935906f8 Merge 5.0 -> 5.1, no conflicts, no changes 2009-06-19 18:57:42 +02:00
Matthias Leich
584c1fb3de Merge of latest changes into local tree, no conflicts 2009-06-19 18:53:10 +02:00
Matthias Leich
ff317bf8f5 Merge of latest changes into local tree 2009-06-19 18:34:49 +02:00
Matthias Leich
c788e763fc Merge 5.0 -> 5.1 of fixes for various funcs_1 related bugs 2009-06-19 17:44:29 +02:00
Georgi Kodinov
2a1166128d automerge 2009-06-19 18:32:10 +03:00
Matthias Leich
a4dec0aab1 Merge of fix for bug 40545, 40209, 40618, 38346 into tree 2009-06-19 17:21:20 +02:00
Matthias Leich
eb91084540 Fix for Bug#40545, Bug#40209, Bug#40618, Bug#38346
Details:
  - Limit the queries to character sets and collations
    which are most probably available in all build types.
    But try to preserve the intention of the tests.
  - Remove the variants adjusted to some build types.

  Note:
  1. The results of the review by Bar are included.
  2. I am not able to check the correctness of this patch
     on any existing build type and any MySQL version.
     So it could happen that the new test fails somewhere.
2009-06-19 17:04:25 +02:00
Georgi Kodinov
c5d904ebbe Bug #36654: mysqld_multi cannot start instances with different versions
occasionally.

mysql_multi can call mysqld_safe. In doing this it's not changing the 
current working directory. This may cause confusion in the case where 
mysqld_multi is handling instances of servers of different versions 
and the current working directory is the installation directory of one 
of these servers.

Fixed by enhancing the meaning of basedir in [mysqldN] sections of 
mysqld_multi. If specified, mysqld_multi will change the current 
working directory to the basedir directory before starting the server 
in mysqld_multi ... start ... and then change it back to what it was.
2009-06-19 15:52:20 +03:00
V Narayanan
81dbbd68c1 merging with mysql-5.0-bugteam 2009-06-19 17:58:46 +05:30
V Narayanan
728d3c39de Bug#43572 Handle failures from hash_init
Failure to allocate memory for the hash->array element,
caused hash_init to return without initializing the other
members of the hash. Thus although the dynamic array
buffer may be allocated at a later point in the code, the
incompletely initialized hash caused fatal failures.

This patch moves the initialization of the other members
of the hash above the array allocation, so that the usage
of this hash will not result in fatal failures.
2009-06-19 17:29:21 +05:30
Alfranio Correia
5289e1a9e2 Post-fix for BUG#43929. 2009-06-19 12:27:24 +01:00
Sergey Glukhov
cf66632d5e null merge 2009-06-19 14:31:09 +05:00
Staale Smedseng
c3ef506a02 Null-merge from 5.0-bugteam 2009-06-19 11:29:21 +02:00
Staale Smedseng
2b48caa42d Bug #32223 SETting max_allowed_packet variable
Inconsistent behavior of session variable max_allowed_packet 
(and net_buffer_length); only assignment to the global variable 
has any effect, without this being obvious to the user.
      
The patch for Bug#22891 is backported to 5.0, making the two
session variables read-only. As this is a backport to GA 
software, the error used when trying to assign to the read-
only variable is ER_UNKNOWN_ERROR. The error message is the 
same as in 5.1+.
2009-06-19 11:27:19 +02:00
Sergey Glukhov
c92abdc2a0 Bug#44834 strxnmov is expected to behave as you'd expect
The problem: described in the bug report.
The fix:
--increase buffers where it's necessary
  (buffers which are used in stxnmov)
--decrease buffer lengths which are used
2009-06-19 13:24:43 +05:00
Davi Arnaut
f6ea8b7675 Bug#42599: error: `pthread_setschedprio' was not declared in this scope
The problem was that a pthread.h header used by gcc did not
declare the pthread_setscheprio, yet the function is implemented
by the function is implemented, causing a autoconf check to pass
and compilation with C++ to fail. The solution is to add a
autoconf check to ensure that the function is properly declared.
2009-06-18 20:21:47 -03:00
Alfranio Correia
56b6f1b691 auto-merge mysql-5.1-bugteam (local) --> mysql-5.1-bugteam 2009-06-18 19:25:14 +01:00
Alfranio Correia
2cf77a8ea8 merge mysql-5.0-bugteam --> mysql-5.1-bugteam 2009-06-18 18:58:56 +01:00
Alfranio Correia
9069e110d4 auto-merge mysql-5.0-bugteam (local) --> mysql-5.0-bugteam 2009-06-18 18:28:47 +01:00
Alfranio Correia
16ead29710 auto-merge mysql-5.1-bugteam (local) --> mysql-5.1-bugteam 2009-06-18 15:16:14 +01:00
Alfranio Correia
ac1b464a33 BUG#43929 binlog corruption when max_binlog_cache_size is exceeded
Large transactions and statements may corrupt the binary log if the size of the
cache, which is set by the max_binlog_cache_size, is not enough to store the
the changes.

In a nutshell, to fix the bug, we save the position of the next character in the
cache before starting processing a statement. If there is a problem, we simply
restore the position thus removing any effect of the statement from the cache.
Unfortunately, to avoid corrupting the binary log, we may end up loosing changes
on non-transactional tables if they do not fit in the cache. In such cases, we
store an Incident_log_event in order to stop the slave and alert users that some
changes were not logged.

Precisely, for every non-transactional changes that do not fit into the cache,
we do the following:
  a) the statement is *not* logged
  b) an incident event is logged after committing/rolling back the transaction,
  if any. Note that if a failure happens before writing the incident event to
  the binary log, the slave will not stop and the master will not have reported
  any error.
  c) its respective statement gives an error

For transactional changes that do not fit into the cache, we do the following:
  a) the statement is *not* logged
  b) its respective statement gives an error

To work properly, this patch requires two additional things. Firstly, callers to
MYSQL_BIN_LOG::write and THD::binlog_query must handle any error returned and
take the appropriate actions such as undoing the effects of a statement. We
already changed some calls in the sql_insert.cc, sql_update.cc and sql_insert.cc
modules but the remaining calls spread all over the code should be handled in
BUG#37148. Secondly, statements must be either classified as DDL or DML because
DDLs that do not get into the cache must generate an incident event since they
cannot be rolled back.
2009-06-18 14:52:46 +01:00
Martin Hansson
0a214a42d1 Merge 2009-06-18 09:25:46 +02:00
Alexey Kopytov
880dbcce38 Automerge. 2009-06-17 21:03:01 +04:00
Alexey Kopytov
7433b19aa5 Automerge. 2009-06-17 21:00:39 +04:00
Alexey Kopytov
1827a979fc Automerge. 2009-06-17 20:58:46 +04:00