Commit graph

20054 commits

Author SHA1 Message Date
Nirbhay Choubey
d5e7008bdd Bug#58139 : default-auth option not recognized in MySQL standard
command line clients.

Command line tools like mysqladmin and mysqldump did not recognize
default-auth and plugin-dir options.

Support for these options was found missing in these command line
tools.

Fixed by adding support for the same.
2010-12-07 17:37:07 +05:30
Vasil Dimov
1c5eca41cc Merge mysql-5.5-bugteam -> mysql-5.5-innodb 2010-12-05 21:17:01 +02:00
Ramil Kalimullin
93efc7e2c4 Fix for bug #58669: read_only not enforced on 5.5.x
Problem: "read-only" option ignored if it's enabled in
the command line (or in the config file).

Fix: sync opt_readonly (which is used for checks) with 
read_only (global var) when all server options are handled.
2010-12-03 20:49:08 +03:00
Mattias Jonsson
5618a20e10 post-push fix for test to work on row-based-replication 2010-12-03 14:05:33 +01:00
Mattias Jonsson
1956220002 merge of bug#58147, including rename of the new argument,
to_binlog -> binlog_stmt.
2010-12-03 10:33:29 +01:00
Mats Kindahl
651d029e99 Merging with mysql-5.5-bugteam. 2010-12-02 09:55:08 +01:00
Mats Kindahl
afb8f0f882 BUG#58246: INSTALL PLUGIN not secure & crashable
Fixing test case that fails on Windows because .dll is used.
2010-12-02 09:13:31 +01:00
Mats Kindahl
8ea491e720 Merging patch for BUG#58246 into mysql-5.5-bugteam. 2010-12-01 23:15:14 +01:00
Mattias Jonsson
f3c6e6ffd6 Bug#58147: ALTER TABLE w/ TRUNCATE PARTITION fails
but the statement is written to binlog

TRUNCATE PARTITION was written to the binlog
even if it failed before calling any partition's
truncate function.

Solved by adding an argument to truncate_partition,
to flag if it should be written to the binlog or not.

It should be written to the binlog when a call to any
partitions truncate function is done.
2010-12-01 22:47:40 +01:00
Mats Kindahl
bfb43fb44f Merging patch for BUG#58246 with mysql-5.1-bugteam. 2010-12-01 20:33:31 +01:00
Sergey Vojtovich
45f6f933d1 BUG#58205 - Valgrind failure in fn_format when called from
archive_discover

Fixed buffer underrun in cleanup_dirname().

Also fixed that original (unencoded) database and table
names were used to discover archive tables.
2010-12-01 15:56:46 +03:00
Mats Kindahl
91a4a8aba6 BUG#58246: INSTALL PLUGIN not secure & crashable
When installing plugins, there is a missing check
for slash (/) in the path on Windows. Note that on
Windows, both / and \ can be used to separate
directories.

This patch fixes the issue by:
- Adding a FN_DIRSEP symbol for all platforms
  consisting of a string of legal directory
  separators.
- Adding a charset-aware version of strcspn().
- Adding a check_valid_path() function that uses
  my_strcspn() to check if any FN_DIRSEP character
  is in the supplied string.
- Using the check_valid_path() function in
  sql_plugin.cc and sql_udf.cc (which means
  replacing the existing test there).
2010-12-01 13:54:50 +01:00
Bjorn Munch
9dca123d02 Bug #58092 Test "rpl_cross_version" has "copy_file" failing
I am not fixing the test failure
Adds printing of my_errno when commands fail, could hopefully help
2010-12-01 11:11:16 +01:00
Nirbhay Choubey
938c61dcbb Merging from mysql-5.1-bugteam 2010-12-01 12:28:21 +05:30
Nirbhay Choubey
c8310653b4 Additional fix for bug#54899
Fixing the testcase to use the database name
as connected_db instead of 'test' database.
2010-12-01 12:25:31 +05:30
kevin.lewis@oracle.com
a53845ca45 Bug#55222 - RB://517 - Approved by Sunny
InnoDB does not attempt to handle lower_case_table_names == 2 when looking
up foreign table names and referenced table name.  It turned that server
variable into a boolean and ignored the possibility of it being '2'.  

The setting lower_case_table_names == 2 means that it should be stored and
displayed in mixed case as given, but compared internally in lower case.
Normally the server deals with this since it stores table names.  But
InnoDB stores referential constraints for the server, so it needs to keep
track of both lower case and given names.

This solution creates two table name pointers for each foreign and referenced
table name.  One to display the name, and one to look it up.  Both pointers
point to the same allocated string unless this setting is 2.  So the overhead
added is not too much.

Two functions are created in dict0mem.c to populate the ..._lookup versions
of these pointers.  Both dict_mem_foreign_table_name_lookup_set() and
dict_mem_referenced_table_name_lookup_set() are called 5 times each.
2010-11-30 12:25:52 -06:00
Jon Olav Hauglid
a186085a07 Bug #58414 mysql_upgrade fails on dump upgrade between 5.1.53 -> 5.5.8
The problem was that mysql_upgrade failed because DROP DATABASE
refused to drop the 'performance_schema' database when the 
mysql.proc table definition was made temporarily invalid
by dump import.

This patch fixes the problem by adding the error resulting
from opening a damaged mysq.proc table (ER_CANNOT_LOAD_FROM_TABLE),
to the list of errors DROP DATABASE will ignore when trying
to lock stored procedures and functions before deletion.

This problem was a regression introduced by the patch for
Bug#57663.

Test case added to sp-destruct.test.
2010-11-30 18:52:38 +01:00
Bjorn Munch
d2fb19855e merge from 5.5-mtr 2010-11-27 11:52:17 +01:00
Georgi Kodinov
7c0b2859ac merge 2010-11-26 17:34:33 +02:00
Georgi Kodinov
534ba9c98a merge 2010-11-26 17:27:41 +02:00
Georgi Kodinov
96d45ed2f6 merge 2010-11-26 16:32:51 +02:00
Alexander Barkov
43cd08712c Merging from mysql-5.1-bugteam 2010-11-26 17:22:06 +03:00
Alexander Barkov
bd3a5831f6 Bug#56639 Character Euro (0x88) not converted from cp1251 to utf8
Problem: MySQL cp1251 did not support 'U+20AC EURO SIGN'
which was assigned a few years ago to 0x88.

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

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

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

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

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

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

