Commit graph

2624 commits

Author SHA1 Message Date
svoj@mysql.com/june.mysql.com
62fb86207a BUG#26978 - s->z_err not assigned a value?
azio didn't handle situation when my_read() returns error.

Added handling of situation when my_read() returns error.

No test case for this fix.
2007-12-12 17:16:59 +04:00
istruewing@stella.local
65fda831ce Merge stella.local:/home2/mydev/mysql-5.1-bug30273
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2007-12-11 21:38:08 +01:00
istruewing@stella.local
03d99c5956 Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2007-12-11 21:37:33 +01:00
istruewing@stella.local
55aa6376f1 Bug#30273 - merge tables: Can't lock file (errno: 155)
The patch for Bug 26379 (Combination of FLUSH TABLE and
REPAIR TABLE corrupts a MERGE table) fixed this bug too.
However it revealed a new bug that crashed the server.

Flushing a merge table at the moment when it is between open
and attach of children crashed the server.

The flushing thread wants to abort locks on the flushed table.
It calls ha_myisammrg::lock_count() and ha_myisammrg::store_lock()
on the TABLE object of the other thread.

Changed ha_myisammrg::lock_count() and ha_myisammrg::store_lock()
to accept non-attached children. ha_myisammrg::lock_count() returns
the number of MyISAM tables in the MERGE table so that the memory
allocation done by get_lock_data() is done correctly, even if the
children become attached before ha_myisammrg::store_lock() is
called. ha_myisammrg::store_lock() will not return any lock if the
children are not attached.

This is however a change in the handler interface. lock_count()
can now return a higher number than store_lock() stores locks.
This is more safe than the reverse implementation would be.
get_lock_data() in the SQL layer is adjusted accordingly. It sets
MYSQL_LOCK::lock_count based on the number of locks returned by
the handler::store_lock() calls, not based on the numbers returned
by the handler::lock_count() calls. The latter are only used for
allocation of memory now.

No test case. The test suite cannot reliably run FLUSH between
lock_count() and store_lock() of another thread. The bug report
contains a program that can repeat the problem with some
probability.
2007-12-11 15:32:10 +01:00
svoj@mysql.com/june.mysql.com
413112fb55 BUG#32817 - though CSV is marked as supported create table is rejected
with error 1005.

CSV doesn't support nullable fields. Report descriptive error if create
table with nullable field is requested.
2007-12-07 14:44:03 +04:00
tsmith@ramayana.hindu.god
8fc0bfb6b6 Merge ramayana.hindu.god:/home/tsmith/m/bk/51
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/51-merge
2007-12-05 12:33:36 -07:00
svoj@mysql.com/april.(none)
c7b75f18a3 Merge april.(none):/home/svoj/devel/bk/mysql-5.1-engines
into  april.(none):/home/svoj/devel/mysql/BUG32050/mysql-5.1-engines
2007-11-29 23:51:05 +04:00
svoj@june.mysql.com
50ace543fc Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG31833/mysql-5.1-engines
2007-11-29 15:45:09 +04:00
svoj@mysql.com/april.(none)
a4d2d87395 BUG#32050 - table logging gone wrong.
INSERT/UPDATE against CSV table created by MySQL earlier than 5.1.23
with NULL-able column results in server crash in debug builds.

Starting with 5.1.23 CSV doesn't permit creation of NULL-able columns,
but it is still possible to get such table from older MySQL versions.

Fixed by removing excessive DBUG_ASSERT().
2007-11-27 14:01:11 +04:00
istruewing@stella.local
c29088d275 Merge stella.local:/home2/mydev/mysql-5.0-axmrg
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2007-11-26 15:38:29 +01:00
svoj@mysql.com/june.mysql.com
876f49710e BUG#31833 - ORDER BY leads to wrong result when ARCHIVE, BLOB and
table cache is full

After reading last record from freshly opened archive table
(e.g. after flush table, or if there is no room in table cache),
the table is reported as crashed.

