Commit graph

281 commits

Author SHA1 Message Date
Sergei Golubchik
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
Sergei Golubchik
2ccf247e93 after merge changes:
* rename all debugging related command-line options
  and variables to start from "debug-", and made them all
  OFF by default.
* replace "MySQL" with "MariaDB" in error messages
* "Cast ... converted ... integer to it's ... complement"
  is now a note, not a warning
* @@query_cache_strip_comments now has a session scope,
  not global.
2011-12-12 23:58:40 +01:00
Michael Widenius
6d4224a31c Merge with 5.2.
no_error handling for select (used by INSERT ... SELECT) still needs to be fixed, but I will do that in a separate commit
2011-12-11 11:34:44 +02:00
Sergei Golubchik
effed09bd7 5.3->5.5 merge 2011-11-27 17:46:20 +01:00
Michael Widenius
6920457142 Merge with MariaDB 5.1 2011-11-24 18:48:58 +02:00
Michael Widenius
7b368e3810 Merge with MySQL 5.1.60 2011-11-23 19:32:14 +02:00
Sergei Golubchik
d2755a2c9c 5.3->5.5 merge 2011-11-22 18:04:38 +01:00
Igor Babaev
af3d1da31d Made the optimizer switch for index condition pushdown set to 'on' by default. 2011-11-21 05:16:16 -08:00
Sergey Vojtovich
de8c70e70b BUG#11757032 - 49030: OPTIMIZE TABLE BREAKS MYISAM TABLE WHEN
USING MYISAM_USE_MMAP ON WINDOWS

When OPTIMIZE/REPAIR TABLE is switching to new data file,
old data file is removed while memory mapping is still
active.

With 5.1 implementation of nt_share_delete() it is not
permitted to remove mmaped file.

This fix disables memory mapping for mi_repair() operations.

mysql-test/r/myisam.result:
  A test case for BUG#11757032.
mysql-test/t/myisam.test:
  A test case for BUG#11757032.
storage/myisam/ha_myisam.cc:
  mi_repair*() functions family use file I/O even if memory
  mapping is available.
  
  Since mixing mmap I/O and file I/O may cause various artifacts,
  memory mapping must be disabled.
storage/myisam/mi_delete_all.c:
  Clean-up: do not attempt to remap file after truncate, since
  there is nothing to map.
2011-10-20 15:03:22 +04:00
Sergei Golubchik
76f0b94bb0 merge with 5.3
sql/sql_insert.cc:
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
  ******
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
  small cleanup
  ******
  small cleanup
2011-10-19 21:45:18 +02:00
Igor Babaev
715dc5f99d Fixed a cost estimation bug introduced into in the function best_access_path
of the 5.3 code line after a merge with 5.2 on 2010-10-28
in order not to allow the cost to access a joined table to be equal
to 0 ever.

Expanded data sets for many test cases to get the same execution plans
as before.
2011-09-30 18:55:02 -07:00
Sergey Petrunya
1492de8563 Set the default to be mrr=off,mrr_sort_keys=off:
- Set the default
- Adjust the testcases so that 'new' tests are run with optimizations turned on.
- Pull out relevant tests from "irrelevant" tests and run them with optimizations on.
- Run range.test and innodb.test with both mrr=on and mrr=off
2011-07-08 18:46:47 +04:00
Sergei Golubchik
0accbd0364 lots of post-merge changes 2011-04-25 17:22:25 +02:00
Sergey Petrunya
2a498b393a Merge: Make EXPLAIN better at displaying MRR/BKA 2011-04-04 12:38:08 +04:00
Sergey Petrunya
997445bc8e Make EXPLAIN better at displaying MRR/BKA:
- "Using MRR" is no longer shown with range access.
- Instead, both range and BKA accesses will show one of the following:
  = "Rowid-ordered scan"
  = "Key-ordered scan"
  = "Key-ordered Rowid-ordered scan"
depending on whether DS-MRR implementation will do scan keys in order, rowids in order,
or both.
- The patch also introduces a way for other storage engines/MRR implementations to
  pass information to EXPLAIN output about the properties of employed MRR scans.
