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.
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).
- When a MyISAM table which belongs to a merge table union and is
renamed the associated file descriptors are closed on windows.
This causes a server crash next time an insert or update is
performed on the merge table.
- This patch prevents the system from crashing on windows by
checking for bad file descriptors every time the MyISAM table
is locked by associated the merge table.
1. Fix index access costs for MERGE tables, set block_size=myisam_block_size/#underlying_tables
instead of 0 which it was before.
2. Make index scans on MERGE table to return records in (key_tuple, merge_table_rowid) order,
instead of just (key_tuple) order. This makes an index scan on MERGE table to be truly a ROR-scan
which is a requirement for index_merge union/intersection.
The problem was an ab-use of last_rkey_length.
Formerly we saved the packed key length (of the search key)
in this element. But in certain cases it got replaced by
the (packed) result key length.
Now we use a new element of MI_INFO to save the packed key
length of the search key.
This is a replacement for the original patch given by Ingo. This one comes
from Monty.
The problem is that merge files now use unix style pathnames on all
platforms. The merge file open code was not properly converting those
pathnames back to non-unix when necessary.
Changed the creation of the .MRG file so that only the table name
is written when the MyISAM table is in the same database as the
MERGE table, a relative path is used in other cases in mysqld,
and possibly an absolute path is used in an embedded server.
No test case is added as the external behaviour is unchanged.
Only the file names within the .MRG file are changed.
Use 'mysqltest' as test database instead of test_$1 or test1,test2 to not accidently delete an important database
Safety fix for mailformed MERGE files
New records_in_range() interface (similar to read_range())
Macros for faster bitmap handling
Simplify read_range() code (#WL1786)
New general key_cmp() function to compare keys