Commit graph

6174 commits

Author SHA1 Message Date
unknown
9d85b0a616 BUG#21310 - Trees in SQL causing a "crashed" table with MyISAM storage engine
An update that used a join of a table to itself and modified the
table on one side of the join reported the table as crashed or
updated wrong rows.

Fixed by creating temporary table for self-joined multi update statement.


mysql-test/r/myisam.result:
  A test case for BUG#21310.
mysql-test/t/myisam.test:
  A test case for BUG#21310.
sql/lock.cc:
  Exclude 'table' param from check.
sql/sql_update.cc:
  Disabling record cache for self-joined multi update statement is wrong.
  The join must only see the table as it was at the beginning of the statement.
  safe_update_on_fly check if it is safe to update first table on the fly, that is
  not creating temporary table. It is possible in case a row from this table is
  never read more than once. safe_update_on_fly now detect self-joined table and
  refuse to update this table on the fly.
2006-12-20 19:05:35 +04:00
unknown
2576c4c0c9 Merge mysql.com:/home/svoj/devel/mysql/BUG23175/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/engines/mysql-4.1-engines


mysql-test/r/repair.result:
  Manual merge.
mysql-test/t/repair.test:
  Manual merge.
2006-10-19 17:35:09 +05:00
unknown
f841b546b0 Merge mysql.com:/home/svoj/devel/mysql/BUG22562/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/engines/mysql-4.1-engines
2006-10-19 17:33:22 +05:00
unknown
48cf65c037 BUG#23175 - MYISAM crash/repair failed during repair
Repair table could crash a server if there is not sufficient
memory (myisam_sort_buffer_size) to operate. Affects not only
repair, but also all statements that use create index by sort:
repair by sort, parallel repair, bulk insert.

Return an error if there is not sufficient memory to store at
least one key per BUFFPEK.

Also fixed memory leak if thr_find_all_keys returns an error.


myisam/sort.c:
  maxbuffer is number of BUFFPEK-s for repair. It is calculated
  as records / keys. keys is number of keys that can be stored
  in memory (myisam_sort_buffer_size). There must be sufficient
  memory to store both BUFFPEK-s and keys. It was checked
  correctly before this patch. However there is another
  requirement that wasn't checked: there must be sufficient
  memory for at least one key per BUFFPEK, otherwise repair
  by sort/parallel repair cannot operate.
  
  Return an error if there is not sufficient memory to store at
  least one key per BUFFPEK.
  
  Also fixed memory leak if thr_find_all_keys returns an error.
mysql-test/r/repair.result:
  A test case for BUG#23175.
mysql-test/t/repair.test:
  A test case for BUG#23175.
2006-10-18 17:57:29 +05:00
unknown
403cc15508 Merge bk-internal.mysql.com:/home/bk/mysql-4.1-engines
into  chilla.local:/home/mydev/mysql-4.1-bug8283-one


include/my_sys.h:
  Auto merged
2006-10-11 22:28:06 +02:00
unknown
31754c57bd BUG#22562 - REPAIR TABLE .. USE_FRM causes server crash on Windows and server
hangs on Linux

If REPAIR TABLE ... USE_FRM is issued for table that is located in different
than default database server crash could happen.

In reopen_name_locked_table take database name from table_list (user specified
or default database) instead of from thd (default database).

Affects 4.1 only.


mysql-test/r/repair.result:
  A test case for BUG#22562.
mysql-test/t/repair.test:
  A test case for BUG#22562.
sql/sql_base.cc:
  In reopen_name_locked_table take database name from table_list (user specified
  or default database) instead of from thd (default database).
2006-10-11 20:34:20 +05:00
unknown
679b5848f3 Merge chilla.local:/home/mydev/mysql-4.1-bug8283
into  chilla.local:/home/mydev/mysql-4.1-bug8283-one


myisam/mi_check.c:
  Auto merged
myisam/mi_packrec.c:
  Auto merged
myisam/sort.c:
  Auto merged
mysql-test/r/myisam.result:
  Bug#8283 - OPTIMIZE TABLE causes data loss
  Manual merge
mysql-test/t/myisam.test:
  Bug#8283 - OPTIMIZE TABLE causes data loss
  Manual merge
2006-10-09 19:40:16 +02:00
unknown
3109da7719 Bug#8283 - OPTIMIZE TABLE causes data loss
OPTIMIZE TABLE with myisam_repair_threads > 1 performs a non-quick 
parallel repair. This means that it does not only rebuild all 
indexes, but also the data file.

Non-quick parallel repair works so that there is one thread per 
index. The first of the threads rebuilds also the new data file.

