Commit graph

26168 commits

Author SHA1 Message Date
Vasil Dimov
bc7bf937c5 Merge mysql-5.1-innodb -> mysql-5.1 2011-05-02 12:49:19 +03:00
Vasil Dimov
2e0e518f39 Sync 5.1 .inc file with 5.5 due to a missing changeset
Add extra codes to wait_until_disconnected.inc that are present in 5.5,
but not in 5.1. The missing codes cause innodb_bug59641 to fail in 5.1 on
Windows PB2 runs. The addition of those codes in 5.5 was done in
luis.soares@sun.com-20090930233215-aup3kxy4j6ltvjfp
2011-04-29 14:04:28 +03:00
Bjorn Munch
cc78ab77c9 merge from 5.1 main 2011-04-29 10:55:08 +02:00
Mattias Jonsson
aefbea7d0b Post push fix for bug#11766249 bug#59316
Partitions can have different ref_length (position data length).
Removed DBUG_ASSERT which crashed debug builds when using
MAX_ROWS on some partitions.
2011-04-27 17:51:06 +02:00
Sergey Glukhov
735bab72c5 Bug#11889186 60503: CRASH IN MAKE_DATE_TIME WITH DATE_FORMAT / STR_TO_DATE COMBINATION
calc_daynr() function returns negative result
if malformed date with zero year and month is used.
Attempt to calculate week day on negative value
leads to crash. The fix is return NULL for
'W', 'a', 'w' specifiers if zero year and month is used.
Additional fix for calc_daynr():
--added assertion that result can not be negative
--return 0 if zero year and month is used
2011-04-27 11:35:57 +04:00
Vasil Dimov
b4a98699be Merge mysql-5.1 -> mysql-5.1-innodb 2011-04-21 11:08:05 +03:00
Bjorn Munch
5cc7844b5c Bug #12379923 60907: MYSQL-TEST/LIB/MY/SAFEPROCESS/SAFE_PROCESS.PL USES HARDCODED SIGNAL NUMBE
Replaced the hardcoded 9 with 'KILL'
2011-04-20 14:58:53 +02:00
Sergey Glukhov
71bb332aa3 Bug#11765923 58937: MANY VALGRIND ERRORS AFTER GROUPING BY RESULT OF DECIMAL COLUMN FUNCTION
Bug#11764671  57533: UNINITIALISED VALUES IN COPY_AND_CONVERT (SQL_STRING.CC) WITH CERTAIN CHA
When ROUND evaluates decimal result it uses Item::decimal
value as fraction value for the result. In some cases
Item::decimal is greater than real result fraction value
and uninitialised memory of result(decimal) buffer can be
used in further calculations. Issue is introduced by
Bug33143 fix. The fix is to remove erroneous assignment.
2011-04-20 11:39:20 +04:00
Serge Kozlov
410ee93cde BUG#12371924
Update test case
2011-04-18 23:59:15 +04:00
Bjorn Munch
c346b0a483 Bug #12365486 MTR FAILS TO FIND WARNINGS IN SERVER LOG WITH --VALGRIND COMBINED WITH --DEBUG
With this combination, outoput was directed to .trace but not all
      parts of MTR was aware of this.
Replace .err with .trace at the earliest possible place
2011-04-18 15:35:14 +02:00
Sven Sandberg
5038060b3b test fails on more platforms, removed @freebsd from default.experimental. 2011-04-18 14:42:14 +02:00
Martin Hansson
7b4cafe9b9 Bug 11758558 - 50774: WRONG RESULTSET WHEN TIMESTAMP VALUES ARE APPENDED WITH
.0

The bug was fixed by the patch for bug number BUG 11763109 - 55779: SELECT
DOES NOT WORK PROPERLY IN MYSQL SERVER VERSION "5.1.42 SUSE MYSQL (Exact same
fix as was proposed for this bug.) Since the motivation for the two bug
reports was completely different, however, it still makes sense to push the
test case.

This patch contains only the test case.
2011-04-18 10:44:41 +02:00
Bjorn Munch
19add93d3a merge from 5.1 main 2011-04-15 15:51:31 +02: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
Bjorn Munch
331058bc91 Bug #12360195 MTR DOES NOT IGNORE TABS IN EXPERIMENTAL FILE
Instead of just filtering space, filter white space (\s)
I left the default.experimental file as is, with tabs.
2011-04-15 10:30:52 +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
Bjorn Munch
a23276c5c1 Bug #12351213 MTR --VS-CONFIG DOES NOT WORK LIKE MTR_VS_CONFIG
Fix for --vs-config applied
Find.pm incorrectly tested an unitialized local variable instead
  of the global, corrected.
