Commit graph

63683 commits

Author SHA1 Message Date
Mattias Jonsson
d4f8ffeeb6 Bug#56380: valgrind memory leak warning from partition tests
There could be memory leaks if ALTER ... PARTITION command fails.

Problem was that the list of items to free was not set in
the partition info structure when fix_partition_func call failed
during ALTER ... PARTITION.

Solved by always setting the list in the partition info struct.
2010-12-01 12:20:46 +01:00
Bjorn Munch
9dca123d02 Bug #58092 Test "rpl_cross_version" has "copy_file" failing
I am not fixing the test failure
Adds printing of my_errno when commands fail, could hopefully help
2010-12-01 11:11:16 +01:00
Marko Mäkelä
55a12f888a Bug#58623: Bogus debug assertion failure in i_s_locks_row_validate()
This bogus assertion was introduced in the fix of Bug #57802:
Empty ASSERTION parameter passed to the HASH_SEARCH macro.
2010-12-01 10:03:53 +02:00
Nirbhay Choubey
c8310653b4 Additional fix for bug#54899
Fixing the testcase to use the database name
as connected_db instead of 'test' database.
2010-12-01 12:25:31 +05:30
Luis Soares
aaefb52df8 BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error
when generating new name.
      
If find_uniq_filename returns an error, then this error is not
being propagated upwards, and execution does not report error to
the user (although a entry in the error log is generated).
                  
Additionally, some more errors were ignored in new_file_impl:
- when writing the rotate event
- when reopening the index and binary log file
                  
This patch addresses this by propagating the error up in the
execution stack. Furthermore, when rotation of the binary log
fails, an incident event is written, because there may be a
chance that some changes for a given statement, were not properly
logged. For example, in SBR, LOAD DATA INFILE statement requires
more than one event to be logged, should rotation fail while
logging part of the LOAD DATA events, then the logged data would
become inconsistent with the data in the storage engine.
2010-11-30 23:32:51 +00:00
Davi Arnaut
2419cec9f1 Workaround a GCC warning about a pointer being cast to a larger
integral type. Use intptr which is designed to hold pointer values
and pass it to off_t.
2010-11-30 21:07:55 -02:00
kevin.lewis@oracle.com
03d1576b60 RB://518 approved by Jimmy Yang and Sunny bains
Code cleanup after changes for Bug 56628.  The general approach for 
InnoDB is to make a reference to each enum value whenever it is used in a
switch statement.  In addition, no default case should be used for switch 
statements on enum types.  This assures that if there is ever any change 
in the enum values, the switch will need to change to reflect it since a 
compiler warning will occur.  In this case, the enum row_type is declared 
in handler.h and could be changed for another storage engine.  If so, a 
warning will occur in the InnoDB build.  

Other changes;
* This patch uses 2 macros to help consolidate warning messages that
   need to occur twice in the single switch for row_format.
* Using row_format as the variable name to distinguish it from the enum
  type.
* Function declaration format correction.
2010-11-30 10:03:55 -06:00
Sunny Bains
9a0a5a9d0b Fix Bug# 56228 - Dropping tables from within an active statement crashes server
InnoDB AUTOINC code expects the locks to be released in strict reverse order
at the end of the statement. However, nested stored proedures and partition
tables break this rule. We now allow the locks to be deleted from the
trx->autoinc_locks vector in any order but optimise for the common (old) case.

rb://441 Approved by Marko Makela
2010-11-30 20:11:26 +11:00
Christopher Powers
a723fa8744 merge 2010-11-29 21:10:05 -06:00
Christopher Powers
33b560e89d Bug#35333, "If Federated table can't connect to remote host, can't retrieve metadata"
Improved error handling such that queries against Information_Schema.Tables won't
fail if a Federated table is unable to connect to remote host.
2010-11-29 18:51:46 -06:00
Georgi Kodinov
24800599b3 Fixed bteam issue #37235: 5.0 trees now will work correctly in pb2 and
will not display "indicated result file not found" due to wrongly named
var directory.
2010-11-29 17:33:24 +02:00
Georgi Kodinov
12c5a7d72f Fixed a pb2 issue with not finding the test dirs. 2010-11-29 17:30:07 +02:00
Vasil Dimov
6d315aa4f8 Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-11-29 09:07:11 +02:00
abb201c131 BUG#54903 BINLOG statement toggles session variables
When using BINLOG statement to execute rows log events, session variables
foreign_key_checks and unique_checks are changed temporarily.  As each rows
log event has their own special session environment and its own
foreign_key_checks and unique_checks can be different from current session
which executing the BINLOG statement. But these variables are not restored
correctly after BINLOG statement. This problem will cause that the following
statements fail or generate unexpected data.

