Commit graph

24683 commits

Author SHA1 Message Date
Bernt M. Johnsen
15b23550d4 Prepare for push 2009-07-03 10:36:10 +02:00
Sergey Glukhov
45d59063cb Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table
enabled message storing into error message list
for 'drop table' command


mysql-test/r/warnings.result:
  test result
mysql-test/t/warnings.test:
  test case
sql/sql_table.cc:
  We should skip error sending then we should return
  warnings to client as some functions may send its
  own errors, so we should set no_warnings_for_error= 0
  only in case of warning.
  The fix is to enable message storing into error message
  list for 'drop table' command(only for error case).
tests/mysql_client_test.c:
  test fix
2009-07-03 13:22:06 +05:00
Bernt M. Johnsen
61488d2abb automerge 2009-07-03 10:33:34 +02:00
Bernt M. Johnsen
7bb5986d93 Bug#15866 Prepared for push on 5.1 2009-07-03 10:23:16 +02:00
Bernt M. Johnsen
e0a3403b45 Bug#15866 Prepared for push on 5.0 2009-07-03 10:19:32 +02:00
Alexey Kopytov
096c12b2c4 Bug #45262: Bad effects with CREATE TABLE and DECIMAL
Using DECIMAL constants with more than 65 digits in CREATE 
TABLE ... SELECT led to bogus errors in release builds or 
assertion failures in debug builds. 
 
The problem was in inconsistency in how DECIMAL constants and 
fields are handled internally. We allow arbitrarily long 
DECIMAL constants, whereas DECIMAL(M,D) columns are limited to 
M<=65 and D<=30. my_decimal_precision_to_length() was used in 
both Item and Field code and truncated precision to 
DECIMAL_MAX_PRECISION when calculating value length without 
adjusting precision and decimals. As a result, a DECIMAL 
constant with more than 65 digits ended up having length less 
than precision or decimals which led to assertion failures. 
 
Fixed by modifying my_decimal_precision_to_length() so that 
precision is truncated to DECIMAL_MAX_PRECISION only for Field 
object which is indicated by the new 'truncate' parameter. 
 
Another inconsistency fixed by this patch is how DECIMAL 
constants and expressions are handled for CREATE ... SELECT. 
create_tmp_field_from_item() (which is used for constants) was 
changed as a part of the bugfix for bug #24907 to handle long 
DECIMAL constants gracefully. Item_func::tmp_table_field() 
(which is used for expressions) on the other hand was still 
using a simplistic approach when creating a Field_new_decimal 
from a DECIMAL expression. 

mysql-test/r/type_newdecimal.result:
  Added a test case for bug #45262.
mysql-test/t/type_newdecimal.test:
  Added a test case for bug #45262.
sql/item.cc:
  Use the new 'truncate' parameter in 
  my_decimal_precision_to_length().
sql/item_cmpfunc.cc:
  Use the new 'truncate' parameter in 
  my_decimal_precision_to_length().
sql/item_func.cc:
  1. Use the new 'truncate' parameter in 
  my_decimal_precision_to_length().
  
  2. Do not truncate decimal precision to DECIMAL_MAX_PRECISION
  for additive expressions involving long DECIMAL constants.
  
  3. Fixed an incosistency in how DECIMAL constants and 
  expressions are handled for CREATE ... SELECT.
sql/item_func.h:
  Use the new 'truncate' parameter in 
  my_decimal_precision_to_length().
sql/item_sum.cc:
  Use the new 'truncate' parameter in 
  my_decimal_precision_to_length().
sql/my_decimal.h:
  Do not truncate precision to DECIMAL_MAX_PRECISION
  when calculating length in 
  my_decimal_precision_to_length() if 'truncate' parameter
  is FALSE.
sql/sql_select.cc:
  1. Use the new 'truncate' parameter in 
  my_decimal_precision_to_length().
  
  2. Use a more correct logic when adjusting value's length.
2009-07-03 11:41:19 +04:00
Georgi Kodinov
ae8950f1e8 Bug #45807: crash accessing partitioned table and sql_mode
contains ONLY_FULL_GROUP_BY

The partitioning code needs to issue a Item::fix_fields()
on the partitioning expression in order to prepare 
it for being evaluated.
It does this by creating a special table and a table list 
for the scope of the partitioning expression.
But when checking ONLY_FULL_GROUP_BY the 
Item_field::fix_fields() was relying that there always be
cached_table set and was trying to use it to get the 
select_lex of the SELECT the field's table is in.
But the cached_table was not set by the partitioning code
that creates the artificial TABLE_LIST used to resolve the
partitioning expression and this resulted in a crash.
 
Fixed by rectifying the following errors :
1. Item_field::fix_fields() : the code that check for 
ONLY_FULL_GROUP_BY relies on having tables with 
cacheable_table set. This is mostly true, the only 
two exceptions being the partitioning context table
and the trigger context table.
Fixed by taking the current parsing context if no pointer
to the TABLE_LIST instance is present in the cached_table.

2. fix_fields_part_func() : 

2a. The code that adds the table being created to the 
scope for the partitioning expression is mostly a copy 
of the add_table_to_list and friends with one exception :
it was not marking the table as cacheable (something that
normal add_table_to_list is doing). This caused the 
problem in the check for ONLY_FULL_GROUP_BY in 
Item_field::fix_fields() to appear.
Fixed by setting the correct members to make the table
cacheable.
The ideal structural fix for this is to use a unified 
interface for adding a table to a table list 
(add_table_to_list?) : noted in a TODO comment

2b. The Item::fix_fields() was called with a NULL destination
pointer. This causes uninitalized memory reads in the 
overloaded ::fix_fields() function (namely 
Item_field::fix_fields()) as it expects a non-zero pointer 
there. Fixed by passing the source pointer similarly to how 
it's done in JOIN::prepare().

mysql-test/r/partition.result:
  Bug #45807: test case
mysql-test/t/partition.test:
  Bug #45807: test case
sql/item.cc:
  Bug #45807: fix the ONLY_FULL_GROUP_BY check code to 
  handle correctly non-cacheable tables.
sql/sql_partition.cc:
  Bug #45807: fix the Item::fix_fields() context
  initializatio for the partitioning expression in 
  CREATE TABLE.
2009-07-02 17:42:00 +03:00
Matthias Leich
a01b9e2922 Merge 5.0 -> 5.1 of fix for bug 45902 2009-07-02 15:40:27 +02:00
Matthias Leich
3abee40e6b Fix for Bug#45902 rpl_sp fails sporadically in check testcases
Details:
- Add "sync_slave_with_master" at test end
- Restore the initial value of log_bin_trust_function_creators
2009-07-02 13:22:12 +02:00
V Narayanan
fdf1461a4f Bug#45793 macce charset causes error with IBMDB2I
Creating an IBMDB2I table with the macce character set
is successful, but any attempt to insert data into the
table was failing.

This was happening because the character set name "macce"
is not a valid iconv descriptor for IBM i PASE. This patch
adds an override to convertTextDesc to use the equivalent
valid iconv descriptor "IBM-1282" instead.

mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45793.result:
  Bug#45793 macce charset causes error with IBMDB2I
  
  Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45793.test:
  Bug#45793 macce charset causes error with IBMDB2I
  
  Add a testcase for the macce charater set.
storage/ibmdb2i/db2i_charsetSupport.cc:
  Bug#45793 macce charset causes error with IBMDB2I
  
  The character set name "macce" is not a valid iconv
  descriptor for IBM i PASE. Add an override to convertTextDesc
  to use the equivalent valid iconv descriptor "IBM-1282" 
  instead.
2009-07-02 13:34:23 +05:30
Luis Soares
38088ef6a4 merge: 5.1-bt bug branch --> 5.1-bt latest 2009-06-30 19:40:38 +01:00
Michael Widenius
bb55791994 Added some changes inspired by Zardosht Kasheff:
- Added a handler call (prepare_index_scan()) to inform storage engines that an index scan is about to take place.
- Extended the maximun key parts for an index from 16 to 32
- Extended MyISAM and Maria engines to support up to 32 parts

Added checks for return value from ha_index_init()



include/my_handler.h:
  Extended number of key parts for MyISAM and Maria from 16 to 32
include/my_pthread.h:
  Ensure we always have 256M of stack.
  (Required to be able to handle the current number of keys and key parts in MyISAM)
mysql-test/r/create.result:
  Extended to test for 32 key parts
mysql-test/r/myisam.result:
  Test that we can create 32 but not 33 key parts
mysql-test/r/ps_1general.result:
  Length of ref is now 2048 as we can have more key parts
mysql-test/r/ps_2myisam.result:
  Length of ref is now 2048 as we can have more key parts
mysql-test/r/ps_3innodb.result:
  Length of ref is now 2048 as we can have more key parts
mysql-test/r/ps_4heap.result:
  Length of ref is now 2048 as we can have more key parts
mysql-test/r/ps_5merge.result:
  Length of ref is now 2048 as we can have more key parts
mysql-test/suite/maria/r/maria.result:
  Max key length is now 1208 bytes
mysql-test/suite/maria/r/maria3.result:
  Max key length is now 1208 bytes
mysql-test/suite/maria/r/ps_maria.result:
  Max key length is now 1208 byte
mysql-test/t/create.test:
  Extended to test for 32 key parts
mysql-test/t/myisam.test:
  Test that we can create 32 but not 33 key parts
sql/handler.cc:
  Check return value from ha_index_init()
sql/handler.h:
  Added a handler call (prepare_index_scan()) to inform storage engines that an index scan is about to take place.
sql/sql_select.cc:
  Checks all return values from ha_index_init()
  Call prepare_index_scan()) to inform storage engines that an index scan is about to take place.
  Fixed indentation
sql/table.cc:
  Fixed wrong types for key_length (rest of code assumed this was 32 bit)
sql/unireg.h:
  Extended the maximun key parts for an index from 16 to 32
storage/maria/ha_maria.cc:
  Don't allocate HA_CHECK on the stack in functions where we call repair() as HA_CHECK is HUGE and will overflow stack
storage/myisam/ha_myisam.cc:
  Don't allocate HA_CHECK on the stack in functions where we call repair() as HA_CHECK is HUGE and will overflow stack
storage/myisam/mi_check.c:
  Fixed wrong check if value overflow
tests/mysql_client_test.c:
  Added fflush() to fix output in case of error
  Fixed wrong check of 'ref' length in EXPLAIN
2009-06-30 00:03:30 +03:00
Sergey Petrunya
9fa1bce436 MWL#17: Table elimination
mysql-test/r/table_elim.result:
  MWL#17: Table elimination
  - More tests
mysql-test/t/table_elim.test:
  MWL#17: Table elimination
  - More tests
sql/opt_table_elimination.cc:
  MWL#17: Table elimination
  - Code cleanup
sql/sql_select.cc:
  MWL#17: Table elimination
  - Code cleanup
sql/sql_select.h:
  MWL#17: Table elimination
  - Code cleanup
sql/table.h:
  MWL#17: Table elimination
  - Code cleanup
2009-06-29 17:51:15 +04:00
Satya B
889b96b9c9 merge to mysql-5.1-bugteam 2009-06-29 18:33:11 +05:30
Luis Soares
40e87bcf2b merge: 5.1-bt bug branch --> 5.1-bt latest 2009-06-29 12:00:58 +01:00
V Narayanan
db044ad94f Bug#45196 Some collations do not sort correctly with IBMDB2I
Some collations--including cp1250_czech_cs,latin2_czech_cs,
ucs2/utf8_czech_ci, ucs2/utf8_danish_ci--are not being
sorted correctly by the IBMDB2I storage engine. This
was being caused because the sort order used by DB2 is
incompatible with the order expected by MySQL.

This patch removes support for the cp1250_czech_cs and
latin2_czech_cs collations because it has been determined
that the sort order used by DB2 is incompatible with the
order expected by MySQL. Users needing a czech collation
with IBMDB2I are encouraged to use a Unicode-based collation 
instead of these single-byte collations. This patch also
modifies the DB2 sort sequence used for ucs2/utf8_czech_ci
and ucs2/utf8_danish_ci collations to better match the
sorting expected by MySQL. This will only affect indexes
or tables that are newly created through the IBMDB2I storage
engine. Existing IBMDB2I tables will retain the old sort
sequence until recreated.

mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result:
  Bug#45196  Some collations do not sort correctly with IBMDB2I
  
  Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test:
  Bug#45196  Some collations do not sort correctly with IBMDB2I
  
  Adding tests for testing the sort order with the modified collations.
storage/ibmdb2i/db2i_collationSupport.cc:
  Bug#45196  Some collations do not sort correctly with IBMDB2I
  
  Remove the support for the cp1250_czech_cs and latin2_czech_cs 
  collations because it has been determined that the sort order
  used by DB2 is incompatible with the order expected by MySQL.
  Users needing a czech collation with IBMDB2I are encouraged to
  use a Unicode-based collation instead of these single-byte
  collations. This patch also modifies the DB2 sort sequence
  used for ucs2/utf8_czech_ci and ucs2/utf8_danish_ci collations
  to better match the sorting expected by MySQL. This will only 
  affect indexes or tables that are newly created through the
  IBMDB2I storage engine. Existing IBMDB2I tables will retain
  the old sort sequence until recreated.
2009-06-29 07:32:17 +05:30
Luis Soares
92956ef627 BUG#42851: Spurious "Statement is not safe to log in statement
format." warnings
      
Despite the fact that a statement would be filtered out from binlog, a
warning would still be thrown if it was issued with the LIMIT.
      
This patch addresses this issue by checking the filtering rules before
printing out the warning.


mysql-test/suite/binlog/t/binlog_stm_unsafe_warning-master.opt:
  Parameter to filter out database: "b42851".
mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test:
  Added a new test case.
sql/sql_class.cc:
  Added filtering rules check to condition used to decide whether to
  printout warning or not.
2009-06-27 14:18:47 +01:00
Evgeny Potemkin
f99df8f775 Merged bug#45266. 2009-06-26 19:59:41 +00:00
Evgeny Potemkin
93bac51ef3 Bug#45266: Uninitialized variable lead to an empty result.
The TABLE::reginfo.impossible_range is used by the optimizer to indicate
that the condition applied to the table is impossible. It wasn't initialized
at table opening and this might lead to an empty result on complex queries:
a query might set the impossible_range flag on a table and when the query finishes,
all tables are returned back to the table cache. The next query that uses the table
with the impossible_range flag set and an index over the table will see the flag
and thus return an empty result.

The open_table function now initializes the TABLE::reginfo.impossible_range
variable.

mysql-test/r/select.result:
  A test case for the bug#45266: Uninitialized variable lead to an empty result.
mysql-test/t/select.test:
  A test case for the bug#45266: Uninitialized variable lead to an empty result.
sql/sql_base.cc:
  Bug#45266: Uninitialized variable lead to an empty result.
  The open_table function now initializes the TABLE::reginfo.impossible_range
  variable.