Fixed by making get_current_db() a no-op function when one_database is set,
and hence, under that condition current_db will not get altered.
Note, however the value of current_db can change when we execute 'connect'
command with a differnet database to reconnect to the server, in which case,
the behavior of --one-database will be formulated using this new database.
2010-11-26 19:27:59 +05:30
Georgi Kodinov
c5987223db merge 2010-11-26 14:51:48 +02:00
Alexander Barkov
93386d7387 Bug#57737 Character sets: search fails with like, contraction, index
Problem: LIKE over an indexed column optimized away good results,
because my_like_range_utf32/utf16 returned wrong ranges for contractions.
Contraction related code was missing in my_like_range_utf32/utf16,
but did exist in my_like_range_ucs2/utf8.
It was forgotten in utf32/utf16 versions (during mysql-6.0 push/revert mess).

Fix:
The patch removes individual functions my_like_range_ucs2,
my_like_range_utf16, my_like_range_utf32 and introduces a single function
my_like_range_generic() instead. The new function handles contractions
correctly. It can handle any character set with cs->min_sort_char and
cs->max_sort_char represented in Unicode code points.

added:
  @ mysql-test/include/ctype_czech.inc
  @ mysql-test/include/ctype_like_ignorable.inc
  @ mysql-test/r/ctype_like_range.result
  @ mysql-test/t/ctype_like_range.test
  Adding tests


modified:

  @ include/m_ctype.h
  - Adding helper functions for contractions.
  - Prototypes: removing ucs2,utf16,utf32 functions, adding generic function.
  @ mysql-test/r/ctype_uca.result
  @ mysql-test/r/ctype_utf16_uca.result
  @ mysql-test/r/ctype_utf32_uca.result
  @ mysql-test/t/ctype_uca.test
  @ mysql-test/t/ctype_utf16_uca.test
  @ mysql-test/t/ctype_utf32_uca.test
  - Adding tests.

  @ strings/ctype-mb.c
  - Pad function did not put the last character.
  - Implementing my_like_range_generic() - an universal replacement
    for three separate functions
    my_like_range_ucs2(), my_like_range_utf16() and my_like_range_utf32(),
    with correct contraction handling.

  @ strings/ctype-ucs2.c
  - my_fill_mb2 did not put the high byte, as previously
    it was used to put only characters in ASCII range.
    Now it puts high byte as well
    (needed to pupulate cs->max_sort_char correctly).
  - Adding DBUG_ASSERT()
  - Removing character set specific functions:
    my_like_range_ucs2(), my_like_range_utf16() and my_like_range_utf32().
  - Using my_like_range_generic() instead of the old functions.

  @ strings/ctype-uca.c
  - Using generic function instead of the old character set specific ones.

  @ sql/item_create.cc
  @ sql/item_strfunc.cc
  @ sql/item_strfunc.h
  - Adding SQL functions LIKE_RANGE_MIN and LIKE_RANGE_MAX,
    available only in debug build to make sure like_range()
    works correctly for all character sets and collations.
2010-11-26 13:44:39 +03:00
Bjorn Munch
20851e4012 Bug #58412 mysqltest: allow quoting of strings in let and in if comparison
Stripping quotes in let was a bad idea, will not fix
Added code to strip quotes from rhs in comparisons
2010-11-26 10:57:01 +01:00
Alexander Nozdrin
b07b8de14f Auto-merge from mysql-5.5.7-rc-release. 2010-11-25 14:33:11 +03:00
Alexander Nozdrin
9e3fa25e01 Auto-merge from mysql-5.5.7-rc-release. 2010-11-25 13:46:18 +03:00
Tatiana A. Nurnberg
94cb45b3e6 merge some docs changes and a test case; null merge the code.
(we don't need to port the actual code from 5.1;
5.5+ do the relevant things differently, but correctly. the
test obviously is so it stays that way.)
2010-11-25 03:50:16 +00:00
Tatiana A. Nurnberg
3a15cb6ce9 Assorted post-merge fixes, clean-up, integration, compat with 5.6.
43233/55794.
2010-11-25 03:11:05 +00:00
Tatiana A. Nurnberg
9ab7421b10 merge 2010-11-24 10:02:46 +00:00
Tatiana A. Nurnberg
eda8b1feeb merge 2010-11-24 08:50:04 +00:00
Ramil Kalimullin
1b897ad1d8 Auto-merge with mysql-5.5-bugteam. 2010-11-23 16:44:26 +03:00
Ramil Kalimullin
743fd50d62 Auto-merge with mysql-5.1-bugteam. 2010-11-23 16:08:10 +03:00
Ramil Kalimullin
cc5263b223 Manual merge from mysql-5.5-bugteam. 2010-11-22 14:47:28 +03:00
Ramil Kalimullin
0628752fe9 Manual-merge from mysql-5.1-bugteam. 2010-11-22 12:21:10 +03:00
Guilhem Bichot
b5586c67ec Fix for Bug#56138 "valgrind errors about overlapping memory when double-assigning same variable",
and related small fixes.
2010-11-22 09:57:59 +01:00
Guilhem Bichot
b3232453a1 merge of 5.1-bugteam 2010-11-22 10:13:46 +01:00
Alexander Barkov
677639f46a Bug#58175 xml functions read initialized bytes when conversions happen
Problem:

 nr_of_decimals could read behind the end of the buffer
 in case of a non-null-terminated string, which caused
 valgring warnings.

Fix:

  fixing nr_of_decimals not to read behind the "end" pointer.

modified:

  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  @ sql/item.cc
2010-11-19 18:24:29 +03:00
Bjorn Munch
b295a25109 merge from 5.1-mtr 2010-11-19 10:29:08 +01:00
Bjorn Munch
374c6447ca upmerge 58257 2010-11-18 16:41:35 +01:00
Alexander Barkov
d720c49188 Bug#57279 updatexml dies with: Assertion failed: str_arg[length] == 0
Problem: crash in Item_float constructor on DBUG_ASSERT due
to not null-terminated string parameter.

Fix: making Item_float::Item_float non-null-termintated parameter safe:
- Using temporary buffer when generating error

modified:
  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  @ sql/item.cc