The problem was that all threads shared the read io cache on the
old data file. If there were holes (deleted records) in the table,
the first thread skipped them, writing only contiguous, non-deleted
records to the new data file. Then it built the new index so that
its entries pointed to the correct record positions. But the other
threads didn't know the new record positions, but put the positions
from the old data file into the index.

The new design is so that there is a shared io cache which is filled
by the first thread (the data file writer) with the new contiguous
records and read by the other threads. Now they know the new record
positions.

Another problem was that for the parallel repair of compressed
tables a common bit_buff and rec_buff was used. I changed it so
that thread specific buffers are used for parallel repair.

A similar problem existed for checksum calculation. I made this
multi-thread safe too.


include/my_sys.h:
  Bug#8283 - OPTIMIZE TABLE causes data loss
  Redesign of io_cache_share.
include/myisam.h:
  Bug#8283 - OPTIMIZE TABLE causes data loss
  Redesign of checksum calculation in mi_check.c.
  'calc_checksum' is now in myisamdef.h:st_mi_sort_param.
myisam/mi_check.c:
  Bug#8283 - OPTIMIZE TABLE causes data loss
  Implemented a new parallel repair design.
  Using a synchronized shared read/write cache.
  Allowed for thread specific bit_buff, rec_buff, and calc_checksum.
myisam/mi_open.c:
  Bug#8283 - OPTIMIZE TABLE causes data loss
  Added DBUG output.
myisam/mi_packrec.c:
  Bug#8283 - OPTIMIZE TABLE causes data loss
  Allowed for thread specific bit_buff and rec_buff.
myisam/myisamdef.h:
  Bug#8283 - OPTIMIZE TABLE causes data loss
  Commented on checksum calculation variables.
  Allowed for thread specific bit_buff.
  Added DBUG output for better table crash detection.
myisam/sort.c:
  Bug#8283 - OPTIMIZE TABLE causes data loss
  Added implications of the new parallel repair design.
  Renamed 'info' -> 'sort_param'.
  Added DBUG output.
mysql-test/r/myisam.result:
  Bug#8283 - OPTIMIZE TABLE causes data loss
  Added test results.
mysql-test/t/myisam.test:
  Bug#8283 - OPTIMIZE TABLE causes data loss
  Added test cases.
mysys/mf_iocache.c:
  Bug#8283 - OPTIMIZE TABLE causes data loss
  Redesign of io_cache_share.
  We do now allow a writer to synchronize himself with the
  readers of a shared cache. When all threads join in the lock,
  the writer copies the data from his write buffer to the shared
  read buffer.
2006-10-09 19:26:55 +02:00
unknown
6abdffe4f6 Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-4.1
into  may.pils.ru:/home/svoj/devel/bk/mysql-4.1-engines
2006-10-08 15:11:17 +05:00
unknown
b7d1c48213 Per discussion with pekka removed non-deterministic test case for bug#21381. 2006-10-06 14:47:58 +05:00
unknown
f463cb389b Addition to fix for bug#10974. Fixed spelling. 2006-10-06 10:54:47 +05:00
unknown
9387a593c7 Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG21381/mysql-4.1-engines
2006-10-05 18:56:10 +05:00
unknown
2268afedea BUG#21381 - Engine not notified about multi-table UPDATE IGNORE
Though this is not storage engine specific problem, I was able to
repeat this problem with BDB and NDB engines only. That was the
reason to add a test case into ndb_update.test. As a result
different bad things could happen.

BDB has removed duplicate rows which is not expected.
NDB returns an error.

For multi table update notify storage engine about UPDATE IGNORE
as it is done in single table UPDATE.


mysql-test/r/ndb_update.result:
  A test case for bug#21381.
mysql-test/t/ndb_update.test:
  A test case for bug#21381.
sql/sql_update.cc:
  For multi table update notify storage engine about UPDATE IGNORE
  as it is done in single table UPDATE.
2006-10-05 18:23:53 +05:00
unknown
287b027ed8 Merge mysql.com:/home/gluh/MySQL/Merge/4.1
into  mysql.com:/home/gluh/MySQL/Merge/4.1-kt


include/m_ctype.h:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
sql/table.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
2006-10-05 16:38:21 +05:00
unknown
5549ed3a4a Merge bk-internal:/home/bk/mysql-4.1-runtime
into  neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
2006-10-03 12:55:33 +02:00
unknown
6a67f60c42 Merge bk-internal:/home/bk/mysql-4.1-rpl
into  neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint


sql/item_func.cc:
  Auto merged
2006-10-03 11:20:37 +02:00
unknown
8c192e2d02 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into  neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
2006-10-03 11:19:00 +02:00
unknown
dc62ff5560 Merge mysql.com:/usr/home/bar/mysql-4.1.b8663
into  mysql.com:/usr/home/bar/mysql-4.1-rpl


mysql-test/r/cast.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
sql/item_func.cc:
  Auto merged
