Commit graph

26271 commits

Author SHA1 Message Date
Vasil Dimov
9f42efeb78 Disable the tests on embedded windows that fail due to
Bug #53947 InnoDB: Assertion failure in thread 4224 in file
.\sync\sync0sync.c line 324

This changeset should be reverted once the bug is fixed.
2010-05-24 21:22:09 +03:00
Vasil Dimov
de124ac0fb Merge mysql-trunk-bugfixing -> mysql-trunk-innodb 2010-05-21 17:52:35 +03:00
Jon Olav Hauglid
ac9bae9e04 merge from mysql-trunk-runtime 2010-05-21 15:49:15 +02:00
Alexander Nozdrin
dfec05be05 Backporting a test case for Bug#30036 (SHOW TABLE TYPES causes the debug client
to crash) from mysql-6.0-codebase.
2010-05-21 17:36:59 +04:00
Dmitry Lenev
6ceacd4fb9 Follow-up for the fix for bug #46947 "Embedded SELECT without
FOR UPDATE is causing a lock".
 
This patch tries to address problems which were exposed 
during backporting of original patch to 5.1 tree.
 
- It ensures that we don't change locking behavior of simple
  SELECT statements on InnoDB tables when they are executed
  under LOCK TABLES ... READ and with @@innodb_table_locks=0.
  Also we no longer pass TL_READ_DEFAULT/TL_WRITE_DEFAULT 
  lock types, which are supposed to be parser-only, to 
  handler::start_stmt() method.
- It makes check_/no_concurrent_insert.inc auxiliary scripts 
  more robust against changes in test cases that use them
  and also ensures that they don't unnecessarily change 
  environment of caller.
2010-05-21 16:41:24 +04:00
Vasil Dimov
456130f38d Merge mysql-trunk-bugfixing -> mysql-trunk-innodb 2010-05-19 23:48:50 +03:00
Alexander Nozdrin
091bcacc79 Another incarnation of the patch for Bug#30708
(make relies GNU extentions). The patch was partially
backport from 6.0.

Original comment:
bug#30708: make relies GNU extensions.  Now that we no longer use
BitKeeper we can safely remove the SCCS handling with no loss of
functionality.
2010-05-19 17:00:23 +04:00
Alexander Nozdrin
2f7945b8b9 Backporting a patch for Bug#43358 from 6.0 to trunk-bugfixing. 2010-05-19 16:33:51 +04:00
Alexander Nozdrin
796fd24e15 Backport test cases for Bug#46198 and Bug#38054
from 6.0 to trunk-bugfixing.
2010-05-19 16:31:18 +04:00
Jon Olav Hauglid
c09eb2afc3 Bug #53798 OPTIMIZE TABLE breaks repeatable read
The problem was that OPTMIZE TABLE was allowed to run on a table
in use by a transaction in a different connection. This caused
repeatable read to break.

This bug was fixed by the introduction of metadata locking, WL#4284.
OPTIMIZE TABLE will now be blocked until the transaction using the
table, has ended.

