Commit graph

27269 commits

Author SHA1 Message Date
0688c086a0 Bug #54579 Wrong unsafe warning for INSERT DELAYED in SBR
The lock_type is upgrade to TL_WRITE from TL_WRITE_DELAYED for
INSERT DELAYED when inserting multi values in one statement.
It's safe. But it causes an unsafe warning in SBR.
      
Make INSERT DELAYED safe by logging it as INSERT without DELAYED.
2010-08-30 14:03:28 +08:00
Alexander Nozdrin
19908377b8 Update result files. 2010-08-28 20:36:17 +04:00
Marc Alff
7357081989 local merge 2010-08-27 15:23:37 -06:00
Marc Alff
fe3221d6a9 local merge 2010-08-26 15:21:23 -06:00
Marc Alff
81cdce4d22 local merge 2010-08-26 08:41:24 -06:00
Alexander Barkov
3509fecfc1 Bug#42511 mysqld: ctype-ucs2.c:2044: my_strnncollsp_utf32: Assertion (tlen % 4) == 0' fai
Problem: trailing spaces were stripped using 8-bit code,
so the truncation result length was incorrect, which led
to an assertion failure.
Fix: using multi-byte safe code.
2010-08-26 16:36:33 +04:00
Marc Alff
4c2de881de Bug#55873 short startup options do not work in 5.5
Before this fix, the server did not recognize 'short' (as in -a)
options but only 'long' (as in --ansi) options
in the startup command line, due to earlier changes in 5.5
introduced for the performance schema.

The root cause is that handle_options() did not honor the
my_getopt_skip_unknown flag when parsing 'short' options.

The fix changes handle_options(), so that my_getopt_skip_unknown is
honored in all cases.

Note that there are limitations to this,
see the added doxygen documentation in handle_options().

The current usage of handle_options() by the server to
parse early performance schema options fits within the limitations.
This has been enforced by an assert for PARSE_EARLY options, for safety.
2010-08-25 18:59:28 -06:00
Marc Alff
b4dd6de474 Bug#52312 lost Handler_read_last status variable
Before this fix, the ha_read_last_count status variable was defined and
updated internally, for never exposed as a system variable.

This fix exposes the system variable as "Handler_read_last",
for completness of the Handler_read_* system variables interface.

Adjusted tests results accordingly.
2010-08-25 13:00:38 -06:00
Alexey Botchkov
f0d2765cc3 mysqlhotcopy tests fixed.
The 'mysqlhotcopy' tool gets into bin/ directory after the installation
from the scripts/.
So check for it in that in the mysql-test-run.pl.

per-file comments:
  mysql-test/mysql-test-run.pl
Check the bin/ for mysqlhotcopy presence.
2010-08-25 18:55:22 +05:00
Alfranio Correia
4f37e847d6 Post-fix push for BUG#53452.
Updated the result files for ndb test cases.
2010-08-25 15:13:20 +01:00
Alexey Botchkov
9492861342 mysql.test fixed.
Parts that aren't supposed to work on Windows moved to the separate
mysql_not_windows.test.
2010-08-25 13:17:15 +05:00
Marc Alff
d2df3a8ac5 Bug#55576 Two perfschema tests failed on mysql-next-mr-innodb PB2 tests
Before this fix, some tests failed due to lack of instrumentation slots
in the performance schema, because the default sizing was too low.

Now that more code has been instrumented, the default sizing has to be adjusted
to match the current instrumentation consumption.

This change:
- increases the number of rwlock classes from 20 to 30,
- increases the number of rwlock and mutex instances to 1 million.
Both are to account for the volume of data instrumented
when the innodb storage engine is used (because of the innodb buffer pool).

Adjusted the test output accordingly.
2010-08-24 18:21:43 -06:00
Evgeny Potemkin
b7f0ce88d0 Auto-merged. 2010-08-24 22:20:45 +04:00
Dmitry Lenev
6c50022ac8 Fixed --ps-protocol failures of test for bug#54332 "Deadlock
with two connections doing LOCK TABLE+INSERT DELAYED".

