- Reset static variables that are used to signal "init done" for DBUG, in dbug_end()
- Set string server variables to NULL after memory for the value is freed - avoids double free()
- fix DBUG_ASSERTs that happened during reinitialization.
- Let _ma_record_pos() set SEARCH_PART_KEY when doing a search on
a prefix of a [unique] key. Otherwise, _ma_search_pos() would
find the first key equal to search key, and assume it is also
the last one, which will make a wrong estimate of key's position.
A wrong key position may cause min_pos > max_pos and records_in_range()
will return 0, which will make the optimizer think it's an impossible
range while in fact it is not.
Backport the fix olav.sandstaa@sun.com-20101102184747-qfuntqwj021imy9r:
"Fix for Bug#52660 Perf. regr. using ICP for MyISAM on range queries on an index containing TEXT"
(together with further fixes in that code) into MyISAM and Aria.
Partitioning didn't store the name of default storage engine for partitions
in the frm file - it only store the typecode. Typecodes aren't stable, and
might vary depending on the order in which storage engines are loaded (can
be changed even from my.cnf without recompilation).
As a temporary workaround for 5.5, we hard-code Aria's typecode, to make sure it
never changes.
Federated uses SHOW TABLE STATUS LIKE for ::info().
For nonexisting remote table it doesn't fail, but returns an empty result set.
We need to fake the error in the handler.
Fixed some cases that didn't work with > 4G buffers.
Fixed compiler warnings
include/mysql_com.h:
Avoid compiler warning with strncmp()
sql-common/client.c:
Fixed long comment; Added ()
sql/filesort.cc:
Fix code to get filesort to work with big buffers
sql/sys_vars.cc:
Fixed some cache variables that could be set to higher value than the size_t
Limit query cache to ULONG_MAX as the query cache buffer variables are ulong
storage/federatedx/ha_federatedx.cc:
Remove not used variable
storage/maria/ha_maria.cc:
Fix that bulk_insert() works with big buffers
storage/maria/ma_write.c:
Fix that bulk_insert() works with big buffers
storage/myisam/ha_myisam.cc:
Fix that bulk_insert() works with big buffers
storage/myisam/mi_write.c:
Fix that bulk_insert() works with big buffers
storage/sphinx/snippets_udf.cc:
Fixed compiler warnings
replaced snippets_udf.cc with the latest version (2.0.8 from sphinxsource.com), fixed trivial errors on Windows.
It will be compiled and installed into plugins directory now.
mysql-test/suite/maria/maria-autozerofill.result:
Updated result
mysql-test/suite/maria/maria-autozerofill.test:
Added test that zerofilled table should not give any warnings when table is used
mysql-test/suite/maria/maria-recovery2.result:
More tests to make it easier to find bugs
mysql-test/suite/maria/maria-recovery2.test:
More tests to make it easier to find bugs
storage/maria/ha_maria.cc:
Set create_trid after repair (needed if table was moved from another system)
Set uuid after repair (needed if table was moved from another system)
storage/maria/maria_chk.c:
Reset share->state.create_trid if we reset share->state.create_rename_lsn.
Make the table moveable
outside datafile) on INSERT into an Aria table.
The isssue was that the check if a table was moved between systems didn't take into account that create_trid could be bigger than the current max trid on the new system.
This could only happen if one tried to move a table that one had just done a 'REPAIR TABLE' on.
Tables that one had run 'aria_chk --zerofill' on worked.
Fixed this by assuming that if create_trid is too big then the table has been moved from one system to another and we have to do an automatic zerofill.
Other fixed:
- Added a check to detect a wrong create_trid in 'check table'.
- aria_chk -dvv will now write out also the create_trid (to make future error finding easier)
- aria_chk --zerofill doesn't anymore require a aria_control_file
- Removed some warnings from safemalloc when using aria_chk, ma_test1 and ma_test2.
include/myisamchk.h:
Removed wrong 'QQ' flags (the flags are used by myisamchk and aria_chk)
storage/maria/ha_maria.cc:
maria_chk_status() can now also return an error.
storage/maria/ma_check.c:
In maria_chk_status() check if create_trid value is too big.
storage/maria/ma_open.c:
Changed check if table is moved so that we can detect wrong create_trid values.
Don't set STATE_NOT_MOVABLE flag if we are doing repair/check. This was done so that aria_chk can print out the movable flag.
storage/maria/ma_test1.c:
Added code to suppress memory leaks from safemalloc
storage/maria/ma_test2.c:
Added code to suppress memory leaks from safemalloc
storage/maria/maria_chk.c:
Added code to suppress memory leaks from safemalloc.
Make help text a bit better for --HELP and --zerofill.
Incresed version number.
Don't require a control file if we are only doing --zerofill
Print out 'create_trid' when doing --describe --verbose
storage/maria/unittest/ma_test_recovery.expected:
Updated result file
MDEV-3989: Server crashes on import from MariaDB mysqldump export with partitioned Aria table.
Problem was that bulk insert in aria was not properly protected against concurrent selects.
storage/maria/ha_maria.cc:
Move settings of file->state to _ma_block_start_trans() to ensure that lock_key_trees is not changed by a concurrent bulk_insert.
storage/maria/ma_check.c:
Added DBUG_ASSERT()
storage/maria/ma_open.c:
Set start_trans to ma_start_trans for default behaviour.
storage/maria/ma_pagecrc.c:
Removed test for 'non_transactional' as a now_transactinal could be reset while a flush was happening.
storage/maria/ma_state.c:
Moved setting of info->state from external_lock to start_trans to protect against concurrent running bulk inserts.
This works as the other threads will wait in thr_lock() until bulk_insert is done and keys are re-generated.
storage/maria/ma_state.h:
Added _ma_start_trans()
This could happen when using Aria for internal temporary files (default case) and using DISTINCT.
_ma_scan_restore_block_record() didn't work correctly if there was rows inserted, updated or deleted on the handler
between calls to _ma_scan_remember_block_record() and _ma_scan_restore_block_record().
The effect was that some DISTINCT queries that used remove_dup_with_compare() could fail.
.bzrignore:
Ignore sql_yacc.hh
mysql-test/suite/maria/r/distinct.result:
Test case for MDEV-4280
mysql-test/suite/maria/t/distinct.test:
Test case for MDEV-4280
mysql-test/t/mysql.test:
Fixed test suite (we could get error -1 in some cases)
sql/sql_select.cc:
Break loop if restart_rnd_next() gives an error
storage/maria/ha_maria.cc:
scan_restore_pos() can return disk fault error.
storage/maria/ma_blockrec.c:
_ma_scan_remember_block_record() did incorrectly update scan.dir instead of scan_save.dir .
_ma_scan_restore_block_record() didn't work correctly if there was rows inserted,updated or deleted on the handler
between calls to _ma_scan_remember_block_record() and _ma_scan_restore_block_record().
Fixed by adding counters for row changes and reading the current scan page if changes had been made.
storage/maria/ma_blockrec.h:
scan_restore_pos() can return disk fault error.
storage/maria/ma_delete.c:
Increment row_changes
storage/maria/ma_scan.c:
scan_restore_pos() can return disk fault error.
storage/maria/ma_update.c:
Increment row_changes
storage/maria/ma_write.c:
Increment row_changes
storage/maria/maria_def.h:
scan_restore_pos() can return disk fault error.