In this patch, code is added to backup and restore these two variables.
So BINLOG statement will not affect current session's variables again.
2010-11-28 17:43:36 +08:00
Luis Soares
13c9cf26a6 BUG#58416: binlog.binlog_row_failure_mixing_engines fails on
win x86 debug_max

The windows MTR run exhibited a different test execution 
ordering (due to the fact that in these platforms MTR is invoked
with --parallel > 1). This uncovered a bug in the aforementioned
test case, which is triggered by the following conditions:

  1. server is not restarted between two different tests;
  2. the test before binlog.binlog_row_failure_mixing_engines
     issues flush logs;
  3. binlog.binlog_row_failure_mixing_engines uses binlog
     positions to limit the output of show_binlog_events;
  4. binlog.binlog_row_failure_mixing_engines does not state which
     binlog file to use, thence it uses a wrong binlog file with
     the correct position.

There are two possible fixes: 1. make sure that the test start 
from a clean slate - binlog wise; 2. in addition to the position, 
also state the binary log file before sourcing 
show_binlog_events.inc .

We go for fix #1, ie, deploy a RESET MASTER before the test is 
actually started.
2010-11-27 11:51:07 +00:00
Bjorn Munch
86a4cf1116 merge from 5.1-mtr 2010-11-27 11:51:22 +01:00
Davi Arnaut
0008e06489 Bug#51817: incorrect assumption: thd->query at 0x2ab2a8360360 is an invalid pointer
The problem is that the logic which checks if a pointer is
valid relies on a poor heuristic based on the start and end
addresses of the data segment and heap.

Apart from miscalculating the heap bounds, this approach also
suffers from the fact that memory can come from places other
than the heap. See Bug#58528 for a more detailed explanation.

On Linux, the solution is to access the process's memory
through /proc/self/task/<tid>/mem, which allows for retrieving
the contents of pages within the virtual address space of
the calling process. If a address range is not mapped, a
input/output error is returned.
2010-11-26 19:59:10 -02:00
Luis Soares
a8680a58a1 BUG 57288: automerged bzr bundle from bug report. 2010-11-30 18:14:30 +00:00
Christopher Powers
f8c6800009 Null-merge from mysql-5.0-bugteam 2010-11-30 11:51:25 -06:00
Luis Soares
23636330c9 BUG#57288: binlog_tmp_table fails sporadically: "Failed to write
the DROP statement ..."
      
Problem: When using temporary tables and closing a session, an
implicit DROP TEMPORARY TABLE IF EXISTS is written to the binary
log (while cleaning up the context of the session THD - see:
sql_class.cc:THD::cleanup which calls close_temporary_tables).
     
close_temporary_tables, first checks if the binary log is opened
and then proceeds to creating the DROP statements. Then, such
statements, are written to the binary log through
MYSQL_BIN_LOG::write(Log_event *). Inside, there is another check
if the binary log is opened and if not an error is returned. This
is where the faulty behavior is triggered. Given that the test
case replays a binary log, with temp tables statements, and right
after it issues RESET MASTER, there is a chance that is_open will
report false (when the mysql session is closed and the temporary
tables are written).
      
is_open may return false, because MYSQL_BIN_LOG::reset_logs is
not setting the correct flag (LOG_CLOSE_TO_BE_OPENED), on the
MYSQL_LOG_BIN::log_state (instead it sets just the
LOG_CLOSE_INDEX flag, leaving the log_state to
LOG_CLOSED). Thence, when writing the DROP statement as part of
the THD::cleanup, the thread could get a return value of false
for is_open - inside MYSQL_BIN_LOG::write, ultimately reporting
that it can't write the event to the binary log.
      
Fix: We fix this by adding the correct flag, missing in the
second close.
2010-11-30 16:55:28 +00:00
Christopher Powers
5094555e53 Bug#35333, "If Federated table can't connect to remote host, can't retrieve metadata" 2010-11-30 09:43:50 -06:00
Christopher Powers
f40cc1e000 Bug#35333, "If Federated table can't connect to remote host, can't retrieve
metadata"
            