The problem was that azio wrongly invalidated azio_stream when it
meets EOF.
2007-11-23 17:51:12 +04:00
istruewing@stella.local
3be5815015 Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2007-11-21 20:32:58 +01:00
tsmith@ramayana.hindu.god
eff821aeaa Applied InnoDB snapshot innodb-5.1-ss2093
Fixes the following bug:

- Bug #32125: Database crash due to ha_innodb.cc:3896: ulint convert_search_mode_to_innobase

  When unknown find_flag is encountered in convert_search_mode_to_innobase()
  do not call assert(0); instead queue a MySQL error using my_error() and
  return the error code PAGE_CUR_UNSUPP. Change the functions that call
  convert_search_mode_to_innobase() to handle that error code by "canceling"
  execution and returning appropriate error code further upstream.
2007-11-20 12:23:18 -07:00
istruewing@stella.local
6d06272e8a Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2007-11-16 14:07:59 +01:00
joerg@trift2.
07b6bec842 Merge trift2.:/MySQL/M51/mysql-5.1
into  trift2.:/MySQL/M51/push-5.1
2007-11-16 11:12:13 +01:00
istruewing@stella.local
0605274155 Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Bug 26867 - LOCK TABLES + REPAIR + merge table result in
            memory/cpu hogging
Bug 26377 - Deadlock with MERGE and FLUSH TABLE
Bug 25038 - Waiting TRUNCATE
Bug 25700 - merge base tables get corrupted by
            optimize/analyze/repair table
Bug 30275 - Merge tables: flush tables or unlock tables
            causes server to crash
Bug 19627 - temporary merge table locking
Bug 27660 - Falcon: merge table possible
Bug 30273 - merge tables: Can't lock file (errno: 155)

The problems were:

Bug 26379 - Combination of FLUSH TABLE and REPAIR TABLE
                corrupts a MERGE table

  1. A thread trying to lock a MERGE table performs busy waiting while
     REPAIR TABLE or a similar table administration task is ongoing on
     one or more of its MyISAM tables.
  
  2. A thread trying to lock a MERGE table performs busy waiting until all
     threads that did REPAIR TABLE or similar table administration tasks
     on one or more of its MyISAM tables in LOCK TABLES segments do UNLOCK
     TABLES. The difference against problem #1 is that the busy waiting
     takes place *after* the administration task. It is terminated by
     UNLOCK TABLES only.
  
  3. Two FLUSH TABLES within a LOCK TABLES segment can invalidate the
     lock. This does *not* require a MERGE table. The first FLUSH TABLES
     can be replaced by any statement that requires other threads to
     reopen the table. In 5.0 and 5.1 a single FLUSH TABLES can provoke
     the problem.

Bug 26867 - LOCK TABLES + REPAIR + merge table result in
            memory/cpu hogging

  Trying DML on a MERGE table, which has a child locked and
  repaired by another thread, made an infinite loop in the server.

Bug 26377 - Deadlock with MERGE and FLUSH TABLE

  Locking a MERGE table and its children in parent-child order
  and flushing the child deadlocked the server.

Bug 25038 - Waiting TRUNCATE

  Truncating a MERGE child, while the MERGE table was in use,
  let the truncate fail instead of waiting for the table to
  become free.

Bug 25700 - merge base tables get corrupted by
            optimize/analyze/repair table

  Repairing a child of an open MERGE table corrupted the child.
  It was necessary to FLUSH the child first.

Bug 30275 - Merge tables: flush tables or unlock tables
            causes server to crash

  Flushing and optimizing locked MERGE children crashed the server.

Bug 19627 - temporary merge table locking

  Use of a temporary MERGE table with non-temporary children
  could corrupt the children.

  Temporary tables are never locked. So we do now prohibit
  non-temporary chidlren of a temporary MERGE table.