Disabled --ps-protocol for this part of the test as INSERT
DELAYED simply doesn't work with it under LOCK TABLES.
2010-08-24 20:20:00 +04:00
Alfranio Correia
12668c148b merge mysql-5.5-bugfixing (local) --> mysql-5.5-bugfixing 2010-08-24 13:37:11 +01:00
Alfranio Correia
037958bfbc Post-fix push for BUG#53452. 2010-08-23 23:31:12 +01:00
Evgeny Potemkin
137ede4ac3 Bug#56120: Failed assertion on MIX/MAX on negative time value
The Item_cache_datetime::val_str function wasn't taking into account that time
could be negative. This led to failed assertion.
Now Item_cache_datetime::val_str correctly converts negative time values
from integer to string representation.
2010-08-23 19:59:56 +04:00
Jon Olav Hauglid
d2210981e3 Bug #54332 Deadlock with two connections doing LOCK TABLE+INSERT DELAYED
The problem was that deadlocks involving INSERT DELAYED were not detected.

The reason for this is that two threads are involved in INSERT DELAYED:
the connection thread and the handler thread. The connection thread would
wait while the handler thread acquired locks and opened the table.
In essence, this adds an edge to the wait-for-graph between the 
connection thread and the handler thread that the deadlock detector is
unaware of. Therefore many deadlocks involving INSERT DELAYED were not 
detected.

This patch fixes the problem by having the connection thread acquire the
metadata lock the table before starting the handler thread. This allows the
deadlock detector to detect any possible deadlocks resulting from trying to
acquire a metadata lock the table. If a metadata lock is successfully acquired,
the handler thread is started and given a copy of the ticket representing the
metadata lock. When the handler thread then tries to lock and open the table,
it will find that it already has the metadata lock and therefore not acquire
any new metadata locks.

Test cases added to delayed.test.
2010-08-23 17:42:53 +02:00
Alexander Barkov
622250cba7 Bug#52121 partition by key on utf32 enum field cause debug assertion: (length % 4) == 0
Problem: ENUM columns are sorted and distributed according to their
numeric value, but Field::hash() incorrectly passed string character set
(utf32) in combination with numeric value to the hash function,
which made assertion fail.

Fix: pass "binary" character set in combination with numeric value
to the hash function.

  mysql-test/suite/parts/r/part_ctype_utf32.result
  Adding tests

  mysql-test/suite/parts/t/part_ctype_utf32.test
  Adding test

  sql/field.cc
  Pass correct character set pointer to the hash function.
2010-08-23 13:56:21 +04:00
Alexey Botchkov
46fe17c523 mysqlhotcopy tests fixed.
The include/mysqlhotcopy.inc had an error in the 'if' condition, so it failed
if the mysqlhotcopy tool was found.

per-file comments:
  mysql-test/include/mysqlhotcopy.inc
        test should proceed exactly if the mysqlhotcopy was set.
  mysql-test/mysql-test-run.pl
        don't set the MYSQL_HOTCOPY variable if no mysqlhotcopy was found.
2010-08-23 13:48:27 +05:00
Alexander Barkov
5d873f5815 After fix for Bug#55912 FORMAT with locale set fails for numbers < 1000
Recording fixed correct results results.
2010-08-24 10:15:43 +04:00
Mattias Jonsson
0c2b883dd2 Bug#54747: Deadlock between REORGANIZE PARTITION and SELECT is not detected
The ALTER PARTITION and SELECT seemed to be deadlocked
when having innodb_thread_concurrency = 1.

Problem was that there was unreleased latches
in the ALTER PARTITION thread which was needed
by the SELECT thread to be able to continue.

Solution was to release the latches by commit 
before requesting upgrade to exclusive MDL lock.

Updated according to reviewers comments (3).
2010-08-20 19:15:48 +02:00
Alexey Botchkov
e1d285d1e0 Bug#54129 Missing the execute bit for scripts
files for cmake had some minor bugs causing this.
      
per-file comments:
  mysql-test/CMakeLists.txt
Bug#54129      Missing the execute bit for scripts
    use same permissions as in the source folder

  mysql-test/t/disabled.def
