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.
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.
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).
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
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.
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.
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
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
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.
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.
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.
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
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.
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
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.
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.
- 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.
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.
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