This patch contains a regression test added to innodb_mysql_lock.test
and no code changes.
2010-05-19 13:32:21 +02:00
Andrei Elkin
b530d5660e reverting fixes for Bug@50316 in mysql-trunk 2010-05-18 18:32:44 +03:00
Vasil Dimov
997b5dbcff Merge mysql-trunk-innodb from bk-internal to my local branch 2010-05-18 16:59:50 +03:00
Vasil Dimov
b686ebae67 Silence a valgrind warning caused by zlib:
==31182== Conditional jump or move depends on uninitialised value(s)
==31182==    at 0xA9188B: longest_match (deflate.c:1143)
==31182==    by 0xA92C19: deflate_slow (deflate.c:1595)
==31182==    by 0xA90C6B: deflate (deflate.c:790)
==31182==    by 0x9B447B: page_zip_compress (page0zip.c:1342)
==31182==    by 0x9A8540: page_cur_insert_rec_zip_reorg (page0cur.c:1174)
==31182==    by 0x9A8998: page_cur_insert_rec_zip (page0cur.c:1279)
==31182==    by 0x9214F9: page_cur_tuple_insert (page0cur.ic:264)
==31182==    by 0x9221A2: btr_cur_optimistic_insert (btr0cur.c:1314)
==31182==    by 0x9C99EB: row_ins_index_entry_low (row0ins.c:2087)
==31182==    by 0x9C9DFB: row_ins_index_entry (row0ins.c:2167)
==31182==    by 0x9CA057: row_ins_index_entry_step (row0ins.c:2252)
==31182==    by 0x9CA0FD: row_ins (row0ins.c:2384)
==31182==    by 0x9CA760: row_ins_step (row0ins.c:2494)
==31182==    by 0x8CBF7E: row_insert_for_mysql (row0mysql.c:1138)
==31182==    by 0x8BCF32: ha_innobase::write_row(unsigned char*) (ha_innodb.cc:4929)
==31182==    by 0x736E03: handler::ha_write_row(unsigned char*) (handler.cc:4682)
2010-05-18 16:48:10 +03:00
Vasil Dimov
c1ac191cd0 Silence a valgrind warning caused by zlib:
innodb.innodb-zip                        [ fail ]  Found warnings/errors in server log file!
        Test ended at 2010-05-17 16:41:25
line
==31182== Thread 13:
==31182== Conditional jump or move depends on uninitialised value(s)
==31182==    at 0xA9193F: longest_match (deflate.c:1143)
==31182==    by 0xA92C19: deflate_slow (deflate.c:1595)
==31182==    by 0xA90C6B: deflate (deflate.c:790)
==31182==    by 0x928A07: btr_store_big_rec_extern_fields (btr0cur.c:4092)
==31182==    by 0x9C9B90: row_ins_index_entry_low (row0ins.c:2119)
==31182==    by 0x9C9DFB: row_ins_index_entry (row0ins.c:2167)
==31182==    by 0x9CA057: row_ins_index_entry_step (row0ins.c:2252)
==31182==    by 0x9CA0FD: row_ins (row0ins.c:2384)
==31182==    by 0x9CA760: row_ins_step (row0ins.c:2494)
==31182==    by 0x8CBF7E: row_insert_for_mysql (row0mysql.c:1138)
==31182==    by 0x8BCF32: ha_innobase::write_row(unsigned char*) (ha_innodb.cc:4929)
==31182==    by 0x736E03: handler::ha_write_row(unsigned char*) (handler.cc:4682)
==31182==    by 0x5B0EEE: write_record(THD*, TABLE*, st_copy_info*) (sql_insert.cc:1670)
==31182==    by 0x5B129D: select_insert::send_data(List<Item>&) (sql_insert.cc:3279)
==31182==    by 0x5F31ED: end_send(JOIN*, st_join_table*, bool) (sql_select.cc:12428)
==31182==    by 0x5F9B9B: evaluate_join_record(JOIN*, st_join_table*, int) (sql_select.cc:11632)
2010-05-18 16:25:06 +03:00
Marko Mäkelä
c6c1604350 Merge a change from mysql-5.1-innodb:
------------------------------------------------------------
  revno: 3468
  revision-id: marko.makela@oracle.com-20100518130658-rd00ql7h02ooakh1
  parent: marko.makela@oracle.com-20100514131050-mkhlvlui1u52irob
  committer: Marko Mäkelä <marko.makela@oracle.com>
  branch nick: 5.1-innodb
  timestamp: Tue 2010-05-18 16:06:58 +0300
  message:
    Work around Bug #53750 in innodb_bug48024.test