Bug 27660 - Falcon: merge table possible

  It was possible to create a MERGE table with non-MyISAM children.

Bug 30273 - merge tables: Can't lock file (errno: 155)

  This was a Windows-only bug. Table administration statements
  sometimes failed with "Can't lock file (errno: 155)".

These bugs are fixed by a new implementation of MERGE table open.

When opening a MERGE table in open_tables() we do now add the
child tables to the list of tables to be opened by open_tables()
(the "query_list"). The children are not opened in the handler at
this stage.

After opening the parent, open_tables() opens each child from the
now extended query_list. When the last child is opened, we remove
the children from the query_list again and attach the children to
the parent. This behaves similar to the old open. However it does
not open the MyISAM tables directly, but grabs them from the already
open children.

When closing a MERGE table in close_thread_table() we detach the
children only. Closing of the children is done implicitly because
they are in thd->open_tables.

For more detail see the comment at the top of ha_myisammrg.cc.

Changed from open_ltable() to open_and_lock_tables() in all places
that can be relevant for MERGE tables. The latter can handle tables
added to the list on the fly. When open_ltable() was used in a loop
over a list of tables, the list must be temporarily terminated
after every table for open_and_lock_tables().
table_list->required_type is set to FRMTYPE_TABLE to avoid open of
special tables. Handling of derived tables is suppressed.
These details are handled by the new function
open_n_lock_single_table(), which has nearly the same signature as
open_ltable() and can replace it in most cases.

In reopen_tables() some of the tables open by a thread can be
closed and reopened. When a MERGE child is affected, the parent
must be closed and reopened too. Closing of the parent is forced
before the first child is closed. Reopen happens in the order of
thd->open_tables. MERGE parents do not attach their children
automatically at open. This is done after all tables are reopened.
So all children are open when attaching them.

Special lock handling like mysql_lock_abort() or mysql_lock_remove()
needs to be suppressed for MERGE children or forwarded to the parent.
This depends on the situation. In loops over all open tables one
suppresses child lock handling. When a single table is touched,
forwarding is done.

Behavioral changes:
===================

This patch changes the behavior of temporary MERGE tables.
Temporary MERGE must have temporary children.
The old behavior was wrong. A temporary table is not locked. Hence
even non-temporary children were not locked. See
Bug 19627 - temporary merge table locking.

You cannot change the union list of a non-temporary MERGE table
when LOCK TABLES is in effect. The following does *not* work:
CREATE TABLE m1 ... ENGINE=MRG_MYISAM ...;
LOCK TABLES t1 WRITE, t2 WRITE, m1 WRITE;
ALTER TABLE m1 ... UNION=(t1,t2) ...;
However, you can do this with a temporary MERGE table.

You cannot create a MERGE table with CREATE ... SELECT, neither
as a temporary MERGE table, nor as a non-temporary MERGE table.
CREATE TABLE m1 ... ENGINE=MRG_MYISAM ... SELECT ...;
Gives error message: table is not BASE TABLE.
2007-11-15 20:25:43 +01:00
joerg@trift2.
eaf9ae8889 Merge trift2.:/MySQL/M51/mysql-5.1
into  trift2.:/MySQL/M51/push-5.1
2007-11-14 16:11:52 +01:00
istruewing@stella.local
a545de21d1 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-engines
into  stella.local:/home2/mydev/mysql-5.1-bug4692
2007-11-14 15:22:54 +01:00
gluh@eagle.(none)
58336411c9 Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-11-14 17:30:16 +04:00
istruewing@stella.local
500d5c788e Merge stella.local:/home2/mydev/mysql-5.0-bug4692
into  stella.local:/home2/mydev/mysql-5.1-bug4692
2007-11-14 12:51:36 +01:00
svoj@june.mysql.com
b5c9a981d4 Merge mysql.com:/home/svoj/devel/mysql/BUG31277/mysql-5.0-engines
into  mysql.com:/home/svoj/devel/mysql/BUG31277/mysql-5.1-engines
2007-11-14 14:55:12 +04:00
gshchepa/uchum@gleb.loc
70f36562bc Fixed bug #32034: On 64bit platforms assigning values of
storage engine system variables was not validated and
unexpected value was assigned.