Find.pm is also wrong in 5.5: uses a non-existent global variable. Fix when
  merging up.
2011-04-14 16:17:58 +02:00
Serge Kozlov
c65d5b7610 WL#5867, postfix for binlog_bug23533 2011-04-14 15:24:11 +04: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
Serge Kozlov
58cb12c9b2 WL#5867, reorganize test cases of bugs suite 2011-04-14 00:18:08 +04:00
Sven Sandberg
d08c710457 marked rpl_stop_slave experimental due to BUG#12345981 2011-04-12 13:14:49 +02: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
bbfb9eabd5 corrected bug reference for experimental test 2011-04-11 16:01:46 +02: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
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
Marko Mäkelä
1a0dde9206 Bug #11766513 - 59641: Prepared XA transaction in system after hard crash
causes future shutdown hang

InnoDB would hang on shutdown if any XA transactions exist in the
system in the PREPARED state. This has been masked by the fact that
MySQL would roll back any PREPARED transaction on shutdown, in the
spirit of Bug #12161 Xa recovery and client disconnection.

[mysql-test-run] do_shutdown_server: Interpret --shutdown_server 0 as
a request to kill the server immediately without initiating a
shutdown procedure.

xid_cache_insert(): Initialize XID_STATE::rm_error in order to avoid a
bogus error message on XA ROLLBACK of a recovered PREPARED transaction.

innobase_commit_by_xid(), innobase_rollback_by_xid(): Free the InnoDB
transaction object after rolling back a PREPARED transaction.

trx_get_trx_by_xid(): Only consider transactions whose
trx->is_prepared flag is set. The MySQL layer seems to prevent
attempts to roll back connected transactions that are in the PREPARED
state from another connection, but it is better to play it safe. The
is_prepared flag was introduced in the InnoDB Plugin.

trx_n_prepared: A new counter, counting the number of InnoDB
transactions in the PREPARED state.

logs_empty_and_mark_files_at_shutdown(): On shutdown, allow
trx_n_prepared transactions to exist in the system.

trx_undo_free_prepared(), trx_free_prepared(): New functions, to free
the memory objects of PREPARED transactions on shutdown. This is not
needed in the built-in InnoDB, because it would collect all allocated
memory on shutdown. The InnoDB Plugin needs this because of
innodb_use_sys_malloc.

trx_sys_close(): Invoke trx_free_prepared() on all remaining
transactions.
2011-04-07 21:12:54 +03:00
Guilhem Bichot
08bf3ddde9 Fix for Bug#11765141 - "58072: LOAD DATA INFILE: LEAKS IO CACHE MEMORY WHEN ERROR OCCURS" 2011-04-07 15:09:19 +02:00
Serge Kozlov
e7079a3235 BUG#12371924. Fxi test case 2011-04-25 23:49:56 +04:00
Sergey Glukhov
76f37a0235 Bug#11756928 48916: SERVER INCORRECTLY PROCESSING HAVING CLAUSES WITH AN ORDER BY CLAUSE
Before sorting HAVING condition is split into two parts,
first part is a table related condition and the rest of is
HAVING part. Extraction of HAVING part does not take into account
the fact that some of conditions might be non-const but
have 'used_tables' == 0 (independent subqueries)
and because of that these conditions are cut off by
make_cond_for_table() function.
The fix is to use (table_map) 0 instead of used_tables in
third argument for make_cond_for_table() function.
It allows to extract elements which belong to sorted
table and in addition elements which are independend
subqueries.
2011-04-22 11:20:55 +04:00
Bjorn Munch
507f816e2c merge from 5.1-mtr 2011-04-07 13:15:24 +02:00
Vasil Dimov
325715c43f Load the innodb plugin instead of builtin in innodb_plugin.innodb_bug59410
Spotted by:	Marko
2011-04-06 14:38:24 +03:00
Bjorn Munch
aafabc920d merge from 5.1 main 2011-04-05 15:02:01 +02:00
Vasil Dimov
56c34b5c1e Add the testcase for Bug#59410 to 5.1/InnoDB Plugin
Bug#59410 read uncommitted: unlock row could not find a 3 mode lock
on the record

This bug is present only in 5.6 but I am adding the test case to earlier
versions to ensure it never appears in earlier versions too.
2011-04-05 11:20:20 +03:00
Vasil Dimov
619f684f54 Add the testcase for Bug#59410 to 5.1/builtin
Bug#59410 read uncommitted: unlock row could not find a 3 mode lock
on the record

This bug is present only in 5.6 but I am adding the test case to earlier
versions to ensure it never appears in earlier versions too.
2011-04-05 11:08:36 +03:00
Georgi Kodinov
19332ed7b9 Bug #11758687: 50924: object names not resolved correctly
on lctn2 systems