2010-11-18 16:11:18 +03:00
Ramil Kalimullin
aab0c52976 Manual-merge from 5.5-bugfixing. 2010-11-18 15:01:50 +03:00
Ramil Kalimullin
7a4708cfd7 Auto-merge from mysql-5.1-bugteam. 2010-11-18 13:40:57 +03:00
Sergey Glukhov
3a669ed906 5.1-security->5.5-security merge 2010-11-18 12:14:27 +03:00
Sergey Glukhov
594a599247 Bug#58022 ... like ... escape export_set ( ... ) crashes when export_set returns warnings
ESCAPE argument might be empty string. It leads
to server crash under some circumstances.
The fix:
-added check if ESCAPE argument result is not empty string
2010-11-18 11:53:08 +03:00
Tor Didriksen
0654c94ca2 Bug #58137 char(0) column cause: my_gcvt: Assertion `width > 0 && to != ((void *)0)' failed 2010-11-17 16:39:35 +01:00
Bjorn Munch
d718af063e Bug #58257 mysqltest: in if(), ! $var with space is always false
Evaluation would start with the space and thus ignore the $
Added while() to skip past white space
2010-11-17 16:05:52 +01:00
Georgi Kodinov
bb642a5cc0 Bug #57551: Live upgrade fails between 5.1.52 -> 5.5.7-rc
Updated the server to treat a missing mysql.proxies_priv table 
as empty. 
Added some grants to make sure tables are correctly opened
when they must be opened.
Fixed a mysql_upgrade omission not adding rights to root to 
execute GRANT PROXY on other users.
Removed a redundant CREATE TABLE from 
mysql_system_tables_fix.sql since it's always executed after
mysql_system_tables.sql and the first file has CREATE TABLE 
in it. 
Added a test case for the above.
Fixed error handling code to close the cursor
2010-11-19 16:35:04 +02:00
Bjorn Munch
0b260aca41 merge from 5.5-mtr 2010-11-19 11:26:43 +01:00
Dmitry Lenev
8d0eabd20a Merged recent change from mysql-5.5-bugteam into
mysql-5.5-runtime tree.
2010-11-19 10:46:50 +03:00
Dmitry Lenev
b019ba2f47 Fix for bug #57985 "ONLINE/FAST ALTER PARTITION can fail and
leave the table unusable".
 
Failing ALTER statement on partitioned table could have left
this table in an unusable state. This has happened in cases
when ALTER was executed using "fast" algorithm, which doesn't 
involve copying of data between old and new versions of table, 
and the resulting new table was incompatible with partitioning
function in some way.
 
The problem stems from the fact that discrepancies between new 
table definition and partitioning function are discovered only 
when the table is opened. In case of "fast" algorithm this has
happened too late during ALTER's execution, at the moment when
all changes were already done and couldn't have been reverted.
 
In the cases when "slow" algorithm, which copies data, is used 
such discrepancies are detected at the moment new table
definition is opened implicitly when new version of table is
created in storage engine. As result ALTER is aborted before 
any changes to table were done.
 
This fix tries to address this issue by ensuring that "fast"
algorithm behaves similarly to "slow" algorithm and checks
compatibility between new definition and partitioning function 
by trying to open new definition after .FRM file for it has 
been created.
 
Long term we probably should implement some way to check
compatibility between partitioning function and new table
definition which won't involve opening it, as this should
allow much cleaner fix for this problem.
2010-11-19 10:26:09 +03:00
Alexander Barkov
bdfcad0f9b Bug#57306 SHOW PROCESSLIST does not display string literals well.
A post-patch fixing test failures on Windows.

Host name in "SHOW PROCESSLIST" is displayed with port number
for some reasons.
2010-11-19 08:33:34 +03:00
Jon Olav Hauglid
a2275f0c8f Merge from mysql-5.5-runtime to mysql-5.5-bugteam
No conflicts
2010-11-18 16:01:58 +01:00
Alexander Barkov
fad763a81f Bug#57306 SHOW PROCESSLIST does not display string literals well.
Problem: Extended characters outside of ASCII range where not displayed
properly in SHOW PROCESSLIST, because thd_info->query was always sent as 
system_character_set (utf8). This was wrong, because query buffer
is never converted to utf8 - it is always have client character set.

Fix: sending query buffer using query character set

  @ sql/sql_class.cc
  @ sql/sql_class.h
    Introducing a new class CSET_STRING, a LEX_STRING with character set.
    Adding set_query(&CSET_STRING)
    Adding reset_query(), to use instead of set_query(0, NULL).

  @ sql/event_data_objects.cc
    Using reset_query()

  @ sql/log_event.cc
    Using reset_query()
    Adding charset argument to set_query_and_id().

  @ sql/slave.cc
    Using reset_query().

  @ sql/sp_head.cc
    Changing backing up and restore code to use CSET_STRING.

  @ sql/sql_audit.h
    Using CSET_STRING.
    In the "else" branch it's OK not to use
    global_system_variables.character_set_client.
    &my_charset_latin1, which is set in constructor, is fine
    (verified with Sergey Vojtovich).

  @ sql/sql_insert.cc
    Using set_query() with proper character set: table_name is utf8.

  @ sql/sql_parse.cc
    Adding character set argument to set_query_and_id().
    (This is the main point where thd->charset() is stored
     into thd->query_string.cs, for use in "SHOW PROCESSLIST".)
    Using reset_query().
    
  @ sql/sql_prepare.cc
    Storing client character set into thd->query_string.cs.

  @ sql/sql_show.cc
    Using CSET_STRING to fetch and send charset-aware query information
    from threads.

  @ storage/myisam/ha_myisam.cc
    Using set_query() with proper character set: table_name is utf8.

  @ mysql-test/r/show_check.result
  @ mysql-test/t/show_check.test
    Adding tests
2010-11-18 17:08:32 +03:00
Davi Arnaut
a6d21fc09b In certain phases of query processing, a interrupted error might
be sent to a user even if its the connection that is actually
being killed.
2010-11-18 11:41:08 -02:00
Alexander Barkov
52331c6613 Merging from mysql-5.1-bugteam. 2010-11-18 16:35:15 +03:00
Magne Mahre
64c059b0a8 Bug#58199 name_const in the having clause crashes
NAME_CONST(..) was used wrongly in a HAVING clause, and
should have caused a user error.  Instead, it caused a
segmentation fault.
      
During parsing, the value parameter to NAME_CONST was
specified to be an uninitialized Item_ref object (it
would be resolved later).   During the semantic analysis,
the object is tested, and since it was not initialied,
the server seg.faulted.
      
The fix is to check if the object is initialized
before testing it.  The same pattern has already been
applied to most other methods in the Item_ref class.
      
Bug was introduced by the optimization done as part of
Bug#33546.
2010-11-18 14:02:24 +01:00
Bjorn Munch
f6b1d5a63e upmerge 58087 2010-11-17 11:18:52 +01:00
Bjorn Munch
0f551def8f Tests: many if/while expresissons simplified after 57276 2010-11-17 11:16:13 +01:00
Mattias Jonsson
7dde08a842 merge 2010-11-17 10:41:54 +01:00
Mattias Jonsson
d25e3389f4 post-push fix, backported --replace_result patch
for --list_files in mysqltest.
2010-11-17 10:13:57 +01:00
Jon Olav Hauglid
b23c19e82f Merge from mysql-5.5-bugteam to mysql-5.5-runtime
No conflicts
2010-11-17 17:42:28 +01:00
Jon Olav Hauglid
ed928b14be Bug #57663 Concurrent statement using stored function and DROP DATABASE
breaks SBR

