Commit graph

68985 commits

Author SHA1 Message Date
Mikael Ronstrom
d5d966a6b9 Fixed error in merge 2011-04-20 15:15:47 +02:00
Mikael Ronstrom
8486212a24 Fixed missing change of thd_unlock_connection_data to thd_unlock_thread_count 2011-04-20 15:07:19 +02:00
Mikael Ronström
50b5f456c1 Merge 5.5, step 3 2011-04-15 15:58:30 +02:00
Mikael Ronström
4569537ff0 Merge step 2 2011-04-15 15:47:26 +02:00
Mikael Ronström
7b079a3a7e Merge 5.5 2011-04-15 15:46:11 +02:00
Alexander Nozdrin
506ff594c8 A patch for Bug#11763166 (55847: SHOW WARNINGS returns empty
result set when SQLEXCEPTION is active.

The problem was in a hackish THD::no_warnings_for_error attribute.
When it was set, an error was not written to Warning_info -- only
Diagnostics_area state was changed. That means, Diagnostics_area
might contain error state, which is not present in Warning_info.

The user-visible problem was that in some cases SHOW WARNINGS
returned empty result set (i.e. there were no warnings) while
the previous SQL statement failed. According to the MySQL
protocol errors must be presented in warning list.

The main idea of this patch is to remove THD::no_warnings_for_error.
There were few places where it was used:
  - sql_admin.cc, handling of REPAIR TABLE USE_FRM.
  - sql_show.cc, when calling fill_schema_table_from_frm().
  - sql_show.cc, when calling fill_table().
The fix is to either use internal-error-handlers, or to use
temporary Warning_info storing warnings, which might be ignored.

This patch is needed to fix Bug 11763162 (55843).
2011-04-15 16:02:22 +04:00
Mikael Ronström
97036a97a1 Changed name to better reflect function logic in accordance with WL#5788 2011-04-15 13:02:29 +02:00
Mikael Ronström
cec8c6e790 Changed name to better reflect function logic in accordance with WL#5788 2011-04-15 13:00:59 +02:00
Mikael Ronström
0db7bb2bfe Use C++ manner for unused param instead of C manner 2011-04-15 12:57:59 +02:00
Sergey Glukhov
df28a9d804 5.1 -> 5.5 merge 2011-04-15 12:55:21 +04:00
Sergey Glukhov
12a6e0d90e Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
Some multibyte sequences could be considered by my_mbcharlen() functions
as multibyte character but more exact my_ismbchar() does not think so.
In such a case this multibyte sequences is pushed into 'stack' buffer which
is too small to accommodate the sequence.
The fix is to allocate stack buffer in
compliance with max character length.
2011-04-15 12:51:34 +04:00
Tor Didriksen
73c8173f44 Merge fix for Bug#11765713 from 5.1 2011-04-15 08:54:05 +02:00
Tor Didriksen
2af655c2e5 Bug#11765713 58705: OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES CREATED BY OPT_SUM_QU
Valgrind warnings were caused by comparing index values to an un-initialized field.
2011-04-14 16:35:24 +02:00
Serge Kozlov
2705490f68 autocommit 5.1 -> 5.5 2011-04-14 15:54:48 +04:00
Serge Kozlov
c65d5b7610 WL#5867, postfix for binlog_bug23533 2011-04-14 15:24:11 +04:00
Sergey Glukhov
8ded325f42 automerge 2011-04-14 13:34:53 +04:00
Sergey Glukhov
625d0c6c0b 5.1 -> 5.5 merge 2011-04-14 13:10:11 +04:00
Jon Olav Hauglid
889a52d585 Bug#12352846 - TRANS_XA_START(THD*):
ASSERTION THD->TRANSACTION.XID_STATE.XID.IS_NULL()
               FAILED

The triggered assert checks that the previous XA transaction has
done proper cleanup before a new XA transaction is started.
The bug that caused it to be triggered was that XA COMMIT did not
clean up error state if XA COMMIT discovered that the current XA
transaction had to be rolled back.

This patch fixes the problem by resetting the XA error state
before XA COMMIT calls ha_rollback_trans(). This allows following
XA transactions to be started without triggering the assert.

Test case added to xa.test.
2011-04-14 10:13:28 +02:00
Sergey Glukhov
3f3318c34e Bug#11756242 48137: PROCEDURE ANALYSE() LEAKS MEMORY WHEN RETURNING NULL
There are two problems with ANALYSE():

1. Memory leak 
   it happens because do_select() can overwrite
   JOIN::procedure field(with zero value in our case) and
   JOIN destructor don't free the memory allocated for
   JOIN::procedure. The fix is to save original JOIN::procedure
   before do_select() call and restore it after do_select
   execution.