The check_func_enum function used subtraction from the uint
value with the probably negative result. That result of
type uint was compared with 0 after casting to signed long
type. On architectures where long type is longer than int
type the result of comparison was unexpected.
2007-11-14 13:48:21 +04:00
holyfoot/hf@hfmain.(none)
b10c63646c Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/31305/my51-31305
2007-11-13 23:12:45 +04:00
holyfoot/hf@hfmain.(none)
8240a3e868 Merge mysql.com:/home/hf/work/31305/my50-31305
into  mysql.com:/home/hf/work/31305/my51-31305
2007-11-12 13:07:30 +04:00
ramil/ram@ramil.myoffice.izhnet.ru
188a47e53c Merge mysql.com:/home/ram/work/mysql-5.0-maint
into  mysql.com:/home/ram/work/mysql-5.1-maint
2007-11-10 21:41:05 +04:00
joerg@trift2.
a9bd54f002 Merge trift2.:/MySQL/M51/mysql-5.1
into  trift2.:/MySQL/M51/push-5.1
2007-11-08 10:40:46 +01:00
tsmith@ramayana.hindu.god
b0d01ab27d Cast away compiler warning on Windows. 2007-11-07 12:59:22 -07:00
tsmith@ramayana.hindu.god
a88d94614c Apply snapshot innodb-5.1-ss2034
The following bugs are fixed:

Bug #31860: Server crashes after inserting into InnoDB table with auto_increment column
  In the Bug 16979 fix there was an erroneous assertion that
  autoincrement columns can't contain negative values. With the fix, the
  autoincrement table counter is set to 0 if the maximum value read from
  the autoinc column index is negative.
2007-11-06 16:40:50 -07:00
tsmith@ramayana.hindu.god
eb65479127 Apply snapshot innodb-5.1-ss1989
Fixes the following bugs:

Bug #30706: SQL thread on slave is allowed to block client queries when slave load is high
  Add (innodb|innobase|srv)_replication_delay MySQL config parameter.

Bug #30888: Innodb table + stored procedure + row deletion = server crash
  While adding code for the low level read of the AUTOINC value from the index,
  the case for MEDIUM ints which are 3 bytes was missed triggering an
  assertion.

Bug #30907: Regression: "--innodb_autoinc_lock_mode=0" (off) not same as older releases
  We don't rely on *first_value to be 0 when checking whether
  get_auto_increment() has been invoked for the first time in a multi-row
  INSERT. We instead use trx_t::n_autoinc_rows. Initialize trx::n_autoinc_rows
  inside ha_innobase::start_stmt() too.

Bug #31444: "InnoDB: Error: MySQL is freeing a thd" in innodb_mysql.test
  ha_innobase::external_lock(): Update prebuilt->mysql_has_locked and
  trx->n_mysql_tables_in_use only after row_lock_table_for_mysql() returns
  DB_SUCCESS.  A timeout on LOCK TABLES would lead to an inconsistent state,
  which would cause trx_free() to print a warning.

Bug #31494: innodb + 5.1 + read committed crash, assertion
  Set an error code when a deadlock occurs in semi-consistent read.