sql/sql_select.cc:
  Bug#45266: Uninitialized variable lead to an empty result.
  The open_table function now initializes the TABLE::reginfo.impossible_range
  variable.
sql/structs.h:
  Bug#45266: Uninitialized variable lead to an empty result.
  A comment is added.
2009-06-26 19:57:42 +00:00
Luis Soares
626d3e1d6b local merge: 5.1-bt bug branch --> 5.1-bt latest 2009-06-26 00:20:14 +01:00
Davi Arnaut
eefdd70ab2 Bug#45548: XA transaction without access to InnoDB tables crashes the server
The problem is that the one phase commit function failed to
properly end a empty transaction. The solution is to ensure
that the transaction cleanup procedure is invoked even for
empty transactions.

mysql-test/r/xa.result:
  Add test case result for Bug#45548
mysql-test/t/xa.test:
  Add test case for Bug#45548
sql/handler.cc:
  Invoke transaction cleanup function whenever a transaction is ended.
2009-06-25 12:25:23 -03:00
Luis Soares
0fdebc8c49 BUG#44270: Post-push fix
The test case added failed sporadically on PB. This is due to the
fact that the user thread in some cases is waiting for slave IO
to stop and then check the error number. Thence, sometimes the
user thread would race for the error number with IO thread.

This post push fix addresses this by replacing the wait for slave
io to stop with a wait for slave io error (as it seems it was
added in 6.0 also after patch on which this is based was
pushed). This implied backporting wait_for_slave_io_error.inc
from 6.0 also.
2009-06-26 12:05:56 +01:00
Sergey Glukhov
5eab9716ba Bug#45412 SHOW CREATE TRIGGER does not require privileges to disclose trigger data
Added privilege checking to SHOW CREATE TRIGGER code.



mysql-test/r/trigger_notembedded.result:
  test result
mysql-test/t/trigger_notembedded.test:
  test case
sql/sql_show.cc:
  Added privilege checking to SHOW CREATE TRIGGER code.
2009-06-25 15:52:50 +05:00
Satya B
faaa9e0855 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
Sergey Vojtovich
9f78d5857c Expanded list of directories to seach for InnoDB plugin. With
this fix it is possible to test InnoDB plugin from binary
distribution. As well as on pb.
2009-06-25 14:34:37 +05:00
Sergey Glukhov
d5f8459beb test case fix
mysql-test/r/ctype_cp932_binlog_stm.result:
  result fix
mysql-test/t/ctype_gbk_binlog.test:
  test fix
2009-06-25 13:44:50 +05:00
Sergey Glukhov
bebc987595 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.



mysql-test/r/ctype_gbk_binlog.result:
  test result
mysql-test/t/ctype_gbk_binlog.test:
  test case
sql/item.cc:
  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
Vadim Tkachenko
f657606df9 sync with rev73 extensions 2009-06-24 18:43:25 -07:00
Sergey Petrunia
e1250b8656 MWL#17: Table elimination
- fix a typo bug in has_eqref_access_candidate()
- Adjust test to remove race condition

mysql-test/r/mysql-bug41486.result:
  Adjust test to remove race condition
mysql-test/t/mysql-bug41486.test:
  Adjust test to remove race condition
sql/item.cc:
  MWL#17: Table elimination:
    fix a typo bug in has_eqref_access_candidate()
2009-06-25 02:44:14 +04:00
unknown
c40d85c634 Fix of BUG#45632 (http://bugs.mysql.com/bug.php?id=45632) - sharing non default debug settings between sessions. This bugfix proposed by Monty.
mysql-test/r/variables_debug.result:
  Test that sessions do not share the same session debug variable.
mysql-test/t/variables_debug.test:
  Test that sessions do not share the same session debug variable.
sql/set_var.cc:
  As soon as default setting are shared between sessions we should push dbug state before changing debug setting first time.
2009-06-25 01:22:20 +03:00
Sergey Vojtovich
b4ac7f8c15 This patch implements testing InnoDB plugin milestone.
mysql-test/lib/mtr_cases.pm:
  Expand test cases list with test cases to test
  InnoDB plugin.
mysql-test/mysql-test-run.pl:
  Added "innodb" suite to default list of suites.
mysql-test/suite/innodb/include/have_innodb_plugin.inc:
  This file determines if innodb plugin is available.
mysql-test/suite/innodb/my.cnf:
  Removed temporary my.cnf, which was added for testing. Not
  needed anymore - options are substituted by mtr.
mysql-test/suite/innodb/t/innodb-analyze.test:
  This test can only be run with InnoDB plugin.
mysql-test/suite/innodb/t/innodb-timeout.test:
  This test can only be run with InnoDB plugin.
mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt:
  Use "loose" prefix with mysqld options. This makes this
  test skipped properly when no innodb is available.
mysql-test/suite/innodb/t/innodb-use-sys-malloc.test:
  This test can only be run with InnoDB plugin.
mysql-test/suite/innodb/t/innodb-zip.test:
  This test can only be run with InnoDB plugin.
mysql-test/suite/innodb/t/innodb_bug36169.test:
  This test can only be run with InnoDB plugin.
mysql-test/suite/innodb/t/innodb_bug36172.test:
  This test can only be run with InnoDB plugin.
mysql-test/suite/innodb/t/innodb_information_schema.test:
  This test can only be run with InnoDB plugin.
2009-06-24 22:18:58 +05:00
Sergey Petrunia
c4922cbf10 MWL#17: Table elimination
- More testcases
- Let add_ft_key() set keyuse->usable

mysql-test/r/table_elim.result:
  MWL#17: Table elimination
  - More testcases
mysql-test/t/table_elim.test:
  MWL#17: Table elimination
  - More testcases
sql/sql_select.cc:
  MWL#17: Table elimination
  - Let add_ft_key() set keyuse->usable
2009-06-24 00:06:13 +04:00
Bernt M. Johnsen
2a5907a8fd Bug#45293 Supressed some warnings 2009-06-23 14:32:14 +02:00
unknown
e84748406c Fix memory leak in mysql_ssl_set() when called more than once.
Fix sleep() synchronisation in innodb_information_schema test case.

mysql-test/t/innodb_information_schema.test:
  Using sleep for synchronisation does not work!!!
  Replace by looping until the required condition is met.
sql-common/client.c:
  mysql_ssl_set() did not free old pointers before overwriting with new ones (happens when
  mysql_ssl_set() is called twice without calling mysql_close() in-between).
  
  This sometimes caused memory leaks in the slave depending on exact timing of
  master/slave shutdown.
  
  Fixed by freeing old pointers before installing new ones in mysql_ssl_set(), just like
  mysql_options() does.
2009-06-23 14:00:24 +02:00
Martin Hansson
f3bdd56fe6 Merge 2009-06-22 16:01:42 +02:00
Martin Hansson
543885d1b1 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)


mysql-test/r/trigger.result:
  Bug#44653: Test result
mysql-test/t/trigger.test:
  Bug#44653: Test case
sql/sql_insert.cc:
  Bug#44653: Fix: Make sure to unset this field before returning in case of error
2009-06-22 14:51:33 +02:00
Satya B
7d0675f613 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
unknown
7c5e321bb8 More XtraDB after-merge fixes following review and buildbot runs:
- Better fix for --innodb-use-sys-malloc causing Valgrind warnings.
 - Different fix for INNODB_IBUF_MAX_SIZE variable changing default value.
 - Fix some problems with the safe mutex lazy init patch.

mysql-test/include/mtr_check.sql:
  Do not check INNODB_IBUF_MAX_SIZE for changes. It is not a dynamic variable, so cannot
  be changed by a test case anyway, and the value may vary slightly from one start of the
  server to the next.
mysql-test/lib/mtr_cases.pm:
  Even just starting and stopping the server with --innodb-use-sys-malloc to check for
  disabled test case under valgrind will cause valgrind leak warnings. So add not_valgrind
  to the list of conditions also tested for directly in mysql-test-run.pl.
mysql-test/mysql-test-run.pl:
  Even just starting and stopping the server with --innodb-use-sys-malloc to check for
  disabled test case under valgrind will cause valgrind leak warnings. So add not_valgrind
  to the list of conditions also tested for directly in mysql-test-run.pl.
mysys/thr_mutex.c:
  Fix a few problems found during review of the lazy init safe mutex patch.
storage/xtradb/ibuf/ibuf0ibuf.c:
  Revert previous fix of INNODB_IBUF_MAX_SIZE default varying slightly between server starts.
  (Fixed instead by ignoring that variable in the test suite).
2009-06-22 10:06:35 +02:00
Matthias Leich
86cb0d8ce4 Merge 5.0 -> 5.1 of fixes for various funcs_1 related bugs 2009-06-19 17:44:29 +02:00
Matthias Leich
a4f0b44232 Merge of fix for bug 40545, 40209, 40618, 38346 into tree 2009-06-19 17:21:20 +02:00
Matthias Leich
59730d8fce 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
Alfranio Correia
18bd3cd5f3 Post-fix for BUG#43929. 2009-06-19 12:27:24 +01:00
Staale Smedseng
37d2019d17 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+.

mysql-test/t/variables.test:
  Tests are changed to account for the new semantics, and assignment to the read-only variables is added to test 
  the emission of the correct error message.
sql/set_var.cc:
  Both max_allowed_packet and net_buffer_length are changed 
  to be of type sys_var_thd_ulong_session_readonly. ER_UNKNOWN_ERROR is used to indicate an attempt to assign 
  to an instance of a read-only variable.
sql/set_var.h:
  Class sys_var_thd_ulong_session_readonly is added.
2009-06-19 11:27:19 +02:00
Alfranio Correia
f45b12dc5e auto-merge mysql-5.1-bugteam (local) --> mysql-5.1-bugteam 2009-06-18 15:16:14 +01:00
Alfranio Correia
3cf052b76c 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
unknown
2a663359a4 Fix test cases after merge of XtraDB into MariaDB.
Manually merge some InnoDB changes into XtraDB.
Fix ALTER TABLE bug in XtraDB with wrong comparison of row type.

mysql-test/include/varchar.inc:
  Fix in test case that which of several duplicate keys triggers an error is not
  deterministic.
mysql-test/mysql-test-run.pl:
  InnoDB does not bother to free resources individually during shutdown, but due to using
  its own memory tracking it nevertheless can free everything at exit. But XtraDB adds an
  option, on by default, to skip this extra tracking. This causes lots of Valgrind
  warnings, so needs to be disabled for Valgrind testing.
mysql-test/r/innodb.result:
  Fix in test case that which of several duplicate keys triggers an error is not
  deterministic.
mysql-test/t/innodb-use-sys-malloc.test:
  InnoDB does not bother to free resources individually during shutdown, but due to using
  its own memory tracking it nevertheless can free everything at exit. But XtraDB adds an
  option, on by default, to skip this extra tracking. This causes lots of Valgrind
  warnings, so needs to be disabled for Valgrind testing.
sql/sql_table.cc:
  Add some useful DBUG while debugging alter table.
storage/xtradb/handler/ha_innodb.cc:
  Fix that check_if_incompatible_data did not realise that ROW_TYPE_DEFAULT is identical
  to the default row format ROW_TYPE_COMPACT, causing excessive table copying in
  ALTER TABLE
  Add some useful DBUG while debugging alter table.
  Manually merge into XtraDB a few small changes for InnoDB from upstream MySQL.
storage/xtradb/include/pars0pars.h:
  Manually merge into XtraDB a few small changes for InnoDB from upstream MySQL.
storage/xtradb/include/univ.i:
  Manually merge a MariaDB fix in InnoDB into XtraDB.
2009-06-18 14:39:21 +02:00
Martin Hansson
37b2b7fadb Merge 2009-06-18 09:25:46 +02:00
Alexey Kopytov
56dd4d44b1 Automerge. 2009-06-17 20:12:50 +04:00
Alexey Kopytov
5814263583 Disabled embedded server for the test case for bug #45236. 2009-06-17 20:10:48 +04:00
Martin Hansson
4f59ca45a0 Merge 2009-06-17 17:34:53 +02:00
Kristofer Pettersson
b1967ef40e Automerge 2009-06-17 17:07:20 +02:00
Martin Hansson
0d460bcd65 Bug#44684: valgrind reports invalid reads in
Item_func_spatial_collection::val_str
        
When the concatenation function for geometry data collections
reads the binary data it was not rigorous in checking that there
is data available, leading to invalid reads and crashes.
Fixed by making checking stricter.


mysql-test/r/gis.result:
  Bug#44684: Test result
mysql-test/t/gis.test:
  Bug#44684: Test case
sql/item_geofunc.cc:
  Bug#44684: fix(es)
  - Check that there are 4 bytes available for type code.
  - Check that there is at least one point available for linestring.
  - Check that there are at least 2 points in a polygon and
    data for all the points.
2009-06-17 16:58:33 +02:00
Vladislav Vaintroub
87da3df623 merge 2009-06-17 16:32:16 +02:00
Kristofer Pettersson
389fba8403 Bug#43758 Query cache can lock up threads in 'freeing items' state
This patch corrects a misstake in the test case for bug patch 43658.

There was a race in the test case when the thread id was retrieved from the processlist.
The result was that the same thread id was signalled twice and one thread id wasn't
signalled at all.

The affected platforms appears to be limited to linux.

mysql-test/r/query_cache_debug.result:
  There was a race in the test case when the thread id was retrieved from the processlist.
  The result was that the same thread id was signalled twice and one thread id wasn't
  signalled at all.
mysql-test/t/query_cache_debug.test:
  There was a race in the test case when the thread id was retrieved from the processlist.
  The result was that the same thread id was signalled twice and one thread id wasn't
  signalled at all.
2009-06-17 16:28:11 +02:00
Alexey Kopytov
de4d3f2b39 Automerge. 2009-06-17 16:37:10 +04:00
Alexey Kopytov
689901f36f Automerge. 2009-06-17 16:36:45 +04:00
Alexey Kopytov
736fa25e58 Automerge. 2009-06-17 15:50:50 +04:00
Sergey Petrunia
7a9f45c6d5 * Use excessive parentheses to stop compiler warning
* Fix test results to account for changes in previous cset
2009-06-17 09:27:39 +04:00
Sergey Petrunia
c0103f705c * Merge
* Change valgrind suppression to work on valgrind 3.3.0
2009-06-17 00:43:58 +04:00
Martin Hansson
aa8677bc32 Bug#45168: assertion with convert() and empty set value
The assertion in String::copy was added in order to avoid
valgrind errors when the destination was the same as the source.
Eased restriction to allow for the case when str == NULL.


mysql-test/r/func_set.result:
  Bug#45168: Test result
mysql-test/t/func_set.test:
  Bug#45168: Test case
sql/item_strfunc.cc:
  Bug#45168: Code cleanup and grammar correction in comment