2. Wrong result
   If ANALYSE() procedure is used for the statement with LIMIT clause
   it could retrun empty result set. It happens because of missing 
   analyse::end_of_records() call. First end_send() function call
   returns NESTED_LOOP_QUERY_LIMIT and second call of end_send() with
   end_of_records flag enabled does not happen. The fix is to return
   NESTED_LOOP_OK from end_send() if procedure is active.
2011-04-14 12:11:57 +04:00
Magne Mahre
da08d69b70 Bug#11766320 MYSQL SYMBOLIC LINKS NOT WORKING
When MySQL converted from autotools to CMake, the
preprocessor symbol USE_SYMDIR was omitted by mistake.

Without this symbol, the code for checking .sym files
is not built.

This patch defines USE_SYMDIR when built on MS Windows.
2011-04-14 10:08:12 +02:00
Serge Kozlov
6b3c702f61 autocommit 5.1->5.5 2011-04-14 00:48:09 +04:00
Serge Kozlov
58cb12c9b2 WL#5867, reorganize test cases of bugs suite 2011-04-14 00:18:08 +04:00
Davi Arnaut
9e3699ca4f Remove some leftovers from the removal of the gethostbyname wrappers. 2011-04-13 16:05:26 -03:00
Davi Arnaut
475c4f7bed Increment the I_P_List counter whenever a element is inserted into
the list. Previously, the counter would only be incremented if the
insertion method push_front() was used, in which case the counter
wouldn't be incremented if a element was inserted using the push_back()
and/or insert_after() methods.

Currently this does not affect the code base because there isn't any
code that uses a counted list with the push_back() or insert_after()
methods.
2011-04-13 08:23:10 -03:00
Anitha Gopi
dd17a7e0ae Bug#11762246 : Test is not failing in PB2. Remove from experimental group 2011-04-13 16:42:13 +05:30
Dmitry Lenev
be65ee15fb Bug#11938039 "RE-EXECUTION OF FRM-ONLY ALTER TABLE WITH RENAME
CLAUSE FAILS OR ABORTS SERVER".
 
Attempt to re-execute prepared ALTER TABLE statement which 
involves .FRM-only changes and also have RENAME clause led
to unwarranted 'Table doesn't exist' error in production
builds and assertion failure for debug builds.
 
This problem stemmed from the fact that for such ALTER TABLE
mysql_alter_table() code changed table list element for table 
to be altered when it tried to re-open table under new name. 
Since this change was not reverted back before next 
re-execution, it made this statement re-execution unsafe.
 
This fix addresses this problem by avoiding changing table list
element from the main table list in such a situation. Instead 
temporary TABLE_LIST object is used.
2011-04-13 10:16:40 +04:00
Sven Sandberg
288d71b95e null merge 2011-04-12 13:17:25 +02:00
Sven Sandberg
d08c710457 marked rpl_stop_slave experimental due to BUG#12345981 2011-04-12 13:14:49 +02:00
Jon Olav Hauglid
ba82398dab Bug#12348348 - ASSERTION IN ROW0SEL.C LINE 3698:
TRX->CONC_STATE == 0 || TRX->CONC_STATE == 1

This bug was a different manifestation of Bug#11766752,
which was previously only fixed on mysql-trunk.

This patch backports the fix for Bug#11766752 to mysql-5.5,
which fixes the problem. The patch also adds some extra test
coverage.
2011-04-12 12:57:02 +02:00
Sergey Glukhov
4e8e373fb1 automerge 2011-04-12 14:34:12 +04:00
Sergey Glukhov
f88699196c 5.1 -> 5.5 merge 2011-04-12 14:13:15 +04:00
Sergey Glukhov
60cc2f91d6 Bug#11766270 59343: YEAR(4): INCORRECT RESULT AND VALGRIND WARNINGS WITH MIN/MAX, UNION
When we create temporary result table for UNION
incorrect max_length for YEAR field is used and
it leads to incorrect field value and incorrect
result string length as YEAR field value calculation
depends on field length.
The fix is to use underlying item max_length for
Item_sum_hybrid::max_length intialization.
2011-04-12 14:01:33 +04:00
Sergey Glukhov
56bff85247 Bug#11766212 59270: NOT IN (YEAR( ... ), ... ) PRODUCES MANY VALGRIND WARNINGS
Valgrind warning happens due to early null values check
in Item_func_in::fix_length_and_dec(before item evaluation).
As result null value items with uninitialized values are
placed into array and it leads to valgrind warnings during
value array sorting.
The fix is to check null value after item evaluation, item
is evaluated in in_array::set() method.
2011-04-12 13:51:36 +04:00
Sven Sandberg
81ae92c260 some replication tests were marked experimental with reference
to a bug that has been fixed. made these tests non-experimental.
2011-04-12 11:47:00 +02:00
Sven Sandberg
db63b0b771 null merge 2011-04-11 16:11:19 +02:00
Sven Sandberg
bbfb9eabd5 corrected bug reference for experimental test 2011-04-11 16:01:46 +02:00
Davi Arnaut
74ccd37745 Move I_P_List_adapter to sql_plist.h as it is currently being used
for code other then in mdl.h. Since the adapter is generic, it is
better located in sql_plist.h.
2011-04-11 08:39:15 -03:00
Alexander Nozdrin
c210b98b53 Null-merge from mysql-5.1. 2011-04-11 13:59:59 +04:00
Alexander Nozdrin
df327bb034 Null-merge from mysql-5.0. 2011-04-11 13:58:44 +04:00
Alexander Nozdrin
280c3cf7a9 Bump NDB-version. 2011-04-11 13:57:45 +04:00
Alexander Nozdrin
2408c2e639 Merge from mysql-5.1 (bump the version). 2011-04-11 13:49:05 +04:00
Alexander Nozdrin
e3fc6b27ef Merge from mysql-5.0 (bump the version). 2011-04-11 13:47:15 +04:00
Alexander Nozdrin
ab52fdfaab Bump version. 2011-04-11 13:45:41 +04:00
Alexander Barkov
ece1996b5a Bug#11926811 / Bug#60625 Illegal mix of collations
Problem: comparison of a DATETIME sp variable and NOW()
led to Illegal mix of collations error when 
character_set_connection=utf8.
Introduced by "WL#2649 Number-to-string conversions".