2007-11-06 15:42:58 -07:00
msvensson@pilot.mysql.com
571b178b24 Merge pilot.mysql.com:/data/msvensson/mysql/mysql-5.0-maint
into  pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-new-maint
2007-11-06 14:55:10 +01:00
istruewing@stella.local
43999692a8 Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2007-11-06 14:35:02 +01:00
istruewing@stella.local
241cd5f969 Bug#4692 - DISABLE/ENABLE KEYS waste a space
Fixed absurd compiler warnings of a Suse 10.1 system.
2007-11-05 10:57:52 +01:00
tomas@whalegate.ndb.mysql.com
883abae508 Merge whalegate.ndb.mysql.com:/home/tomas/cge-5.1
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge
2007-11-01 11:37:32 +01:00
jmiller/ndbdev@mysql.com/ndb15.mysql.com
480ee022ad Adding dbutil to ndb test lib 2007-10-31 22:37:10 +01:00
istruewing@stella.local
8b1679d769 Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2007-10-31 13:13:20 +01:00
tomas@whalegate.ndb.mysql.com
a214b1b9ba Merge whalegate.ndb.mysql.com:/home/tomas/cge-5.1
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge
2007-10-30 11:28:19 +01:00
istruewing@stella.local
7aa8144460 Merge stella.local:/home2/mydev/mysql-5.0-bug4692
into  stella.local:/home2/mydev/mysql-5.1-bug4692
2007-10-30 09:51:05 +01:00
gshchepa/uchum@gleb.loc
3cc449465c ha_archive.cc:
Post-merge fix.
2007-10-28 02:33:18 +05:00
gshchepa/uchum@gleb.loc
c6429f7990 Merge gleb.loc:/home/uchum/work/bk/PA/5.1-opt-31036-v
into  gleb.loc:/home/uchum/work/bk/5.1-opt
2007-10-28 01:27:47 +05:00
gshchepa/uchum@gleb.loc
5eb3b270d3 Fixed bug #31036: Using order by with archive table crashes server.
1. Memory overrun have been fixed.
2. Server failure on assertion has been fixed.
2007-10-26 21:26:06 +05:00
knielsen@loke.(none)
328fc573e4 Merge loke.(none):/home/knielsen/devel/mysql-5.1-telco-gca
into  loke.(none):/home/knielsen/devel/mysql-5.1-new-ndb
2007-10-25 10:48:42 +02:00
knielsen@loke.(none)
815a63008c Merge loke.(none):/home/knielsen/devel/bug31761
into  loke.(none):/home/knielsen/devel/mysql-5.1-telco-gca
2007-10-25 09:27:15 +02:00
gluh@eagle.(none)
17acda6ca8 Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-10-23 19:08:21 +05:00
jonas@perch.ndb.mysql.com
ac1dc64ebb ndb - bug#26450
partial backport from 6.2 + add fix of bug
2007-10-23 11:24:34 +02:00
tsmith@ramayana.hindu.god
e347c1413a Merge ramayana.hindu.god:/home/tsmith/m/bk/51
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/51
2007-10-22 14:32:22 -06:00
holyfoot/hf@hfmain.(none)
f4785845b4 Merge mysql.com:/home/hf/work/29801/my51-29801
into  mysql.com:/home/hf/work/30638/my51-30638
2007-10-22 10:25:35 +05:00
holyfoot/hf@hfmain.(none)
5a20acc709 Merge mysql.com:/home/hf/work/29801/my50-29801
into  mysql.com:/home/hf/work/29801/my51-29801
2007-10-22 10:21:32 +05:00
antony@pcg5ppc.xiphis.org
3b95727600 Merge anubis.xiphis.org:/usr/home/antony/work/mysql-5.1-engines
into  anubis.xiphis.org:/usr/home/antony/work/mysql-5.1-engines.merge
2007-10-19 13:06:37 -07:00
jonas@perch.ndb.mysql.com
9cd83c5365 Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/51-ndb
2007-10-19 21:25:07 +02:00
antony@pcg5ppc.xiphis.org
407f73c821 Merge pcg5ppc.xiphis.org:/private/Network/Servers/anubis.xiphis.org/home/antony/work/p1-bug31473.1
into  pcg5ppc.xiphis.org:/private/Network/Servers/anubis.xiphis.org/home/antony/work/p1-bug31473.1-merge-5.1-engines
2007-10-18 15:02:20 -07:00