Commit graph

67595 commits

Author SHA1 Message Date
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
4ca561e78b Suppress false-positive uninitialized variable use
warnings in Event_queue::get_top_for_execution_if_time()
method which has caused -Werror build to fail.
2010-11-19 10:41:09 +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
2d773c8b3a Merge from mysql-5.5-bugteam to mysql-5.5-runtime
No conflicts
2010-11-18 17:52:53 +01: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
f481c14e3e Auto-merge 2010-11-18 17:10:43 +03:00
Vasil Dimov
2db59b4d9f Merge mysql-5.1-bugteam -> mysql-5.5-bugteam (empty) 2010-11-18 16:12:13 +02: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
Vasil Dimov
da58ea8375 Merge mysql-5.1-bugteam from bk-internal into my local repo 2010-11-18 16:04:53 +02:00
Vasil Dimov
459c3b8f55 Merge mysql-5.5-bugteam from bk-internal into my local repo 2010-11-18 16:02:30 +02:00
Vasil Dimov
a4b86d7dae Merge mysql-5.1-bugteam -> mysql-5.5-bugteam (empty) 2010-11-18 15:48:45 +02:00
Vasil Dimov
3cd3081ac1 Merge mysql-5.5-innodb -> mysql-5.5-bugteam 2010-11-18 15:47:05 +02:00
Vasil Dimov
3ff58881bd Merge mysql-5.1-innodb -> mysql-5.1-bugteam 2010-11-18 15:45:36 +02: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
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
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
Davi Arnaut
94c79b37a0 Fix a debug assertion caused by a missing DBUG_RETURN macro. 2010-11-17 19:02:48 -02: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
Davi Arnaut
46dd9e8658 Merge of mysql-5.1-bugteam into mysql-5.5-bugteam. 2010-11-17 07:50:19 -02:00
Davi Arnaut
aaa370f5d7 Bug#57994: Compiler flag change build error : my_redel.c
Use __builtin_stpcpy only if the system supports stpcpy.
This is necessary as in some cases a call to stpcpy will
be emitted if the built-in can not optimized.
2010-11-17 07:41:29 -02:00
Davi Arnaut
afcf7bc71c Bug#57058: SERVER_QUERY_WAS_SLOW not wired up.
Finalize the server flags after any kind of command is executed.
To avoid updating the flag multiple times, reorganize code so that
its invoked only once for each command.
2010-11-16 19:57:18 -02: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
Mats Kindahl
b0185d2a81 Merging with mysql-5.5-bugteam 2010-11-16 12:19:24 +01:00
Mats Kindahl
55c752fc75 Merging with mysql-5.5-bugfixing. 2010-11-16 12:12:09 +01:00
Mats Kindahl
3219886dc2 Bug #58173: Valgrind warning in load_defaults()
Memory was allocated for storing path names inside
fn_expand(), which were not free:ed anywhere.

This patch fixes the problem by storing the path
names in statically allocated buffers instead,
which is automatically free:ed when the server
exits.
2010-11-16 11:58:39 +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
Davi Arnaut
2495e10c11 Merge of mysql-5.1-bugteam into mysql-5.5-bugteam. 2010-11-16 07:45:07 -02: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
Marc Alff
b4b3c996af Local merge 2010-11-16 06:59:26 +01:00
Marc Alff
089b5769d3 Local merge 2010-11-16 06:45:24 +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
5bbe83f6d6 merge 2010-11-15 23:57:14 +01:00
Mattias Jonsson
61f14ae031 merge 2010-11-15 23:38:26 +01:00
Mattias Jonsson
6b1a7db900 merge 2010-11-15 17:44:27 +01:00
Mattias Jonsson
71bf3d5760 merge 2010-11-15 17:13:53 +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
Jon Olav Hauglid
294f3865cd Bug #57663 Concurrent statement using stored function and DROP DATABASE
breaks SBR

This pre-requisite patch removes obsolete and dead code used to remove
raid subdirectories and files during DROP DATABASE.

Other parts of the raid code have already been removed in WL#5498
and the support for MyISAM raid tables was removed in 5.0.
2010-11-15 12:32:49 +01:00
Jimmy Yang
f4cec49456 Fix Bug #16290 Unclear error message when adding foreign key constraint
rb://502 approved by Sunny Bains
2010-11-14 23:08:04 -08:00
Vladislav Vaintroub
616f90b372 merge 2010-11-13 23:17:22 +01:00
Vladislav Vaintroub
a6b4be2522 add missing COMPONENT to all CMake INSTALL commands 2010-11-13 23:16:52 +01:00
Vladislav Vaintroub
8a9549434d Bug#58178: "make package" is broken with cmake 2.8.3
Problem:  with "make package" , many small packages are 
generated, one per CMake COMPONENT, instead of expected single
package. This is due to the new (in cmake 2.8.3) component-based 
install for archive( e.g ZIP,TGZ ) CPack generators.

See http://public.kitware.com/Bug/view.php?id=11452 for discussion.

Fix: use CPACK_MONOLITHIC_INSTALL=1 to enforce single package.
Reset this variable temporarily to 0 for  MSI creation  (MSI needs 
COMPONENTs)
2010-11-13 19:38:39 +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
Joerg Bruehe
6c6ad182a6 Patch for bug#57596
MySQL-shared RPM no longer provides mysql-shared

The spec file is changed to explicitly "provide" "mysql-shared"
by the "shared" sub-RPM.
2010-11-12 22:22:55 +01:00
Konstantin Osipov
0d61ebcb27 Fix a compilation failure of non-debug build introduced
by the patch for Bug#57058.
2010-11-12 17:20:12 +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