2006-10-03 11:53:01 +05:00
unknown
69e970a5ea Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  mockturtle.local:/home/dlenev/src/mysql-4.1-rt-merge


sql/sql_select.cc:
  Auto merged
2006-10-03 08:19:06 +04:00
unknown
c71ecd928f Remove faulty merge 2006-10-02 14:05:36 +02:00
unknown
4c59fceab0 Remove faulty merge causing ctype_utf8 failure 2006-10-02 13:47:18 +02:00
unknown
350ec8b198 Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/svoj/devel/mysql/merge/mysql-4.1-engines


mysql-test/r/myisam.result:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
sql/table.cc:
  Auto merged
2006-10-02 14:42:12 +05:00
unknown
045a8adcd0 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
2006-09-29 17:23:44 -04:00
unknown
f621def226 Fix a test case according to fix for bug#10974. 2006-09-29 19:00:52 +05:00
unknown
1bb27aeab1 Merge rolltop.ignatz42.dyndns.org:/mnt/storeage/bug20305/my41-bug20305
into  rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-4.1-maint
2006-09-28 15:56:14 -04:00
unknown
314e10592c Bug#20305: PROCEDURE ANALYSE() returns wrong M for FLOAT(M, D) and DOUBLE(M, D)
mysql-test/r/analyse.result:
  Added Results
mysql-test/t/analyse.test:
  Added test cases to make sure field_str and field_real return correctly.
sql/sql_analyse.cc:
  According the manaul, when declaring a FLOAT(M, N), N equals the number of decimal places and M equals the total number of
  digits in the number.
2006-09-28 14:30:20 -04:00
unknown
d96989ca65 Merge mysql.com:/home/svoj/devel/bk/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG21617/mysql-4.1-engines


myisammrg/myrg_open.c:
  Auto merged
mysql-test/r/merge.result:
  Manual merge.
mysql-test/t/merge.test:
  Manual merge.
2006-09-28 22:14:31 +05:00
unknown
7d915f0193 BUG#21617 - crash when selecting from merge table with inconsistent indexes
Crash may happen when selecting from a merge table that has underlying
tables with less indexes than in a merge table itself.

If number of keys in merge table is not bigger than requested key number,
return error.


myisammrg/myrg_open.c:
  Store min(number of keys) in m_info instead of number of keys in last
  underlying table.
myisammrg/myrg_queue.c:
  Return error if inx passed to _myrg_init_queue function is not less
  than number of keys.
mysql-test/r/merge.result:
  A test case for bug#21617.
mysql-test/t/merge.test:
  A test case for bug#21617.
mysys/queues.c:
  Replaced annoying ifndef DBUG_OFF with DBUG_ASSERT, fixed coding style.
  The problem was that having queue overrun in debug build was hidden
  with this ifdef.
2006-09-28 22:10:06 +05:00
unknown
6e985efb1e Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint


mysql-test/r/ctype_utf8.result:
  Manual merge.
mysql-test/t/ctype_utf8.test:
  Manual merge.
2006-09-28 10:02:53 -04:00
unknown
b8fe620615 Merge dl145s.mysql.com:/data/bk/team_tree_merge/mysql-4.1
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-4.1-opt


sql/sql_select.cc:
  Auto merged
2006-09-28 10:19:25 +02:00
unknown
4bbca0b6bf Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  mockturtle.local:/home/dlenev/src/mysql-4.1-runtime
2006-09-28 11:02:10 +04:00
unknown
abd883f4d0 Patch for bug#21432 is reverted 2006-09-27 17:49:16 +05:00
unknown
9bf2ed9553 Fixed bug #21853: assert failure for a grouping query with
an ALL/ANY quantified subquery in HAVING.
The Item::split_sum_func2 method should not create Item_ref
for objects of any class derived from Item_subselect.


mysql-test/r/subselect.result:
  Added a test case for bug #21853.
mysql-test/t/subselect.test:
  Added a test case for bug #21853.
2006-09-25 05:24:07 -07:00
unknown
53d2e32b81 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
2006-09-23 09:55:16 -04:00
unknown
14ad51e09e Merge mysql.com:/users/lthalmann/bkroot/mysql-4.1-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-4.1-merge


BitKeeper/etc/ignore:
  auto-union
mysql-test/r/myisam.result:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
2006-09-23 05:58:48 +02:00
unknown
41c25e0185 Merge bk-internal.mysql.com:/home/bk/mysql-4.1-maint
into  polly.local:/home/kaa/src/maint/m41-maint--07OGk
2006-09-22 19:50:16 +04:00
unknown
e749f9eb67 Merge polly.local:/tmp/22129/bug22129/my41-bug22129
into  polly.local:/home/kaa/src/maint/m41-maint--07OGk