The problem was that DROP DATABASE ignored any metadata locks on stored
functions and procedures held by other connections. This made it
possible for DROP DATABASE to drop functions/procedures that were in use
by other connections and therefore break statement based replication.
(DROP DATABASE could appear in the binlog before a statement using a
dropped function/procedure.)

This problem was an issue left unresolved by the patch for Bug#30977
where metadata locks for stored functions/procedures were introduced.

This patch fixes the problem by making sure DROP DATABASE takes
exclusive metadata locks on all stored functions/procedures to be
dropped.

Test case added to sp-lock.test.
2010-11-17 15:37:23 +01:00
Jon Olav Hauglid
a84d750300 Bug #57663 Concurrent statement using stored function and DROP DATABASE
breaks SBR

This pre-requisite patch refactors the code for dropping tables, used
by DROP TABLE and DROP DATABASE. The patch moves the code for acquiring
metadata locks out of mysql_rm_table_part2() and makes it the
responsibility of the caller. This in preparation of changing the
DROP DATABASE implementation to acquire all metadata locks before any
changes are made. mysql_rm_table_part2() is renamed
mysql_rm_table_no_locks() to reflect the change.
2010-11-16 11:00:12 +01:00
Jon Olav Hauglid
2ef19bdcc4 Merge from mysql-5.5-bugteam to mysql-5.5-runtime
No conflicts
2010-11-16 10:05:19 +01:00
Mattias Jonsson
666e6efe05 disabled main.create-big as pre-push fix 2010-11-16 02:01:49 +01:00
Mattias Jonsson
a89a5fce8c Manual merge of bug#58197 to mysql-5.5.
Including adding test in 5.5 requiring --big-test
flag from mysql-test-run.pl and also disabled
tests that fails.
2010-11-16 01:11:06 +01:00
Mattias Jonsson
61f14ae031 merge 2010-11-15 23:38:26 +01:00
Mattias Jonsson
15e5eaef5b merge 2010-11-15 23:31:04 +01:00
Mattias Jonsson
67f640fd50 post-push fix for test to pass on windows 2010-11-15 23:27:37 +01:00
Mattias Jonsson
f3804527f3 Null-merge
Already fixed in 5.5 as bug#56172,
but fixed in 5.1 as bug#55091.

Only test case was merged, no code change!
2010-11-15 16:59:49 +01:00
Mattias Jonsson
59849b2bc8 merge 2010-11-15 16:32:21 +01:00
Jorgen Loland
4bfd212177 Bug#54812: assert in Diagnostics_area::set_ok_status
during EXPLAIN

Before the patch, send_eof() of some subclasses of 
select_result (e.g., select_send::send_eof()) could 
handle being called after an error had occured while others 
could not. The methods that were not well-behaved would trigger
an ASSERT on debug builds. Release builds were not affected.

Consider the following query as an example for how the ASSERT
could be triggered:

A user without execute privilege on f() does
   SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1;
resulting in "ERROR 42000: execute command denied to user..." 

The server would end the query by calling send_eof(). The 
fact that the error had occured would make the ASSERT trigger. 

select_dumpvar::send_eof() was the offending method in the
bug report, but the problem also applied to other 
subclasses of select_result. This patch uniforms send_eof() 
of all subclasses of select_result to handle being called 
after an error has occured.
2010-11-15 16:18:04 +01:00
Mattias Jonsson
413dd7d2ca Bug#58197: main.variables-big fails on windows
The test result differs on windows, since
it writes out 'localhost:<port>' instead of
only 'localhost', since it uses tcp/ip instead
of unix sockets on windows.

Fixed by replacing that column.