sql/sql_string.cc:
  Bug#45168: Fix
2009-06-16 16:36:15 +02:00
Georgi Kodinov
48d911e708 Addendum to the fix for bug #44821: move partition dependent test
to a test file that guarantees the presence of partition code
2009-06-16 12:59:57 +03:00
Kristofer Pettersson
86c0346212 Automerge 2009-06-16 10:49:04 +02:00
Kristofer Pettersson
b9e1ee63bb Automerge 2009-06-16 10:42:54 +02:00
Kristofer Pettersson
02e5ad9881 Bug#43758 Query cache can lock up threads in 'freeing items' state
Early patch submitted for discussion.

It is possible for more than one thread to enter the condition
in query_cache_insert(), but the condition predicate is to
signal one thread each time the cache status changes between
the following states: {NO_FLUSH_IN_PROGRESS,FLUSH_IN_PROGRESS,
TABLE_FLUSH_IN_PROGRESS}

Consider three threads THD1, THD2, THD3

   THD2: select ... => Got a writer in ::store_query
   THD3: select ... => Got a writer in ::store_query
   THD1: flush tables => qc status= FLUSH_IN_PROGRESS;
                      new writers are blocked.
   THD2: select ... => Still got a writer and enters cond in
                       query_cache_insert
   THD3: select ... => Still got a writer and enters cond in
                       query_cache_insert
   THD1: flush tables => finished and signal status change.
   THD2: select ... => Wakes up and completes the insert.
   THD3: select ... => Happily waiting for better times. Why hurry?

This patch is a refactoring of this lock system. It introduces four new methods:
   Query_cache::try_lock()
   Query_cache::lock()
   Query_cache::lock_and_suspend()
   Query_cache::unlock()

This change also deprecates wait_while_table_flush_is_in_progress(). All threads are
queued and put on a conditional wait. On each unlock the queue is signalled. This resolve
the issues with left over threads. To assure that no threads are spending unnecessary
time waiting a signal broadcast is issued every time a lock is taken before a full
cache flush.

mysql-test/r/query_cache_debug.result:
  * Added test case for bug43758
mysql-test/t/query_cache_debug.test:
  * Added test case for bug43758
sql/sql_cache.cc:
  * Replaced calls to wait_while_table_flush_is_in_progress() with
    calls to try_lock(), lock_and_suspend() and unlock().
  * Renamed enumeration Cache_status to Cache_lock_status.
  * Renamed enumeration items to UNLOCKED, LOCKED_NO_WAIT and LOCKED.
    If the LOCKED_NO_WAIT lock type is used to lock the query cache, other
    threads using try_lock() will fail to acquire the lock.
    This is useful if the query cache is temporary disabled due to 
    a full table flush.
sql/sql_cache.h:
  * Replaced calls to wait_while_table_flush_is_in_progress() with
    calls to try_lock(), lock_and_suspend() and unlock().
  * Renamed enumeration Cache_status to Cache_lock_status.
  * Renamed enumeration items to UNLOCKED, LOCKED_NO_WAIT and LOCKED.
    If the LOCKED_NO_WAIT lock type is used to lock the query cache, other
    threads using try_lock() will fail to acquire the lock.
    This is useful if the query cache is temporary disabled due to 
    a full table flush.
2009-06-16 10:34:47 +02:00
Martin Hansson
5d44b2f3a5 Merge 2009-06-16 10:34:32 +02:00
Davi Arnaut
3cc3aa7d70 Post-merge fix: modify regular expression to better handle 24 hour
times (ie: 2:16:20).

mysql-test/r/log_tables_debug.result:
  Update test case result.
mysql-test/t/log_tables_debug.test:
  Skip spaces and handle case when a leading zero is not printed.
2009-06-15 20:27:27 -03:00
Davi Arnaut
cebad07c5d Disable session debugging after its not necessary anymore.
mysql-test/t/log_tables_debug.test:
  Remove spurious spaces and disable session debugging.
2009-06-15 20:02:25 -03:00
Sergey Petrunia
a0a7cb03ae Fix spurious valgrind warnings in rpl_trigger.test 2009-06-15 20:22:08 +04:00
Staale Smedseng
37a5f2d421 Bug #45387 Information about statement id for prepared
statements missed from general log

A FLUSH LOGS is added to ensure that the log info hits
the file before attempting to process.

mysql-test/t/log_tables_debug.test:
  A FLUSH LOGS is added, and in the event that a match is
  not found, <FILE> is reset and the contents of the log
  file is dumped for debugging purposes.
2009-06-15 18:03:25 +02:00
Georgi Kodinov
778999907f automerge 2009-06-15 17:58:23 +02:00
Georgi Kodinov
9d0d363be3 merged 5.0-main to 5.0-bugteam 2009-06-15 17:29:26 +02:00
Bernt M. Johnsen
d6a9e61c45 Bug#32357 Prepared for push on 5.0-bugteam branch 2009-06-15 17:14:00 +02:00
Georgi Kodinov
f264697084 automerge 2009-06-15 17:36:51 +03:00
Georgi Kodinov
6df6c8ee95 Bug #44810: index merge and order by with low sort_buffer_size
crashes server!