There was a local variable in get_all_tables() to store the 
"original" value of the database name as it can get lowercased
depending on the lower_case_table_name value.
get_all_tables() iterates over database names and for each 
database iterates over the tables in it.
The "original" db name was assigned in the table names loop.
Thus the first table is ok, but the second and subsequent tables
get the lowercased name from processing the first table.
Fixed by moving the assignment of the original database name
from the inner (table name) to the outer (database name) loop.
Test suite added.
2011-04-04 16:04:15 +03:00
Gleb Shchepa
173551bb1e Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS
In the string context the MIN() and MAX() functions don't take
into account the unsignedness of the UNSIGNED BIGINT argument
column.

I.e.:
        CREATE TABLE t1 (a BIGINT UNSIGNED);
        INSERT INTO t1 VALUES (18446668621106209655);
        SELECT CONCAT(MAX(a)) FROM t1;

returns -75452603341961.
2011-03-31 22:59:11 +04:00
Bjorn Munch
b1dc6899c3 One more test suppression for rpl_extra_col_master tests 2011-03-31 15:48:05 +02:00
Bjorn Munch
64b8f1414b merge from 5.1 main 2011-03-31 11:22:54 +02:00
Bjorn Munch
9cd8fc9a61 Small followup fix after MTR warning cleanup 2011-03-31 10:33:07 +02:00
Bjorn Munch
c82e0399cb mtr: cleaned up some superfluos global warning suppressions 2011-03-30 14:33:53 +02:00
Sergey Glukhov
fbed52c1ba Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME
Valgrind warning happens due to missing NULL value check in
Item::get_date. The fix is to add this check.
2011-03-30 11:08:35 +04:00
Sergey Glukhov
778a605af3 Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING
Valgrind warning happens because null values check happens too late
in Item_func_month::val_str(after result string calculation).The fix
is to check null value before result string calculation.
2011-03-30 11:00:41 +04:00
Jon Olav Hauglid
455646e785 Bug# 11763784 (former 56541)
ASSERTION TABLE->DB_STAT FAILED IN
SQL_BASE.CC::OPEN_TABLE() DURING I_S Q

This assert could be triggered if a statement requiring a name
lock on a table (e.g. DROP TRIGGER) executed concurrently
with an I_S query which also used the table.

One connection first started an I_S query that opened a given table.
Then another connection started a statement requiring a name lock
on the same table. This statement was blocked since the table was
in use by the I_S query. When the I_S query resumed and tried to
open the table again as part of get_all_tables(), it would encounter
a table instance with an old version number representing the pending
name lock. Since I_S queries ignore version checks and thus pending
name locks, it would try to continue. This caused it to encounter
the assert. The assert checked that the TABLE instance found with a
different version, was a real, open table. However, since this TABLE
instance instead represented a pending name lock, the check would
fail and trigger the assert.

This patch fixes the problem by removing the assert. It is ok for
TABLE::db_stat to be 0 in this case since the TABLE instance can
represent a pending name lock.

Test case added to lock_sync.test.
2011-03-29 10:09:05 +02:00
Mayank Prasad
4a4892d4d8 Bug#11751148 : show events shows events in other schema
Issue:
======
Test case Correction for bug#11751148.
2011-03-28 21:01:37 +05:30
Sergey Glukhov
9d1c240ac2 Bug#11766087 59125: VALGRIND UNINITIALISED VALUE WARNING IN ULL2DEC, LONGLONG2DECIMAL
Valgrind warning happens due to missing NULL value check in
Item_func::val_decimal. The fix is to add this check.
2011-03-28 17:27:44 +04:00
Sergey Glukhov
9893d60e4f Bug#11765216 58154: UNINITIALIZED VARIABLE FORMAT IN STR_TO_DATE FUNCTION
Valgrind warning happens due to uninitialized cached_format_type field
which is used later in Item_func_str_to_date::val_str method.
The fix is to init cached_format_type field.
2011-03-28 17:24:25 +04:00
Georgi Kodinov
f6ac2f5fbd Fixed a test failure becase of a new warning caused by the fix for
Bug #11766769
2011-03-28 13:32:25 +03:00
Georgi Kodinov
792781f982 Fixed a test failure in embedded because of the fix for BUG#11766769 2011-03-28 13:25:03 +03:00
Sergey Glukhov
86c1225699 Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR
Assert fails due to overflow which happens in
Item_func_int_val::fix_num_length_and_dec() as
geometry functions have max_length value equal to
max_field_size(4294967295U). The fix is to skip
max_length calculation for some boundary cases.
2011-03-28 12:35:50 +04:00