Also requires --big-test from some long running tests
and added a weekly run of all test requiring --big-test.
2010-11-15 16:17:38 +01:00
Bjorn Munch
9142f7462b Bug #58087 mysqltest re-evaluates 'let' expressions infinitely
Results from query is sent for evaluation
Break recursion by asking for ` to be ignored
2010-11-15 14:23:02 +01:00
Bjorn Munch
5e51571f7b merge from 5.5 2010-11-14 13:24:29 +01:00
Bjorn Munch
2ab2426104 merge from 5.1 up to rev 3471 2010-11-14 12:23:51 +01:00
Alexander Nozdrin
5af51e4a3c Fix for Bug#56934 (mysql_stmt_fetch() incorrectly fills MYSQL_TIME
structure buffer).

This is a follow-up for WL#4435. The bug actually existed not only
MYSQL_TYPE_DATETIME type. The problem was that Item_param::set_value()
was written in an assumption that it's working with expressions, i.e.
with basic data types.

There are two different quick fixes here:
  a) Change Item_param::make_field() -- remove setting of
     Send_field::length, Send_field::charsetnr, Send_field::flags and
     Send_field::type.

     That would lead to marshalling all data using basic types to the client
     (MYSQL_TYPE_LONGLONG, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_STRING and
     MYSQL_TYPE_NEWDECIMAL). In particular, that means, DATETIME would be
     sent as MYSQL_TYPE_STRING, TINYINT -- as MYSQL_TYPE_LONGLONG, etc.

     That could be Ok for the client, because the client library does
     reverse conversion automatically (the client program would see DATETIME
     as MYSQL_TIME object). However, there is a problem with metadata --
     the metadata would be wrong (misleading): it would say that DATETIME is
     marshaled as MYSQL_TYPE_DATETIME, not as MYSQL_TYPE_STRING.

  b) Set Item_param::param_type properly to actual underlying field type.
     That would lead to double conversion inside the server: for example,
     MYSQL_TIME-object would be converted into STRING-object
     (in Item_param::set_value()), and then converted back to MYSQL_TIME-object
     (in Item_param::send()).

     The data however would be marshalled more properly, and also metadata would
     be correct.

This patch implements b).

There is also a possibility to avoid double conversion either by clonning
the data field, or by storing a reference to it and using it on Item::send()
time. That requires more work and might be done later.
2010-11-13 18:05:02 +03:00
Dmitry Lenev
7e68adfba1 Follow-up for patch fixing bug #57006 "Deadlock between
HANDLER and FLUSH TABLES WITH READ LOCK" and bug #54673
"It takes too long to get readlock for 'FLUSH TABLES
WITH READ LOCK'".

Disable execution of flush_read_lock.test on embedded
server. This test uses too many statements which are
not supported by embedded server.
2010-11-12 16:57:08 +03:00
Jon Olav Hauglid
936bec8e2c Merge from mysql-5.5-bugteam to mysql-5.5-runtime
Text conflict in mysql-test/suite/perfschema/r/dml_setup_instruments.result
Text conflict in mysql-test/suite/perfschema/r/global_read_lock.result
Text conflict in mysql-test/suite/perfschema/r/server_init.result
Text conflict in mysql-test/suite/perfschema/t/global_read_lock.test
Text conflict in mysql-test/suite/perfschema/t/server_init.test
2010-11-12 12:23:17 +01:00
Alexander Barkov
efe8743bd8 Merging from mysql-5.1-security 2010-11-12 13:20:58 +03:00
Alexander Barkov
0e1c167e16 Bug#58005 utf8 + get_format causes failed assertion: !str || str != Ptr'
Problem: When GET_FORMAT() is called two times from the upper
level function (e.g. LEAST in the bug report), on the second
call "res= args[0]->val_str(...)" and str point to the same
String object.

1. Fix: changing the order from
- get val_str into tmp_value then convert to str
to
- get val_str into str then convert to tmp_value

The new order is more correct: the purpose of "str" parameter
is exactly to call val_str() for arguments.
The purpose of String class members (like tmp_value) is to do further
actions on the result.
Doing it in the other way around give unexpected surprises.

2. Using str_value instead of str to do padding, for the same reason.
2010-11-12 13:12:15 +03:00
Dmitry Lenev
378cdc58c1 Patch that refactors global read lock implementation and fixes
bug #57006 "Deadlock between HANDLER and FLUSH TABLES WITH READ
LOCK" and bug #54673 "It takes too long to get readlock for
'FLUSH TABLES WITH READ LOCK'".

The first bug manifested itself as a deadlock which occurred
when a connection, which had some table open through HANDLER
statement, tried to update some data through DML statement
while another connection tried to execute FLUSH TABLES WITH
READ LOCK concurrently.

What happened was that FTWRL in the second connection managed
to perform first step of GRL acquisition and thus blocked all
upcoming DML. After that it started to wait for table open
through HANDLER statement to be flushed. When the first connection
tried to execute DML it has started to wait for GRL/the second
connection creating deadlock.

The second bug manifested itself as starvation of FLUSH TABLES
WITH READ LOCK statements in cases when there was a constant
stream of concurrent DML statements (in two or more
connections).

This has happened because requests for protection against GRL
which were acquired by DML statements were ignoring presence of
pending GRL and thus the latter was starved.

This patch solves both these problems by re-implementing GRL
using metadata locks.

Similar to the old implementation acquisition of GRL in new
implementation is two-step. During the first step we block
all concurrent DML and DDL statements by acquiring global S
metadata lock (each DML and DDL statement acquires global IX
lock for its duration). During the second step we block commits
by acquiring global S lock in COMMIT namespace (commit code
acquires global IX lock in this namespace).

Note that unlike in old implementation acquisition of
protection against GRL in DML and DDL is semi-automatic.
We assume that any statement which should be blocked by GRL
will either open and acquires write-lock on tables or acquires
metadata locks on objects it is going to modify. For any such
statement global IX metadata lock is automatically acquired
for its duration.

The first problem is solved because waits for GRL become
visible to deadlock detector in metadata locking subsystem
and thus deadlocks like one in the first bug become impossible.

The second problem is solved because global S locks which
are used for GRL implementation are given preference over
IX locks which are acquired by concurrent DML (and we can
switch to fair scheduling in future if needed).

Important change:
FTWRL/GRL no longer blocks DML and DDL on temporary tables.
Before this patch behavior was not consistent in this respect:
in some cases DML/DDL statements on temporary tables were
blocked while in others they were not. Since the main use cases
for FTWRL are various forms of backups and temporary tables are
not preserved during backups we have opted for consistently
allowing DML/DDL on temporary tables during FTWRL/GRL.

Important change:
This patch changes thread state names which are used when
DML/DDL of FTWRL is waiting for global read lock. It is now
either "Waiting for global read lock" or "Waiting for commit
lock" depending on the stage on which FTWRL is.

Incompatible change:
To solve deadlock in events code which was exposed by this
patch we have to replace LOCK_event_metadata mutex with
metadata locks on events. As result we have to prohibit
DDL on events under LOCK TABLES.

This patch also adds extensive test coverage for interaction
of DML/DDL and FTWRL.

Performance of new and old global read lock implementations
in sysbench tests were compared. There were no significant
difference between new and old implementations.
2010-11-11 20:11:05 +03:00
Tatiana A. Nurnberg
58f5b9c0cc Bug#43233: Some server variables are clipped during "update," not "check" stage
Bug#55794: ulonglong options of mysqld show wrong values.

Port the few remaining system variables to the correct mechanism --
range-check in check-stage (and throw error or warning at that point
as needed and depending on STRICTness), update in update stage.
Fix some signedness errors when retrieving sysvar values for display.
2010-11-11 11:35:48 +00:00
Alexander Barkov
324cb45899 Merging from mysql-5.1-security 2010-11-11 13:31:17 +03:00
Alexander Barkov
771137b50e Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
Bug#57820 extractvalue crashes

Problem: ExtractValue and Replace crashed in some cases
due to invalid handling of empty and NULL arguments.

Per file comments:

  @mysql-test/r/ctype_ujis.result
  @mysql-test/r/xml.result
  @mysql-test/t/ctype_ujis.test
  @mysql-test/t/xml.test
  Adding tests

  @sql/item_strfunc.cc
  Make sure Item_func_replace::val_str safely handles empty strings.

  @sql/item_xmlfunc.cc
  set null_value if nodeset_func returned NULL,
  which is possible when the second argument is an
  unset user variable.
2010-11-11 13:25:23 +03:00
Alexander Barkov
0c4e115c95 Bug#57687 crash when reporting duplicate group_key error and utf8
Fixing DoS regression problem.

Using "key_part->fieldnr - 1" to access the desired field
is only correct in real INSERT queries.
In case of inserting records into a temporary table
when performing GROUP BY queries this expression does not work.

Fix: Instead of accessing field_length and comparing it
to key_part->length, there is an easier way to check if
we're dealing with a prefix key: check key_part_flag against
HA_PART_KEY_SEG flag.
2010-11-11 11:08:53 +03:00
Tatiana A. Nurnberg
b56f1d8283 Bug #49752: 2469.126.2 unintentionally breaks authentication against
MySQL 5.1 server

Server used to clip overly long user-names. This was presumably lost
when code was made UTF8-clean.

Now we emulate the behaviour for backward compatibility, but UTF8-ly
correct.
2010-11-11 07:34:14 +00:00
Dmitry Shulga
0fa20fa441 Auto-merge from mysql-5.1-bugteam for bug#54375. 2010-11-11 11:06:16 +06:00
Dmitry Shulga
0fc49ccf9a Fixed bug#54375 - Error in stored procedure leaves connection
in different default schema.

In strict mode, when data truncation or conversion happens,
THD::killed is set to THD::KILL_BAD_DATA.

This is abuse of KILL mechanism to guarantee that execution
of statement is aborted.

The stored procedures execution, on the other hand,
upon detection that a connection was killed, would
terminate immediately, without trying to restore the caller's
context, in particular, restore the caller's current schema.

The fix is, when terminating a stored procedure execution,
to only bypass cleanup if the entire connection was killed,
not in case of other forms of KILL.
2010-11-11 10:52:51 +06:00
Oystein Grovlen
117c19c262 Bug#57704 Cleanup code dies with void TABLE::set_keyread(bool): Assertion `file' failed.
This bug was introduced in this revision: 
kostja@sun.com-20100727102553-b4n2ojcyfj79l2x7
("A pre-requisite patch for the fix for Bug#52044.")

