While printing the Max keyfile length 'llstr' call was used which
was treating the max_key_file_length as negative.
Changing this to ullstr fixes the problem.
myisamchk output will differ in 32 bit and 64 bit Operating systems
so its not possible to have test case for this bug.
myisam/myisamchk.c:
Replaced llstr by ullstr, while converting
share->base.max_key_file_length-1 to string.
The test started failing following the push for BUG#41541.
Some of the algorithms access bytes beyond the input data
and this can affect up to one byte less than "word size"
which is BITS_SAVED / 8.
Fixed by adding (BITS_SAVED / 8) -1 bytes to buffer size
(i.e. Memory Segment #2) to avoid accessing un-allocated data.
myisam/mi_packrec.c:
Fixed _mi_read_pack_info() method to allocate (BITS_SAVED/8) - 1
bytes to the Memory Segment #2
mysql-test/r/myisampack.result:
Result file for BUG#43973
mysql-test/t/myisampack.test:
Testcase for BUG#43973
After the table is compressed by the myisampack utility,
opening the table by the server produces valgrind warnings.
This happens because when we try to read a record into the buffer
we alway assume that the remaining buffer to read is always equal
to word size(4 or 8 or 2 bytes) we read. Sometimes we have
remaining buffer size less than word size and trying to read the
entire word size will end up in valgrind errors.
Fixed by reading byte by byte when we detect the remaining buffer
size is less than the word size.
myisam/mi_packrec.c:
Fixed fill_buffer() to read byte by byte when the remaining
buffer size is less than word size.
mysql-test/r/myisampack.result:
Result file for BUG#41541
mysql-test/t/myisampack.test:
Testcase for BUG#41541
are written.
When we have a myisam table with DELAY_KEY_WRITE option, index updates
are not applied until the flush tables command is issued or until the
server is shutdown. If server gets killed before the index updates are
written to disk, the index file is corrupted as expected but the table
is not marked as crashed. So when we start server with myisam-recover,
table is not repaired leaving the table unusable.
The problem is when we try to write the index updates to index file,
we decrement the open_count even before the flushing the keys to index
file.
Fixed by moving the decrement operation after flushing the keys to the
index file. So we always have non zero open count if the flush table
operation is killed and when the server is started with mysiam-recover
option, it marks the table as crashed and repairs it.
Note: No testcase for added as we need to kill the server and start the
server with different set of options and other non trivial
operations involved.
myisam/mi_close.c:
Decrement open count after flushing the key blocks to the
key file. If the server(with DELAY_KEY_WRITE option) is
killed before flush_key_blocks operation, we will have non
zero open count and the table can be repaired when server is
started with --myisam-recover option.
- Remove bothersome warning messages. This change focuses on the warnings
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
Certain boolean mode queries with truncation operator did
not return matching records and calculate relevancy
incorrectly.
myisam/ft_boolean_search.c:
Sort ftb->list in ascending order. This helps to fix binary
search in ft_boolean_find_relevance() without rewriting it
much.
Fixed binary search in ft_boolean_find_relevance(), so it finds
right-most element in an array.
Fixed that ft_boolean_find_relevance() didn't return match for
words with truncation operator in case query has other non-
matching words.
mysql-test/r/fulltext.result:
A test case for BUG#37245.
mysql-test/t/fulltext.test:
A test case for BUG#37245.
Problem: data consistency check (maximum record length) for a correct
MyISAM table with CHECKSUM=1 and ROW_FORMAT=DYNAMIC option
may fail due to wrong inner MyISAM parameter. In result we may
have the table marked as 'corrupted'.
Fix: properly set MyISAM maximum record length parameter.
myisam/mi_create.c:
Fix for bug #37310: 'on update CURRENT_TIMESTAMP' option crashes the table
Use HA_OPTION_PACK_RECORD instead of HA_PACK_RECORD (typo?)
calculating packed record length.
test_if_data_home_dir fixed to look into real path.
Checks added to mi_open for symlinks into data home directory.
per-file messages:
include/my_sys.h
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
my_is_symlink interface added
include/myisam.h
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
myisam_test_invalid_symlink interface added
myisam/mi_check.c
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
mi_open_datafile calls modified
myisam/mi_open.c
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
code added to mi_open to check for symlinks into data home directory.
mi_open_datafile now accepts 'original' file path to check if it's
an allowed symlink.
myisam/mi_static.c
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
myisam_test_invlaid_symlink defined
myisam/myisamchk.c
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
mi_open_datafile call modified
myisam/myisamdef.h
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
mi_open_datafile interface modified - 'real_path' parameter added
mysql-test/r/symlink.test
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
error codes corrected as some patch now rejected pointing inside datahome
mysql-test/r/symlink.result
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
error messages corrected in the result
mysys/my_symlink.c
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
my_is_symlink() implementsd
my_realpath() now returns the 'realpath' even if a file isn't a symlink
sql/mysql_priv.h
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
test_if_data_home_dir interface
sql/mysqld.cc
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
myisam_test_invalid_symlik set with the 'test_if_data_home_dir'
sql/sql_parse.cc
Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
error messages corrected
test_if_data_home_dir code fixed
into amd64.(none):/src/bug26243/my50-bug26243
libmysql/libmysql.c:
Auto merged
myisam/mi_open.c:
Auto merged
sql/ha_federated.cc:
Auto merged
sql/ha_myisammrg.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_select.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
- Backported the 5.1 DBUG to 5.0.
- Avoid memory cleanup race on Windows client for CTRL-C
client/mysql.cc:
Bug#26243 mysql command line crash after control-c
- On Windows, the sigint handler shouldn't call mysql_end
because the main thread will do so automatically.
- Remove unnecessary signal call from the sigint handler.
- Call my_end with proper value.
dbug/dbug.c:
Bug#26243 mysql command line crash after control-c
- Backported the 5.1 DBUG library. The old version uses a non-thread
safe global variable 'static struct state *stack'.
dbug/factorial.c:
Bug#26243 mysql command line crash after control-c
- Backported the 5.1 DBUG library. The old version uses a non-thread
safe global variable 'static struct state *stack'.
dbug/user.r:
Bug#26243 mysql command line crash after control-c
- Backported the 5.1 DBUG library. The old version uses a non-thread
safe global variable 'static struct state *stack'.
include/my_dbug.h:
Bug#26243 mysql command line crash after control-c
- Backported the 5.1 DBUG library. The old version uses a non-thread
safe global variable 'static struct state *stack'.
libmysql/libmysql.c:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
myisam/mi_open.c:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
sql/ha_federated.cc:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
sql/ha_innodb.cc:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
sql/ha_myisammrg.cc:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
sql/item_cmpfunc.cc:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
sql/mysqld.cc:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
sql/net_serv.cc:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
sql/opt_range.cc:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
sql/set_var.cc:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
sql/slave.cc:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
sql/sql_cache.cc:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
sql/sql_select.cc:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
tests/mysql_client_test.c:
Bug#26243 mysql command line crash after control-c
- Update for new DBUG library.
empty result when using DESC
Problem: fetching MyISAM keys we copy a key block pointer to the end of the key buffer.
However, we don't take into account the pointer length calculatig the buffer size,
that may leads to memory overwriting and in turn to unpredictable results.
Fix: increase key buffer size by length of the key block pointer.
Note: no simple test case.
myisam/mi_open.c:
Fix for bug #33758: Got query result when using ORDER BY ASC, but
empty result when using DESC
- increase possible maximum key length by size of the key block pointer,
as it's copied into the key buffer in the get_key() MyISAM functions.
at page 1024 with ucs2_bin
Inserting strings with a common prefix into a table with
characterset UCS2 corrupted the table.
An efficient search method was used, which compares end space
with ASCII blank. This doesn't work for character sets like UCS2,
which do not encode blank like ASCII does.
Use the less efficient search method _mi_seq_search()
for charsets with mbminlen > 1.
myisam/mi_open.c:
Bug#32705 - myisam corruption: Key in wrong position
at page 1024 with ucs2_bin
Use _mi_seq_search() for charsets with mbminlen > 1.
mysql-test/r/myisam.result:
Bug#32705 - myisam corruption: Key in wrong position
at page 1024 with ucs2_bin
Added test result.
mysql-test/t/myisam.test:
Bug#32705 - myisam corruption: Key in wrong position
at page 1024 with ucs2_bin
Added test.
into mysql.com:/home/gluh/MySQL/Merge/5.0-opt
client/mysql.cc:
Auto merged
client/mysqltest.c:
Auto merged
include/mysql_com.h:
Auto merged
libmysql/CMakeLists.txt:
Auto merged
myisam/mi_check.c:
Auto merged
mysql-test/r/delayed.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/r/ps.result:
Auto merged
mysql-test/t/merge.test:
Auto merged
mysql-test/t/myisam.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/type_datetime.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/field.cc:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/func_misc.result:
manual merge
mysql-test/r/innodb_mysql.result:
manual merge
mysql-test/t/func_misc.test:
manual merge
mysql-test/t/innodb_mysql.test:
manual merge
sql/sql_insert.cc:
manual merge
into ramayana.hindu.god:/home/tsmith/m/bk/maint/50
client/mysqldump.c:
Auto merged
include/my_sys.h:
Auto merged
libmysql/CMakeLists.txt:
Auto merged
libmysql/Makefile.shared:
Auto merged
myisam/ft_boolean_search.c:
Auto merged
myisam/sort.c:
Auto merged
mysql-test/t/cast.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/field.cc:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
mysql-test/mysql-test-run.pl:
Manual merge
mysql-test/r/ctype_ucs.result:
Manual merge
mysql-test/r/func_misc.result:
Manual merge
mysql-test/t/binlog_killed.test:
Manual merge
mysql-test/t/ctype_ucs.test:
Manual merge
mysql-test/t/func_misc.test:
Manual merge
sql/item_strfunc.h:
Manual merge
strings/ctype-simple.c:
Manual merge
SPATIAL key is fine actually, but the chk_key() function
mistakenly returns error. It tries to compare checksums
of btree and SPATIAL keys while the checksum for the SPATIAL isn't
calculated (always 0). Same thing with FULLTEXT keys is handled
using full_text_keys counter, so fixed by counting both
SPATIAL and FULLTEXT keys in that counter.
myisam/mi_check.c:
Bug #30284 spatial key corruption
full_text_keys counts both FULL_TEXT and SPATIAL keys
mysql-test/r/gis.result:
Bug #30284 spatial key corruption
test result
mysql-test/t/gis.test:
Bug #30284 spatial key corruption.
test case
into mysql.com:/home/gluh/MySQL/Merge/5.0-opt
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
mysql-test/r/select.result:
manual merge
mysql-test/t/select.test:
manual merge
Post-pushbuild fix
Added a purecov comment and a test for coverage of parallel
enable keys.
myisam/mi_check.c:
Bug#4692 - DISABLE/ENABLE KEYS waste a space
Added purecov comment.
mysql-test/r/myisam.result:
Bug#4692 - DISABLE/ENABLE KEYS waste a space
Added test result.
mysql-test/t/myisam.test:
Bug#4692 - DISABLE/ENABLE KEYS waste a space
Added test for coverage of parallel enable keys.
into mysql.com:/home/svoj/devel/mysql/BUG31277/mysql-5.0-engines
myisam/mi_check.c:
Auto merged
myisam/mi_open.c:
Auto merged
myisam/mi_packrec.c:
Auto merged
myisam/myisamchk.c:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
sql/mysql_priv.h:
Auto merged
include/mysql_com.h:
Use local.
sql-common/client.c:
Use local.
When we insert a record into MYISAM table which is almost 'full',
we first write record data in the free space inside a file, and then
check if we have enough space after the end of the file.
So if we don't have the space, table will left corrupted.
Similar error also happens when we updata MYISAM tables.
Fixed by modifying write_dynamic_record and update_dynamic_record functions
to check for free space before writing parts of a record
BitKeeper/etc/ignore:
Added libmysql_r/client_settings.h libmysqld/ha_blackhole.cc to the ignore list
myisam/mi_dynrec.c:
Bug #31305 myisam tables crash when they are near capacity.
now we check space left in table in write_dynamic_record
and update_dynamic_record functions.
If we don't have enough room for the new (updated) record, return with the
error.
mysql-test/r/almost_full.result:
New BitKeeper file ``mysql-test/r/almost_full.result''
mysql-test/t/almost_full.test:
New BitKeeper file ``mysql-test/t/almost_full.test''
With certain data sets (when compressed record length gets bigger than
uncompressed) myisamchk --unpack may corrupt data file.
Fixed that record length was wrongly restored from compressed table.
myisam/mi_check.c:
With compressed tables compressed record length may be bigger than
pack_reclength, thus we may allocate insufficient memory for record
buffer.
Let single function allocate record buffer, performing needed record
length calculations.
Still, it is not doable with parallel repair, as it allocates needed
record buffers at once. For parellel repair added better record length
calculation.
myisam/mi_open.c:
When calculating record buffer size, take into account that compressed
record length may be bigger than uncompressed.
myisam/mi_packrec.c:
With certain data set share->max_pack_length (compressed record length)
may be bigger than share->base.pack_reclength (packed record length).
set_if_bigger(pack_reclength, max_pack_length) in this case causes
myisamchk --unpack to write extra garbage, whereas pack_reclength
remains the same in new index file. As a result we get unreadable
table.
myisam/myisamchk.c:
With compressed tables compressed record length may be bigger than
pack_reclength, thus we may allocate insufficient memory for record
buffer.
Let single function allocate record buffer, performing needed record
length calculations.
mysql-test/mysql-test-run.pl:
Environment variables to execute myisamchk and myisampack.
mysql-test/r/myisampack.result:
New BitKeeper file ``mysql-test/r/myisampack.result''
mysql-test/t/myisampack.test:
New BitKeeper file ``mysql-test/t/myisampack.test''
Disabling and enabling indexes on a non-empty table grows the
index file.
Disabling indexes just sets a flag per non-unique index and does not
free the index blocks of the affected indexes. Re-enabling indexes
creates new indexes with new blocks. The old blocks remain unused
in the index file.
Fixed by dropping and re-creating all indexes if non-empty disabled
indexes exist when enabling indexes. Dropping all indexes resets
the internal end-of-file marker to the end of the index file header.
It also clears the root block pointers of every index and clears the
deleted blocks chains. This way all blocks are declared as free.
myisam/mi_check.c:
Bug#4692 - DISABLE/ENABLE KEYS waste a space
Added function mi_drop_all_indexes() to support drop of all indexes
in case we want to re-enable non-empty disabled indexes.
Changed mi_repair(), mi_repair_by_sort(), and mi_repair_parallel()
to use the new function instead of duplicate drop index code.
mysql-test/r/myisam.result:
Bug#4692 - DISABLE/ENABLE KEYS waste a space
Added test result.
mysql-test/t/myisam.test:
Bug#4692 - DISABLE/ENABLE KEYS waste a space
Added test.
fulltext index
Having a table with broken multibyte characters may cause fulltext
parser dead-loop.
Since normally it is not possible to insert broken multibyte sequence
into a table, this problem may arise only if table is damaged.
Affected statements are:
- CHECK/REPAIR against damaged table with fulltext index;
- boolean mode phrase search against damaged table with or
without fulltext inex;
- boolean mode searches without index;
- nlq searches.
No test case for this fix. Affects 5.0 only.
myisam/ft_parser.c:
When skipping leading spaces, skip broken characters as well (broken
characters a identified by mbl == 0).
Fulltext boolean mode phrase search may crash server on platforms
where size of pointer is not equal to size of unsigned integer
(in other words some 64-bit platforms).
The problem was integer overflow.
Affects 4.1 only.
myisam/ft_boolean_search.c:
my_match_t::beg is unsigned int, that means type of expression
(m[0].beg - 1) has unsigned type too. It may happen that instr()
finds substring in the beggining of passed string, returning
m[0].beg equal to 0. In this case value of expression (m[0].beg - 1)
is equal to MAX_UINT.
This is not a problem on platforms where sizeof(pointer) equals to
sizeof(uint). That means ptr[(uint)-1] = ptr[(uint)MAX_UINT] = ptr - 1.
On some 64-bit platforms where sizeof(pointer) is 8 and sizeof(uint)
is 4, wrong address gets accessed. In other words ptr[(uint)-1] is
equal to ptr + MAX_UINT.
mysql-test/r/fulltext.result:
A test case for BUG#11392.
mysql-test/t/fulltext.test:
A test case for BUG#11392.
into mysql.com:/home/gluh/MySQL/Merge/5.0-opt
client/mysqldump.c:
Auto merged
include/config-win.h:
Auto merged
libmysql/libmysql.c:
Auto merged
myisam/sort.c:
Auto merged
mysql-test/r/func_sapdb.result:
Auto merged
mysql-test/r/variables.result:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/field.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_timefunc.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/r/type_datetime.result:
manual merge
mysql-test/r/type_decimal.result:
manual merge
mysql-test/t/type_datetime.test:
manual merge
mysql-test/t/type_decimal.test:
manual merge
sql/item.cc:
manual merge
myisam/mi_write.c:
type conversion fixed
myisam/sort.c:
type conversion fixed
sql/ha_federated.cc:
type conversion fixed
sql/ha_heap.cc:
type conversion fixed
sql/ha_innodb.cc:
type conversion fixed
sql/ha_myisam.cc:
type conversion fixed
sql/opt_range.cc:
type conversion fixed
sql/sql_map.cc:
type conversion fixed
sql/sql_select.cc:
type conversion fixed
sql/sql_update.cc:
type conversion fixed
CPUs / Intel's ICC compile
The bug is a combination of two problems:
1. IA64/ICC MySQL binaries use glibc's qsort(), not the one in mysys.
2. The order relation implemented by join_tab_cmp() is not transitive,
i.e. it is possible to choose such a, b and c that (a < b) && (b < c)
but (c < a). This implies that result of a sort using the relation
implemented by join_tab_cmp() depends on the order in which
elements are compared, i.e. the result is implementation-specific. Since
choose_plan() uses qsort() to pre-sort the
join tables using join_tab_cmp() as a compare function, the results of
the sorting may vary depending on qsort() implementation.
It is neither possible nor important to implement a better ordering
algorithm in join_tab_cmp(). Therefore the only way to fix it is to
force our own qsort() to be used by renaming it to my_qsort(), so we don't depend
on linker to decide that.
This patch also "fixes" bug #20530: qsort redefinition violates the
standard.
include/my_sys.h:
Renamed qsort() and qsort2() to my_qsort() and my_qsort2(). Since
previously we relied on stdlib.h to provide a declaration for qsort(), a
separate declaration for my_qsort() is now required.
libmysql/Makefile.shared:
Added mf_qsort.c to libmysql, since my_lib.c now uses my_qsort() instead of qsort().
myisam/ft_boolean_search.c:
Replaced qsort2() with my_qsort2().
myisam/ft_nlq_search.c:
Replaced qsort2() with my_qsort2().
myisam/myisampack.c:
Replaced qsort() with my_qsort().
myisam/sort.c:
Replaced qsort2() with my_qsort2().
mysys/mf_keycache.c:
Replaced qsort() with my_qsort().
mysys/mf_qsort.c:
Renamed qsort() to my_qsort() and qsort2() to my_qsort2().
mysys/mf_sort.c:
Replaced qsort2() with my_qsort2().
mysys/my_lib.c:
Replaced qsort() with my_qsort().
mysys/queues.c:
Replaced qsort2() with my_qsort2().
sql/item_cmpfunc.cc:
Replaced qsort2() with my_qsort2().
sql/item_cmpfunc.h:
Replaced qsort2() with my_qsort2().
sql/opt_range.cc:
Replaced qsort() with my_qsort().
sql/records.cc:
Replaced qsort() with my_qsort().
sql/sql_acl.cc:
Replaced qsort() with my_qsort().
sql/sql_array.h:
Replaced qsort() with my_qsort().
sql/sql_help.cc:
Replaced qsort() with my_qsort().
sql/sql_select.cc:
Replaced qsort() with my_qsort().
sql/examples/ha_tina.cc:
Replaced qsort() with my_qsort().
sql/sql_table.cc:
Replaced qsort() with my_qsort().
into polly.(none):/home/kaa/src/maint/mysql-5.0-maint
myisam/sort.c:
Auto merged
mysql-test/r/repair.result:
Auto merged
mysql-test/t/repair.test:
Auto merged