Commit graph

26658 commits

Author SHA1 Message Date
Marko Mäkelä
c129f738a6 dict_create_index_step(): Be strict about DYNAMIC and COMPRESSED tables.
Bug #50495 is about REDUNDANT and COMPACT tables, after all.
2010-04-21 13:27:23 +03:00
Marko Mäkelä
74422d6164 Adjust tests for the Bug #50495 fix. 2010-04-21 12:40:32 +03:00
Jon Olav Hauglid
da1fbb375e merge from mysql-trunk-bugfixing 2010-04-21 08:50:58 +02:00
Kristofer Pettersson
9d63e36ca7 Bug#50373 --secure-file-priv=""
Correcting a patch misstake. The converted file path is placed in 'buff' not in opt_secure_file_priv.
2010-04-20 16:17:34 +02:00
Alfranio Correia
9ba731c299 BUG#51894 Replication failure with SBR on DROP TEMPORARY TABLE inside a
transaction
BUG#52616 Temp table prevents switch binlog format from STATEMENT to ROW

Before the WL#2687 and BUG#46364, every non-transactional change that happened
after a transactional change was written to trx-cache and flushed upon
committing the transaction. WL#2687 and BUG#46364 changed this behavior and
non-transactional changes are now written to the binary log upon committing
the statement.

A binary log event is identified as transactional or non-transactional through
a flag in the Log_event which is set taking into account the underlie storage
engine on what it is stems from. In the current bug, this flag was not being
set properly when the DROP TEMPORARY TABLE was executed.

However, while fixing this bug we figured out that changes to temporary tables
should be always written to the trx-cache if there is an on-going transaction.
Otherwise, binlog events in the reversed order would be produced.

Regarding concurrency, keeping changes to temporary tables in the trx-cache is
also safe as temporary tables are only visible to the owner connection.

In this patch, we classify the following statements as unsafe:
   1 - INSERT INTO t_myisam SELECT * FROM t_myisam_temp

   2 - INSERT INTO t_myisam_temp SELECT * FROM t_myisam

   3 - CREATE TEMPORARY TABLE t_myisam_temp SELECT * FROM t_myisam

On the other hand, the following statements are classified as safe:

   1 - INSERT INTO t_innodb SELECT * FROM t_myisam_temp

   2 - INSERT INTO t_myisam_temp SELECT * FROM t_innodb

The patch also guarantees that transactions that have a DROP TEMPORARY are
always written to the binary log regardless of the mode and the outcome:
commit or rollback. In particular, the DROP TEMPORARY is extended with the
IF EXISTS clause when the current statement logging format is set to row.

Finally, the patch allows to switch from STATEMENT to MIXED/ROW when there
are temporary tables but the contrary is not possible.
2010-04-20 10:10:43 +01:00
Jon Olav Hauglid
f2587df7ba merge from mysql-trunk-bugfixing 2010-04-20 10:51:50 +02:00
Alexey Kopytov
5575d724cf Added a test for skip_name_resolve to the sys_vars suite. 2010-04-20 11:32:39 +04:00
Jon Olav Hauglid
b12af816d5 Additional test coverage for
Bug#30977 Concurrent statement using stored function and
          DROP FUNCTION breaks SBR
Bug#48246 assert in close_thread_table
2010-04-19 15:35:13 +02:00
Alexey Kopytov
ee09f97211 Manual merge of mysql-5.1-bugteam to
mysql-trunk-merge.

Conflicts:

Text conflict in sql/sql_priv.h
2010-04-19 16:09:44 +04:00
Alfranio Correia
de3e233b8a auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing 2010-04-19 12:05:07 +01:00
Marko =?ISO-8859-1?Q?M=E4kel=E4?=
5c6d38d781 Enable innodb_plugin tests based on the presence of lib_innodb_plugin. 2010-04-19 12:44:05 +03:00
Marko =?ISO-8859-1?Q?M=E4kel=E4?=
59137ec354 Do not require innodb for running innodb_plugin tests. 2010-04-19 12:21:13 +03:00
Alexey Kopytov
3f0f8048d9 Automerge. 2010-04-19 12:27:46 +04:00
Kristofer Pettersson
f394543181 Automerge 2010-04-16 16:56:16 +02:00
Kristofer Pettersson
2a37d531be Bug#50373 --secure-file-priv=""
The server variable opt_secure_file_priv wasn't
normalized properly and caused the operations
LOAD DATA INFILE .. INTO TABLE ..
and
SELECT load_file(..)
to do different interpretations of the 
--secure-file-priv option.

The patch moves code to the server initialization
routines so that the path always is normalized
once and only once.

It was also intended that setting the option
to an empty string should be equal to 
lifting all previously set restrictions. This
is also fixed by this patch.
2010-04-16 16:10:47 +02:00
Sergey Glukhov
0d242648b5 Bug#52124 memory leaks like a sieve in datetime, timestamp, time, date fields + warnings
Arg_comparator initializes 'comparators' array in case of
ROW comparison and does not free this array on destruction.
It leads to memory leaks.
The fix:
-added Arg_comparator::cleanup() method which frees
 'comparators' array.