It happens because close_thread_tables() is now called in
open_and_lock_tables upon failure.  Hence, table is no longer
open when optimizer tries to do cleanup.

Fix: Make sure to do cleanup in st_select_lex_unit::prepare()
upon failure. This way, cleanup() is called before tables are
released.
2010-11-10 15:48:29 +01:00
Bjorn Munch
28f60d525a Bug #57276 mysqltest: add support for simple compares in if/while conditions
Added more parsing in do_block()
      Limitation: left operand must be variable
      Also changed var_set_int from 57036 to var_check_int
      Added tests to mysqltest.test
      Some tests can now be simplified but will take this later
      Updated after comments, now white space around operator not needed
2010-11-10 09:42:14 +01:00
Bjorn Munch
9de480c577 merge from 5.5-mtr 2010-11-09 13:04:44 +01:00
Bjorn Munch
b21d06f680 merge from 5.1-mtr 2010-11-09 11:20:50 +01:00
Alexander Barkov
30e9dfda9e Postfix for Bug#26474 Add Sinhala script (Sri Lanka) collation to MySQL 2010-11-09 11:08:02 +03:00
Jon Olav Hauglid
aee8fce233 Merge from mysql-5.5-bugteam to mysql-5.5-runtime
No conflicts
2010-11-08 15:37:04 +01:00
Dmitry Shulga
1f79894087 Auto-merge from mysql-5.1-bugteam for bug#47924. 2010-11-08 00:06:22 +06:00
Dmitry Shulga
9c45600dac A fix and a test case for Bug#47924 -main.log_tables times out
sporadically.

The cause of the sporadic time out was a leaking protection
against the global read lock, taken by the RENAME statement,
and not released in case of an error occurred during RENAME.
The leaking protection counter would lead to the value of
protect_against_global_read never dropping to 0.
Consequently FLUSH TABLES in all connections, including the
one that leaked the protection, could not proceed.
 
The fix is to ensure that all branchesin RENAME code properly
release GRL protection.
2010-11-07 23:42:54 +06:00
Bjorn Munch
b541611cb9 some test fixes after merging 57840 2010-11-06 19:21:12 +01:00
Bjorn Munch
d88353ec88 upmerge 57840 2010-11-05 15:36:00 +01:00
Bjorn Munch
0527d492cc Bug #57840 MTR: parallel execution breaks with smart ordering of test cases
There were actually more problems in this area:
  Slaves (if any) were unconditionally restarted, this appears unnecessary.
  Sort criteria were suboptimal, included the test name.
Added logic to "reserve" a sequence of tests with same config for one thread
Got rid of sort_criteria hash, put it into the test case itself
Adds little sanity check that expected worker picks up test
Fixed some tests that may fail if starting on running server
Some of these fail only if *same* test is repeated.
Finally, special sorting of tests that do --force-restart
2010-11-05 15:26:38 +01:00
Jon Olav Hauglid
355ff93fbc Merge from mysql-5.5-bugteam to mysql-5.5-runtime
No conflicts
2010-11-05 15:24:16 +01:00
Mattias Jonsson
6c2c6118b3 Bug#57778: failed primary key add to partitioned innodb table inconsistent and crashes
It was possible to issue an ALTER TABLE ADD PRIMARY KEY on
an partitioned InnoDB table that failed and crashed the server.

The problem was that it succeeded to create the PK on at least
one partition, and then failed on a subsequent partition, due to
duplicate key violation. Since the partitions that already had added
the PK was not reverted all partitions was not consistent with the
table definition, which caused the crash.

The solution was to add a revert step to ha_partition::add_index()
that dropped the index for the already succeeded partitions, on failure.
2010-11-05 12:01:10 +01:00
Luis Soares
373be0d5fa BUG 57899: merged bzr bundle #2 from bug report into latest
mysql-5.5-bugteam.
2010-11-05 08:30:49 +00:00
Luis Soares
682014526c BUG 57899: merged bzr bundle #1 from bug report into latest
mysql-5.5-bugteam.
2010-11-05 08:30:10 +00:00
Luis Soares
2ac03c699d BUG#57899: Certain reserved words should not be reserved
Small fix for the test case. The column named "slow" was
used twice in the SELECTs. As a consequence, the column
named "ignore_server_ids" was not used.

To fix this we simply replace the second column selected 
named "slow" with a column named "ignore_server_ids".
2010-11-05 08:23:39 +00:00
Evgeny Potemkin
a7a1cf0d33 Auto-merged. 2010-11-04 23:38:45 +03:00
Evgeny Potemkin
ccbf81d5ff Bug#57278: Crash on min/max + with date out of range.
MySQL officially supports DATE values starting from 1000-01-01. This is
enforced for int values, but not for string values, thus one
could easily insert '0001-01-01' value. Int values are checked by
number_to_datetime function and Item_cache_datetime::val_str uses it
to fill MYSQL_TIME struct out of cached int value. This leads to the
scenario where Item_cache_datetime caches a non-null datetime value and when
it tries to convert it from int to string number_to_datetime function
treats the value as out-of-range and returns an error and
Item_cache_datetime::val_str returns NULL for a non-null value. Due to this
inconsistency server crashes.