The problem affects the scenario when index merge is followed by a filesort
and the sort buffer is not big enough for all the sort keys.
In this case the filesort function will read the data to the end through the 
index merge quick access method (and thus closing the cursor etc), 
but will leave the pointer to the quick select method in place.
It will then create a temporary file to hold the results of the filesort and
will add it as a sort output file (in sort.io_cache).
Note that filesort will copy the original 'sort' structure in an automatic
variable and restore it after it's done.
As a result at exiting filesort() we have a sort.io_cache filled in and 
nothing else (as a result of close of the cursors at end of reading data 
through index merge).
Now create_sort_index() will note that there is a select and will clean it up
(as it's been used already by filesort() reading the data in). While doing that
a special case in the index merge destructor will clean up the sort.io_cache,
assuming it's an output of the index merge method and is not needed anymore.
As a result the code that tries to read the data back from the filesort output 
will get no data in both memory and disk and will crash.
      
Fixed similarly to how filesort() does it : by copying the sort.io_cache structure
to a local variable, removing the pointer to the io_cache (so that it's not freed 
by QUICK_INDEX_MERGE_SELECT::~QUICK_INDEX_MERGE_SELECT) and restoring the original 
structure (together with the valid pointer) after the cleanup is done.
This is a safe thing to do because all the structures are already cleaned up by
hitting the end of the index merge's read method (QUICK_INDEX_MERGE_SELECT::get_next()) 
and the cleanup code being written in a way that tolerates repeating cleanups.

mysql-test/r/index_merge.result:
  Bug #44810: test case
mysql-test/t/index_merge.test:
  Bug #44810: test case
sql/sql_select.cc:
  Bug #44810: preserve the io_cache produced by filesort while cleaning up
  the index merge quick access method (QUICK_INDEX_MERGE_SELECT).
2009-06-15 16:38:15 +03:00
Sergey Petrunia
6b4727dcb9 MWL#17: Table elimination
- Fix print_join() to work both for EXPLAIN EXTENDED (after table elimination) and for 
  CREATE VIEW (after join->prepare() but without any optimization).

mysql-test/r/union.result:
  MWL#17: Table elimination
  - Adjust test results
2009-06-15 00:59:24 +04:00
Sergey Petrunia
402e58cf78 MWL#17: Table elimination
- Do not show eliminated tables in the output of EXPLAIN EXTENDED
2009-06-14 14:01:10 +04:00
Davi Arnaut
66398a877a Bug#45100: Incomplete DROP USER in case of SQL_MODE = 'PAD_CHAR_TO_FULL_LENGTH'
The SQL-mode PAD_CHAR_TO_FULL_LENGTH could prevent a DROP USER
statement from privileges associated with the user being dropped.
What ocurred was that reading from the User and Host fields of
the tables tables_priv or columns_priv would yield values padded
with spaces, causing a failure to match a specified user or host 
('user' != 'user     ');

The solution is to disregard the PAD_CHAR_TO_FULL_LENGTH mode
when iterating over and matching values in the privileges tables
for a DROP USER statement.

mysql-test/r/sql_mode.result:
  Add test case result for Bug#45100.
mysql-test/t/sql_mode.test:
  Add test case for Bug#45100.
sql/sql_acl.cc:
  Clear MODE_PAD_CHAR_TO_FULL_LENGTH before dropping privileges.
2009-06-12 18:11:19 -03:00
Staale Smedseng
35cf663250 Bug #45387 Information about statement id for prepared
statements missed from general log

A refinement of the test in the previous patch to avoid
using sleep as a means to ensure that timestamps are
added to the log entries.

mysql-test/t/log_tables_debug.test:
  New test file. A debug feature is used to ensure that
  log entries are prefixed with a timestamp.
sql/log.cc:
  A debug feature is implemented to ensure that
  log entries are prefixed with a timestamp.
2009-06-12 16:28:10 +02:00
Georgi Kodinov
ed112a8049 automerge 2009-06-12 17:04:24 +03:00
Georgi Kodinov
4228f4371e automerge 2009-06-12 16:58:48 +03:00
Patrick Crews
62a32540fc Bug#44920: MTR2 is not processing master.opt input properly on Windows
Re-enabled tests main.init_connect and rpl.rpl_init_slave.test for non-Windows
platforms.

Please remove this code upon fixing the bug.
2009-06-12 14:40:02 +01:00
Georgi Kodinov
3e82a86ed2 Bug #45386: Wrong query result with MIN function in field list,
WHERE and GROUP BY clause

Loose index scan may use range conditions on the argument of 
the MIN/MAX aggregate functions to find the beginning/end of 
the interval that satisfies the range conditions in a single go.
These range conditions may have open or closed minimum/maximum 
values. When the comparison returns 0 (equal) the code should 
check the type of the min/max values of the current interval 
and accept or reject the row based on whether the limit is 
open or not.
There was a wrong composite condition on checking this and it was
not working in all cases.
Fixed by simplifying the conditions and reversing the logic.

mysql-test/r/group_min_max.result:
  Bug #45386: test case
mysql-test/t/group_min_max.test:
  Bug #45386: test case
sql/opt_range.cc:
  Bug #45386: fix the check whether to use the value if on the
  interval boundry
2009-06-12 15:38:55 +03:00
unknown
4b2aafb35c Merge of Percona XtraDB into MariaDB. 2009-06-11 19:49:51 +02:00
Satya B
92ffd7e025 Applying InnoDB snashot 5.1-ss5282, Add TestCase for BUG#40565
Merge the test case from 5.0 to 5.1 for BUG#40565

Detailed revision comments:

r5233 | marko | 2009-06-03 15:12:44 +0300 (Wed, 03 Jun 2009) | 11 lines
branches/5.1: Merge the test case from r5232 from branches/5.0:
  ------------------------------------------------------------------------
  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
  ------------------------------------------------------------------------
2009-06-11 18:42:25 +05:30
Sergey Vojtovich
4e430bb4cf Make innodb test suite pass with INNODB_PLUGIN.
mysql-test/suite/innodb/my.cnf:
  Added temporary my.cnf for initial testing.
mysql-test/suite/innodb/t/disabled.def:
  Disabled innodb-index test until we know how to fix it.
  An error message appears in the error log, which is likely
  needs to be suppressed.
mysql-test/suite/innodb/t/innodb-analyze.test:
  Cleanup variables before returning.
mysql-test/suite/innodb/t/innodb-index.test:
  Include file from proper location.
mysql-test/suite/innodb/t/innodb-index_ucs2.test:
  Include file from proper location.
mysql-test/suite/innodb/t/innodb_bug36169.test:
  Cleanup variables before returning.
mysql-test/suite/innodb/t/innodb_bug36172.test:
  Cleanup variables before returning.
2009-06-11 17:57:44 +05:00
unknown
93bcda598b Merge latest XtraDB from lp:percona-xtradb into MariaDB.
include/my_sys.h:
  Move generic file parsing functions out to shared code, as they are used in several places.
mysys/mf_iocache2.c:
  Move generic file parsing functions out to shared code, as they are used in several places.
sql/log_event.cc:
  Fix XtraDB build with embedded server.
  XtraDB needs access to replication stuff, which is missing in embedded server.
  Solved by defining wrapper function for this which is compiled differently for normal and
  embedded case.
sql/log_event.h:
  Fix XtraDB build with embedded server.
  XtraDB needs access to replication stuff, which is missing in embedded server.
  Solved by defining wrapper function for this which is compiled differently for normal and
  embedded case.
sql/slave.cc:
  Move generic file parsing functions out to shared code, as they are used in several places.
2009-06-11 14:53:26 +02:00
Satya B
ad9bbfe5f6 Remove the following tests and include files as they are already in
the mysql test suite.

Tests removed:
1. innodb_trx_weight.test
2. innodb_bug35220.test

Include files removed:
1. have_innodb.inc
2. ctype_innodb_like.inc
3. innodb_trx_weight.inc

Also add the missing opt file for the test innodb-use-sys-malloc.test
2009-06-11 16:50:53 +05:30
Satya B
098679e8f8 Add innodb plugin tests to a new mysql test suite 'innodb'.
Created a test suite 'innodb' under mysql-test/suite/innodb for the innodb plugin tests.
test suite 'innodb' has tests only which are not under any other mysql-test suites.

Total 14 testcases are added to the test suite.

Note: the patches in storage/innodb_plugin/mysql-test/patches are not applied yet
2009-06-10 19:21:20 +05:30
Martin Hansson
f2448c93d6 Bug#44821: select distinct on partitioned table returns wrong results
Range analysis did not request sorted output from the storage engine,
which cause partitioned handlers to process one partition at a time
while reading key prefixes in ascending order, causing values to be 
missed. Fixed by always requesting sorted order during range analysis.
This fix is introduced in 6.0 by the fix for bug no 41136.

mysql-test/r/group_min_max.result:
  Bug#44821: Test result.
mysql-test/t/group_min_max.test:
  Bug#44821: Test case
sql/opt_range.cc:
  Bug#44821: Fix.
2009-06-10 11:56:00 +02:00
Vladislav Vaintroub
768bbae90e Backport WL#3653 to 5.1 to enable bundled innodb plugin.
Remove custom DLL loader code from innodb plugin code, use 
symbols exported from mysqld.


storage/innodb_plugin/handler/ha_innodb.cc:
  Remove a Win32 workaround for current_thd.
  The original  problem that innodb plugin used
  value of TLS variable across DLL boundaries is 
  solved in MySQL server (current_thd is a function
  not TLS variable now)
storage/innodb_plugin/handler/handler0alter.cc:
  Remove custom delay loader
storage/innodb_plugin/handler/handler0vars.h:
  Remove custom delay loader
storage/innodb_plugin/handler/i_s.cc:
  Remove custom delay loader
storage/innodb_plugin/handler/win_delay_loader.cc:
  Remove custom delay loader
storage/innodb_plugin/plug.in:
  Remove commented out MYSQL_PLUGIN_STATIC, 
  CMake would not parse that correctly
2009-06-10 10:59:49 +02:00
Philip Stoev
d98dee2c3b Bug #29971 status.test fails
This test uses SHOW STATUS and the like, which may be unstable in the face
of logging to table, since the CSV handler is actively executing operations
and thus incrementing the counters.

Fixed by disabling logging to table for the duration of the test and restoring
it afterwards. This causes various counters to properly start counting from zero
and never advance due to CSV operations.
2009-06-10 11:58:36 +03:00
Alexey Kopytov
897a1b56d8 Bug #45236: large blob inserts from mysqldump fail, possible
memory issue ? 
 
The mysql command line client could misinterpret some character 
sequences as commands under some circumstances. 
 
The upper limit for internal readline buffer was raised to 1 GB 
(the same as for server's max_allowed_packet) so that any input 
line is processed by add_line() as a whole rather than in 
chunks.

client/mysql.cc:
  The upper limit for internal readline buffer was raised to 1 GB 
  (the same as for server's max_allowed_packet) so that any input 
  line is processed by add_line() as a whole rather than in 
  chunks.
mysql-test/r/mysql-bug45236.result:
  Added a test case for bug #45236.
mysql-test/t/mysql-bug45236.test:
  Added a test case for bug #45236.
2009-06-10 11:24:47 +04:00
Davi Arnaut
403b08342d Define MASTER_MYSOCK for ndb tests.
Needed for substitution in some tests.

mysql-test/suite/funcs_1/t/ndb_storedproc_06.tes:
  Remove unused file.
mysql-test/suite/funcs_1/t/ndb_storedproc_08.tes:
  Remove unused file.
mysql-test/suite/ndb/my.cnf:
  Export the socket path.
2009-06-09 19:32:32 -03:00
Sergey Petrunia
fd485ad988 MWL#17: Table elimination
- Make elimination work with aggregate functions. The problem was that aggregate functions 
  reported all table bits in used_tables(), and that prevented table elimination. Fixed by 
  making aggregate functions return more correct value from used_tables(). 

mysql-test/r/ps_11bugs.result:
  MWL#17: Table elimination
  - Update test results. The difference is because of Item_ref change: outer references to constants
    are now recognized as constants, too.
mysql-test/r/subselect.result:
  - Update test results. The difference is because of Item_ref change: outer references to constants
    are now recognized as constants, too.
mysql-test/r/table_elim.result:
  MWL#17: Table elimination
  - Check that elimination works in presense of aggreagate functions
mysql-test/t/table_elim.test:
  MWL#17: Table elimination
  - Check that elimination works in presense of aggreagate functions
sql/item.h:
  MWL#17: Table elimination
  - Add Item_ref::const_item() which calls (*ref)->const_item(). Before this diff Item_ref used the 
    default implementation of const_item(){ return used_tables()==0; }. This is no longer true, as 
    COUNT(*) now has used_tables()==0 but const_item()==FALSE.
sql/item_sum.cc:
  MWL#17: Table elimination
  - Make Item_sum() and it descendants not to return all bits in used_tables(). This is needed 
    because otherwise table elimination can't work in presense of aggregate functions
  - COUNT(*) now has used_tables()==0 and const_item()==FALSE. Had to change 
    Item_ref::const_item() to account for this.
sql/item_sum.h:
  MWL#17: Table elimination
  - Add comments
2009-06-10 01:11:33 +04:00
Matthias Leich
279998d817 Merge of latest changes into GCA tree, no conflicts 2009-06-09 21:05:31 +02:00
Davi Arnaut
cb26bb932c Remove assignments of the $MASTER_MYSOCK variable.
This variable is defined by default and one should not do it
directly as the socket variable is not available on Windows.
2009-06-09 13:09:16 -03:00
unknown
bb9a3f0c2b XtraDB after-merge fixes.
Fixes to get the test suite to run without failures.

mysql-test/r/information_schema.result:
  Additional variables available now.
  Sort output to avoid depending on engine order.
mysql-test/r/information_schema_all_engines.result:
  More variables now.
mysql-test/r/innodb-autoinc.result:
  Avoid picking up pbxt variables in result
mysql-test/r/innodb-index.result:
  Save state to not corrupt following testcases.
  Suppress an expected warning.
mysql-test/r/innodb-zip.result:
  Work around a problem with dependency on zlib version
mysql-test/r/innodb.result:
  Checksums have changed in Maria.
  Save and restore server state to not corrupt following testcases.
mysql-test/r/innodb_bug36169.result:
  Save and restore server state to not corrupt following testcases.
mysql-test/r/innodb_xtradb_bug317074.result:
  Save and restore server state to not corrupt following testcases.
mysql-test/r/row-checksum-old.result:
  Update result file
mysql-test/r/row-checksum.result:
  Update result file
mysql-test/t/information_schema.test:
  Sort output to avoid depending on engine order.
mysql-test/t/innodb-analyze.test:
  Save and restore server state to not corrupt following testcases.
mysql-test/t/innodb-autoinc.test:
  Save and restore server state to not corrupt following testcases.
mysql-test/t/innodb-index.test:
  Save state to not corrupt following testcases.
  Suppress an expected warning.
mysql-test/t/innodb-zip.test:
  Work around a problem with dependency on zlib version
mysql-test/t/innodb.test:
  Save and restore server state to not corrupt following testcases.
  Update --replace statements for new mysql-test-run
mysql-test/t/innodb_bug34300.test:
  Save and restore server state to not corrupt following testcases.
mysql-test/t/innodb_bug36169.test:
  Save and restore server state to not corrupt following testcases.
mysql-test/t/innodb_bug36172.test:
  Save and restore server state to not corrupt following testcases.
mysql-test/t/innodb_xtradb_bug317074.test:
  Save and restore server state to not corrupt following testcases.
mysql-test/t/partition_innodb.test:
  Fix regexps to work with new SHOW INNODB STATUS output.
mysys/thr_mutex.c:
  Initialize mutex deadlock detection lazily.
  This allows to test XtraDB, which initializes huge amounts of mutexes without using any but a few of them.
storage/xtradb/ibuf/ibuf0ibuf.c:
  Fix problem where value of INNODB_IBUF_MAX_SIZE would depend on the alignment of memory
  allocated by the buffer pool.
storage/xtradb/include/sync0rw.h:
  Fix XtraDB to compile without GCC atomic operation intrinsics (performance may suffer
  when they are not available though).
storage/xtradb/include/sync0rw.ic:
  Fix XtraDB to compile without GCC atomic operation intrinsics (performance may suffer
  when they are not available though).
storage/xtradb/include/univ.i:
  Fix for MariaDB
storage/xtradb/setup.sh:
  Remove no longer needed file from XtraDB.
storage/xtradb/srv/srv0start.c:
  Fix for MariaDB
2009-06-09 17:08:46 +02:00
Matthias Leich
25c7fb7a50 Merge of fix for bug 44949 into GCA tree, no conflicts 2009-06-09 17:01:11 +02:00
Davi Arnaut
e66c574df9 Don't run funcs_1/myisam_views test case under valgrind, unless
the --big-test flag is supplied. Test is too resource intensive
under normal valgrind runs (takes more than 30min on powerful
hardware).

mysql-test/include/no_valgrind_without_big.inc:
  Add MTR prerequisite file by Matthias Leich.
mysql-test/suite/funcs_1/t/myisam_views.test:
  Test is too resource intensive under "Valgrind".
2009-06-09 11:36:14 -03:00
unknown
a03c9ff55f XtraDB after-merge fixes.
The original XtraDB (and InnoDB plugin) is shipped as a separate source tree which is copied
into the MySQL source, after which a setup.sh script must be run to move things into place.

Now that XtraDB is part of the MariaDB source tree, this commit fixes these things up once
and for all:

 - New innodb build scripts.
 - Test suite fixes (new tests and patches to existing).
 - Remove files no longer needed due to this.
2009-06-09 15:19:13 +02:00
Davi Arnaut
9d8c191e9c Tag count_distinct3.test as a big test.
mysql-test/t/count_distinct3.test:
  Test is resource intensive.
2009-06-08 20:03:01 -03:00
Davi Arnaut
8ad4596150 Test is very resource intensive under debug and valgrind runs.
Under a debug run, the trace file grows to a few gigabytes.
Under valgrind, takes more then 20 minutes due to the high
number of insert statements.

mysql-test/t/multi_update2.test:
  Skip under --valgrind and --debug.
2009-06-08 19:18:31 -03:00
Davi Arnaut
a7c2707740 Test is very resource intensive under debug and valgrind runs.
Under a debug run, the trace file grows to a few gigabytes.
Under valgrind, takes more then 20 minutes due to the high
number of insert statements.

mysql-test/t/multi_update2.test:
  Skip under --valgrind and --debug.
2009-06-08 12:51:06 -03:00
Davi Arnaut
55eee5208c Merge from 5.1 main. 2009-06-08 09:55:37 -03:00
Luis Soares
1b1ca7fe38 BUG#42941: --database paramater to mysqlbinlog fails with RBR
mysqlbinlog --database parameter was being ignored when processing
row events. As such no event filtering would take place.
            
This patch addresses this by deploying a call to shall_skip_database
when table_map_events are handled (as these contain also the name of
the database). All other rows events referencing the table id for the
filtered map event, will also be skipped.

client/mysqlbinlog.cc:
  Added shall_skip_database call to the part of the code that handles 
  Table_map_log_events. It inspects the database name and decides whether
  to filter the event or not. Furthermore, if table map event is filtered
  next events referencing the table id in the table map event, will also
  be filtered.
mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test:
  Test case that checks if row events are actually filtered out.
sql/log_event.h:
  Added a map for holding the currently ignored table map events.
  Table map events are inserted when they shall be skipped and removed
  once the last row event in the statement is processed.
2009-06-07 23:28:08 +01:00
Gleb Shchepa
ed7f0f3023 Bug #44886: SIGSEGV in test_if_skip_sort_order() -
uninitialized variable used as subscript

Grouping select from a "constant" InnoDB table (a table
of a single row) joined with other tables caused a crash.


mysql-test/r/innodb_mysql.result:
  Added test case for bug bug #44886.
mysql-test/t/innodb_mysql.test:
  Added test case for bug bug #44886.
sql/sql_select.cc:
  Bug #44886: SIGSEGV in test_if_skip_sort_order() -
              uninitialized variable used as subscript
  
  1. The test_if_order_by_key function returned unitialized
     used_key_parts parameter in case of a "constant" InnoDB
     table. Calling function uses this parameter values as
     an array index, thus sometimes it caused a crash.
     The test_if_order_by_key function has been modified
     to set used_key_parts to 0 (no need for ordering).
  
  2. The test_if_skip_sort_order function has been
     modified to accept zero used_key_parts value and
     to prevent an array access by negative index.
2009-06-08 01:40:53 +05:00
Michael Widenius
1f81aa5f5a Added tests to cover more server code
Author: Stewart Smith

mysql-test/r/alter_table.result:
  Testing of ALTER TABLE .. DROP DEFAULT
mysql-test/r/limit.result:
  Testing of LIMIT ... OFFSET
mysql-test/t/alter_table.test:
  Testing of ALTER TABLE .. DROP DEFAULT
mysql-test/t/limit.test:
  Testing of LIMIT ... OFFSET
2009-06-07 13:05:19 +03:00
Davi Arnaut
12f91b1d8c Bug#44672: Assertion failed: thd->transaction.xid_state.xid.is_null()
The problem is that when a optimization of read-only transactions
(bypass 2-phase commit) was implemented, it removed the code that
reseted the XID once a transaction wasn't active anymore:

sql/sql_parse.cc:

-  bzero(&thd->transaction.stmt, sizeof(thd->transaction.stmt));
-  if (!thd->active_transaction())
-    thd->transaction.xid_state.xid.null();
+  thd->transaction.stmt.reset();

This mostly worked fine as the transaction commit and rollback
functions (in handler.cc) reset the XID once the transaction is
ended. But those functions wouldn't reset the XID in case of
a empty transaction, leading to a assertion when a new starting
a new XA transaction.

The solution is to ensure that the XID state is reset when empty
transactions are ended (by either commit or rollback). This is
achieved by reorganizing the code so that the transaction cleanup
routine is invoked whenever a transaction is ended.

mysql-test/r/xa.result:
  Add test case result for Bug#44672
mysql-test/t/xa.test:
  Add test case for Bug#44672
sql/handler.cc:
  Invoke transaction cleanup function whenever a transaction is
  ended. Move XID state reset logic to the transaction cleanup
  function.
sql/sql_class.h:
  Add XID state reset logic.
2009-06-05 19:16:54 -03:00
Michael Widenius
774ceff0c0 Fixed valgrind warnings on 64 bit x86 SuSE 11.1 2009-06-05 23:46:23 +03:00
Davi Arnaut
46a4685cdb The valgrind suppression file (valgrind.supp) must be added to
a binary distribution of the server as the MTR valgrind option
relies on it to silence unmeaningful warnings.

mysql-test/Makefile.am:
  Install valgrind.supp as part of the test suite.
  Remove reference to inexistent directory.
2009-06-05 13:55:09 -03:00
Michael Widenius
4c4480e937 Add include files required for --staging-run 2009-06-05 18:36:14 +03:00
Michael Widenius
3d831149f9 Added option --staging-run to mysql-test-run to mark slow, not important tests, to not be run in staging trees
Use MY_MUTEX_INIT_FAST for pool mutex

mysql-test/mysql-test-run.pl:
  Added option --staging-run
  Added information about --parallell=# to help message
mysql-test/suite/federated/federated_server.test:
  Slow test, don't run with --staging-run
mysql-test/suite/maria/t/maria-preload.test:
  Slow test, don't run with --staging-run
mysql-test/suite/rpl/t/rpl_optimize.test:
  Slow test, don't run with --staging-run
mysql-test/suite/rpl/t/rpl_relayrotate.test:
  Slow test, don't run with --staging-run
mysql-test/suite/rpl/t/rpl_row_001.test:
  Slow test, don't run with --staging-run
mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test:
  Slow test, don't run with --staging-run
mysql-test/suite/rpl/t/rpl_row_sp003.test:
  Slow test, don't run with --staging-run
mysql-test/suite/rpl/t/rpl_start_stop_slave.test:
  Slow test, don't run with --staging-run
mysql-test/t/compress.test:
  Slow test, don't run with --staging-run
mysql-test/t/count_distinct3.test:
  Slow test, don't run with --staging-run
mysql-test/t/index_merge_innodb.test:
  Slow test, don't run with --staging-run
mysql-test/t/information_schema_all_engines.test:
  Slow test, don't run with --staging-run
mysql-test/t/innodb_mysql.test:
  Slow test, don't run with --staging-run
mysql-test/t/pool_of_threads.test:
  Slow test, don't run with --staging-run
mysql-test/t/preload.test:
  Slow test, don't run with --staging-run
mysql-test/t/ssl.test:
  Slow test, don't run with --staging-run
mysql-test/t/ssl_compress.test:
  Slow test, don't run with --staging-run
mysql-test/valgrind.supp:
  Suppress warnings from SuSE 11.1 on x86
sql/scheduler.cc:
  Use MY_MUTEX_INIT_FAST for pool mutex
2009-06-05 18:35:22 +03:00
Bernt M. Johnsen
6199226f94 Bug#15866 Split of main.sp and main.sp-fib. Merged from 5.0 gca 2009-06-04 16:13:16 +02:00
Bernt M. Johnsen
dee1bbaa5c Bug#15866 Split of main.sp and main.sp-fib. Merged from 5.1 gca 2009-06-04 16:10:18 +02:00
Bernt M. Johnsen
caa703b1e3 Bug#15866 ported from 5.0-gca 2009-06-04 13:53:15 +02:00
Bernt M. Johnsen
a3ac1f7e78 Bug#15866 main.sp-fib split from main.sp 2009-06-04 13:38:53 +02:00
Georgi Kodinov
8c18db4c8e merged 36995 to 5.1-bugteam 2009-06-04 13:26:18 +03:00
Georgi Kodinov
a037071a75 Bug #36995: valgrind error in remove_const during subquery executions
When copying the Item class one must copy its attributes as well.

mysql-test/r/innodb_mysql.result:
  Bug #36995: test case
mysql-test/t/innodb_mysql.test:
  Bug #36995: test case
sql/item.cc:
  Bug #36995: copy attributes in the copy constructor
2009-06-04 12:52:40 +03:00
Alexander Barkov
d7bfc76dec Bug#43827 Server closes connections and restarts
Problem:
  Crash happened with a user-defined utf8 collation,
  on attempt to insert a value longer than the column
  to store.
Reason:
  The "ctype" member was not initialized (NULL) when
  allocating a user-defined utf8 collation, so an attempt
  to call my_ctype(cs, *str) to check if we loose any important
  data when truncating the value made the server crash.
Fix:
  Initializing tge "ctype" member to a proper value.


mysql-test/r/ctype_ldml.result
  Adding tests

mysql-test/t/ctype_ldml.test
  Adding tests

strings/ctype-uca.c
  Adding initialization of "ctype" member.

modified:
  mysql-test/r/ctype_ldml.result
  mysql-test/t/ctype_ldml.test
  strings/ctype-uca.c
2009-06-04 14:35:29 +05:00
Sergey Glukhov
5fb8b93e98 5.0-bugteam->5.1-bugteam merge 2009-06-04 10:54:23 +05:00
Sergey Glukhov
8041311e24 Bug#44798 MySQL engine crashes when creating stored procedures with execute_priv=N
The crash happens because of uninitialized
lex->ssl_cipher, lex->x509_subject, lex->x509_issuer variables.
The fix is to add initialization of these variables for
stored procedures&functions.


mysql-test/r/sp_notembedded.result:
  test result
mysql-test/t/sp_notembedded.test:
  test case
sql/sql_acl.cc:
  The crash happens because of uninitialized
  lex->ssl_cipher, lex->x509_subject, lex->x509_issuer variables.
  The fix is to add initialization of these variables for
  stored procedures&functions.
2009-06-04 10:28:45 +05:00
Sergey Petrunia
680107f107 Merge MWL#17 with maria/5.1 2009-06-03 22:23:30 +04:00
Luis Soares
11f1ab1069 BUG#44270: RESET SLAVE does not reset Last_IO_Error or Last_IO_Errno
The server was not cleaning the last IO error and error number when
resetting slave.

This patch addresses this issue by backporting into 5.1 part of the
patch in BUG 34654. A fix for this issue had already been pushed into
6.0 as part of the aforementioned bug, however the patch also included
some refactoring. The fix for 5.1 does not take into account the
refactoring part.

mysql-test/extra/rpl_tests/rpl_reset_slave.test:
  Backported the test case and improved with deploying include/start_slave.inc
  in relevant spots.
sql/slave.cc:
  Backported part of patch from 6.0 that includes cleaning 
  mi->clear_error() at:
    1. beginning of handle_slave_io
    2. on successful connection
  
  Also, backported the assertion added in the original patch.
sql/sql_repl.cc:
  Backported the call to mi->clear_error() on reset_slave().
2009-06-03 15:14:18 +01:00
Sergey Petrunia
275a4b354b MWL#17: Table elimination
- First code. Elimination works for simple cases, passes the testsuite.
- Known issues:
  = No elimination is done for aggregate functions.
  = EXPLAIN EXTENDED shows eliminated tables (I think it better not)
  = No benchmark yet
  = The code needs some polishing.

mysql-test/r/table_elim.result:
  MWL#17: Table elimination
  - Testcases
mysql-test/t/table_elim.test:
  MWL#17: Table elimination
  - Testcases
sql/sql_select.cc:
  MWL#17: Table elimination
sql/sql_select.h:
  MWL#17: Table elimination
  - Added JOIN_TAB::eliminated (is JOIN_TAB the best place to store this flag?)
sql/table.h:
  MWL#17: Table elimination
  - ADded NESTED_JOIN::n_tables. We need to have the number of real tables remaining in an outer join nest.
2009-06-03 17:10:45 +04:00
Bjorn Munch
92773bfc11 Bug #45256 Enable 'auto' for mtr --parallel
Let the user specify 'auto' for parallel value
Also set --parallel=auto in default.push so we can get this tested.
2009-06-03 12:46:04 +02:00
Michael Widenius
67eb7eeeea Fix for bug 39200.
mysql-test/suite/maria/r/maria3.result:
  Merged fix from bug #39200.
mysql-test/suite/maria/t/maria3.test:
  Merged maria3.test
sql/sql_table.cc:
  Bug fix for 39200
2009-06-02 12:58:27 +03:00
Satya B
ac8e02d55f merge to 5.1-bugteam 2009-06-02 14:10:21 +05:30
Satya B
8bd3383fd6 merge to 5.1-bugteam tree 2009-06-02 13:44:41 +05:30
Bjorn Munch
ad365a5c07 Bug #45190 mtr should report some statistics even if aborting after too many tests fail
Added calls to mtr_report_stats() also after timeout or too many failures
2009-06-02 10:00:45 +02:00
Sergey Glukhov
86e425fe11 5.0-bugteam->5.1-bugteam merge 2009-06-02 12:00:37 +05:00
Sergey Glukhov
33734e956f Bug#45152 crash with round() function on longtext column in a derived table
The crash happens due to wrong max_length value which is set on
Item_func_round::fix_length_and_dec() stage. The value is set to
args[0]->max_length which is too big in case of LONGTEXT(LONGBLOB) fields.
The fix is to set max_length using float_length() function.



mysql-test/r/func_math.result:
  test result
mysql-test/t/func_math.test:
  test case
sql/item_func.cc:
  The crash happens due to wrong max_length value which is set on
  Item_func_round::fix_length_and_dec() stage. The value is set to
  args[0]->max_length which is too big in case of LONGTEXT(LONGBLOB) fields.
  The fix is to set max_length using float_length() function.
2009-06-02 11:38:13 +05:00
Alexey Kopytov
aef45b47a0 Automerge. 2009-06-01 16:43:16 +04:00
Alexey Kopytov
47b334a642 Automerge. 2009-06-01 16:42:24 +04:00
Alexey Kopytov
7561bc9212 Manual merge. 2009-06-01 16:00:38 +04:00
He Zhenxing
83a11b78df post fix of test result 2009-05-31 20:10:59 +08:00
He Zhenxing
e1fb88f2cc Merge BUG#43263 from 5.0-bugteam to 5.1-bugteam 2009-05-31 13:44:41 +08:00
He Zhenxing
5dd1abae7d BUG#43263 BEGIN skipped in some replicate-do-db cases
BEGIN/COMMIT/ROLLBACK was subject to replication db rules, and
caused the boundary of a transaction not recognized correctly 
when these queries were ignored by the rules.

Fixed the problem by skipping replication db rules for these
statements.


sql/log_event.cc:
  Skip checking replication db rules for BEGIN/COMMIT/ROLLBACK statements
2009-05-31 11:26:58 +08:00
Tatiana A. Nurnberg
88e84c1fbf auto-merge 2009-05-29 18:49:35 +02:00
Kristofer Pettersson
b34227cee6 Automerge 2009-05-29 16:25:22 +02:00
Kristofer Pettersson
66e0ee6639 Bug#44658 Create procedure makes server crash when user does not have ALL privilege
MySQL crashes if a user without proper privileges attempts to create a procedure.

The crash happens because more than one error state is pushed onto the Diagnostic
area. In this particular case the user is denied to implicitly create a new user
account with the implicitly granted privileges ALTER- and EXECUTE ROUTINE.

The new account is needed if the original user account contained a host mask.
A user account with a host mask is a distinct user account in this context.
An alternative would be to first get the most permissive user account which
include the current user connection and then assign privileges to that
account. This behavior change is considered out of scope for this bug patch.

The implicit assignment of privileges when a user creates a stored routine is a
considered to be a feature for user convenience and as such it is not
a critical operation. Any failure to complete this operation is thus considered
non-fatal (an error becomes a warning).

The patch back ports a stack implementation of the internal error handler interface.
This enables the use of multiple error handlers so that it is possible to intercept
and cancel errors thrown by lower layers. This is needed as a error handler already
is used in the call stack emitting the errors which needs to be converted.


mysql-test/r/grant.result:
  * Added test case for bug44658
mysql-test/t/grant.test:
  * Added test case for bug44658
sql/sp.cc:
  * Removed non functional parameter no_error and my_error calls as all errors
    from this function will be converted to a warning anyway.
  * Change function return type from int to bool.
sql/sp.h:
  * Removed non functional parameter no_error and my_error calls as all errors
    from this function will be converted to a warning anyway.
  * Changed function return value from int to bool
sql/sql_acl.cc:
  * Removed the non functional no_error parameter from the function prototype.
    The function is called from two places and in one of the places we now 
    ignore errors through error handlers.
  * Introduced the parameter write_to_binlog
  * Introduced an error handler to cancel any error state from mysql_routine_grant.
  * Moved my_ok() signal from mysql_routine_grant to make it easier to avoid
    setting the wrong state in the Diagnostic area.
  * Changed the broken error state in sp_grant_privileges() to a warning
    so that if "CREATE PROCEDURE" fails because "Password hash isn't a hexidecimal
    number" it is still clear what happened.
sql/sql_acl.h:
  * Removed the non functional no_error parameter from the function prototype.
    The function is called from two places and in one of the places we now 
    ignore errors through error handlers.
  * Introduced the parameter write_to_binlog
  * Changed return type for sp_grant_privileges() from int to bool
sql/sql_class.cc:
  * Back ported implementation of internal error handler from 6.0 branch
sql/sql_class.h:
  * Back ported implementation of internal error handler from 6.0 branch
sql/sql_parse.cc:
  * Moved my_ok() signal from mysql_routine_grant() to make it easier to avoid
    setting the wrong state in the Diagnostic area.
2009-05-29 15:37:54 +02:00
Bjorn Munch
cf6aeea48c merge from 5.1 main 2009-05-29 13:04:02 +02:00
Joerg Bruehe
f101f2b58b Merge main 5.0 into 5.0-build 2009-05-28 21:58:48 +02:00
Sergey Glukhov
b4a725c4f3 5.0-bugteam->5.1-bugteam merge 2009-05-28 16:21:41 +05:00
Sergey Glukhov
4cfc9d771a test case fix 2009-05-28 16:19:49 +05:00
Bjorn Munch
4404b6a915 Bug #43659 MTR2 should report worker data for tests when using --parallel > 1
Adding "w# " before the test result
Also enable --parallel=2 so this can be tested.
2009-05-28 13:02:03 +02:00
Sergey Glukhov
0aa26d39aa 5.0-bugteam->5.1-bugteam merge 2009-05-28 13:40:09 +05:00
Sergey Glukhov
1b91400ac6 Bug#37268 'binary' character set makes CLI-internal commands case sensitive
The fix is to use case insensitive collation
for mysql client command search.



client/mysql.cc:
  The fix is to use case insensitive collation
  for mysql client command search.
mysql-test/r/mysql.result:
  test result
mysql-test/t/mysql.test:
  test case
2009-05-28 13:34:30 +05:00
Bjorn Munch
444bbe56f5 cherry picking fix for Bug #39542 from 6.0-runtime 2009-05-27 22:54:40 +02:00
Georgi Kodinov
c675beab98 merged 5.0-bugteam to 5.1-bugteam 2009-05-27 18:19:44 +03:00
Tatiana A. Nurnberg
7f50fc02c2 Bug#34861: mysqldump with --tab gives weird output for triggers.
mysqldump --tab still dumped triggers to stdout rather than to
individual tables.

We now append triggers to the .sql file for the corresponding
table.

--events and --routines correspond to a database rather than a
table and will still go to stdout with --tab unless redirected
with --result-file (-r).

client/mysqldump.c:
  Extend open_sql_file_for_table() so we can open-append.
  Change dump_triggers_for_table() so it will append its
  output to the table's .sql-file when --tab is used.
mysql-test/r/mysqldump.result:
  Show that when using --tab, triggers now end up in the .sql
  file with the corresponding table (after that table), while
  --routines and --events go to stdout or --result-file.
mysql-test/t/mysqldump.test:
  Show that when using --tab, triggers now end up in the .sql
  file with the corresponding table (after that table), while
  --routines and --events go to stdout or --result-file.
2009-05-27 15:16:21 +02:00
Georgi Kodinov
80730df7d6 Bug #38159: Function parsing problem generates misleading error message
Added a more detailed error message on calling an ambiguous missing function.

mysql-test/r/ps.result:
  Bug #38159: fixed existing tests
mysql-test/r/sp-error.result:
  Bug #38159: test case
mysql-test/t/ps.test:
  Bug #38159: fixed existing tests
mysql-test/t/sp-error.test:
  Bug #38159: test case
sql/item_func.cc:
  Bug #38159: generate more detailed error message
sql/share/errmsg.txt:
  Bug #38159: add a more detailed error message
sql/sql_derived.cc:
  Bug #38159: treat the detailed error message the same way as the
  generic one
sql/sql_lex.cc:
  Bug #38159: 
    - detect if the token is ambiguous and print the appropriate error.
    - backport is_lex_native_function() from 5.1
sql/sql_lex.h:
  Bug #38159: detect if the token is ambiguous and print the appropriate error.
sql/sql_yacc.yy:
  Bug #38159: generate more detailed error message
sql/table.cc:
  Bug #38159: treat the detailed error message the same way as the
  generic one
2009-05-27 16:05:29 +03:00
Alexey Kopytov
1b8322c3c6 Bug #44767: invalid memory reads in password() and
old_password() functions   
The PASSWORD() and OLD_PASSWORD() functions could lead to   
memory reads outside of an internal buffer when used with BLOB   
arguments.   
  
String::c_ptr() assumes there is at least one extra byte  
in the internally allocated buffer when adding the trailing  
'\0'.  This, however, may not be the case when a String object  
was initialized with externally allocated buffer.  
  
The bug was fixed by adding an additional "length" argument to  
make_scrambled_password_323() and make_scrambled_password() in  
order to avoid String::c_ptr() calls for  
PASSWORD()/OLD_PASSWORD().  
  
However, since the make_scrambled_password[_323] functions are  
a part of the client library ABI, the functions with the new  
interfaces were implemented with the 'my_' prefix in their  
names, with the old functions changed to be wrappers around  
the new ones to maintain interface compatibility.  

mysql-test/r/func_crypt.result:
  Added a test case for bug #44767.
mysql-test/t/func_crypt.test:
  Added a test case for bug #44767.
sql/item_strfunc.cc:
  Use the new my_make_scrambled_password*() to avoid 
  String::c_ptr().
sql/item_strfunc.h:
  Changed Item_func[_old]_password::alloc() interfaces so that
  we can use the new my_make_scrambled_password*() functions.
sql/mysql_priv.h:
  Added declarations for the new my_make_scrambled_password*() 
  functions.
sql/password.c:
  Added new my_make_scrambled_password*() functions with an
  additional "length" argument. Changed ones to be wrappers
  around the new ones to maintain interface compatibility.
sql/sql_yacc.yy:
  Utilize the new password hashing functions with additional length
  argument.
2009-05-27 14:20:57 +04:00
Bjorn Munch
f7a645c9cc Bug #45120 Fix of 44922 caused regression in funcs_1.processlist_priv_no_prot
Protected '' in connect command with ""
2009-05-27 10:54:59 +02:00
Bjorn Munch
d7d3c56aee merge from 5.1-mtr 2009-05-25 22:58:31 +02:00
Bjorn Munch
b12bb225d1 Bug #44922 mysqltest's query_get_value function can't work with queries containing ','
check_command_args() always looks for the first , (or whatever)
Extended check_command_args() to let arguments be quoted
Added test in mysqltest.test
2009-05-25 17:19:20 +02:00
Davi Arnaut
7c4eb8c0d1 Bug#42158: leak: SSL_get_peer_certificate() doesn't have matching X509_free()
The problem is that the server failed to follow the rule that
every X509 object retrieved using SSL_get_peer_certificate()
must be explicitly freed by X509_free(). This caused a memory
leak for builds linked against OpenSSL where the X509 object
is reference counted -- improper counting will prevent the
object from being destroyed once the session containing the
peer certificate is freed.

The solution is to explicitly free every X509 object used.

mysql-test/r/openssl_1.result:
  Add test case result for Bug#42158
mysql-test/t/openssl_1.test:
  Add test case for Bug#42158
sql/sql_acl.cc:
  Deallocate X509 objects.
2009-05-25 10:00:18 -03:00
Georgi Kodinov
7348140465 Bug #44399 : crash with statement using TEXT columns, aggregates, GROUP BY, and
HAVING
            
When calculating GROUP BY the server caches some expressions. It does
that by allocating a string slot (Item_copy_string) and assigning the 
value of the expression to it. This effectively means that the result
type of the expression can be changed from whatever it was to a string.
As this substitution takes place after the compile-time result type 
calculation for IN but before the run-time type calculations, 
it causes the type calculations in the IN function done at run time 
to get unexpected results different from what was prepared at compile time.
                  
In the CASE ... WHEN ... THEN ... statement there was a similar problem
and it was solved by artificially adding a STRING argument to the set of 
types of the IN/CASE arguments at compile time, so if any of the 
arguments of the CASE function changes its type to a string it will 
still be covered by the information prepared at compile time.

mysql-test/include/mix1.inc:
  Bug #44399: extended the test to cover the different types
mysql-test/r/func_in.result:
  Bug #44399: test case
mysql-test/r/innodb_mysql.result:
  Bug #44399: extended the test to cover the different types
mysql-test/t/func_in.test:
  Bug #44399: test case
sql/item.cc:
  Bug #44399: Implement typed caching for GROUP BY
sql/item.h:
  Bug #44399: Implement typed caching for GROUP BY
sql/item_cmpfunc.cc:
  Bug #44399: remove the special case
sql/sql_select.cc:
  Bug #44399: Implement typed caching for GROUP BY
2009-05-25 11:00:40 +03:00
Luis Soares
c8c688daa8 BUG#41725: upmerge: 5.0-bt --> 5.1-bt 2009-05-23 00:29:41 +01:00
Luis Soares
8e589d1d06 BUG#41725: slave crashes when inserting into temporary table after
stop/start slave
      
When stopping and restarting the slave while it is replicating
temporary tables, the server would crash or raise an assertion
failure. This was due to the fact that although temporary tables are
saved between slave threads restart, the reference to the thread in
use (table->in_use) was not being properly updated when the restart
happened (it would still reference the old/invalid thread instead of
the new one).
      
This patch addresses this issue by resetting the reference to the new
slave thread on slave thread restart.

mysql-test/r/rpl_temporary.result:
  Result file.
mysql-test/t/rpl_temporary.test:
  Test case that checks that both failures go away.
sql/slave.cc:
  Changed slave.cc to reset sql_thd reference in temporary tables.
2009-05-23 00:15:21 +01:00
unknown
d7ae55e704 Fix ps_not_windows test for -all-static build which cannot load plugins. 2009-05-22 19:53:25 +02:00
Patrick Crews
a41d2dafa0 merge 2009-05-22 11:38:52 -04:00
Patrick Crews
2c5e79bbe4 merge 5.0-> 5.1 2009-05-22 11:24:45 -04:00
Patrick Crews
e42f28192d Bug#40465 - mysqldump.test does no checking of dump or restore
Created new .test file - mysqldump_restore that does test restore from mysqldump
output for a limited number of basic cases.
Create new .inc file - mysqldump.inc - renames original table and uses mysqldump
output to recreate the table, then uses diff_tables.inc to compare the two tables.
Backported include/diff_tables.inc to facilitate this testing.
New patch incorporating review feedback prior to push.

mysqldump.test - removed redundant call to include/have_log_bin.inc (was used twice in the test!)
2009-05-22 10:38:17 -04:00
unknown
48083d73d3 After-merge fixes for problems seen in buildbot after merging MySQL-5.1.35.
- Version number.
 - Valgrind false alarms in libz.
 - New variant of suppression for Valgrind warning in dlclose().
 - Fix double free() in plugin init error case.

configure.in:
  Fix version number. We should reset the maria variant back to `1' when the MySQL version
  number increases.
include/my_sys.h:
  Fix false alarms in Valgrind for zlib.
  
  Apply same fix as for archive storage handler also to the cases of compression in the
  client protocol, and to the compression SQL function.
mysql-test/valgrind.supp:
  A new variant of the dlclose() suppression is needed now.
mysys/my_compress.c:
  Fix false alarms in Valgrind for zlib.
  
  Apply same fix as for archive storage handler also to the cases of compression in the
  client protocol, and to the compression SQL function.
sql/handler.cc:
  Fix a double free() in error case for plugin initialisation.
sql/item_strfunc.cc:
  Fix false alarms in Valgrind for zlib.
  
  Apply same fix as for archive storage handler also to the cases of compression in the
  client protocol, and to the compression SQL function.
2009-05-22 14:38:50 +02:00
Gleb Shchepa
8354ce0771 Bug #42778: delete order by null global variable causes
assertion .\filesort.cc, line 797

Minor fix to test case (embedded server failure).
2009-05-22 11:44:11 +05:00
Gleb Shchepa
06142cd545 Bug #42778: delete order by null global variable causes
assertion .\filesort.cc, line 797

A query with the "ORDER BY @@some_system_variable" clause,
where @@some_system_variable is NULL, causes assertion
failure in the filesort procedures.

The reason of the failure is in the value of
Item_func_get_system_var::maybe_null: it was unconditionally
set to false even if the value of a variable was NULL.


mysql-test/r/variables.result:
  Added test case for bug #42778.
mysql-test/suite/sys_vars/r/innodb_data_home_dir_basic.result:
  Updated test case for bug #42778:
  system variables were NOT NULL, now they are nullable.
mysql-test/suite/sys_vars/r/innodb_flush_method_basic.result:
  Updated test case for bug #42778:
  system variables were NOT NULL, now they are nullable.
mysql-test/suite/sys_vars/r/rpl_init_slave_func.result:
  Updated test case for bug #42778:
  system variables were NOT NULL, now they are nullable.
mysql-test/suite/sys_vars/r/ssl_capath_basic.result:
  Updated test case for bug #42778:
  system variables were NOT NULL, now they are nullable.
mysql-test/suite/sys_vars/r/ssl_cipher_basic.result:
  Updated test case for bug #42778:
  system variables were NOT NULL, now they are nullable.
mysql-test/suite/sys_vars/t/innodb_data_home_dir_basic.test:
  Updated test case for bug #42778:
  system variables were NOT NULL, now they are nullable.
mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test:
  Updated test case for bug #42778:
  system variables were NOT NULL, now they are nullable.
mysql-test/suite/sys_vars/t/ssl_capath_basic.test:
  Updated test case for bug #42778:
  system variables were NOT NULL, now they are nullable.
mysql-test/suite/sys_vars/t/ssl_cipher_basic.test:
  Updated test case for bug #42778:
  system variables were NOT NULL, now they are nullable.
mysql-test/t/variables.test:
  Added test case for bug #42778.
sql/item.cc:
  Bug #42778: delete order by null global variable causes
              assertion .\filesort.cc, line 797
  
  The longlong_from_string_with_check function has been modified
  to skip unwanted warnings: now it uses the THD::no_errors
  flag to suppress warnings.
  The Item_func_get_system_var::update_null_value method
  sets the no_error flag.
sql/item_func.cc:
  Bug #42778: delete order by null global variable causes
              assertion .\filesort.cc, line 797
  
  1. The Item_func_get_system_var::fix_length_and_dec method
     has been modified to make system variables truly nullable.
  
  2. The Item_func_get_system_var::update_null_value method
     method has been overloaded with a simple wrapper (like
     Item_field::update_null_value) to suppress unwanted warnings
     from Item_func_get_system_var::val_int() calls on non-numeric
     variable values: the Item_func_get_system_var::update_null_value
     method sets and restores THD::no_errors flag for a nested
     call of the longlong_from_string_with_check function.
sql/item_func.h:
  Bug #42778: delete order by null global variable causes
              assertion .\filesort.cc, line 797
  
  The Item_func_get_system_var::update_null_value method
  method has been overloaded.
2009-05-22 01:22:46 +05:00
Patrick Crews
2a47699cad Bug#40465: mysqldump.test does no checking of dump or restore.
Created new .test file - mysqldump_restore that does this for a limited number
of basic cases.
Created new .inc file - mysqldump.inc - renames original table and uses mysqldump
output to recreate the table, then uses diff_tables.inc to compare the two tables.
Backported include/diff_tables.inc to facilitate this testing.
2009-05-21 16:03:53 -04:00
Alexey Kopytov
42b3d8c74f Automerge. 2009-05-21 21:51:48 +04:00
Alexey Kopytov
645817dd56 Automerge. 2009-05-21 21:50:58 +04:00
Alexey Kopytov
82c878f913 Attempt #2 to fix PB failures introduced by the patch for bug #44796.
Since max_allowed_packet is a read-only variable in 5.1 and up,
disable warnings to avoid unnecessary test case complication.
2009-05-21 21:50:17 +04:00
Alexey Kopytov
2e644e2b5d Automerge. 2009-05-21 19:19:13 +04:00
Alexey Kopytov
9cf94dadeb Automerge. 2009-05-21 19:17:39 +04:00
Alexey Kopytov
2cd3eaf27d Fixed a PB failure introduced by the patch for bug #44796.
Set max_allowed_packet to get a consistent error message.
2009-05-21 19:14:56 +04:00
Alexey Kopytov
1bf8e86ab4 Automerge. 2009-05-21 16:16:17 +04:00
Alexey Kopytov
336028da76 Automerge. 2009-05-21 16:15:25 +04:00
Alexey Kopytov
958e896d8f Automerge. 2009-05-21 16:08:16 +04:00
Ramil Kalimullin
295afc7af4 Auto-merge. 2009-05-21 14:56:05 +05:00
Alfranio Correia
9ce928de59 auto-merge 5.1-bugteam (local) --> 5.1-bugteam 2009-05-21 09:36:38 +01:00
Ramil Kalimullin
985df4dcdc Fix for bug#44743: Join in combination with concat does not always work
bug#44766: valgrind error when using convert() in a subquery

Problem: input and output buffers may be the same 
converting a string to some charset. 
That may lead to wrong results/valgrind warnings.  

Fix: use different buffers.


mysql-test/r/cast.result:
  Fix for bug#44743: Join in combination with concat does not always work
          bug#44766: valgrind error when using convert() in a subquery
    - test result.
mysql-test/r/func_concat.result:
  Fix for bug#44743: Join in combination with concat does not always work
          bug#44766: valgrind error when using convert() in a subquery
    - test result.
mysql-test/t/cast.test:
  Fix for bug#44743: Join in combination with concat does not always work
          bug#44766: valgrind error when using convert() in a subquery
    - test case.
mysql-test/t/func_concat.test:
  Fix for bug#44743: Join in combination with concat does not always work
          bug#44766: valgrind error when using convert() in a subquery
    - test case.
sql/item.cc:
  Fix for bug#44743: Join in combination with concat does not always work
          bug#44766: valgrind error when using convert() in a subquery
    - comment added.
sql/item_strfunc.cc:
  Fix for bug#44743: Join in combination with concat does not always work
          bug#44766: valgrind error when using convert() in a subquery
    - '&args[0]->str_value' used as a parameter of args[0]->val_str(),
      as 'str' may be equal to 'str_value' which we use as the output buffer
      converting strings.
sql/sql_string.cc:
  Fix for bug#44743: Join in combination with concat does not always work
          bug#44766: valgrind error when using convert() in a subquery
    - input and output buffers must NOT be the same.
2009-05-21 13:06:43 +05:00
Jim Winstead
f0f4efd77e mysqlcheck failed to fix table names when using the --fix-table-names
and --all-in-1 options together. (Bug #31821)
2009-05-20 18:31:10 -07:00
Jim Winstead
1e9a02c943 The mysql command-line client would include superfluous spaces at the end of
some result set lines. (Bug #29622)
2009-05-20 17:04:44 -07:00
Matthias Leich
60955e54a2 Merge of latest modfications into GCA tree, no conflicts 2009-05-20 21:58:29 +02:00
Matthias Leich
e0010c3742 Merge fix for bug 42308 into GCA tree 2009-05-20 15:27:44 +02:00
He Zhenxing
0130162452 Auto merge 2009-05-20 21:26:43 +08:00
Bjorn Munch
20e09b39fc merge from main 2009-05-20 14:22:39 +02:00
Georgi Kodinov
54d36955b2 Revert of the fix for bug #44399 (joro@sun.com-20090512135917-kal1dvtqpqgnj3yc). 2009-05-20 14:14:33 +03:00
He Zhenxing
65d15fcd2a Post fix of result file after push of BUG#42415 2009-05-20 18:28:43 +08:00
Alexey Kopytov
0b62b7f26d Bug #44796: valgrind: too many my_longlong10_to_str_8bit
warnings after uncompressed_length 
 
UNCOMPRESSED_LENGTH() did not validate its argument. In 
particular, if the argument length was less than 4 bytes, 
an uninitialized memory value was returned as a result. 
 
Since the result of COMPRESS() is either an empty string or 
a 4-byte length prefix followed by compressed data, the bug was 
fixed by ensuring that the argument of UNCOMPRESSED_LENGTH() is 
either an empty string or contains at least 5 bytes (as done in 
UNCOMPRESS()). This is the best we can do to validate input 
without decompressing. 

mysql-test/r/func_compress.result:
  Added a test case for bug #44796.
mysql-test/t/func_compress.test:
  Added a test case for bug #44796.
sql/item_strfunc.cc:
  Make sure that the argument of UNCOMPRESSED_LENGTH() contains 
  at least 5 bytes (as done in UNCOMPRESS()).
2009-05-20 12:30:06 +04:00
Jim Winstead
1c9e45c3c4 Table identifiers and file names were not quoted and escaped correctly by
mysqlimport. (Bug #28071)
2009-05-19 15:26:57 -07:00
Matthias Leich
86a7766bda Fix for Bug#44949 funcs_1: Several tests for embedded server need maintenance
Detail:
The results for the "normal" server testcase variants
were already adjusted to the modified information_schema
content. Therefore just do the same for the embedded
server variants.
2009-05-19 18:43:50 +02:00
Michael Widenius
224108a19e Fixed problems in merge
mysql-test/r/information_schema.result:
  Fixed a result file.
mysql-test/r/innodb-autoinc.result:
  Fixed a result file.
mysql-test/t/connect.test:
  Fixed a problem with merge, needed to close
  connections and use the default
2009-05-19 12:28:05 +03:00
Sergey Glukhov
0a892c46e0 Bug#39793 Foreign keys not constructed when column has a '#' in a comment or default value
Internal InnoDN FK parser does not recognize '\'' as quotation symbol.
Suggested fix is to add '\'' symbol check for quotation condition
(dict_strip_comments() function).


innobase/dict/dict0dict.c:
  Internal InnoDN FK parser does not recognize '\'' as quotation symbol.
  Suggested fix is to add '\'' symbol check for quotation condition
  (dict_strip_comments() function).
mysql-test/r/innodb_mysql.result:
  test result
mysql-test/t/innodb_mysql.test:
  test case
2009-05-19 11:32:21 +05:00
Jim Winstead
7117ee8ccc The output of mysqldump --tab for views included a DROP TABLE statement
without the IF EXISTS qualifier even though no temporary table is created
as for all-in-one dumps including views. (Bug #37377)
2009-05-18 12:52:51 -07:00
Gleb Shchepa
a7294532b2 Bug#40825: Error 1356 while selecting from a view
with a "HAVING" clause though query works

SELECT from views defined like:

  CREATE VIEW v1 (view_column)
    AS SELECT c AS alias FROM t1 HAVING alias

fails with an error 1356:
  View '...' references invalid table(s) or column(s)
  or function(s) or definer/invoker of view lack rights
  to use them


CREATE VIEW form with a (column list) substitutes
SELECT column names/aliases with names from a
view column list.
However, alias references in HAVING clause was
not substituted.


The Item_ref::print function has been modified
to write correct aliased names of underlying
items into VIEW definition generation/.frm file.


mysql-test/r/view.result:
  Added test file for bug #40825.
mysql-test/t/view.test:
  Added test file for bug #40825.
sql/item.cc:
  Bug#40825: Error 1356 while selecting from a view
             with a "HAVING" clause though query works
  
  The Item_ref::print function has been modified
  to write correct aliased names of underlying
  items into VIEW definition generation/.frm file.
2009-05-18 23:43:06 +05:00
Gleb Shchepa
405bd2af11 Bug #44768: SIGFPE crash when selecting rand from a view containing null
The RAND(N) function where the N is a field of "constant" table
(table of single row) failed with a SIGFPE.

Evaluation of RAND(N) rely on constant status of its argument.
Current server "seeded" random value for each constant argument
only once, in the Item_func_rand::fix_fields method.
Then the server skipped a call to seed_random() in the
Item_func_rand::val_real method for such constant arguments.

However, non-constant state of an argument may be changed
after the call to fix_fields, if an argument is a field of
"constant" table. Thus, pre-initialization of random value
in the fix_fields method is too early.


Initialization of random value by seed_random() has been
removed from Item_func_rand::fix_fields method.
The Item_func_rand::val_real method has been modified to
call seed_random() on the first evaluation of this method
if an argument is a function.


mysql-test/r/func_math.result:
  Added test case for bug #44768.
mysql-test/t/func_math.test:
  Added test case for bug #44768.
sql/item_func.cc:
  Bug #44768: SIGFPE crash when selecting rand from a view containing null
  
  1. Initialization of random value by seed_random() has been
     removed from Item_func_rand::fix_fields method.
  2. The Item_func_rand::val_real method has been modified to
     call seed_random() on the first evaluation of this method
     if an argument is a function.
sql/item_func.h:
  Bug #44768: SIGFPE crash when selecting rand from a view containing null
  
  1. The Item_func_rand::first_eval has been added to trace
     the first evaluation of the val_real method.
  2. The Item_func_rand::cleanup method has been added to
     cleanup the first_eval flag.
2009-05-18 09:21:25 +05:00
Kristofer Pettersson
baeac87623 Bug#19027 MySQL 5.0 starts even with Fatal InnoDB errors
Fix bug in mtr_cases.pm script visible only when InnoDB isn't configured.

mysql-test/lib/mtr_cases.pm:
  If InnoDB isn't configured the help texts won't show the "innodb" option and mysqld_variables will not contain any "innodb" entry.
2009-05-17 22:16:21 +02:00
Narayanan V
a8df3d3c90 Bug#44610 RCDFMT clause requested when creating DB2 table
In order to better support the usage of
IBMDB2I tables from within RPG programs,
the storage engine should ensure that the
RCDFMT name is consistent and predictable
for DB2 tables.

This patch appends a "RCDFMT <name>"
clause to the CREATE TABLE statement
that is passed to DB2.  <name> is
generated from the original name of
the table itself. This ensures a
consistent and deterministic mapping
from the original table.

For the sake of simplicity only
the alpha-numeric characters are
preserved when generating the new
name, and these are upper-cased;
other characters are replaced with
an underscore (_). Following DB2
system identifier rules, the name
always begins with an alpha-character
and has a maximum of ten characters.
If no usable characters are found in
the table name, the name X is used.

mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44610.result:
  Bug#44610 RCDFMT clause requested when creating DB2 table
  
  Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test:
  Bug#44610 RCDFMT clause requested when creating DB2 table
  
  Test case that confirms that the names that are being generated are valid.
storage/ibmdb2i/ha_ibmdb2i.cc:
  Bug#44610 RCDFMT clause requested when creating DB2 table
  
  This patch appends a "RCDFMT <name>"
  clause to the CREATE TABLE statement
  that is passed to DB2.  <name> is
  generated from the original name of
  the table itself. This ensures a
  consistent and deterministic mapping
  from the original table.
storage/ibmdb2i/ha_ibmdb2i.h:
  Bug#44610 RCDFMT clause requested when creating DB2 table
  
  This patch appends a "RCDFMT <name>"
  clause to the CREATE TABLE statement
  that is passed to DB2.  <name> is
  generated from the original name of
  the table itself. This ensures a
  consistent and deterministic mapping
  from the original table.
2009-05-17 21:55:23 +05:30
Jim Winstead
68bf2c03fb Fix test case, table name needs to be upper-case. 2009-05-15 12:24:45 -07:00
Jim Winstead
9922476838 Merge from 5.1-bugteam 2009-05-15 10:40:51 -07:00
Jim Winstead
793d8e1820 Fix syntax in test to eliminate failure on Windows. 2009-05-15 10:36:59 -07:00
Matthias Leich
6920f9a091 Merge 5.0 -> 5.1 of fix for bug 44826 2009-05-15 17:47:50 +02:00
Matthias Leich
1d03fb715e Merge of fix into GCA tree, no conflicts 2009-05-15 17:41:35 +02:00
Vladislav Vaintroub
f4b8ae3b45 merge 2009-05-15 13:47:36 +02:00
Satya B
1e37c919ef Fix for BUG#10206 - InnoDB: Transaction requiring Max_BinLog_Cache_size > 4GB
always rollsback.

The global variable max_binlog_cache_size cannot be set more than 4GB on
32 bit systems, limiting transactions of all storage engines to 4G of changes.

The problem is max_binlog_cache_size is declared as ulong which is 4 bytes
on 32 bit and 8 bytes on 64 bit machines.

Fixed by using ulonglong for max_binlog_cache_size which is 8bytes on 32 
and 64 bit machines.The range for max_binlog_cache_size on 32 bit and 64 bit
systems is 4096-18446744073709547520 bytes.

mysql-test/r/variables.result:
  Result file for BUG#10206
mysql-test/t/variables.test:
  Testcase for BUG#10206
sql/mysql_priv.h:
  change the extern declaration of max_binlog_cache_size to ulonglong
sql/mysqld.cc:
  change the declaration of max_binlog_cache_size to ulonglong and the option is fixed to extend the range of max_binlog_cache_size
sql/set_var.cc:
  change the variable declaration of max_binlog_cache_size to ulonglong
2009-05-15 16:33:08 +05:30
Matthias Leich
21f878e724 Fix for Bug#42308 Several server tests do not pass MTR's --check option
Details:
Most tests mentioned within the bug report were already fixed.
The test modified here failed in stability (high parallel load) tests.

Details:
1. Take care that disconnects are finished before the test terminates.
2. Correct wrong handling of send/reap in events_stress which caused
   random garbled output
3. Minor beautifying of script code
2009-05-15 12:15:56 +02:00
Philip Stoev
8e72b44969 Bug #32651 grant_cache.test fails
It turns out that this test case no longer fails with the discrepancy
  in numbers that was the original cause for disabling this test (and showed
  potential genuine issues with the query cache). Therefore
  this test is being enabled after some minor adjustment of error codes and
  messages.
2009-05-15 13:06:11 +03:00
Matthias Leich
f4eb0953b1 Fix for Bug#44826 main.information_schema_db could harm succeeding tests
Details:
1. Add missing "disconnect <session>"
2. Take care that the disconnects are finished when the test terminates
3. Replace error names by error numbers
4. Minor beautifying of script code
2009-05-15 11:59:31 +02:00
Joerg Bruehe
b0efa1766e Merge main 5.0 -> 5.0-build 2009-05-15 11:54:55 +02:00
Georgi Kodinov
812d2559b5 merged 5.0-main -> 5.0-bugteam 2009-05-15 12:29:41 +03:00
Kristofer Pettersson
65febd1abf Automerge 2009-05-15 11:23:23 +02:00
Alexey Kopytov
620a27000e Automerge. 2009-05-15 12:55:01 +04:00
Alexey Kopytov
d68ea7d519 Automerge. 2009-05-15 12:54:40 +04:00
Alexey Kopytov
5c598ba6b5 Automerge. 2009-05-15 12:42:57 +04:00
Alexey Kopytov
22e840d707 Bug #44792: valgrind warning when casting from time to time
Field_time::get_time() did not initialize some members of 
MYSQL_TIME which led to valgrind warnings when those members 
were accessed in Protocol_simple::store_time(). 
 
It is unlikely that this bug could result in wrong data 
being returned, since Field_time::get_time() initializes the 
'day' member of MYSQL_TIME to 0, so the value of 'day' 
in Protocol_simple::store_time() would be 0 regardless 
of the values for 'year' and 'month'.

mysql-test/r/type_time.result:
  Added a test case for bug #44792.
mysql-test/t/type_time.test:
  Added a test case for bug #44792.
sql/field.cc:
  Field_time::get_time() did not initialize some members of 
  MYSQL_TIME which led to valgrind warnings when those members 
  were accessed in Protocol_simple::store_time().
2009-05-15 12:16:00 +04:00
Kristofer Pettersson
a41d3800bc Auto merge 2009-05-15 09:36:42 +02:00
Sergey Glukhov
376d67e5c0 5.0-bugteam->5.1-bugteam merge 2009-05-15 12:11:07 +05:00
Sergey Glukhov
fc57b4cfb5 Bug#43612 crash with explain extended, union, order by
In UNION if we use last SELECT without braces and this
SELECT have ORDER BY clause, such clause belongs to
global UNION. It is parsed like last SELECT
part and used further as 'unit->global_parameters->order_list' value.
During DESCRIBE EXTENDED we call select_lex->print_order() for
last SELECT where order fields refer to tmp table 
which already freed. It leads to crash.
The fix is clean up global_parameters->order_list
instead of fake_select_lex->order_list.


mysql-test/r/union.result:
  test result
mysql-test/t/union.test:
  test case
sql/sql_union.cc:
  In UNION if we use last SELECT without braces and this
  SELECT have ORDER BY clause, such clause belongs to
  global UNION. It is parsed like last SELECT
  part and used further as 'unit->global_parameters->order_list' value.
  During DESCRIBE EXTENDED we call select_lex->print_order() for
  last SELECT where order fields refer to tmp table 
  which already freed. It leads to crash.
  The fix is clean up global_parameters->order_list
  instead of fake_select_lex->order_list.
2009-05-15 12:03:34 +05:00
Vladislav Vaintroub
e3bdffe100 Bug #44775 MTR fails to bootstrap mysqld on Windows in Pushbuild 2.
Suspected reason for the failure is that safe_process.exe already runs in a job that does not allow breakaways. 
The fix is to use a fallback -  make newly created process the root of the new process group. This allows to kill process together with descendants via GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, pid)
2009-05-14 21:56:53 +02:00
Kristofer Pettersson
afee63222a Bug#19027 MySQL 5.0 starts even with Fatal InnoDB errors
It is not possible to prevent the server from starting if a mandatory
built-in plugin fails to start. This can in some cases lead to data
corruption when the old table name space suddenly is used by a different
storage engine.

A boolean command line option in the form of --foobar is automatically
created for every existing plugin "foobar". By changing this command line
option from a boolean to a tristate { OFF, ON, FORCE } it is possible to
specify the plugin loading policy for each plugin.

The behavior is specified as follows:
   OFF   = Disable the plugin and start the server
   ON    = Enable the plugin and start the server even if an error occurrs
           during plugin initialization.
   FORCE = Enable the plugin but don't start the server if an error occurrs
           during plugin initialization.


mysql-test/lib/mtr_cases.pm:
  * Changed --<pluginname> from a boolean to a tristate.
mysys/my_getopt.c:
  * Changed --<pluginname> from boolean to tristate. Optional arguments
    must still work for tristates. It is praxis that disable means value 0
    and enable is value 1. Since plugin name is the only tristate with
    optional arguments this principle will still hold.
sql/sql_plugin.cc:
  * Changed --<pluginname> option from a boolean type to a tristate.
    - FORCE will now terminate the server if the plugin fails to
      initialize properly.
  * Refactored prototypes for test_plugin_options() and construct_options()
    to get rid of the 'enable' value pointer.
  * Cleaned up code related to option name constructing.
  * Added documentation
sql/sql_plugin.h:
  * Introduced new member to st_plugin_int structure.
2009-05-14 14:03:33 +02:00
Luis Soares
e8e8f2faf4 merge: 5.1-bt local bug fix branch --> 5.1-bt up-to-date. 2009-05-14 12:51:03 +01:00
Philip Stoev
e67233ff3f Bugs #44871 and #43894:
UNIX sockets need to be on a path shorter than 70 characters on some older platofrms.
MTRv1 tries to fix this by moving the socket to the $TMPDIR, however this causes
issues with certain tests on Windows.

Fixed by not applying any hacks on Windows - Windows does not need them.
2009-05-14 14:44:47 +03:00
Narayanan V
872ec20ede merging with mysql-5.1-bugteam 2009-05-14 17:00:03 +05:30
Narayanan V
78283436d7 Bug#44232 Error msg should be improved when collation not supported.
checking in a test case that will reproduce
the error on v5r4.

mysql-test/suite/ibmdb2i/include/have_i54.inc:
  Bug#44232 Error msg should be improved when collation not supported.
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44232.result:
  Bug#44232 Error msg should be improved when collation not supported.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44232.test:
  Bug#44232 Error msg should be improved when collation not supported.
2009-05-14 16:05:09 +05:30
Ramil Kalimullin
d0128f5ec0 Auto-merge. 2009-05-13 23:39:35 +05:00
Jim Winstead
272c17d1df Merge from 5.1-bugteam 2009-05-13 08:56:34 -07:00
Jim Winstead
4161dc49b3 Merge from 5.0-bugteam 2009-05-13 08:48:00 -07:00
Martin Hansson
5811a13712 Merge. 2009-05-13 17:24:27 +02:00
Gleb Shchepa
585cf08fe6 Bug #44290: explain crashes for subquery with distinct in
SQL_SELECT::test_quick_select

The crash was caused by an incomplete cleanup of JOIN_TAB::select
during the filesort of rows for GROUP BY clause inside a subquery.
Queries where a quick index access is replaced with filesort was
was affected. For example:

  SELECT 1 FROM
    (SELECT COUNT(DISTINCT c1) FROM t1
       WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x

Quick index access related data in the SQL_SELECT::test_quick_select
function was inconsistent after an incomplete cleanup.
This function has been completed to prevent crashes in the
SQL_SELECT::test_quick_select function.


mysql-test/include/mix1.inc:
  Add test case for bug #44290.
mysql-test/r/innodb_mysql.result:
  Add test case for bug #44290.
sql/sql_select.cc:
  Bug #44290: explain crashes for subquery with distinct in
              SQL_SELECT::test_quick_select
  
  Quick index access related data in the SQL_SELECT::test_quick_select
  function was inconsistent after an incomplete cleanup.
  This function has been completed to prevent crashes in the
  SQL_SELECT::test_quick_select function.
2009-05-13 12:51:39 +05:00
Ramil Kalimullin
80fdebafa8 Fix for bug#44774 merged. 2009-05-13 09:21:38 +05:00
Jim Winstead
c65ebb5d13 Merge from 5.0-bugteam 2009-05-12 14:20:33 -07:00
Jim Winstead
eae91cc781 mysqlimport was not always compiled correctly to allow thread support,
required for the --use-threads option. (Bug #32991)
2009-05-12 10:45:40 -07:00
Gleb Shchepa
bd59628754 Bug #44290: explain crashes for subquery with distinct in
SQL_SELECT::test_quick_select

The crash was caused by an incomplete cleanup of JOIN_TAB::select
during the filesort of rows for GROUP BY clause inside a subquery.
Queries where a quick index access is replaced with filesort was
was affected. For example:

  SELECT 1 FROM
    (SELECT COUNT(DISTINCT c1) FROM t1
       WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x

Quick index access related data in the SQL_SELECT::test_quick_select
function was inconsistent after an incomplete cleanup.
This function has been completed to prevent crashes in the
SQL_SELECT::test_quick_select function.


mysql-test/include/mix1.inc:
  Add test case for bug #44290.
mysql-test/r/innodb_mysql.result:
  Add test case for bug #44290.
sql/sql_select.cc:
  Bug #44290: explain crashes for subquery with distinct in
              SQL_SELECT::test_quick_select
  
  Quick index access related data in the SQL_SELECT::test_quick_select
  function was inconsistent after an incomplete cleanup.
  This function has been completed to prevent crashes in the
  SQL_SELECT::test_quick_select function.
2009-05-12 22:42:31 +05:00
Jim Winstead
99794e8801 mysqldump would not dump the INFORMATION_SCHEMA even when it was explicitly
requested. (Bug #33762)
2009-05-12 10:38:14 -07:00
Georgi Kodinov
d7a22ed9a9 Bug #44399: crash with statement using TEXT columns, aggregates, GROUP BY,
and HAVING

When calculating GROUP BY the server caches some expressions. It does
that by allocating a string slot (Item_copy_string) and assigning the 
value of the expression to it. This effectively means that the result
type of the expression can be changed from whatever it was to a string.
As this substitution takes place after the compile-time result type 
calculation for IN but before the run-time type calculations, 
it causes the type calculations in the IN function done at run time 
to get unexpected results different from what was prepared at compile time.

In the CASE ... WHEN ... THEN ... statement there was a similar problem
and it was solved by artificially adding a STRING argument to the matrix
at compile time, so if any of the arguments of the CASE function changes 
its type to a string it will still be covered by the information prepared 
at compile time.
Extended the CASE fix for cover the IN case.
An alternative way of fixing this problem is by caching the result type of 
the arguments at compile time and using the cached information at run time
instead of re-calculating the result types.
Preferred the CASE approach for uniformity and fix localization.

mysql-test/r/func_in.result:
  Bug #44399: test case
mysql-test/t/func_in.test:
  Bug #44399: test case
sql/item_cmpfunc.cc:
  Bug #44399: assume at compile time there's an extra string argument
  in the IN function (similar to CASE) to cater for possible string 
  conversions in the process of calculating the GROUP BY/aggregates.
2009-05-12 16:59:17 +03:00
Satya B
ab99c2347b merge to 5.1-bugteam tree 2009-05-19 14:01:29 +05:30
Satya B
07b9358860 Applying InnoDB snashot 5.1-ss5024,part 3. Fixes BUG#42101
BUG#42101 - Race condition in innodb_commit_concurrency

Detailed revision comments:

r4994 | marko | 2009-05-14 15:04:55 +0300 (Thu, 14 May 2009) | 18 lines
branches/5.1: Prevent a race condition in innobase_commit() by ensuring
that innodb_commit_concurrency>0 remains constant at run time. (Bug #42101)

srv_commit_concurrency: Make this a static variable in ha_innodb.cc.

innobase_commit_concurrency_validate(): Check that innodb_commit_concurrency
is not changed from or to 0 at run time.  This is needed, because
innobase_commit() assumes that innodb_commit_concurrency>0 remains constant.
Without this limitation, the checks for innodb_commit_concurrency>0
in innobase_commit() should be removed and that function would have to
acquire and release commit_cond_m at least twice per invocation.
Normally, innodb_commit_concurrency=0, and introducing the mutex operations
would mean significant overhead.

innodb_bug42101.test, innodb_bug42101-nonzero.test: Test cases.

rb://123 approved by Heikki Tuuri
2009-05-19 13:50:28 +05:30
Sergey Glukhov
6b57f95cb2 5.0-bugteam->5.1-bugteam merge 2009-05-19 11:48:04 +05:00
Ramil Kalimullin
fb3e433d4e Fix for bug#44860: ALTER TABLE on view crashes server
Problem: executing queries like "ALTER TABLE view1;" we don't
check new view's name (which is not specified),
that leads to server crash.

Fix: do nothing (to be consistent with the behaviour for tables) 
in such cases.


mysql-test/r/view.result:
  Fix for bug#44860: ALTER TABLE on view crashes server
    - test result.
mysql-test/t/view.test:
  Fix for bug#44860: ALTER TABLE on view crashes server
    - test case.
sql/sql_rename.cc:
  Fix for bug#44860: ALTER TABLE on view crashes server
    - do_rename(): new view/table name must be specified, ASSERT() added.
sql/sql_table.cc:
  Fix for bug#44860: ALTER TABLE on view crashes server
    - mysql_alter_table(): renaming a view, check if new
  view name is specified.
2009-05-19 09:25:36 +05:00
Gleb Shchepa
d4be7dadb8 manual merge 5.0-bugteam --> 5.1-bugteam (bug 40825) 2009-05-19 00:51:52 +05:00
Patrick Crews
bb3f97f4bf Bug#44920 - MTR2 is not processing master.opt input properly on Windows
Disabling these two tests as they are affected by this bug / causing PB2 failures
on Windows platforms.  Can always disable via include/not_windows.inc if
the bug fix looks like it will take some time.
2009-05-18 12:53:06 -04:00
Kristofer Pettersson
cc5d329ae5 Bug#19027 MySQL 5.0 starts even with Fatal InnoDB errors
Fixed start up options for test case "rpl_ndb_2other-slave" to match
the changed behavior for plugin options.
2009-05-18 13:39:13 +02:00
Chad MILLER
dbf8997b40 Remove community-server only feature and place in its own test
with appropriate condition.
2009-05-12 09:14:23 -04:00
Bjorn Munch
2f9155296d Bug #42988 MTR2's --help output does not document --parallel
Several options were not documented
Added missing options and removed a few
Fixed use of --skip-combinations
2009-05-12 14:53:46 +02:00
Luis Soares
60a2bbb8dd BUG#42749: infinite loop writing to row based binlog - processlist shows
"freeing items"

The calculation of the table map log event in the event constructor
was one byte shorter than what would be actually written. This would
lead to a mismatch between the number of bytes written and the event
end_log_pos, causing bad event alignment in the binlog (corrupted
binlog) or in the transaction cache while fixing positions
(MYSQL_BIN_LOG::write_cache). This could lead to impossible to read
binlog or even infinite loops in MYSQL_BIN_LOG::write_cache.

This patch addresses this issue by correcting the expected event
length in the Table_map_log_event constructor, when the field metadata
size exceeds 255.

sql/log_event.cc:
  Added the extra byte as net_store_length imposes.
2009-05-12 12:53:46 +01:00
Daniel Fischer
88294e300f merge bug#42888 2009-05-12 13:09:16 +02:00
Ramil Kalimullin
8b9084eff4 Fix for bug#44774: load_file function produces valgrind warnings
Problem: using LOAD_FILE() in some cases we pass a file name string
without a trailing '\0' to fn_format() which relies on that however.
That may lead to valgrind warnings.

Fix: add a trailing '\0' to the file name passed to fn_format().


mysql-test/r/func_str.result:
  Fix for bug#44774: load_file function produces valgrind warnings
    - test result.
mysql-test/t/func_str.test:
  Fix for bug#44774: load_file function produces valgrind warnings
    - test case.
sql/item_strfunc.cc:
  Fix for bug#44774: load_file function produces valgrind warnings
    - passing a file name to fn_format(), file_name->c_ptr() replaced
      with file_name->c_ptr_safe() to ensure we have a trailing '\0'.
2009-05-12 13:18:27 +05:00
Michael Widenius
b94f191a77 Merge fixes.
mysql-test/mysql-test-run.pl:
  Fixed missed lines in merge.
storage/maria/plug.in:
  Fixed problem with configuration. This is now included
  top level.
storage/pbxt/plug.in:
  Fixed problem with configuration. This is
  included now in top level.
2009-05-12 09:44:01 +03:00
Davi Arnaut
d37aa50557 Bug#44664: valgrind warning for COMMIT_AND_CHAIN and ROLLBACK_AND_CHAIN
The problem is that the internal variable used to specify a
transaction with consistent read was being used outside the
processing context of a START TRANSACTION WITH CONSISTENT
SNAPSHOT statement. The practical consequence was that a
consistent snapshot specification could leak to unrelated
transactions on the same session.

The solution is to ensure a consistent snapshot clause is
only relied upon for the START TRANSACTION statement.

This is already fixed in a similar way on 6.0.

mysql-test/r/consistent_snapshot.result:
  Add test case result for Bug#44664
mysql-test/t/consistent_snapshot.test:
  Add test case for Bug#44664
sql/sql_parse.cc:
  The WITH CONSISTENT SNAPSHOT clause is only valid for the
  START TRANSACTION statement.
2009-05-11 20:54:00 -03:00
Mats Kindahl
206bdd67c6 Merging with 5.1-bugteam tree. 2009-05-11 15:28:02 +02:00
Mats Kindahl
8f95c5e183 Bug #44442: Incident events are silent in mysqlbinlog output
In the output from mysqlbinlog, incident log events were
represented as just a comment. Since the incident log event
represents an incident that could cause the contents of the
database to change without being logged to the binary log,
it means that if the SQL is applied to a server, it could
potentially lead to that the databases are out of sync.

In order to handle that, this patch adds the statement "RELOAD
DATABASE" to the SQL output for the incident log event. This will
require a DBA to edit the file and handle the case as apropriate
before applying the output to a server.

mysql-test/suite/binlog/t/binlog_incident-master.opt:
  Options file to cause server to generate an incident log
  event when executing a REPLACE.
mysql-test/suite/binlog/t/binlog_incident.test:
  Test to check that the incident log event is represented
  correctly in the output from mysqlbinlog.
sql/log_event.cc:
  The incident log event now ouput a "RELOAD DATABASE" instead
  of just a comment. RELOAD DATABASE is not an existing command
  and will generate a syntax error.
2009-05-11 13:32:38 +02:00