2011-04-02 14:04:45 +04:00
Vladislav Vaintroub
3273ce6a77 merge 2011-03-29 22:43:35 +02:00
Sergei Golubchik
0741f1a902 lp:702084 - myisam_block_size is not reported in SHOW GLOBAL VARIABLES
add a read-only server variable @@myisam_block_size
2011-03-28 16:53:46 +02:00
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +01:00
Igor Babaev
25f5debdc7 MWL#128: Added into EXPLAIN output info about types of the used join buffers and
about the employed join algorithms.
Refactored constructors of the JOIN_CACHE* classes.
2010-10-18 13:33:05 -07:00
Igor Babaev
21b1b5f040 Fixed bug #52636.
Applied the fix for bug #47217 from the mysql-6.0 codebase.
The patch adds not null predicates generated for the left parts
of the equality predicates used for ref accesses. This is done
for such predicates both in where conditions and on conditions.
For the where conditions the not null predicates were generated
but in 5.0/5.1 they actually never were used due to some lame
merge from 4.1 to 5.0. The fix for bug #47217 made these 
predicates to be used in the condition pushed to the tables.
Yet only this patch generates not null predicates for equality
predicated from on conditions of outer joins.
This patch introduces a performance regression that can be
observed on a test case from null_key.test. The regression
will disappear after the fix for bug #57024 from mariadb-5.1
is pulled into mariadb-5.3.
The patch contains many changes in the outputs of the EXPLAIN 
commands since generated not null predicates are considered as
parts of the conditions pushed to join tables and may add
'Usingwhere' in some rows of EXPLAINs where there used
to be no such comments.
2010-09-28 12:39:33 -07:00
Sergey Petrunya
27f9fc063c MariaDB 5.2 -> MariaDB 5.3 merge 2010-06-26 14:05:41 +04:00
unknown
be7c84c7e7 5.1.46 after-merge fixes: must FLUSH TABLES before copying .frm. 2010-05-02 08:47:28 +02:00
unknown
b1e00b6be8 Merge MySQL 5.1.46 into MariaDB.
Still two test failures to be solved: main.myisam and main.subselect.
2010-04-28 14:52:24 +02:00
Alexander Nozdrin
e642701c32 Manual merge from mysql-trunk.
Conflicts:
  - mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
2010-04-27 13:58:21 +04:00
Jon Olav Hauglid
ac78736638 merge from mysql-trunk-bugfixing 2010-04-20 10:51:50 +02:00
Jon Olav Hauglid
48ac4ff51f Bug #51327 MyISAM table is automatically repaired on ALTER
even if myisam-recover is OFF

The problem was that a corrupted MyISAM table was auto repaired
even if the myisam_recover_options server variable (or the 
myisam_recover option) was set to OFF.

The reason was that the auto_repair() function, which is supposed
to say if auto repair is to be used, did not use the server variable
setting correctly. This bug was a regression introduced by WL#4738.

This patch fixes the problem by making sure auto_repair() returns
FALSE if myisam_recover_options is set to OFF.

Test case added to myisam.test.
2010-04-15 09:16:29 +02:00
Alexey Kopytov
5a59d706be Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in mysql-test/r/func_str.result
Text conflict in mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result
Text conflict in mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result
Text conflict in mysql-test/t/func_str.test
Text conflict in sql/mysqld.cc
Text conflict in sql/protocol.cc
Text conflict in storage/myisam/mi_open.c
2010-04-02 19:17:43 +04:00
Sergey Vojtovich
5eff6aed0e Merge fix for BUG51866 to mysql-5.1-bugteam. 2010-03-25 16:11:16 +04:00
Sergey Vojtovich
412798658a BUG#51866 - crash with repair by sort and fulltext keys
Repairing MyISAM table with fulltext indexes and low
myisam_sort_buffer_size may crash the server.

Estimation of number of index entries was done incorrectly,
causing further assertion failure or server crash.

Docs note: min value for myisam_sort_buffer_size has been
changed from 4 to 4096.

mysql-test/r/fulltext.result:
  A test case for BUG#51866.
mysql-test/r/myisam.result:
  Min value for myisam_sort_buffer_size is 4096.
mysql-test/r/variables.result:
  Min value for myisam_sort_buffer_size is 4096.
mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result:
  Min value for myisam_sort_buffer_size is 4096.