Improved error handling such that queries against Information_Schema.Tables won't
fail if a federated table can't make a remote connection.
2010-11-29 22:46:43 -06:00
Georgi Kodinov
0fff83dfdc null merge 2010-11-29 17:36:22 +02:00
Gleb Shchepa
6fda86ece6 null merge 5.0-security --> 5.1-security (bug 54461) 2010-11-26 19:13:14 +03:00
Georgi Kodinov
534ba9c98a merge 2010-11-26 17:27:41 +02:00
Alexander Barkov
bd3a5831f6 Bug#56639 Character Euro (0x88) not converted from cp1251 to utf8
Problem: MySQL cp1251 did not support 'U+20AC EURO SIGN'
which was assigned a few years ago to 0x88.

Fix: adding mapping: 0x88 <-> U+20AC 

  @ mysql-test/include/ctype_8bit.inc
  New shared file to test 8bit character sets.

  @ mysql-test/r/ctype_cp1251.result
  @ mysql-test/t/ctype_cp1251.test
  Adding tests

  @ sql/share/charsets/cp1251.xml
  Adding mapping

  @ strings/ctype-extra.c
  Regenerating ctype-extra.c using strings/conf_to_src
  according to new cp1251.xml
2010-11-26 16:58:54 +03:00
Nirbhay Choubey
8629024b23 Bug #54899 : --one-database option cannot handle DROP/CREATE DATABASE commands
After dropping and recreating the database specified along with --one-database
option at command line, mysql client keeps filtering the statements even after
the execution of a 'USE' command on the same database.

--one-database option enables the filtering of statements when the current
database is not the one specified at the command line. However, when the same
database is dropped and recreated the variable (current_db) that holds the
inital database name gets altered. This bug exploits the fact that current_db
initially gets set to null value (0) when a 'use db_name' follows the recreation
of same database db_name (speficied at the command line) and hence skip_updates
gets set to 1, which inturn triggers the further filtering of statements.

Fixed by making get_current_db() a no-op function when one_database is set,
and hence, under that condition current_db will not get altered.
Note, however the value of current_db can change when we execute 'connect'
command with a differnet database to reconnect to the server, in which case,
the behavior of --one-database will be formulated using this new database.
2010-11-26 19:27:59 +05:30
Bjorn Munch
7c6151ff18 Bug #58515 Tests: use use exec echo, not write_file to write mysqld.1.expect
Fixed as suggested in the .inc file and two tests
Could not reproduce problem, but tested tests on Windows
2010-11-26 13:59:39 +01:00
Georgi Kodinov
c5987223db merge 2010-11-26 14:51:48 +02:00
Georgi Kodinov
dce374bb66 bumped up the version string. 2010-11-26 12:24:05 +02:00
sunanda.menon@oracle.com
fce0b5db96 Raise version number after cloning 5.1.54 2010-11-26 07:28:22 +01:00
Georgi Kodinov
c44c95b10f merge 5.1 to 5.1-security 2010-11-25 18:38:01 +02:00
Bjorn Munch
c639254274 Bug #58482 mtr doesn't use suite names from individually specified test cases
It does work in general, the problem here was that the test name
'alter_table' matches 'main.alter_table-big' which has already been found.
Fixed by matching more explicitly (with/without suite name)
2010-11-25 13:43:58 +01:00
Vasil Dimov
951244c650 Bug#47350 Support innodb plugin without separate shared object
Add a _commented_ workaround for Bug#47350. The full solution is tricky
to get right as explained in the bug report. It is not worth the effort
to extend the deprecated autotools framework to support conflicting
plugins and would be too risky for MySQL 5.1 (GA).
2010-11-25 08:55:47 +02:00
Tatiana Azundris Nurnberg
7074a99580 merge 2010-11-25 05:13:44 +00:00
Tatiana A. Nurnberg
3a15cb6ce9 Assorted post-merge fixes, clean-up, integration, compat with 5.6.
43233/55794.
2010-11-25 03:11:05 +00:00
Gleb Shchepa
d85c305362 backport of bug #54461 from 5.1-security to 5.0-security
> revision-id: gshchepa@mysql.com-20100801181236-uyuq6ewaq43rw780
 > parent: alexey.kopytov@sun.com-20100723115254-jjwmhq97b9wl932l
 > committer: Gleb Shchepa <gshchepa@mysql.com>
 > branch nick: mysql-5.1-security
 > timestamp: Sun 2010-08-01 22:12:36 +0400
 > Bug #54461: crash with longblob and union or update with subquery
 >
 > Queries may crash, if
 >   1) the GREATEST or the LEAST function has a mixed list of
 >      numeric and LONGBLOB arguments and
 >   2) the result of such a function goes through an intermediate
 >      temporary table.
 >
 > An Item that references a LONGBLOB field has max_length of
 > UINT_MAX32 == (2^32 - 1).
 >
 > The current implementation of GREATEST/LEAST returns REAL
 > result for a mixed list of numeric and string arguments (that
 > contradicts with the current documentation, this contradiction
 > was discussed and it was decided to update the documentation).
 >
 > The max_length of such a function call was calculated as a
 > maximum of argument max_length values (i.e. UINT_MAX32).
 >
 > That max_length value of UINT_MAX32 was used as a length for
 > the intermediate temporary table Field_double to hold
 > GREATEST/LEAST function result.
 >
 > The Field_double::val_str() method call on that field
 > allocates a String value.
 >
 > Since an allocation of String reserves an additional byte
 > for a zero-termination, the size of String buffer was
 > set to (UINT_MAX32 + 1), that caused an integer overflow:
 > actually, an empty buffer of size 0 was allocated.
 >
 > An initialization of the "first" byte of that zero-size
 > buffer with '\0' caused a crash.
 >
 > The Item_func_min_max::fix_length_and_dec() has been
 > modified to calculate max_length for the REAL result like
 > we do it for arithmetical operators.