Now number_to_datetime allows DATE values below 1000-01-01 if the
TIME_FUZZY_DATE flag is set. Better NULL handling for Item_cache_datetime.
Added the Item_cache_datetime::store function to reset str_value_cached flag
when an item is stored.
2010-11-04 16:18:27 +03:00
Jorgen Loland
4a1a6a2cb9 Bug#57882 - Item_func_conv_charset::val_str(String*):
Assertion `fixed == 1' failed

Followup patch. Test case relied on system variable that is
only available if replication is compiled in. Replaced with
variable available in all builds.
2010-11-04 13:36:36 +01:00
Jorgen Loland
eeb8bce911 Bug#57882 - Item_func_conv_charset::val_str(String*):
Assertion `fixed == 1' failed

(also fixes duplicate bug 57515)

agg_item_set_converter() (item.cc) handles conversion of 
character sets by creating a new Item. fix_fields() is then 
called on this newly created item. Prior to this patch, it was
not checked whether fix_fields() was successful or not. Thus, 
agg_item_set_converter() would return success even when an 
error occured. This patch makes it return error (TRUE) if 
fix_fields() fails.
2010-11-04 09:36:04 +01:00
Jon Olav Hauglid
0fb0d9a9a2 Bug #57130 crash in Item_field::print during SHOW CREATE TABLE or VIEW
This crash could happen if SHOW CREATE VIEW indirectly failed to open a
view due to failures to open underlying tables (or functions). Several
such errors were hidden and converted to ER_VIEW_INVALID warnings to
prevent exposing details of underlying tables for which the user have
no privileges.

However, with the changes introduced by the patch for Bug#52044,
failing to open a view will cause opened tables, views and functions
to be closed. Since the errors causing these failures were converted
to warnings, SHOW CREATE VIEW would try to continue. This made it
possible to try to access memory that had been freed, causing a crash.

This patch fixes the problem by not closing opened tables, views and
functions in these cases. This allows SHOW CREATE VIEW to continue
and also prevents it from accessing freed memory.

Test case added to lock_sync.test.
2010-11-03 16:47:32 +01:00
Luis Soares
9d102947e8 BUG#57899: Certain reserved words should not be reserved
In MySQL 5.5 the new reserved words include:
SLOW                    as in FLUSH SLOW LOGS
GENERAL                 as in FLUSH GENERAL LOGS
IGNORE_SERVER_IDS       as in CHANGE MASTER ... IGNORE_SERVER_IDS
MASTER_HEARTBEAT_PERIOD as in CHANGE MASTER ... MASTER_HEARTBEAT_PERIOD

These are not reserved words in standard SQL, or in Oracle 11g,
and as such, may affect existing applications.

We fix this by adding the new words to the list of 
keywords that are allowed for labels in SPs.
2010-11-03 14:51:52 +00:00
Georgi Kodinov
7e2fa49edf merge 2010-11-03 16:09:17 +02:00
Georgi Kodinov
c5baca93e4 Addendum to bug #57916 : fixed the test suite to be less environment
dependent.
2010-11-03 13:47:22 +02:00
Georgi Kodinov
b69f9b397a Bug #57916: Fix the naming of the proxy_priv table
1. Fixed the name of the table to proxies_priv
2. Fixed the column names to be of the form Capitalized_lowecarse instead of
Capitalized_Capitalized
3. Added Timestamp and Grantor columns
4. Added tests to plugin_auth to check the table structure
5. Updated the existing tests
2010-11-02 17:45:26 +02:00
Jon Olav Hauglid
9d16003a00 Merge from mysql-5.5-bugteam to mysql-5.5-runtime
No conflicts
2010-11-01 12:10:04 +01:00
Sergey Glukhov
05c6fc4b2f 5.1-sucurity->5.5-security merge 2010-11-01 10:01:32 +03:00
Sergey Glukhov
942f71b2e0 test case fix 2010-11-01 09:47:57 +03:00
Gleb Shchepa
89f9f6a40d manual merge 5.1-bugteam --> 5.5-bugteam (bug 52160) 2010-11-01 02:23:37 +03:00
Gleb Shchepa
0389c6aac0 Bug #52160: crash and inconsistent results when grouping
by a function and column

The bugreport reveals two different bugs about grouping
on a function:

1) grouping by the TIME_TO_SEC function result caused
   a server crash or wrong results and
2) grouping by the function returning a blob caused
   an unexpected "Duplicate entry" error and wrong
   result.

Details for the 1st bug:

TIME_TO_SEC() returns NULL if its argument is invalid (empty
string for example). Thus its nullability depends not only
on the nullability of its arguments but also on their values.
Fixed by (overoptimistically) setting TIME_TO_SEC() to be
nullable despite the nullability of its arguments.

Details for the 2nd bug:

The server is unable to create indices on blobs without
explicit blob key part length. However, this fact was
ignored for blob function result fields of GROUP BY
intermediate tables.
Fixed by disabling GROUP BY index creation for blob
function result fields like regular blob fields.
2010-10-31 19:04:38 +03:00
Sven Sandberg
d520df90fc wL#5625: Deprecate mysqlbinlog options --base64-output=always and --base64-output
Adds deprecation warning for the mysqlbinlog options
--base64-output=always and --base64-output.
A warning is printed when the flags are used,
and also when running mysqlbinlog --help.
2010-10-29 16:56:58 +02:00
Jon Olav Hauglid
97e295cc22 Bug #57659 Segfault in Query_cache::invalidate_data for TRUNCATE TABLE
This crash could happen if TRUNCATE TABLE indirectly failed to open a
merge table due to failures to open underlying tables. Even if opening
failed, the TRUNCATE TABLE code would try to invalidate the table in
the query cache. Since this table had been closed and memory released,
this could lead to a crash.

This bug was introduced by a combination of the changes introduced by
the patch for Bug#52044, where failing to open a table will cause opened
tables to be closed. And the changes in patch for Bug#49938, where
TRUNCATE TABLE uses the standard open tables function.

This patch fixes the problem by setting the TABLE pointer to NULL before 
invalidating the query cache.

Test case added to truncate_coverage.test.
2010-10-29 16:10:53 +02:00
Georgi Kodinov
97a06e4d9a merge 2010-10-29 15:25:18 +03:00
Georgi Kodinov
860c9d9c35 merge to 5.1-security 2010-10-29 14:02:49 +03:00
Jon Olav Hauglid
37efd0e1ef Merge from mysql-5.5-bugteam to mysql-5.5-runtime
No conflicts
2010-10-29 11:46:18 +02:00
Sergey Glukhov
88e82a892b 5.1-security->5.5-security merge 2010-10-29 12:31:28 +04:00
Sergey Glukhov
e3917c3d43 Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
Lines below which were added in the patch for Bug#56814 cause this crash:

+      if (table->table)
+        table->table->maybe_null= FALSE;