mysql-test/t/fulltext.test:
  A test case for BUG#51866.
sql/mysqld.cc:
  Min value for myisam_sort_buffer_size is 4096.
storage/myisam/mi_check.c:
  When estimating number of index entries for external
  fulltext parser, take into account that key_length may
  be bigger than myisam_sort_buffer_size. Reuse logic
  from _create_index_by_sort(): force MIN_SORT_BUFFER to
  be min value for myisam_sort_buffer_size.
  
  Another problem is that ftkey_nr has no other meaning
  than serial number of fulltext index starting with 1.
  We can't say if this key using built-in or external
  parser basing on it's value. In other words we always
  entered if-branch for external parser. At this point,
  the only way to check if we use default parser is to
  compare keyinfo::parser with &ft_default_parser.
storage/myisam/sort.c:
  Get rid of MIN_SORT_MEMORY, use MIN_SORT_BUFFER instead
  (defined in myisamdef.h, has the same value and purpose).
2010-03-25 16:08:21 +04:00
Alexey Kopytov
d95c1e3b47 Manual merge of mysql-trunk into mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqlbinlog.cc
Text conflict in mysql-test/Makefile.am
Text conflict in mysql-test/collections/default.daily
Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result
Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test
Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test
Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
Text conflict in mysys/charset.c
Text conflict in sql/field.cc
Text conflict in sql/field.h
Text conflict in sql/item.h
Text conflict in sql/item_func.cc
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/log_event_old.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/rpl_utility.cc
Text conflict in sql/rpl_utility.h
Text conflict in sql/set_var.cc
Text conflict in sql/share/Makefile.am
Text conflict in sql/sql_delete.cc
Text conflict in sql/sql_plugin.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_table.cc
Text conflict in storage/example/ha_example.h
Text conflict in storage/federated/ha_federated.cc
Text conflict in storage/myisammrg/ha_myisammrg.cc
Text conflict in storage/myisammrg/myrg_open.c
2010-03-24 18:03:44 +03:00
Sergey Petrunya
7df026676b Merge MariaDB-5.2 -> MariaDB 5.3 2010-03-20 15:01:47 +03:00
Sergey Vojtovich
e0aadfd491 BUG#47444 - --myisam_repair_threads>1can result in all
index cardinalities=1

Parallel repair didn't poroperly update index cardinality
in certain cases.

When myisam_sort_buffer_size is not enough to store all
keys, index cardinality was updated before index was
actually written, when no index statistic is available.

mysql-test/r/myisam.result:
  A test case for BUG#47444.
mysql-test/t/myisam.test:
  A test case for BUG#47444.
storage/myisam/sort.c:
  update_key_parts() must be called after all index
  entries are written, when index statistic is available.
2010-03-12 14:43:30 +04:00
Sergey Vojtovich
f0c4da7ca2 Merge fix for BUG51307 to 5.1-bugteam. 2010-03-10 16:32:12 +04:00
unknown
4bf849c23c Merge MySQL 5.1.44 into MariaDB. 2010-03-04 09:03:07 +01:00
Sergey Vojtovich
a82cc50958 BUG#51307 - widespread corruption with partitions and
insert...select

Queries following bulk insert into an empty MyISAM table
may break it. This was pure MyISAM problem.

When bulk insert into an empty table is complete, MyISAM
may want to enable indexes via repair by sort. If repair
by sort fails (e.g. insufficient buffer), MyISAM failover
to repair with key cache, requesting repair of data file.

Repair of data file performs data file substitution. This
means that current table instance will point to new data
file. Other cached table instances are still pointing to
an old, deleted data file.

This is fixed by not requesting repair of data file
during enable indexes.

Explicit REPAIR is not affected, since it flushes all
table instances.

mysql-test/r/myisam.result:
  A test case for BUG#51307.
mysql-test/t/myisam.test:
  A test case for BUG#51307.
storage/myisam/ha_myisam.cc:
  When enabling indexes do not attempt to repair data file.
2010-03-02 13:45:50 +04:00
Ramil Kalimullin
9715539ebd Fix for bug#51304: checksum table gives different results
for same data when using bit fields

Problem: checksum for BIT fields may be computed incorrectly 
in some cases due to its storage peculiarity.