Bug#54129      Missing the execute bit for scripts
      mysqlhotcopy tests enabled

  scripts/CMakeLists.txt
Bug#54129      Missing the execute bit for scripts
    chmod +x for the script files
2010-08-19 17:11:31 +05:00
Alexey Botchkov
e4da0b0af6 merging. 2010-08-19 17:08:17 +05:00
Alexander Barkov
bf78f4767d Bug#55912 FORMAT with locale set fails for numbers < 1000
Problems:
- dot character was always printed as decimal point
  instead of localized decimal point for short
  numbers without thousands
- Item_func_format::val_str always returned values in ASCII
format,
  regargless of @@character_set_connection, which in case of utf32
  led to crash in debug build, or to incorrect values in release build.

Fix:
- Adding a piece of code to replace dot character to
  localized decimal point in short numbers.
- Changing parent class for Item_func_format to
  Item_str_ascii_func, because its val_str() implementation is heavily ASCII oriented.
2010-08-20 15:14:11 +04:00
Jon Olav Hauglid
39ac44d660 Merge from mysql-5.5-runtime to mysql-5.5-bugfixing. 2010-08-20 10:24:32 +02:00
Dmitry Lenev
27cb76cd30 Fixed failure of parts.partition_debug_sync_innodb.test which
was caused by change of thread state name from "Waiting for
table" to "Waiting for table metadata lock" (which has 
happened as part of fix for bug 52044 "FLUSH TABLES WITH READ
LOCK and FLUSH TABLES <list> WITH READ LOCK are incompati").
2010-08-20 11:54:37 +04:00
Jon Olav Hauglid
9bd8a62d62 Bug #55973 Assertion `thd->transaction.stmt.is_empty()'
on CREATE TABLE .. SELECT I_S.PART

This assert was triggered if an InnoDB table was created using
CREATE TABLE ... AS SELECT where the query used an I_S table, and
a view existed in the database. It would also be triggered for
any statement changing an InnoDB table (e.g. INSERT, UPDATE, DELETE)
which had a subquery referencing an I_S table.

The assert was triggered if open_normal_and_derived_tables() failed
and a statement transaction had been started. This will usually not
happen as tables are opened before a statement transaction is started.
However, e.g. CREATE TABLE ... AS SELECT starts a transaction in order
to insert tuples into the new table. And if the subquery references
an I_S table, all current tables and views can be opened in order to
fill the I_S table on the fly. If a view is discovered, open will fail
as it is instructed to open tables only (OPEN_TABLE_ONLY). This would
cause the assert to be triggered.

The assert was added in the patch for Bug#52044 and was therefore
not in any released versions of the server.

This patch fixes the problem by adjusting the assert to take into
consideration the possibility of tables being opened as part of
an I_S query. This is similar to what is already done for 
close_tables_for_reopen().

Test case added to information_schema_inno.test.
2010-08-20 09:16:26 +02:00
Alfranio Correia
c6d4915f3c BUG#53452 Inconsistent behavior of binlog_direct_non_transactional_updates with
temp table
            
This patch introduces two key changes in the replication's behavior.
            
Firstly, it reverts part of BUG#51894 which puts any update to temporary tables
into the trx-cache. Now, updates to temporary tables are handled according to
the type of their engines as a regular table.
            
Secondly, an unsafe mixed statement, (i.e. a statement that access transactional
table as well non-transactional or temporary table, and writes to any of them),
are written into the trx-cache in order to minimize errors in the execution when
the statement logging format is in use.
            
Such changes has a direct impact on which statements are classified as unsafe
statements and thus part of BUG#53259 is reverted.
2010-08-20 03:59:58 +01:00
Alexander Barkov
6e9298bddc Bug#54916 GROUP_CONCAT + IFNULL truncates output
Problem: a few functions did not calculate their max_length correctly.
This is an after-fix for WL#2649 Number-to-string conversions".