2010-05-18 16:10:36 +03:00
Jon Olav Hauglid
1c02ed3e67 manual merge from mysql-trunk-bugfixing 2010-05-18 14:52:51 +02:00
Andrei Elkin
1579ae040b rpl_ndb tests fixing results files due to Master_Info_File of bug#50316 2010-05-18 11:07:31 +03:00
Andrei Elkin
2c966ddda1 merging bug#50316 fixes 2010-05-18 10:13:37 +03:00
Alexander Nozdrin
5d3833f51b Patch for Bug#52410 (Test "mysqld--help-*": further output differences).
That was a pure test issue -- filter implementation in Perl did not work
on some platform (the bug occurred on Windows Server 2008 with
Cygwin Perl 5.10.0).
2010-05-17 19:28:50 +04:00
Andrei Elkin
f7e999ed77 removing disabled line for rpl_row_create_table due to Bug#45576. Anyway, the test is still there because of Bug#51574 2010-05-16 22:28:20 +03:00
Andrei Elkin
9e3c410ae7 bug#50316 Add Master_info_file to SHOW SLAVE STATUS
pushing to next-mr-bugfixing from working branch
2010-05-16 21:40:56 +03:00
Alexander Nozdrin
5c4333bc85 Patch for Bug#27863 (excessive memory usage for many small queries in a
multiquery packet).

Background:

  - a query can contain multiple SQL statements;

  - the server frees resources allocated to process a query when the
    whole query is handled. In other words, resources allocated to process
    one SQL statement from a multi-statement query are freed when all SQL
    statements are handled.

The problem was that the parser allocated a buffer of size of the whole
query for each SQL statement in a multi-statement query. Thus, if a query
had many SQL-statements (so, the query was long), but each SQL statement
was short, ther parser tried to allocate huge amount of memory (number of
small SQL statements * length of the whole query).

The memory was allocated for a so-called "cpp buffer", which is intended to
store pre-processed SQL statement -- SQL text without version specific
comments.

The fix is to allocate memory for the "cpp buffer" once for all SQL
statements (once for a query).
2010-05-14 22:11:25 +04:00
Marko Mäkelä
2a3db4b9e2 Merge from mysql-5.1-innodb:
Post-merge fixes: Remove the MYSQL_VERSION_ID checks, because they only
apply to the InnoDB Plugin. Fix potential race condition accessing
trx->op_info and trx->detailed_error.
------------------------------------------------------------
revno: 3466
revision-id: marko.makela@oracle.com-20100514130815-ym7j7cfu88ro6km4
parent: marko.makela@oracle.com-20100514130228-n3n42nw7ht78k0wn
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: mysql-5.1-innodb2
timestamp: Fri 2010-05-14 16:08:15 +0300
message:
  Make the InnoDB FOREIGN KEY parser understand multi-statements. (Bug #48024)
  Also make InnoDB thinks that /*/ only starts a comment. (Bug #53644).

  This fixes the bugs in the InnoDB Plugin.

  ha_innodb.h: Use trx_query_string() instead of trx_query() when
  available (MySQL 5.1.42 or later).

  innobase_get_stmt(): New function, to retrieve the currently running
  SQL statement.

  struct trx_struct: Remove mysql_query_str. Use innobase_get_stmt() instead.

  dict_strip_comments(): Add and observe the parameter sql_length. Treat
  /*/ as the start of a comment.

  dict_create_foreign_constraints(), row_table_add_foreign_constraints():
  Add the parameter sql_length.
2010-05-14 16:31:44 +03:00
Alexander Nozdrin
7752ccec48 Patch for Bug#21818 (Return value of ROW_COUNT() is incorrect
for ALTER TABLE, LOAD DATA).

ROW_COUNT is now assigned according to the following rules:

  - In my_ok():
    - for DML statements: to the number of affected rows;
    - for DDL statements: to 0.

  - In my_eof(): to -1 to indicate that there was a result set.

    We derive this semantics from the JDBC specification, where int
    java.sql.Statement.getUpdateCount() is defined to (sic) "return the
    current result as an update count; if the result is a ResultSet
    object or there are no more results, -1 is returned".

  - In my_error(): to -1 to be compatible with the MySQL C API and
    MySQL ODBC driver.

  - For SIGNAL statements: to 0 per WL#2110 specification. Zero is used
    since that's the "default" value of ROW_COUNT in the diagnostics area.