Fix: convert a BIT field to a string then calculate its checksum.


mysql-test/r/myisam.result:
  Fix for bug#51304: checksum table gives different results 
  for same data when using bit fields
    - test result.
mysql-test/t/myisam.test:
  Fix for bug#51304: checksum table gives different results 
  for same data when using bit fields
    - test case.
sql/sql_table.cc:
  Fix for bug#51304: checksum table gives different results 
  for same data when using bit fields
    - convert BIT fields to strings calculating its checksums
  as some bits may be saved among NULL bits in the record buffer.
2010-02-28 21:29:19 +04:00
Alexander Nozdrin
b3018e8613 Manual merge from mysql-trunk-merge.
Conflicts:
  - client/mysql.cc
  - client/mysqldump.c
  - configure.in
  - mysql-test/r/csv.result
  - mysql-test/r/func_time.result
  - mysql-test/r/show_check.result
  - mysql-test/r/sp-error.result
  - mysql-test/r/sp.result
  - mysql-test/r/sp_trans.result
  - mysql-test/r/type_blob.result
  - mysql-test/r/type_timestamp.result
  - mysql-test/r/warnings.result
  - mysql-test/suite/rpl/r/rpl_sp.result
  - sql/mysql_priv.h
  - sql/mysqld.cc
  - sql/sp.cc
  - sql/sql_base.cc
  - sql/sql_table.cc
  - sql/sql_trigger.cc
  - sql/sql_view.cc
  - sql/table.h
  - sql/share/errmsg.txt
  - mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
2010-02-24 16:52:27 +03:00
Alexander Nozdrin
d1ad316a59 Patch for WL#3736: Extended Table, Column and Index Comments.
The task is to 
  (a) add a comment on indexes and 
  (b) increase the maximum length of column, table and the new index comments.

The patch committed on behalf of Yoshinori Matsunobu (Yoshinori.Matsunobu@Sun.COM).
2010-02-20 13:07:32 +03:00
Sergey Vojtovich
8aeafbd53f Merge fix for BUG48438 to mysql-5.1-bugteam. 2010-02-12 16:47:43 +04:00
Sergey Vojtovich
62933c50df BUG#49628 - corrupt table after legal SQL, LONGTEXT column
Bulk REPLACE or bulk INSERT ... ON DUPLICATE KEY UPDATE may
break dynamic record MyISAM table.

The problem is limited to bulk REPLACE and INSERT ... ON
DUPLICATE KEY UPDATE, because only these operations may
be done via UPDATE internally and may request write cache.

When flushing write cache, MyISAM may write remaining
cached data at wrong position. Fixed by requesting write
cache to seek to a correct position.

mysql-test/r/myisam.result:
  A test case for BUG#49628.
mysql-test/t/myisam.test:
  A test case for BUG#49628.
storage/myisam/mi_dynrec.c:
  delete_dynamic_record() may change data file position.
  IO cache must be notified as it may still have cached
  data, which has to be flushed later.
2010-02-12 16:30:04 +04:00
Sergey Vojtovich
9d0c1ce535 BUG#48438 - crash with error in unioned query against merge
table and view...

Invalid memory reads after a query referencing MyISAM table
multiple times with write lock. Invalid memory reads may
lead to server crash, valgrind warnings, incorrect values
in INFORMATION_SCHEMA.TABLES.{TABLE_ROWS, DATA_LENGTH,
INDEX_LENGTH, ...}.

This may happen when one of the table instances gets closed
after a query, e.g. out of slots in open tables cache. UNION,
MERGE and VIEW are irrelevant.

The problem was that MyISAM didn't restore state info
pointer to default value.

myisam/mi_locking.c:
  When a query is referencing MyISAM table multiple times
  with a write lock, all table instances share the same
  state info, pointing to MI_INFO::save_state of
  "primary" table instance.
  
  When lock is released, state pointer was restored only
  for the primary table instance. Secondary table instances
  are still pointing to save_state of primary table
  instance.
  
  Primary table instance may get closed, leaving secondary
  table instances state pointer pointing to freed memory.
  
  That's mostly ok, since next lock will update state info
  pointer to correct value. But there're some cases, when
  this secondary table instance state info is accessed
  without a lock, e.g. INFORMATION_SCHEMA, MERGE (in 5.1
  and up), MyISAM itself for DBUG purposes.
  
  Restore default value of state pointer unconditionally,
  for both primary and secondary table instances.