-added Item_bool_func2::cleanup() method which calls 
 Arg_comparator::cleanup() method
2010-04-16 16:42:34 +05:00
Georgi Kodinov
51880686ad Bug #52629: memory leak from sys_var_thd_dbug in binlog.binlog_write_error
When re-setting (SET GLOBAL debug='') the GLOBAL debug settings the 
server was not freeing the data elements from the top (initial) frame 
before setting them to 0 without freeing the underlying memory. As these 
are global settings there's a chance that something is there already.
Fixed by :
1. making sure the allocated data are cleaned up before re-setting them
while parsing a debug string
2. making sure the stuff allocated in the global settings is freed on 
shutdown.
2010-04-16 10:30:53 +03:00
Luis Soares
b5c258a829 automerge: merged bug clone into latest mysql-5.1-bugteam. 2010-04-16 01:59:21 +01:00
Jon Olav Hauglid
1a1a96e7af Bug #47459 Assertion in Diagnostics_area::set_eof_status on OPTIMIZE TABLE
This assertion could be triggered during execution of OPTIMIZE TABLE for
InnoDB tables. As part of optimize for InnoDB tables, the table is recreated
and then opened again. If the reopen failed for any reason, the assertion
would be triggered. This could for example be caused by a concurrent DROP
TABLE executed by a different connection. The reason for the assertion was
that any failures during reopening were ignored.

This patch fixes the problem by making sure that the result of reopening the
table is checked and that any error messages are sent to the client.

Test case added to innodb_mysql_sync.test.
2010-04-15 18:53:57 +02:00
Jon Olav Hauglid
b6f0c3a157 Bug #51391 Deadlock involving events during rqg_info_schema test
This was a deadlock between CREATE/ALTER/DROP EVENT and a query
accessing both the mysql.event table and I_S.GLOBAL_VARIABLES.

The root of the problem was that the LOCK_event_metadata mutex was
used to both protect the "event_scheduler" global system variable
and the internal event data structures used by CREATE/ALTER/DROP EVENT.

The deadlock would occur if CREATE/ALTER/DROP EVENT held
LOCK_event_metadata while trying to open the mysql.event table,
at the same time as the query had mysql.event open, trying to
lock LOCK_event_metadata to access "event_scheduler".

This bug was fixed in the scope of Bug#51160 by using only
LOCK_global_system_variables to protect "event_scheduler".
This makes it so that the query above won't lock LOCK_event_metadata,
thereby preventing this deadlock from occuring.

This patch contains no code changes.
Test case added to lock_sync.test.
2010-04-15 14:14:28 +02:00
Alexander Nozdrin
1c4e27a8f6 Post-fix for Bug#52444: update test result. 2010-04-15 12:12:03 +04:00
Jon Olav Hauglid
e232fbe067 Bug #51327 MyISAM table is automatically repaired on ALTER
even if myisam-recover is OFF

The problem was that a corrupted MyISAM table was auto repaired
even if the myisam_recover_options server variable (or the 
myisam_recover option) was set to OFF.

The reason was that the auto_repair() function, which is supposed
to say if auto repair is to be used, did not use the server variable
setting correctly. This bug was a regression introduced by WL#4738.

This patch fixes the problem by making sure auto_repair() returns
FALSE if myisam_recover_options is set to OFF.

Test case added to myisam.test.
2010-04-15 09:16:29 +02:00
Jon Olav Hauglid
d18275c2c2 Bug #52593 SHOW CREATE TABLE is blocked if table is locked
for write by another connection

The problem was that if a table was locked in one connection by
LOCK TABLES ... WRITE, REPAIR TABLE or OPTIMIZE TABLE, SHOW CREATE
TABLE from another connection would be blocked. As SHOW CREATE TABLE
only reads metadata about the table, such blocking is not needed.

The problem was that when SHOW CREATE TABLE tried to get a metadata
lock on the table in order to open it, it used the wrong type of
metadata lock request. It used MDL_SHARED_READ which is used when
the intent is to read both table metadata and table data. Instead
it should have used MDL_SHARED_HIGH_PRIO which signifies an intent
to only read metadata.

This patch fixes the problem by making sure SHOW CREATE TABLE uses
the MDL_SHARED_HIGH_PRIO metadata lock request type when trying to
open the table. The patch also fixes a similar problem with the
mysql_list_fields API call.

Test case added to show_check.test.
2010-04-14 09:40:45 +02:00
Konstantin Osipov
b8d014b8f6 A fix for Bug#11918 "SP does not accept variables in LIMIT clause"
Allow stored procedure variables in LIMIT clause.
Only allow variables of INTEGER types. 
Handle negative values by means of an implicit cast to UNSIGNED 
(similarly to prepared statement placeholders).
Add tests.
Make sure replication works by not doing NAME_CONST substitution
for variables in LIMIT clause.
Add replication tests.
2010-04-14 01:56:19 +04:00
Konstantin Osipov
53fecff1ef Backport of:
ChangeSet@1.2703, 2007-12-07 09:35:28-05:00, cmiller@zippy.cornsilk.net +40 -0
Bug#13174: SHA2 function
Patch contributed from Bill Karwin, paper unnumbered CLA in Seattle