Consider following test case:
--
CREATE TABLE t1(f1 INT NOT NULL);
INSERT INTO t1 VALUES (16777214),(0);

SELECT COUNT(*) FROM t1 LEFT JOIN t1 t2
ON 1 WHERE t2.f1 > 1 GROUP BY t2.f1;

DROP TABLE t1;
--

We set TABLE::maybe_null to FALSE for t2 table
and in create_tmp_field() we create appropriate tmp table field
using create_tmp_field_from_item() function instead of
create_tmp_field_from_field. As a result we have
LONGLONG field. As we have GROUP BY clause we calculate
group buffer length, see calc_group_buffer().
Item from group list which is used for calculation
refer to the field from real tables and have LONG type.
So group buffer length become insufficient for storing of
LONGLONG value. It leads to overwriting of wrong memory
area in do_field_int() function which is called from
end_update().
After some investigation I found out that
create_tmp_field_from_item() is used only for OLAP
grouping and can not be used for common grouping
as it could be an incompatibility between tmp
table fields and group buffer length.
We can not remove create_tmp_field_from_item() call from
create_tmp_field as OLAP needs it and we can not use this
function for common grouping. So we should remove setting
TABLE::maybe_null to FALSE from simplify_joins().
In this case we'll get wrong behaviour of
list_contains_unique_index() back. To fix it we
could use Field::real_maybe_null() check instead of
Field::maybe_null() and add addition check of
TABLE_LIST::outer_join.
2010-10-29 12:23:06 +04:00
Sergey Glukhov
bfa29d10e0 5.1-security->5.5-security 2010-10-29 11:59:36 +04:00
Sergey Glukhov
3a61843a1f Bug#57194 group_concat cause crash and/or invalid memory reads with type errors
The problem is caused by bug49487 fix and became visible
after after bug56679 fix.
Items are cleaned up and set to unfixed state after filling derived table.
So we can not rely on item::fixed state in Item_func_group_concat::print
and we can not use 'args' array as items there may be cleaned up.
The fix is always to use orig_args array of items as it
always should contain the correct data.
2010-10-29 11:44:32 +04:00
Sergey Glukhov
dff3f05bf0 5.1-secutity->5.5-security merge(test case only) 2010-10-27 18:20:25 +04:00
Sergey Glukhov
5bf148fccd Bug#57477 SIGFPE when dividing a huge number a negative number
The problem is dividing by const value when
the result is out of supported range.
The fix:
-return LONGLONG_MIN if the result is out of supported range for DIV operator.
-return 0 if divisor is -1 for MOD operator.
2010-10-27 18:12:10 +04:00
Vasil Dimov
497613c057 Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-10-27 16:39:22 +03:00
Anitha Gopi
0f00988327 Fixed bug numbers in disabled.def files 2010-10-27 09:54:04 +05:30
Bjorn Munch
8eb6992231 merge from 5.5-mtr 2010-10-26 08:30:02 +02:00
Georgi Kodinov
16323dd4d4 merge 2010-10-27 09:34:03 +02:00
Georgi Kodinov
cfa413bf4e merge 2010-10-27 09:32:26 +02:00
Anitha Gopi
0e5cd31368 Up merge revision 3547 from 5.1. Enable sp_sync test since Bug 48157 is fixed 2010-10-27 11:04:48 +05:30
Alexander Nozdrin
1ed6c86396 Patch for Bug#55850 (Trigger warnings not cleared).
The problem was that the warnings risen by a trigger were not cleared upon
successful completion. The warnings should be cleared if the trigger completes
successfully.

The fix is to skip merging warnings into caller's Warning Info for triggers.
2010-10-26 15:48:08 +04:00
Bjorn Munch
16a55614cc merge from 5.1-mtr 2010-10-25 15:48:41 +02:00
Jon Olav Hauglid
a12de3d00d Merge from mysql-5.5-bugteam to mysql-5.5-runtime
No conflicts
2010-10-25 14:26:21 +02:00
Horst.Hunger
1eb1bea003 Due to failing on Freebsd. 2010-10-25 12:24:26 +02:00
Jon Olav Hauglid
d293c4258e Merge from mysql-5.5-runtime to mysql-5.5-bugteam
No conflicts
2010-10-22 14:13:03 +02:00
Davi Arnaut
ae6801eb23 Bug#37780: Make KILL reliable (main.kill fails randomly)
- A prerequisite cleanup patch for making KILL reliable.

The test case main.kill did not work reliably.

The following problems have been identified:

1. A kill signal could go lost if it came in, short before a
thread went reading on the client connection.

2. A kill signal could go lost if it came in, short before a
thread went waiting on a condition variable.

These problems have been solved as follows. Please see also
added code comments for more details.

1. There is no safe way to detect, when a thread enters the
blocking state of a read(2) or recv(2) system call, where it
can be interrupted by a signal. Hence it is not possible to
wait for the right moment to send a kill signal. It has been
decided, not to fix it in the code.  Instead, the test case
repeats the KILL statement until the connection terminates.

2. Before waiting on a condition variable, we register it
together with a synchronizating mutex in THD::mysys_var. After
this, we need to test THD::killed again. At some places we did
only test it in a loop condition before the registration. When
THD::killed had been set between this test and the registration,
we entered waiting without noticing the killed flag. Additional
checks ahve been introduced where required.

In addition to the above, a re-write of the main.kill test
case has been done. All sleeps have been replaced by Debug
Sync Facility synchronization. A couple of sync points have
been added to the server code.

To avoid further problems, if the test case fails in spite of
the fixes, the test case has been added to the "experimental"
list for now.

- Most of the work on this patch is authored by Ingo Struewing
2010-10-22 09:58:09 -02:00
Horst.Hunger
5ff1cbb8ea Due to issues with merge. 2010-10-22 10:20:17 +02:00
Jon Olav Hauglid
26e7ee2fa5 Merge from mysql-5.5-bugteam to mysql-5.5-runtime
No conflicts
2010-10-21 16:28:29 +02:00
Bjorn Munch
add465e5a1 merge from 5.5 2010-10-21 11:20:53 +02:00
Horst.Hunger
237dfb742f due to merge 2010-10-20 16:56:09 +02:00
Oystein Grovlen
07fd5d6f99 Bug#57512 str_to_date crash...
str_to_date function should only try to generate a warning for
invalid input strings, not when input value is NULL. In latter
case, val_str() of input argument will return a nil pointer.
Trying to generate a warning using this pointer lead to a
segmentation fault. Solution: Only generate warning when pointer
to input string is non-nil.
2010-10-20 15:17:29 +02:00