mysql-test/r/myisam.result:
  A test case for BUG#48438.
mysql-test/t/myisam.test:
  A test case for BUG#48438.
2010-02-12 15:28:38 +04:00
Alexander Nozdrin
0e3a80e0a8 Manual merge from mysql-trunk-merge.
Conflicts:
  - storage/myisam/mi_packrec.c
2009-12-17 22:16:54 +03:00
Ramil Kalimullin
4621d480fc Auto-merge. 2009-12-17 10:52:43 +04:00
Ramil Kalimullin
06be03f77c Fix for bug#49465: valgrind warnings and incorrect live checksum...
Problem: inserting a record we don't set unused null bits in the
record buffer if no default field values used.
That may lead to wrong live checksum calculation.

Fix: set unused null bits in the record buffer in such cases.


mysql-test/r/myisam.result:
  Fix for bug#49465: valgrind warnings and incorrect live checksum...
    - test result.
mysql-test/t/myisam.test:
  Fix for bug#49465: valgrind warnings and incorrect live checksum...
    - test case.
sql/sql_insert.cc:
  Fix for bug#49465: valgrind warnings and incorrect live checksum...
    - set unused null bits to 1 in the record buffer in case we
  don't call restore_record() before a fill_record() call
  (when no default values used).
2009-12-17 09:55:03 +04:00
Sergey Petrunya
96e092dc73 Backport into MariaDB-5.2 the following:
WL#2474 "Multi Range Read: Change the default MRR implementation to implement new MRR interface"
WL#2475 "Batched range read functions for MyISAM/InnoDb"
        "Index condition pushdown for MyISAM/InnoDB"
Igor's fix from sp1r-igor@olga.mysql.com-20080330055902-07614:
  There could be observed the following problems:
  1. EXPLAIN did not mention pushdown conditions from on expressions in the 
  'extra' column.  As a result if a query had no where conditions pushed 
  down to a table, but had on conditions pushed to this table the 'extra' 
  column in the EXPLAIN for the table missed 'using where'.
  2. Conditions for ref access were not eliminated from on expressions 
  though such conditions were eliminated from the where condition.
2009-12-15 10:16:46 +03:00
Konstantin Osipov
1b34d593b5 Backport of:
------------------------------------------------------------
revno: 2476.784.3
committer: davi@moksha.local
timestamp: Tue 2007-10-02 21:27:31 -0300
message:
Bug#25858 Some DROP TABLE under LOCK TABLES can cause deadlocks
        
When a client (connection) holds a lock on a table and attempts to
drop (obtain a exclusive lock) on a second table that is already
held by a second client and the second client then attempts to
drop the table that is held by the first client, leads to a
circular wait deadlock. This scenario is very similar to trying to
drop (or rename) a table while holding read locks and are
correctly forbidden.
        
The solution is to allow a drop table operation to continue only
if the table being dropped is write (exclusively) locked, or if
the table is temporary, or if the client is not holding any
locks. Using this scheme prevents the creation of a circular
chain in which each client is waiting for one table that the
next client in the chain is holding.
            
This is incompatible change, as can be seen by number of tests
cases that needed to be fixed, but is consistent with respect to
behavior of the different scenarios in which the circular wait
might happen.

mysql-test/r/drop.result:
  Test case result for Bug#25858
mysql-test/r/group_by.result:
  Fix test case result wrt drop table under lock tables -- unlock tables
  before dropping table.
mysql-test/r/insert_notembedded.result:
  Fix test case result wrt drop table under lock tables -- unlock tables
  before dropping table
mysql-test/r/lock.result:
  Fix test case result wrt drop table under lock tables -- unlock tables
  before dropping table.
mysql-test/r/lock_multi.result:
  Fix test case result wrt drop table under lock tables -- unlock tables
  before dropping table.
mysql-test/r/myisam.result:
  Fix test case result wrt drop table under lock tables -- unlock tables
  before dropping table.
mysql-test/r/view.result:
  Fix test case result wrt drop table under lock tables -- unlock tables
  before dropping table.