Fix: changing the buggy functions to calculate max_length
using fix_char_length() introduced in WL#2649,
instead of setting max_length directly

  mysql-test/include/ctype_numconv.inc
     Adding new tests

  mysql-test/r/ctype_binary.result
     Adding new tests

  mysql-test/r/ctype_cp1251.result
     Adding new tests

  mysql-test/r/ctype_latin1.result
     Adding new tests

  mysql-test/r/ctype_ucs.result
     Adding new tests

  mysql-test/r/ctype_utf8.result
     Adding new tests

  mysql-test/t/ctype_utf8.test
    Including ctype_numconv

  sql/item.h
    - Introducing new method fix_char_length_ulonglong(),
    for the cases when length is potentially greater
    than UINT_MAX32. This method removes a few
    instances of duplicate code, e.g. in item_strfunc.cc.
    - Setting collation in Item_copy properly. This change
    fixes wrong metadata on client side in some cases, when
    "binary" instead of the real character set was reported.

  sql/item_cmpfunc.cc
    - Using fix_char_length() and max_char_length() methods,
    instead of direct access to max_length, to calculate
    item length properly.
    - Moving count_only_length() in COALESCE after
    agg_arg_charsets_for_string_result(). The old
    order was incorrect and led to wrong length
    calucation in case of multi-byte character sets.
    
  sql/item_func.cc
    Fixing that count_only_length() didn't work
    properly for multi-byte character sets.
    Using fix_char_length() and max_char_length()
    instead of direct access to max_length.

  sql/item_strfunc.cc
    - Using fix_char_length(), fix_char_length_ulonglong(),
    max_char_length() instead of direct access to max_length.
    - Removing wierd condition: "if (collation.collation->mbmaxlen > 0)",
    which is never FALSE.
2010-08-19 15:55:35 +04:00
Alexey Botchkov
15ee13fbf7 Bug#54466 client 5.5 built from source lacks "pager" support
#ifdef THREAD removed from mysql.cc.
               No reason was found for this limitation to persist.

per-file comments:
  client/mysql.cc
Bug#54466      client 5.5 built from source lacks "pager" support
        now we have USE_POPEN always if not __WIN__
  mysql-test/r/mysql.result
Bug#54466      client 5.5 built from source lacks "pager" support
        result updated.
  mysql-test/t/mysql.test
Bug#54466      client 5.5 built from source lacks "pager" support
        test case added.
2010-08-19 16:35:47 +05:00
Bernt M. Johnsen
67d895d499 Bug#53563 Fix and enable charset/collation tests in funcs_2 2010-08-19 09:31:24 +02:00
Alexander Barkov
89e6eb0b1e Backporting Bug#32391 Character sets: crash with --character-set-server
from mysql-trunk-bugfixing (5.6.1-m5) from mysql-5.5-bugfixing (5.5.6-m3).
2010-08-19 10:00:43 +04:00
Alexander Barkov
cdce606121 Bug#45263 utf32_general_ci, bad effects around CREATE TABLE AS SELECT
Problem: Item_func_hex::val_str() returned data in ASCII format,
which did not match collation.collation pointing to my_charset_utf32_general_ci.
Fix: changing parent class of Item_func_hex to Item_str_ascii_func,
as val_str() implementation is heavily ASCII-oriented.

  mysql-test/r/ctype_utf32.result
  mysql-test/t/ctype_utf32.test
  Adding test case


  sql/item_strfunc.cc
  sql/item_strfunc.h
  - Changing parent class to Item_str_ascii_func
  - Clean-up in Item_func_hex::fix_length_and_dec()
    Using fix_char_length() instead of setting max_length directly.
2010-08-18 16:08:59 +04:00
Jon Olav Hauglid
8f36eaa11e Merge from mysql-5.5-bugfixing to mysql-5.5-runtime 2010-08-18 13:55:37 +02:00
Jon Olav Hauglid
5139bf6c8f Manual merge from mysql-5.5-bugfixing to mysql-5.5-runtime. 2010-08-18 13:29:04 +02:00
d3b7cd3ff2 WL#5370 Keep forward-compatibility when changing
'CREATE TABLE IF NOT EXISTS ... SELECT' behaviour
BUG#47132, BUG#47442, BUG49494, BUG#23992 and BUG#48814 will disappear
automatically after the this patch.
BUG#55617 is fixed by this patch too.
            