strings/strtod.c:
  Auto merged
2006-09-22 19:44:51 +04:00
unknown
2299727e60 Fixed bug #22129: A small double precision number becomes zero
Better checks for underflow/overflow


mysql-test/r/type_float.result:
  Added testcase for bug #22129
mysql-test/t/type_float.test:
  Added testcase for bug #22129
2006-09-22 19:23:58 +04:00
unknown
4d147f3285 Adding proper setup phase for test case rpl_insert_id
mysql-test/r/rpl_insert_id.result:
  Updated result file
2006-09-21 13:19:52 +02:00
unknown
5d3a59fae7 Fix for bug #20204: "order by" changes the results returned
Item_substr's results are improperly stored in a temporary table due to       
wrongly calculated max_length value for multi-byte charsets if two            
arguments specified.                                                          


mysql-test/r/ctype_utf8.result:
  Fix for bug #20204: "order by" changes the results returned
    - test case.
mysql-test/t/ctype_utf8.test:
  Fix for bug #20204: "order by" changes the results returned
    - test result.
sql/item_strfunc.cc:
  Fix for bug #20204: "order by" changes the results returned
    - always take into account current mbmaxlen value calculating max_length.
2006-09-21 16:05:01 +05:00
unknown
c19ac9ec91 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/mysql-4.1-maint


mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
2006-09-21 09:35:17 +05:00
unknown
9e9632fd9b Vertical printout in test to make easier to read 2006-09-21 03:32:42 +02:00
unknown
0f50a8a7fe Fixed bug #20108.
Any default value for a enum fields over UCS2 charsets was corrupted
when we put it into the frm file, as it had been overwritten by its
HEX representation.
To fix it now we save a copy of structure that represents the enum
type and when putting the default values we use this copy. 


mysql-test/r/ctype_ucs.result:
  Added a test case for bug #20108.
mysql-test/t/ctype_ucs.test:
  Added a test case for bug #20108.
2006-09-20 09:46:12 -07:00
unknown
23fefc8801 BUG#10974 - No error message if merge table based on union of innodb, memory
Fixed confusing error message from the storage engine when
it fails to open underlying table. The error message is issued
when a table is _opened_ (not when it is created).


myisammrg/myrg_open.c:
  Set my_errno to HA_ERR_WRONG_MRG_TABLE_DEF if attempt to open
  underlying table failed.
mysql-test/r/merge.result:
  A test case for bug#10974.
mysql-test/r/repair.result:
  Fixed a test case according to patch for bug#10974.
mysql-test/t/merge.test:
  A test case for bug#10974.
sql/share/english/errmsg.txt:
  Better error message if we fail to open underlying table.
sql/table.cc:
  Report error from handler with print_error instead of frm_error. This
  fixes confusing error message from the handler. Actually this is
  backported from 5.0.
2006-09-20 01:40:59 +05:00
unknown
903fc561b2 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-4.1-opt
2006-09-19 08:42:58 -07:00
unknown
608e10e0ff Merge kpdesk.mysql.com:/home/thek/dev2/bug21139/my41-bug21139
into  kpdesk.mysql.com:/home/thek/dev2/mysql-4.1-maint
2006-09-19 12:44:09 +02:00
unknown
7c8931d836 Bug#21139 Handling of database differs in "embedded" , test lowercase_fs_off fails
- Access checks are omitted when compliled without --with-embedded-privilege-control
- Patch: skip this test


mysql-test/t/lowercase_fs_off.test:
  Added test to check if this embedded built in which case we just skip this test.
2006-09-19 12:40:31 +02:00
unknown
186573b3d6 Merge may.pils.ru:/home/svoj/devel/mysql/merge/mysql-4.1
into  may.pils.ru:/home/svoj/devel/mysql/merge/mysql-4.1-engines


mysql-test/r/myisam.result:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
2006-09-18 20:35:33 +05:00
unknown
c46151d961 Fixed bug #22085: Crash on the execution of a prepared
statement that uses an aggregating IN subquery with 
HAVING clause.
A wrong order of the call of split_sum_func2 for the HAVING
clause of the subquery and the transformation for the 
subquery resulted in the creation of a andor structure
that could not be restored at an execution of the prepared
statement.


mysql-test/r/ps.result:
  Added a test cases for bug #22085.
mysql-test/t/ps.test:
  Added a test cases for bug #22085.
2006-09-16 11:50:00 -07:00
unknown
e5345197ed Merge bk-internal:/home/bk/mysql-4.1-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B21180-4.1-opt


mysql-test/r/subselect.result:
  merge of 4.1-opt
mysql-test/t/subselect.test:
  merge of 4.1-opt
sql/opt_range.h:
  merge of 4.1-opt
2006-09-15 18:56:05 +03:00