mysql-test/t/drop.test:
  Add test case for Bug#25858
mysql-test/t/group_by.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
mysql-test/t/insert_notembedded.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
mysql-test/t/lock.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
mysql-test/t/lock_multi.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
mysql-test/t/myisam.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
mysql-test/t/query_cache_notembedded.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
mysql-test/t/view.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
sql/lock.cc:
  When trying to obtain a name lock under lock tables, ensure that the table is properly exclusively locked and fail otherwise.
2009-11-20 22:51:12 +03:00
unknown
a962160eec Merge with MySQL 5.1, with following additions:
- Moved some code from innodb_plugin to xtradb, to ensure that all tests runs
- Did changes in pbxt and maria storage engines becasue of changes in thd->query
- Reverted wrong code in sql_table.cc for how ROW_FORMAT is used.

This is a re-commit of Monty's merge to eliminate an extra commit from
MySQL-5.1.42 that was accidentally included in the merge.

This is a merge of the MySQL 5.1.41 clone-off (clone-5.1.41-build). In
case there are any extra changes done before final MySQL 5.1.41
release, these will need to be merged later before MariaDB 5.1.41
release.
2009-11-16 21:49:51 +01:00
Sergey Vojtovich
578007404d A follow-up to fix for
BUG#47073 - valgrind errs, corruption,failed repair of partition,
            low myisam_sort_buffer_size

Fixed race conditions discovered with the provided test case and
stabilized test case.

include/myisam.h:
  Serialize submission of messages from multi-threaded REPAIR.
mysql-test/r/myisam.result:
  REPAIR output highly depend on threads activity. Disabled
  result log to make test case deterministic.
mysql-test/t/myisam.test:
  REPAIR output highly depend on threads activity. Disabled
  result log to make test case deterministic.
storage/myisam/ha_myisam.cc:
  Serialize submission of messages from multi-threaded REPAIR.
storage/myisam/mi_check.c:
  Serialize submission of messages from multi-threaded REPAIR.
storage/myisam/sort.c:
  Only master thread is allowed to detach write cache from
  the share.
2009-10-27 18:27:27 +04:00
Sergey Vojtovich
eade898061 Disabled part of test for BUG#47073 until additional fix is pushed. 2009-10-15 12:31:11 +05:00
Sergey Vojtovich
adbd70aa12 BUG#47073 - valgrind errs, corruption,failed repair of partition,
low myisam_sort_buffer_size

Repair by sort (default) or parallel repair of a MyISAM table
(doesn't matter partitioned or not) as well as bulk inserts
and enable indexes some times didn't failover to repair with
key cache.

The problem was that after unsuccessful attempt, data file was
closed. Whereas repair with key cache requires open data file.
Fixed by reopening data file.

Also fixed a valgrind warning, which may appear during repair
by sort or parallel repair with certain myisam_sort_buffer_size
number of rows and length of an index entry (very dependent).

mysql-test/r/myisam.result:
  A test case for BUG#47073.
mysql-test/t/myisam.test:
  A test case for BUG#47073.
storage/myisam/ha_myisam.cc:
  Reverted fix for BUG25289. Not needed anymore.
storage/myisam/mi_check.c:
  Reopen data file, when repair by sort or parallel repair
  fails.
  
  When repair by sort is requested to rebuild data file, data file
  gets rebuilt while fixing first index. When rebuild is completed,
  info->dfile is pointing to temporary data file, original data file
  is closed.
  
  It may happen that repair has successfully fixed first index and
  rebuilt data file, but failed to fix second index. E.g.
  myisam_sort_buffer_size was big enough to fix first shorter index,
  but not enough to fix subsequent longer index.
  
  In this case we end up with info->dfile pointing to temporary file,
  which is removed and info->dfile is set to -1.
  
  Though repair by sort failed, the upper layer may still want to
  try repair with key cache. But it needs info->dfile pointing to
  valid data file.
storage/myisam/sort.c:
  When performing a copy of IO_CACHE structure, current_pos and
  current_end must be updated separatly to point to memory we're
  copying to (not to memory we're copying from).
  
  As t_file2 is always WRITE cache, proper members are write_pos
  and write_end accordingly.
2009-10-09 21:16:29 +05:00