2010-11-24 23:03:16 +03:00
Alexander Nozdrin
1490f18789 Merge from mysql-5.0-security. 2010-11-24 16:14:43 +03:00
Alexander Nozdrin
b6b7fb2bfa A follow-up for Bug#58339 (Replace Server GPL README file).
Fix formatting issues in README file.
2010-11-24 16:12:23 +03:00
Bjorn Munch
891593e42e merge 58424 2010-11-24 13:51:45 +01:00
Alexander Nozdrin
51d121b417 Empty merge from mysql-5.0-security. 2010-11-24 13:50:32 +03:00
Alexander Nozdrin
7642b38834 Merge from mysql-5.1-bugteam. 2010-11-24 13:43:31 +03:00
Alexander Nozdrin
47cfb2c58c Merge from mysql-5.0-bugteam. 2010-11-24 13:40:32 +03:00
Alexander Nozdrin
d7a4672cf7 Merge from mysql-5.0-bugteam. 2010-11-24 13:07:37 +03:00
Tatiana A. Nurnberg
9ab7421b10 merge 2010-11-24 10:02:46 +00:00
Alexander Nozdrin
174a6962da A follow-up for Bug#58340 (Remove Server GPL EXCEPTIONS-CLIENT file) -- remove all
EXCEPTIONS-CLIENT from all the places.
2010-11-24 12:53:39 +03:00
Bjorn Munch
e1fa8cb9bb Bug #58424 mtr ignores failing mysqltest in the presence of expect file for mysqld
If mysqltest dies, mtr waits to see if mysqld dies too within 100ms
But in that case, it should not care about expected crash
Fix: jump past the code that checks the expect file
2010-11-24 10:22:03 +01:00
Tatiana A. Nurnberg
eda8b1feeb merge 2010-11-24 08:50:04 +00:00
Sunny Bains
239ca6006b Fix bug# 18274 InnoDB auto_increment field reset on OPTIMIZE TABLE
OPTIMIZE TABLE recreates the whole table. That is why the counter gets reset.
Making the next autoinc column persistent is a separate issue from resetting
the value after an OPTIMIZE TABLE. We already have a check for ALTER TABLE
and CREATE INDEX to preserve the value on table recreate. We should be able to
add an additional check for OPTIMIZE TABLE to preserve the next value.

rb://519 Approved by Jimmy Yang.
2010-11-24 14:07:43 +11:00
Ramil Kalimullin
9919ac5c97 binlog.binlog_row_failure_mixing_engines test disabled.
See bug #58416.
2010-11-23 16:35:40 +03:00