This is the 5.5 part.
It implements:
- 'CREATE TABLE IF NOT EXISTS ... SELECT' statement will not insert
  anything and binlog anything if the table already exists.
  It only generate a warning that table already exists.
- A couple of test cases for the behavior changing.
2010-08-18 17:35:41 +08:00
Alexander Nozdrin
8977575cff Auto-merge from mysql-5.5. 2010-08-18 11:48:38 +04:00
Vasil Dimov
02492ae36f Merge mysql-5.5-bugfixing -> mysql-5.5-innodb 2010-08-18 10:14:06 +03:00
Vasil Dimov
793dee2d5c Make main.endspace more deterministic
Followup to vasil.dimov@oracle.com-20100817063430-inglmzgdtj95t29d
which didn't fully fix the test because the order of the returned
rows was different in embedded and non-embedded version. So the only
way to fix this is to add an ORDER BY clause.
2010-08-17 14:54:29 +03:00
Magne Mahre
7d2d2e0f9b Bug #54850 rpl_ndb.rpl_ndb_stm_innodb and
rpl_ndb.rpl_ndb_2other fails

The two regressions tests failed after WL#5349 was
pushed, since they were writted with the implicit
requirement that MyISAM is the default storage engine.

Adding --default-storage-engine=MyISAM as startup
parameter, to mimic the pre-wl#5349 situation.
2010-08-17 10:56:50 +02:00
Vasil Dimov
15fd2b4ffa Adjust endspace.result
This is a followup to vasil.dimov@oracle.com-20100816142329-yimenbuktd416z1a
which improved the sampling algorithm. The endspace test is non-deterministic
because it does not include ORDER BY clause in its queries.
2010-08-17 09:34:30 +03:00
Vasil Dimov
260ff5be5e Adjust type_bit_innodb.result
This is a followup to vasil.dimov@oracle.com-20100816142329-yimenbuktd416z1a
which improved the sampling algorithm.
2010-08-17 09:26:41 +03:00
Vasil Dimov
0c7b390448 Adjust rowid_order_innodb.result
This is a followup to vasil.dimov@oracle.com-20100816142329-yimenbuktd416z1a
which improved the sampling algorithm.
2010-08-17 09:25:08 +03:00
Vasil Dimov
4a3ba7343d Adjust innodb_gis.result
This is a followup to vasil.dimov@oracle.com-20100816142329-yimenbuktd416z1a
which improved the sampling algorithm.
2010-08-17 09:24:33 +03:00
Vasil Dimov
f8b5843005 Adjust innodb_mysql.result
This is a followup to vasil.dimov@oracle.com-20100816142329-yimenbuktd416z1a
which improved the sampling algorithm. I have manually checked that the new
values are actually the correct ones, for example:
-rows	16
+rows	32
the number of rows returned by the query is 32.
2010-08-17 09:17:04 +03:00
Magne Mahre
19c9957367 Bug#55001 Change in behavior: thread_concurrency (docs,
example files)

The system variable 'thread_concurrency' has been
(re-)enabled on all platforms, to prevent startup
errors.

'thread_concurrency' is unused and has no effect,
on any platform, in MySQL 5.1 and later versions.  It 
will be deprecated, and removed, in context of 
worklog WL#5265
2010-08-16 15:05:01 +02:00
Mattias Jonsson
7641dd7b4b merge 2010-08-16 14:58:38 +02:00
Mattias Jonsson
25ae81f133 Bug#49907: ALTER TABLE ... TRUNCATE PARTITION does not wait for
locks on the table

Fixing the partitioning specifics after TRUNCATE TABLE in
bug-42643 was fixed.

Reorganize of code to decrease the size of the giant switch
in mysql_execute_command, and to prepare for future parser
reengineering. Moved code into Sql_statement objects.

Updated patch according to davi's review comments.
2010-08-16 14:53:30 +02:00
Alexander Nozdrin
9c41a9909a Auto-merge from mysql-5.5. 2010-08-16 10:46:21 +04:00