Error happened in Arg_comparator::set_compare_func(),
because the first argument was errouneously converted to utf8,
while the second argument was not.

Fix: separate agg_arg_charsets_for_comparison() into two functions:

- agg_arg_charsets_for_comparison() - for pure comparison,
  when we don't need to return any string result and therefore
  don't need to convert arguments to @@character_set_connection:
    SELECT a = b;

- agg_arg_charsets_for_string_results_with_comparison() - when
  we need to return a string result, but we also need to do
  comparison internally: SELECT REPLACE(a,b,c)
  If all arguments are numbers:
    SELECT REPLACE(123,2,3) -> 133
  we convert arguments to @@character_set_connection.


  @ mysql-test/include/ctype_numconv.inc
  @ mysql-test/r/ctype_binary.result
  @ mysql-test/r/ctype_cp1251.result
  @ mysql-test/r/ctype_latin1.result
  @ mysql-test/r/ctype_ucs.result
  @ mysql-test/r/ctype_utf8.result
  Adding tests

  @ sql/item.cc
  @ sql/item.h
  @ sql/item_func.cc
  @ sql/item_func.h
  @ sql/item_strfunc.cc

  Introducing and using new function
   agg_item_charsets_for_string_result_with_comparison() and
  its Item_func wrapper agg_arg_charsets_for_string_result_with_comparison().
2011-04-08 17:15:23 +04:00
Alexander Nozdrin
6a29392289 A patch for Bug#12325375: THE SERVER ON WINXP DOES NOT ALLOW CONNECTIONS
IF NO DNS-SERVER AVAILABLE.

The thing is that on Windows XP getnameinfo() returns WSANO_DATA
when hostname-lookup is not available. The problem was that
this error code was treated as serious error and the client
connection got rejected.

The fix is to treat all errors from getnameinfo() as not ciritical,
but add IP-address to the host cache only for EAI_NONAME (or WSANO_DATA).
2011-04-08 14:23:36 +04:00
Gleb Shchepa
71ffbd4651 manual merge 5.1-->5.5 (bug 11829681) 2011-04-08 12:09:24 +04:00
Gleb Shchepa
bd193c61e3 Bug #11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERY
Select from a view with the underlying HAVING clause failed with a
message: "1356: View '...' references invalid table(s) or column(s)
or function(s) or definer/invoker of view lack rights to use them"

The bug is a regression of the fix for bug 11750328 - 40825 (similar
case, but the HAVING cause references an aliased field).
In the old fix for bug 40825 the Item_field::name_length value has
been used in place of the real length of Item_field::name. However,
in some cases Item_field::name_length is not in sync with the
actual name length (TODO: combine name and name_length into a
solid String field).

The Item_ref::print() method has been modified to calculate actual
name length every time.
2011-04-08 12:05:20 +04:00
Nirbhay Choubey
61dd7b3611 Adjusting test result for bug#11765157. 2011-04-08 12:34:54 +05:30
Nirbhay Choubey
4cf9d978ec Merging patch for bug#11765157 from mysql-5.1. 2011-04-08 12:25:59 +05:30
Nirbhay Choubey
b563350e7a Bug#11765157 - 58090: mysqlslap drops schema specified in
create_schema if auto-generate-sql also set.

mysqlslap uses a schema to run its tests on and later
drops it if auto-generate-sql is used. This can be a
problem, if the schema is an already existing one.

If create-schema is used with auto-generate-sql option,
mysqlslap while performing the cleanup, drops the specified
database.

Fixed by introducing an option --no-drop, which, if used,
will prevent the dropping of schema at the end of the test.
2011-04-08 12:22:44 +05:30