2010-05-14 09:28:51 +04:00
Konstantin Osipov
c40277d8cd Merge trunk -> trunk-runtime. 2010-05-13 19:40:33 +04:00
Jimmy Yang
bd65e80c84 Check in patch for bug #53336, Improved InnoDB Transaction Reporting.
rb://335, Approved by Sunny Bains
2010-05-12 08:39:45 -07:00
Jonathan Perkin
5b85121ca6 Changes to build using CMake according to existing release packages:
- Update/fix file layouts for each package type, add new types for
   native package formats including deb, rpm and svr4.

 - Build all plugins, including debug versions

 - Update compiler flags to match current release

 - Add missing @VAR@ expansions

 - Install correct mysqclient library symlinks

 - Fix icc/ia64 builds

 - Fix install of libmysqld-debug

 - Don't include mysql_embedded

 - Remove unpackaged manual pages to avoid missing files warnings

 - Don't install mtr's test suite
2010-05-12 12:51:23 +01:00
Marko Mäkelä
9451ee4b2c Merge from mysql-5.1-innodb:
------------------------------------------------------------
  revno: 3462
  revision-id: marko.makela@oracle.com-20100512104212-e2h9n1obxjb8tfg4
  parent: marko.makela@oracle.com-20100512060922-oh716ugpukfakwvh
  committer: Marko Mäkelä <marko.makela@oracle.com>
  branch nick: mysql-5.1-innodb
  timestamp: Wed 2010-05-12 13:42:12 +0300
  message:
    ha_innobase::add_index(): Reset trx->error_state in error handling.
    (Bug #53591)
2010-05-12 14:19:26 +03:00
Vasil Dimov
dcf0caa6d5 Fix the failing innodb.innodb test.
Support returning 512 and 511 pages for the buffer pool size, this
is undeterministic and probably depends on alignment issues.

The default buffer pool size is 8M (512) pages, which is set in
include/default_mysqld.cnf. So the previous "replace_result 8192 8191"
had no effect.
2010-05-12 12:13:50 +03:00
Vasil Dimov
6941bfb6bf Improve the comment in innodb_bug38231.test 2010-05-12 10:44:23 +03:00
Vasil Dimov
8b22035f63 Disable innodb.innodb_bug38231 in embedded mode
The --send command does not seem to work as expected in that mode.
2010-05-12 10:42:28 +03:00
Marko Mäkelä
42974cbfa6 Merge from mysql-5.1-innodb:
------------------------------------------------------------
  revno: 3459
  revision-id: marko.makela@oracle.com-20100511165845-lsw7seixftgzpfqt
  parent: vasil.dimov@oracle.com-20100511110029-18xvuu6r7har8toh
  committer: Marko Mäkelä <marko.makela@oracle.com>
  branch nick: mysql-5.1-innodb2
  timestamp: Tue 2010-05-11 19:58:45 +0300
  message:
    Fix sys_vars.tx_isolation_func.test, which was broken in revno 3432
    when making READ UNCOMMITTED lock as little as READ COMMITTED.
2010-05-11 20:02:49 +03:00
Marko Mäkelä
65c34aaf41 Merge from mysql-5.1-innodb:
------------------------------------------------------------
  revno: 3459
  revision-id: marko.makela@oracle.com-20100511105308-grp2t3prh3tqivw0
  parent: marko.makela@oracle.com-20100511105012-b2t7wvz6mu6bll74
  parent: marko.makela@oracle.com-20100505123901-xjxu93h1xnbkfkq0
  committer: Marko Mäkelä <marko.makela@oracle.com>
  branch nick: mysql-5.1-innodb
  timestamp: Tue 2010-05-11 13:53:08 +0300
  message:
    Merge a patch from Facebook to fix Bug #53290

    commit e759bc64eb5c5eed4f75677ad67246797d486460
    Author: Ryan Mack
    Date:   3 days ago

        Bugfix for 53290, fast unique index creation fails on duplicate null values

        Summary:
        Bug in the fast index creation code incorrectly considers null
        values to be duplicates during block merging.  Innodb policy is that
        multiple null values are allowed in a unique index.  Null duplicates
        were correctly ignored while sorting individual blocks and with slow
        index creation.

        Test Plan:
        mtr, including new test, load dbs using deferred index creation

        License:
        Copyright (C) 2009-2010 Facebook, Inc.  All Rights Reserved.

        Dual licensed under BSD license and GPLv2.

        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        1. Redistributions of source code must retain the above copyright notice,
           this list of conditions and the following disclaimer.
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.

        THIS SOFTWARE IS PROVIDED BY FACEBOOK, INC. ``AS IS'' AND ANY EXPRESS OR
        IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
        MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
        EVENT SHALL FACEBOOK, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
        SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
        PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
        OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
        WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
        OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
        ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

        This program is free software; you can redistribute it and/or modify it
        under the terms of the GNU General Public License as published by the Free
        Software Foundation; version 2 of the License.

        This program is distributed in the hope that it will be useful, but WITHOUT
        ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
        FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
        more details.

        You should have received a copy of the GNU General Public License along with
        this program; if not, write to the Free Software Foundation, Inc., 59 Temple
        Place, Suite 330, Boston, MA  02111-1307  USA
      ------------------------------------------------------------
      revno: 3453.2.1
      revision-id: marko.makela@oracle.com-20100505123901-xjxu93h1xnbkfkq0
      parent: marko.makela@oracle.com-20100505120555-ukoq1gklpheslrxs
      committer: Marko Mäkelä <marko.makela@oracle.com>
      branch nick: 5.1-innodb
      timestamp: Wed 2010-05-05 15:39:01 +0300
      message:
        Merge a contribution from Ryan Mack at Facebook:

        Bugfix for 53290, fast unique index creation fails on duplicate null values

            Summary:
            Bug in the fast index creation code incorrectly considers null
            values to be duplicates during block merging.  Innodb policy is that
            multiple null values are allowed in a unique index.  Null duplicates
            were correctly ignored while sorting individual blocks and with slow
            index creation.

            Test Plan:
            mtr, including new test, load dbs using deferred index creation

            DiffCamp Revision: 110840
            Reviewed By: mcallaghan
            CC: mcallaghan, mysql-devel@lists
            Revert Plan:
            OK
2010-05-11 19:18:28 +03:00
Alexander Nozdrin
3511c2e45a Make innodb.innodb_information_schema experimental due to Bug 48883. 2010-05-11 16:00:24 +04:00
Vasil Dimov
5875344794 Merge mysql-trunk into mysql-trunk-innodb 2010-05-11 14:29:58 +03:00
Inaam Rana
1a1d460338 Undo the changes made by Vasil in sys_vars/all_vars when adjusting
for the new parameters introduced in the plugin 1.1. Now that we have
basic tests for all these new parameters it is no longer needed to
adjust the all_vars.result file.
2010-05-10 17:44:40 -04:00
Marko Makela
a2ea94bac7 Merge from mysql-5.1-innodb:
------------------------------------------------------------
  revno: 3454
  committer: Marko Makela <mmakela@bk-internal.mysql.com>
  branch nick: mysql-5.1-innodb
  timestamp: Mon 2010-05-10 13:37:52 +0200
  message:
    Add an innodb test case for Bug #49164.
2010-05-10 15:14:45 +02:00
Magne Mahre
24a14875bc Bug#49193 CREATE TABLE reacts differently depending on whether
data is selected or not

Temporary and permanent tables should live in different 
namespaces.  In this case, resolving a permanent table
name gave the temporary table, resulting in a name
collision.
2010-05-05 23:28:58 +02:00
Marko Mäkelä
bc7dcdc0b1 Merge from mysql-5.1-innodb:
------------------------------------------------------------
  revno: 3449
  revision-id: marko.makela@oracle.com-20100505104425-39y6qbffgotrhck2
  parent: marko.makela@oracle.com-20100505104001-883pqiepo384qr5h
  committer: Marko Mäkelä <marko.makela@oracle.com>
  branch nick: 5.1-innodb
  timestamp: Wed 2010-05-05 13:44:25 +0300
  message:
    Factor out innodb_multi_update.test from innodb.test
2010-05-05 14:03:14 +03:00
Alexander Nozdrin
d91c271b2b Patch for Bug#50511 (Sometimes wrong handling of user variables containing NULL).
The bug happened under the following condition:
  - there was a user variable of type REAL, containing NULL value
  - there was a table with a NOT_NULL column of any type but REAL, having
    default value (or auto increment);
  - a row was inserted into the table with the user variable as value.
    A warning was emitted here.

The problem was that handling of NULL values of REAL type was not properly
implemented: it didn't expect that REAL NULL value can be assigned to other
data type.

Basically, the problem was that set_field_to_null() was used instead of
set_field_to_null_with_conversions().

The fix is to use the right function, or more generally, to allow conversion of
REAL NULL values to other data types.
2010-05-05 15:00:59 +04:00
Alexander Barkov
25d31b8f7c Bug#51571 load xml infile causes server crash
Problem:
  item->name was NULL for Item_user_var_as_out_param
  which made strcmp(something, item->name) crash in the LOAD XML code.
  
  Fix:
  - item_func.h: Adding set_name() in constuctor for Item_user_var_as_out_param
  - sql_load.cc: Changing the condition in write_execute_load_query_log_event() which
  distiguished between Item_user_var_as_out_param and Item_field
  from
    if (item->name == NULL)
  to
    if (item->type() == Item::FIELD_ITEM)
  - loadxml.result, loadxml.test: adding tests
2010-05-05 14:34:20 +04:00
Magne Mahre
1cf9861f86 Bug#48800 CREATE TABLE t...SELECT fails if t is a temporary
table

If a temporary table A exists, and a (permanent) table 
with the same name is attempted created with 
"CREATE TABLE ... AS SELECT", the create would fail with 
an error.
   1050: Table 'A' already exists

The error occured in MySQL 5.1 releases, but is not
present in MySQL 5.5.   This patch adds a regression
test to ensure that the problem does not reoccur.
2010-05-05 12:17:07 +02:00
Vasil Dimov
781debb59b Fix path to include file in innodb_bug52745.test 2010-05-05 13:13:58 +03:00
Vasil Dimov
484741475e Fix path to include file. 2010-05-05 13:13:05 +03:00
Alexander Barkov
6bf10a8623 Bug#52849 [Com]: datetime index not work
Problem: after introduction of "WL#2649 Number-to-string conversions"

This query:
  SET NAMES cp850; -- Or any other non-latin1 ASCII-based character set
  SELECT * FROM t1
  WHERE datetime_column='2010-01-01 00:00:00'
started to add extra character set conversion: 
  SELECT * FROM t1
  WHERE CONVERT(datetime_column USING cp850)='2010-01-01 00:00:00';

so index on DATETIME column was not used anymore.
Fix:
  avoid convertion of NUMERIC/DATETIME items
  (i.e. those with derivation DERIVATION_NUMERIC).
2010-05-05 13:28:37 +04:00
Horst.Hunger
8975d4766f Patch for 47759 to trunk-bugfixing. 2010-05-05 09:35:38 +02:00
Jon Olav Hauglid
27da41cc2e merge from mysql-trunk-bugfixing 2010-05-05 09:25:04 +02:00
Omer BarNir
3cf56bb21b Changes to result files in the engine suite - missed from previous commit 2010-05-04 13:39:17 -07:00
Omer BarNir
1c731cb0c6 Updates to test and result files in the 'engine' suites following changes in 5.5 2010-05-04 11:10:17 -07:00
Alexander Nozdrin
a7cc09e01a Mark 3 test cases experimental on FreeBSD due to Bug 43020, Bug 38965. 2010-05-04 16:17:46 +04:00