Implement SHA2 functions.

Chad added code to make it work with YaSSL.  Also, he removed the 
(probable) bug of embedded server never using SSL-dependent 
functions.  (libmysqld/Makefile.am didn't read ANY autoconf defs.)

Function specification:
  SHA2( string cleartext, integer hash_length ) 
    -> string hash, or NULL
where hash_length is one of 224, 256, 384, or 512.  If either is 
NULL or a length is unsupported, then the result is NULL.  The 
resulting string is always the length of the hash_length parameter
or is NULL.

Include the canonical hash examples from the NIST in the test
results.
---
Polish and address concerns of reviewers.
2010-04-13 19:04:45 +04:00
oystein.grovlen@sun.com
5af5bb2da6 Bug#51980 mysqld service crashes with a simple COUNT(DISTINCT) query over a view
Problem: Segmentation fault in add_group_and_distinct_keys() when accessing
field of what is assumed to be an Item_field object.

Cause: In case of views, the item added to list by is_indexed_agg_distinct() 
was not of type Item_field, but Item_ref.

Resolution:  Add the real Item_field object, the one referred to by 
Item_ref object, to the list, instead.
2010-04-13 11:38:28 +02:00
Vasil Dimov
73a25e4fa5 Fix path to have_innodb_plugin.inc 2010-04-12 17:26:20 +03:00
Vasil Dimov
668f2a89c3 Remove unused file 2010-04-12 17:23:00 +03:00
Vasil Dimov
02e1075fdf Fix path to innodb-index.inc 2010-04-12 16:58:47 +03:00
Vasil Dimov
ceaca681a6 Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb,
the InnoDB Plugin tests are now in mysql-test/suite/innodb_plugin.

Move InnoDB tests to the innodb suite at mysql-test/suite/innodb.
2010-04-12 14:56:24 +03:00
Alexey Kopytov
54f3f65601 Some post-merge fixes afer a merge from mysql-5.1-bugteam. 2010-04-11 14:42:05 +04:00
Alexey Kopytov
abab51e0db Automerge of mysql-5.1-bugteam to mysql-trunk-merge. 2010-04-11 11:17:42 +04:00
Alexey Kopytov
ab50b8885f Automerge. 2010-04-11 10:33:07 +04:00
Alexander Nozdrin
5513891cc3 Make main.query_cache_debug experimental on Linux due to Bug 52356. 2010-04-10 12:25:57 +04:00
Davi Arnaut
9d59b2705a Backport revision alik@sun.com-20100223131824-comthndat57kx8s5:
Add ignore pattern for valgrind messages.
2010-04-09 14:57:11 -03:00
Vasil Dimov
a633c45592 Convert InnoDB Plugin tests to include have_innodb_plugin.inc.
This also instructs mtr to transparently load the plugin.
2010-04-09 16:38:28 +03:00
Vasil Dimov
02c597e731 Fix mtr warning in innodb-autoinc-44030.test 2010-04-09 16:33:42 +03:00
Vasil Dimov
537b806cc8 Fix a failure of innodb_plugin.innodb-autoinc-44030 now that
MySQL and InnoDB dictionaries do not get out of sync.
2010-04-09 16:29:13 +03:00
Vasil Dimov
edaca4bd50 Fix a mtr warning in innodb_plugin.innodb-autoinc 2010-04-09 16:25:17 +03:00
Vasil Dimov
67b9324860 Merge from innodb-branches-zip 2010-04-09 16:07:41 +03:00
Vasil Dimov
164dedbad0 Move the InnoDB Plugin tests from storage/innodb_plugin/mysql-test/ where
they are ignored to a new test suite "innodb_plugin".

Remove a hack in mtr that was deployed to run the builtin InnoDB tests against
the InnoDB Plugin. Also detect if a test is an 'innodb plugin test' and if so
then transparently replace the builtin InnoDB with the InnoDB Plugin.
2010-04-09 15:56:51 +03:00
Vasil Dimov
91600911d9 Adjust mysql-test/suite/binlog/t/binlog_killed.test after a change
in behavior in InnoDB. The change in behavior was introduced by this
changeset:

  ------------------------------------------------------------
  revno: 3370
  revision-id: vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457
  parent: vasil.dimov@oracle.com-20100331130440-l0y517y3mjsjqy4v
  parent: vasil.dimov@oracle.com-20100331113119-2kbgkaz1d426a43c
  committer: Vasil Dimov <vasil.dimov@oracle.com>
  branch nick: mysql-5.1-innodb
  timestamp: Wed 2010-03-31 16:06:13 +0300
  message:
    Merge from innodb-branches-5.1
      ------------------------------------------------------------
      revno: 0.1.819
      revision-id: vasil.dimov@oracle.com-20100331113119-2kbgkaz1d426a43c
      parent: vasil.dimov@oracle.com-20100331064722-9rc3wypzmer7d6jj
      parent: svn-v4:cee13dc7-1704-0410-992b-c9b4543f1246:branches/5.1:6918
      committer: Vasil Dimov <vasil.dimov@oracle.com>
      branch nick: innodb-branches-5.1
      timestamp: Wed 2010-03-31 14:31:19 +0300
      message:
        Merge from SVN
          ------------------------------------------------------------
          revno: 0.2.1
          revision-id: svn-v4:cee13dc7-1704-0410-992b-c9b4543f1246:branches/5.1:6918
          parent: svn-v4:cee13dc7-1704-0410-992b-c9b4543f1246:branches/5.1:6912
          committer: mmakela
          timestamp: Wed 2010-03-31 07:14:51 +0000
          message:
            branches/5.1: Obey KILL during a lock wait (Bug #51920).
  
            srv_suspend_mysql_thread(), srv_lock_timeout_and_monitor_thread():
            Check trx_is_interrupted() in addition to checking the lock wait timeout.
  
            rb://279 approved by Sunny Bains
2010-04-08 19:55:55 +03:00
Omer BarNir
24a9fb555c Correction to the disabled.def file in engines/iuds that got overwritten by
mistake in previous push
2010-04-07 11:28:28 -07:00
Vasil Dimov
2bfc788f7f Merge from mysql-5.1 2010-04-07 15:32:51 +03:00
Vasil Dimov
167b68fecb Move everything into a subdirectory xyz/ 2010-04-07 14:18:43 +03:00
Alexey Kopytov
5a274915ec Bug #52165: Assertion failed: file .\dtoa.c, line 465
The failing assertion was written with the assumption that a NULL
string can never be passed to my_strtod(). However, an empty string
may be passed under some circumstances by passing str == NULL and
*end == NULL.

Fixed the assertion to take the above case into account.
2010-04-07 13:59:02 +04:00
Omer BarNir
327d3f3d58 Updates to test files in the 'engines' suite following changes in 5.1.46 2010-04-06 11:06:34 -07:00
Sergey Glukhov
35f6b544c4 Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817
We should disable const subselect item evaluation because
subselect transformation does not happen in view_prepare_mode
and thus val_...() methods can not be called.
2010-04-06 12:26:59 +05:00
Sergey Glukhov
416f32050a Bug#52336 Segfault / crash in 5.1 copy_fields (param=0x9872980) at sql_select.cc:15355
The problem is that we can not use make_cond_for_table().
This function relies on used_tables() condition
which is not set properly for subqueries.
As result subquery is not filtered out.
The fix is to use remove_eq_conds() function instead
of make_cond_for_table() func. 'remove_eq_conds()'
algorithm relies on const_item() value and it allows
to handle subqueries in right way.
2010-04-05 16:10:26 +05:00
Alexey Kopytov
cab4a776d8 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in storage/myisam/mi_delete_table.c
2010-04-03 21:55:04 +04:00
Alexey Kopytov
7320a95808 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
Text conflict in sql/log.cc
Text conflict in sql/set_var.cc
Text conflict in sql/sql_class.cc
2010-04-03 21:35:51 +04:00
Alexey Kopytov
374bd06319 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in mysql-test/r/partition.result
Text conflict in mysql-test/t/partition.test
Text conflict in storage/myisam/mi_dynrec.c
2010-04-03 12:37:53 +04:00
Gleb Shchepa
99a0ace460 Bug #40625: Concat fails on DOUBLE values in a Stored
Procedure, while DECIMAL works

Selecting of the CONCAT(...<SP variable>...) result into
a user variable may return wrong data.


Item_func_concat::val_str contains a number of memory
allocation-saving tricks. One of them concatenates
strings inplace inserting the value of one string
at the beginning of the other string. However,
this trick didn't care about strings those points
to the same data buffer: this is possible when
a CONCAT() parameter is a stored procedure variable -
Item_sp_variable::val_str() uses the intermediate
Item_sp_variable::str_value field, where it may
store a reference to an external buffer.


The Item_func_concat::val_str function has been
modified to take into account val_str functions
(such as Item_sp_variable::val_str) that return
a pointer to an internal Item member variable
that may reference to a buffer provided.
2010-04-03 00:30:22 +04:00
Alexey Kopytov
87b98f6350 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in mysql-test/r/func_str.result
Text conflict in mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result
Text conflict in mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result
Text conflict in mysql-test/t/func_str.test
Text conflict in sql/mysqld.cc
Text conflict in sql/protocol.cc
Text conflict in storage/myisam/mi_open.c
2010-04-02 19:17:43 +04:00
Alexey Kopytov
5e770ab352 Automerge. 2010-04-02 18:22:18 +04:00
Anurag Shekhar
92a4196045 Bug #47904 Incorrect results w/ table subquery, derived SQs, and LEFT JOIN
on index

'my_decimal' class has two members which can be used to access the 
value. The member variable buf (inherited from parent class decimal_t) 
is set to member variable buffer so that both are pointing to same value.

Item_copy_decimal::copy() uses memcpy to clone 'my_decimal'. The member
buffer is declared as an array and memcpy results in copying the values
of the array, but the inherited member buf, which should be pointing at
the begining of the array 'buffer' starts pointing to the begining of 
buffer in original object (which is being cloned). Further updates on 
'my_decimal' updates only the inherited member 'buf' but leaves 
buffer unchanged.

Later when the new object (which now holds a inconsistent value) is cloned
again using proper cloning function 'my_decimal2decimal' the buf pointer
is fixed resulting in loss of the current value.

Using my_decimal2decimal instead of memcpy in Item_copy_decimal::copy()
fixed this problem.
2010-04-02 01:35:36 +05:30
Sergey Vojtovich
645ee41e26 Merge fix for BUG40980 to mysql-5.1-bugteam. 2010-04-01 22:17:34 +04:00
Sergey Vojtovich
c9ed4d0bfc Merge innodb-zip-ss6900 to mysql-5.1-bugteam. 2010-04-01 19:10:05 +04:00
Sergey Vojtovich
4050910f03 BUG#40980 - Drop table can remove another MyISAM table's
data and index files

It was possible if DATA/INDEX DIRECTORY is pointing to
symlinked MySQL data home directory.

Do not allow to drop data/index files implicitly symlinked
to data home directory. For such tables remove symlink only.
2010-04-01 18:49:02 +04:00
Davi Arnaut
49318af314 Bug#50755: Crash if stored routine def contains version comments
The problem was that a syntactically invalid trigger could cause
the server to crash when trying to list triggers. The crash would
happen due to a mishap in the backup/restore procedure that should
protect parser items which are not associated with the trigger. The
backup/restore is used to isolate the parse tree (and context) of
a statement from the load (and parsing) of a trigger. In this case,
a error during the parsing of a trigger could cause the improper
backup/restore sequence.

The solution is to properly restore the original statement context
before the parser is exited due to syntax errors in the trigger body.
2010-04-01 10:15:22 -03:00
Sergey Vojtovich
edba051bee Applying InnoDB snapshot
Detailed revision comments:

r6800 | marko | 2010-03-11 12:02:57 +0200 (Thu, 11 Mar 2010) | 1 line
branches/zip: Add ut_ad(mtr->state == MTR_ACTIVE) to various places.
2010-04-01 16:27:13 +04:00
Sergey Vojtovich
07e86b5008 Applying InnoDB snapshot
Detailed revision comments:

r6799 | jyang | 2010-03-11 09:59:42 +0200 (Thu, 11 Mar 2010) | 5 lines
branches/zip: Once change in bug #47621 merges into zip branch,
zip only test innodb_bug44571 needs to be updated to reflect the
column name change would be successful be done in InnoDB as well.
2010-04-01 16:22:36 +04:00
Sergey Vojtovich
aacb485899 Applying InnoDB snapshot, fixes BUG#51356.
Detailed revision comments:

r6790 | jyang | 2010-03-10 13:09:41 +0200 (Wed, 10 Mar 2010) | 7 lines
branches/zip: Fix bug #51356: "many valgrind errors in error messages
with concurrent ddl". Null terminate the name string returned
from innobase_convert_identifier() call when reporting DB_DUPLICATE_KEY
error in create_table_def().
rb://266 approved by Marko
2010-04-01 16:14:51 +04:00
Sergey Vojtovich
d10b72dbd6 Applying InnoDB snapshot
Detailed revision comments:

r6786 | vasil | 2010-03-10 09:16:50 +0200 (Wed, 10 Mar 2010) | 4 lines
branches/zip:

Fix typo in comment
2010-04-01 16:07:40 +04:00
Sergey Vojtovich
bb8467ecc5 Applying InnoDB snapshot
Detailed revision comments:

r6770 | marko | 2010-03-03 12:52:55 +0200 (Wed, 03 Mar 2010) | 12 lines
branches/zip: Disallow duplicate index name when creating an index.
This should fix Mantis Issue #461.

innodb.test, innodb.result, innodb-index.test, innodb-index.result:
Adjust the test result and mention that the introduced restriction
has been reported as MySQL Bug #51451.

innobase_check_index_keys(): Add a parameter for the InnoDB table and
check that no duplicate index name is added.  Report errors by
my_error() instead of sql_print_error().

rb://260 approved by Sunny Bains
2010-04-01 16:04:43 +04:00
Sergey Vojtovich
09353b5909 Applying InnoDB snapshot, fixes BUG#47622.
Detailed revision comments:

r6526 | jyang | 2010-01-28 18:12:40 +0200 (Thu, 28 Jan 2010) | 8 lines
branches/zip: Add index translation table to map mysql index
number to InnoDB index structure directly. Fix Bug #47622:
"the new index is added before the existing ones in MySQL,
but after one in SE".

rb://215, approved by Marko
2010-04-01 15:30:11 +04:00
Sergey Vojtovich
33bac9249f Applying InnoDB snapshot
Detailed revision comments:

r6472 | calvin | 2010-01-16 01:53:47 +0200 (Sat, 16 Jan 2010) | 12 lines
branches/zip: Merge revisions 6425:6471 from branches/5.1
to pick up the first part fix of bug49396.

    ------------------------------------------------------------------------
    r6471 | calvin | 2010-01-15 17:43:27 -0600 (Fri, 15 Jan 2010) | 4 lines

    branches/5.1: fix bug#49396: main.innodb test fails in embedded mode

    Change replace_result by using $MYSQLD_DATADIR. Tested in both embedded
    mode and normal server mode.
    ------------------------------------------------------------------------

r6473 | calvin | 2010-01-16 01:58:16 +0200 (Sat, 16 Jan 2010) | 6 lines
branches/zip: fix bug#49396: innodb.innodb-index test fails in
embedded mode

This is 2nd part of the fix for bug#49396. The 1st part is
innodb.test. Tested in both embedded mode and normal server mode.
2010-04-01 15:25:06 +04:00
Georgi Kodinov
3a7b39e17c merge 2010-04-01 14:04:45 +03:00
Alfranio Correia
ec6c56ef5a BUG#51291 Unfortunate effect around variable binlog_direct_non_transactional_updates
Post-merge fix.
2010-04-01 00:16:22 +01:00
Vasil Dimov
2ef71e71a4 Merge from innodb-branches-5.1 2010-03-31 17:02:35 +03:00
Alfranio Correia
2b48577cc2 auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing 2010-03-31 14:51:52 +01:00
Alfranio Correia
f7776c999e BUG#51291 Unfortunate effect around variable binlog_direct_non_transactional_updates
Added test cases to check the case where the option 
binlog_direct_non_transactional_updates is OFF.
2010-03-31 14:49:20 +01:00
Alfranio Correia
4d71a007ba auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing 2010-03-31 14:30:24 +01:00
Alfranio Correia
7827688f23 BUG#51291 Unfortunate effect around variable binlog_direct_non_transactional_updates
BUG#46364 introduced the flag binlog_direct_non_transactional_updates which
would make N-changes to be written to the binary log upon committing the
statement when "ON". On the other hand, when "OFF" the option was supposed
to mimic the behavior in 5.1. However, the implementation was not mimicking
the behavior correctly and the following bugs popped up:

  Case #1: N-changes executed within a transaction would go into
           the S-cache. When later in the same transaction a
           T-change occurs, N-changes following it were written
           to the T-cache instead of the S-cache. In some cases,
           this raises problems. For example, a
           Table_map_log_event being written initially into the
           S-cache, together with the initial N-changes, would be
           absent from the T-cache. This would log N-changes
           orphaned from a Table_map_log_event (thence discarded
           at the slave). (MIXED and ROW)

   Case #2: When rolling back a transaction, the N-changes that
            might be in the T-cache were disregarded and
            truncated along with the T-changes. (MIXED and ROW)

   Case #3: When a MIXED statement (TN) is ahead of any other
            T-changes in the transaction and it fails, it is kept
            in the T-cache until the transaction ends. This is
            not the case in 5.1 or Betony (5.5.2). In these, the
            failed TN statement would be written to the binlog at
            the same instant it had failed and not deferred until
            transaction end. (SBR)

To fix these problems, we have decided to do what follows:

   For Case #1 and #2, we circumvent them:

      1. by not letting binlog_direct_non_transactional_updates
         affect MIXED and RBR. These modes will keep the behavior
         provided by WL#2687. Although this will make Celosia to
         behave differently from 5.1, an execution will be always
         safe under such modes in the sense that slaves will never
         go out sync. In 5.1, using either MIXED or ROW while
         mixing N-statements and T-statements was not safe.

   For Case #3, we don't actually fix it. We:

      1. keep it and make all MIXED statements whether they end
         up failing or not or whether they are up front in the
         transaction or after some transactional change to always
         be stored in the T-cache. This means that it is written
         to the binary log on transaction commit/rollback only.

      2. We make the warning message even more specific about the
         MIXED statement and SBR.
2010-03-31 14:22:47 +01:00
Alfranio Correia
1ddd2ac2db auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing 2010-03-31 14:15:48 +01:00
Vasil Dimov
ae042b6f96 Merge from innodb-branches-5.1. 2010-03-31 16:14:24 +03:00
Georgi Kodinov
56c9c9e9f5 Bug #37168: Missing variable - skip_name_resolve
Added a read-only global boolean variable skip_name_resolve.
2010-03-31 16:12:37 +03:00
Vasil Dimov
d160966976 Rename the newly added mysql-tests from InnoDB to their proper location. 2010-03-31 16:07:55 +03:00
Vasil Dimov
cfcc7ac3a4 Move ./storage/innobase/mysql-test/* into ./mysql-test/* except
innodb.*, innodb_bug34300* and innodb_bug39438* in order to preserve their
history from SVN.
2010-03-31 16:04:40 +03:00
Ramil Kalimullin
2cf7456e03 Fix for bug#52397: another crash with explain extended and group_concat
Problem: EXPLAIN EXTENDED was trying to resolve references to 
freed temporary table fields for GROUP_CONCAT()'s ORDER BY arguments.

Fix: use stored original GROUP_CONCAT()'s arguments in such a case.
2010-03-31 17:00:56 +04:00
mmakela
7079eef220 branches/zip: Merge revisions 6921:6924 from branches/5.1:
------------------------------------------------------------------------
  r6924 | mmakela | 2010-03-31 15:28:25 +0300 (Wed, 31 Mar 2010) | 1 line
  Changed paths:
     M /branches/5.1/mysql-test/innodb_bug51920.test

  branches/5.1: innodb_bug51920.test: Fix a race condition.
  ------------------------------------------------------------------------
2010-03-31 11:30:56 +00:00
mmakela
e92a36c804 branches/zip: Merge revisions 6918:6921 from branches/5.1:
------------------------------------------------------------------------
  r6921 | mmakela | 2010-03-31 14:33:04 +0300 (Wed, 31 Mar 2010) | 2 lines
  Changed paths:
     M /branches/5.1/mysql-test/innodb_bug51920.result
     M /branches/5.1/mysql-test/innodb_bug51920.test

  branches/5.1: innodb_bug51920.test: Make the test quicker and more
  deterministic.  Suggested by Vasil Dimov.
  ------------------------------------------------------------------------
2010-03-31 10:54:30 +00:00
mmakela
5ccfae8284 branches/zip: Merge revisions 6788:6918 from branches/5.1:
------------------------------------------------------------------------
  r6822 | vasil | 2010-03-15 10:17:31 +0200 (Mon, 15 Mar 2010) | 12 lines
  Changed paths:
     M /branches/5.1/row/row0sel.c

  branches/5.1:

  Typecast to silence a compiler warning:

  row/row0sel.c: 4548
          C4244: '=' : conversion from 'float' to 'ib_ulonglong', possible loss of data
  row/row0sel.c: 4553
          C4244: '=' : conversion from 'double' to 'ib_ulonglong', possible loss of data

  Reported by:	Jonas Oreland <Jonas.Oreland@Sun.COM>
  Discussed with:	Sunny Bains <sunny.bains@oracle.com>
  ------------------------------------------------------------------------
  r6884 | vdimov | 2010-03-26 13:05:03 +0200 (Fri, 26 Mar 2010) | 6 lines
  Changed paths:
     M /branches/5.1/mysql-test/innodb_bug38231.test

  branches/5.1:

  Fix a non-determinism in innodb_bug38231.

  Reported by:	Sergey Vojtovich <svoj@Sun.COM>
  ------------------------------------------------------------------------
  r6911 | vdimov | 2010-03-30 11:39:02 +0300 (Tue, 30 Mar 2010) | 2 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc

  branches/5.1: Whitespace fixup
  ------------------------------------------------------------------------
  r6912 | vdimov | 2010-03-30 12:18:46 +0300 (Tue, 30 Mar 2010) | 2 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc

  branches/5.1: Whitespace fixup on line 354
  ------------------------------------------------------------------------
  r6918 | mmakela | 2010-03-31 11:14:51 +0300 (Wed, 31 Mar 2010) | 6 lines
  Changed paths:
     A /branches/5.1/mysql-test/innodb_bug51920.result
     A /branches/5.1/mysql-test/innodb_bug51920.test
     M /branches/5.1/srv/srv0srv.c

  branches/5.1: Obey KILL during a lock wait (Bug #51920).

  srv_suspend_mysql_thread(), srv_lock_timeout_and_monitor_thread():
  Check trx_is_interrupted() in addition to checking the lock wait timeout.

  rb://279 approved by Sunny Bains
  ------------------------------------------------------------------------
2010-03-31 07:34:22 +00:00
Vasil Dimov
c75d70fdc4 Move everything into a subdir in order to workaround a bzr merge bug:
https://bugs.launchpad.net/bzr/+bug/375898
2010-03-30 19:03:46 +03:00
Georgi Kodinov
2d035bf78d Bug #51893: crash with certain characters given to load_file
function on windows
               
When making sure that the directory path ends up with a 
slash/backslash we need to check for the correct length of 
the buffer and trim at the appropriate location so we don't
write past the end of the buffer.
2010-03-30 15:03:50 +03:00
Georgi Kodinov
e32e9cdc66 merge 2010-03-30 15:10:25 +03:00
2049d1afc0 Bug #50407 mysqlbinlog --database=X produces bad output for SAVEPOINTs
When mysqlbinlog was given the --database=X flag, it always printed
'ROLLBACK TO', but the corresponding 'SAVEPOINT' statement was not
printed. The replicated filter(replicated-do/ignore-db) and binlog
filter (binlog-do/ignore-db) has the same problem. They are solved
in this patch together.

After this patch, We always check whether the query is 'SAVEPOINT'
statement or not. Because this is a literal check, 'SAVEPOINT' and
'ROLLBACK TO' statements are also binlogged in uppercase with no
any comments.

The binlog before this patch can be handled correctly except one case
that any comments are in front of the keywords. for example:
 /* bla bla */ SAVEPOINT a;
 /* bla bla */ ROLLBACK TO a;
2010-03-28 19:57:33 +08:00
8d22c5f3ef Bug #50095 Multi statement including CREATE EVENT causes rotten binlog entry
The log event of 'CREATE EVENT' was being binlogged with garbage
at the end of the query if 'CREATE EVENT' is followed by another SQL statement
and they were executed as one command.
for example:
    DELIMITER |;
    CREATE EVENT e1 ON EVERY DAY DO SELECT 1; SELECT 'a';
    DELIMITER ;|
When binlogging 'CREATE EVENT', we always create a new statement with definer
and write it into the log event. The new statement is made from cpp_buf(preprocessed buffer).
which is not a c string(end with '\0'), but it is copied as a c string.

In this patch, cpp_buf is copied with its length.
2010-03-28 16:37:47 +08:00
Sergey Vojtovich
8620be47e5 Applying InnoDB snapshot
Detailed revision comments:

r6884 | vdimov | 2010-03-26 13:05:03 +0200 (Fri, 26 Mar 2010) | 6 lines
branches/5.1:

Fix a non-determinism in innodb_bug38231.

Reported by:	Sergey Vojtovich <svoj@Sun.COM>

r6884 | vdimov | 2010-03-26 13:05:03 +0200 (Fri, 26 Mar 2010) | 6 lines
branches/5.1:

Fix a non-determinism in innodb_bug38231.

Reported by:	Sergey Vojtovich <svoj@Sun.COM>
2010-03-26 15:20:11 +04:00
vdimov
53c27178bd branches/5.1:
Fix a non-determinism in innodb_bug38231.

Reported by:	Sergey Vojtovich <svoj@Sun.COM>
2010-03-26 11:05:03 +00:00
Sergey Vojtovich
8d0b9a8d9d Merge fix for BUG51868 to mysql-5.1-bugteam. 2010-03-26 14:21:10 +04:00
Sergey Vojtovich
0d1c997db5 Merge fix for BUG46565 to mysql-5.1-bugteam. 2010-03-26 14:20:10 +04:00
Sergey Glukhov
1a56ad41f6 Bug#52177 crash with explain, row comparison, join, text field
The crash is the result of an attempt made by JOIN::optimize to evaluate
the WHERE condition when no records have been actually read.
The fix is to remove erroneous 'outer_join' variable check.
2010-03-26 11:44:24 +04:00
Sergey Glukhov
52d89df285 Bug#52164 Assertion failed: param.sort_length, file .\filesort.cc, line 149
The crash happens because of incorrect max_length calculation
in QUOTE function(due to overflow). max_length is set
to 0 and it leads to assert failure.
The fix is to cast expression result to
ulonglong variable and adjust it if the
result exceeds MAX_BLOB_WIDTH.
2010-03-26 09:49:35 +04:00
Sergey Vojtovich
bb3f75bdbc BUG#46565 - repair of partition fail for archive engine
There was no way to repair corrupt ARCHIVE data file,
when unrecoverable data loss is inevitable.

With this fix REPAIR ... EXTENDED attempts to restore
as much rows as possible, ignoring unrecoverable data.

Normal REPAIR is still able to repair meta-data file
only.
2010-03-25 23:57:06 +04:00
Ramil Kalimullin
bd2a0eaa82 An addition to fix for BUG#51866 - crash with repair
by sort and fulltext keys.

Min value for myisam_sort_buffer_size is 4096.
2010-03-25 20:35:07 +04:00
Sergey Vojtovich
47fa2317e5 Merge fixes for BUG51877, BUG51866, BUG47598 to mysql-5.1-bugteam. 2010-03-25 19:59:54 +04:00
Sergey Vojtovich
45e4c066e8 Merge fix for BUG51866 to mysql-5.1-bugteam. 2010-03-25 16:11:16 +04:00
Sergey Vojtovich
3f641968fc BUG#51866 - crash with repair by sort and fulltext keys
Repairing MyISAM table with fulltext indexes and low
myisam_sort_buffer_size may crash the server.

Estimation of number of index entries was done incorrectly,
causing further assertion failure or server crash.

Docs note: min value for myisam_sort_buffer_size has been
changed from 4 to 4096.
2010-03-25 16:08:21 +04:00
Sergey Vojtovich
2ab37b2a0d Merge fix for BUG51877 to mysql-5.1-bugteam. 2010-03-25 15:50:36 +04:00