- Fixed some issues with partitions and connection_string, which also fixed lp:716890 "Pre- and post-recovery crash in Aria"
- Fixed wrong assert in Aria
Now need to merge with latest xtradb before pushing
sql/ha_partition.cc:
Ensure that m_ordered_rec_buffer is not freed before close.
sql/mysqld.cc:
Changed to use opt_stack_trace instead of opt_pstack.
Removed references to pstack
sql/partition_element.h:
Ensure that connect_string is initialized
storage/maria/ma_key_recover.c:
Fixed wrong assert
sql/multi_range_read.cc:
Added printing of error if something goes wrong in get_next()
(Not critical for this bug fix, but this was something that I noticed while testing and found missing)
storage/myisam/mi_rkey.c:
Fixed wrong error number in mi_yield_and_check_if_killed()
- In Maria/MyISAM: Release/re-acquire locks to give queries that wait on them a chance to make progress
- In Maria/MyISAM: Change from numeric constants to ICP_RES values.
- In Maria: Do check index condition in maria_rprev() (was lost in the merge/backport?)
- In Maria/MyISAM/XtraDB: Check if the query was killed, and return immediately if it was.
Added new storage engine error: HA_ERR_ABORTED_BY_USER, for handler to signal that it detected a kill of the query and aborted
Authors: Sergey Petrunia & Monty
include/my_base.h:
Added HA_ERR_ABORTED_BY_USER, for handler to signal that it detected a kill of the query and aborted
include/my_handler.h:
Added comment
mysql-test/r/myisam_icp.result:
Updated test
mysql-test/t/myisam_icp.test:
Drop used tables at start of test
Added test case that can help with manual testing of killing index condition pushdown query.
mysys/my_handler_errors.h:
Text for new storage engine error
sql/handler.cc:
If engine got HA_ERR_ABORTED_BY_USER, send kill message.
sql/multi_range_read.cc:
Return error code
storage/maria/ha_maria.cc:
Added ma_killed_in_mariadb() to detect kill.
Ensure that file->external_ref points to TABLE object.
storage/maria/ma_extra.c:
Dummy test-if-killed for standalone
storage/maria/ma_key.c:
If ma_check_index_cond() fails, set my_errno and info->cur_row.lastpos
storage/maria/ma_rkey.c:
Release/re-acquire locks to give queries that wait on them a chance to make progress
Check if the query was killed, and return immediately if it was
storage/maria/ma_rnext.c:
Check if the query was killed, and return immediately if it was
Added missing fast_ma_writeinfo(info)
storage/maria/ma_rnext_same.c:
Check if the query was killed, and return immediately if it was
Added missing fast_ma_writeinfo(info)
storage/maria/ma_rprev.c:
Check if the query was killed, and return immediately if it was
Added missing fast_ma_writeinfo(info) and ma_check_index_cond()
storage/maria/ma_search.c:
Give error message if we find a wrong key
storage/maria/ma_static.c:
Added pointer to test-if-killed function
storage/maria/maria_def.h:
New prototypes
storage/myisam/ha_myisam.cc:
Added mi_killed_in_mariadb()
Ensure that file->external_ref points to TABLE object.
storage/myisam/mi_extra.c:
Dummy test-if-killed for standalone
storage/myisam/mi_key.c:
If ma_check_index_cond() fails, set my_errno and info->lastpos
storage/myisam/mi_rkey.c:
Ensure that info->lastpos= HA_OFFSET_ERROR in case of error
Release/re-acquire locks to give queries that wait on them a chance to make progress
Check if the query was killed, and return immediately if it was
Reorder code to do less things in case of error.
Added missing fast_mi_writeinfo()
storage/myisam/mi_rnext.c:
Check if the query was killed, and return immediately if it was
Simplify old ICP code
Added missing fast_ma_writeinfo(info)
storage/myisam/mi_rnext_same.c:
Check if the query was killed, and return immediately if it was
Added missing fast_mi_writeinfo(info)
storage/myisam/mi_rprev.c:
Check if the query was killed, and return immediately if it was
Simplify error handling of ICP
Added missing fast_mi_writeinfo(info)
storage/myisam/mi_search.c:
Give error message if we find a wrong key
storage/myisam/mi_static.c:
Added pointer to test-if-killed function
storage/myisam/myisamdef.h:
New prototypes
storage/xtradb/handler/ha_innodb.cc:
Added DB_SEARCH_ABORTED_BY_USER and ha_innobase::is_thd_killed()
Check if the query was killed, and return immediately if it was
storage/xtradb/handler/ha_innodb.h:
Added prototype
storage/xtradb/include/db0err.h:
Added DB_SEARCH_ABORTED_BY_USER
storage/xtradb/include/row0mysql.h:
Added possible ICP errors
storage/xtradb/row/row0sel.c:
Use ICP errors instead of constants.
Detect if killed and return B_SEARCH_ABORTED_BY_USER
Take into account that mysql services start even with
invalid defaults files (using data file relative to mysqld.exe location).
Handle this case in upgrade scenarios, as if there was no
--defaults-file in service definition.
When mariadb 5.3 is compiler with VS2010, several tests would enter infinite loop in
sel_arg_range_seq_next(). The reason is compiler backend bug. This bug is not
present in either VS2008 or VS2010 SP1 RC.
Workaround is to compile this function without most aggresive optimization flag
(-Og ) using #pragma optimize ("g", {on|off}) for this version of MSVC compiler.
Fixed that connection string is returned for partitioned federated tables.
mysql-test/r/partition_federated.result:
Fixed error message
mysql-test/suite/federated/federated_partition.result:
Added test to show that connection string is returned in 'show create'.
sql/ha_partition.cc:
Fixed a set of bugs introduced by the last federated patch:
- We can't allocate m_ordered_rec_buffer in memroot as it has to survive call to clear_handler_file()
sql/partition_element.h:
Ensure that connect_string is properly initialized.
(This caused crashed in partition tests)
sql/sql_partition.cc:
Print CONNECTION option for federated partitioned tables
- Fixed Partition engine to store CONNECTION string for partitions.
Removed HA_NO_PARTITION flag from FederatedX.
Added test 'federated_partition' to suite.
- lp:#585688 - maridb crashes in federatedx code
FederatedX handler instances, created on one thread and used on
another thread (via table cache) when "show table status" is executed
crashed because txn member was not initialized for current thread.
Added test 'federated_bug_585688' to suite.
Author for the patch is Antony Curtis
mysql-test/suite/federated/federated_bug_585688.result:
Test for lp:585688
mysql-test/suite/federated/federated_bug_585688.test:
Test for lp:585688
mysql-test/suite/federated/federated_partition-slave.opt:
Test for partition support in federatedx
mysql-test/suite/federated/federated_partition.result:
Test for partition support in federatedx
mysql-test/suite/federated/federated_partition.test:
Test for partition support in federatedx
mysql-test/t/partition_federated.test:
Updated error message
sql/ha_partition.cc:
Added support for connection strings to partitions for federatedx
sql/ha_partition.h:
Added support for connection strings to partitions for federatedx
sql/partition_element.h:
Added support for connection strings to partitions for federatedx
sql/sql_yacc.yy:
Added support for connection strings to partitions for federatedx
storage/federatedx/ha_federatedx.cc:
Added support for partitions.
FederatedX handler instances, created on one thread and used on another thread (via table cache) when "show table status"
is executed crashed because txn member was not initialized for current thread.
with the test case added by this patch.
The bug cannot be reproduced with the same test case for the main
5.3 tree because the backported fix for bug 59696 masks the
problem that causes the crash in the mentioned test case. It's not
clear weather this fix masks this problem in all possible cases.
Anyway the patch for bug 698882 introduced some inconsistent data
structures that could contain indirect references to deleted object.
It happened when two Item_equal objects were merged and the Item_field
list of the second object was joined to such list of the first object.
This operation required adjustment of the backward pointers in
Item fields from the joined list. However the adjustment was missing
and this caused crashes in the tree for mwl#128.
Now the backward pointers are set only when Item_equal items are
completely built and are not changed anymore.
When this flag is 'off' the size of the used join buffer
is taken directly from the system variable 'join_buffer_size'.
When this flag is 'on' then the size of the buffer depends
on the estimated number of rows in the partial join whose
records are to be stored in the buffer.
By default this flag is set 'on'.
mysqld --install without any parameters.
In such case, service name is always MYSQL, as service
binary path is "path\to\mysqld.exe" "MySQL". Guess data
directory it is either from my.ini (which is assumed to
be in the installation root), or just data directory
under install root.
Fixed that status variables 'empty_queries', 'access_denied_errors' and 'lost_connections' are propageted to global status.
This should also remove some warnings with VC++
sql/mysqld.cc:
Increased precision for status variables Rows_sent and Rows_read from long to longlong
sql/sql_class.cc:
Increased precision for status variables Rows_sent and Rows_read from long to longlong
sql/sql_class.h:
Increased precision for status variables Rows_sent and Rows_read from long to longlong
Fixed that status variables 'empty_queries', 'access_denied_errors' and 'lost_connections' are propageted to global status.
* Spell username correctly as "NT AUTHORITY\NetworkService"
* Also, use well-known SIDs for predefined user when assigning directory
ACLs (the names differ in localized Windows)
The patch fixed the following optimizer defect: when performing
substitution for best equal fields into where conditions to be
able to do their evaluations as soon as possible the optimizer
skipped conditions over views. That could lead to suboptimal
execution of queries that used views.
Slightly changed the test case to demonstrate the performance
improvements if this fix.
New utility to upgrade Windows service to higher MariaDB version.
Its functionality includes changing service definition as well as
running mysql_upgrade.
on Windows.
Some parameters not present in traditional mysql_install_db are present
e.g --port, --default-user (whether to create a new users) or
--service (windows service name)
This bug could manifest itself when hash join over a varchar column
with NULL values in some rows was used. It happened because the
function key_buf_cmp erroneously returned FALSE when one of the joined
key fields was null while the second was not.
Also fixed two other bugs in the functions key_hashnr and key_buf_cmp
that could possibly lead to wrong results for some queries that
used hash join over several columns with nulls.
Also reverted the latest addition of the test case for bug #45092. It
had been already backported earlier.
This was another bug in the patch for bug 698882. The new
code from this patch did not ensured that substitutions
of fields for best equal fields were performed on all
AND-OR levels. As a result substitutions for best fields
in some predicates that had been used by the range optimizer
were not actually performed while range plans could employ
these substitutions. This could lead to inconsistent data
structures and ultimately to a crash.
The bug was in the code of the patch fixing bug 698882.
With improper casting the method store_key_field::change_source_field
was called for the elements of the array TABLE_REF::key_copy that
were either of a different type or not allocated at all. This caused
crashes in some queries.
- MWL#47, allowing to annotate row-based binlog events with the SQL test of
the originating query (eg. in mysqlbinlog output).
- row_based_replication_without_primary_key.patch, providing more intelligent
selection of index to use on slave when applying row-based binlog events
for tables with no primary key.
- Make mysqlbinlog omit redundant `use` around BEGIN/SAVEPOINT/COMMIT/
ROLLBACK in 5.0 binlogs.
- Use -Wno-uninitialized if -DFORCE_INIT_OF_VARS is not used, to avoid warnings about not initialized variables.
- Fixed compiler warnings
- Added a name for each thr_lock to get better error messages (This is needed to find out why 'archive.test' sometimes fails)
BUILD/SETUP.sh:
Use -Wno-uninitialized if -DFORCE_INIT_OF_VARS is not used, to avoid warnings about not initialized variables.
BUILD/build_mccge.sh:
Use -Wno-uninitialized if -DFORCE_INIT_OF_VARS is not used, to avoid warnings about not initialized variables.
client/mysqltest.cc:
Fixed bug in remove_files_wildcards (the orignal code never removed anything)
extra/libevent/devpoll.c:
Fixed compiler warning
include/thr_lock.h:
Added a name for each thr_lock to get better error messages.
mysql-test/suite/maria/t/maria3.test:
Speed up test.
mysys/thr_lock.c:
Added a name for each thr_lock to get better error messages.
Added a second 'check_locks' to find if something goes wrong in 'wake_up_waiters'.
sql/lock.cc:
Added a name for each thr_lock to get better error messages.
storage/xtradb/fil/fil0fil.c:
Fixed compiler warning
Added logging of all possible fatal table errors if --log-warnings set to > 1
mysql-test/extra/rpl_tests/rpl_EE_err.test:
Safety fix
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/r/archive.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/r/csv.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/maria/r/maria-autozerofill.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/maria/t/maria-autozerofill.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/maria/t/maria-recover.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/parts/t/partition_recover_myisam.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_bug38694.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_idempotency.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_ignore_table.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_row_conflicts.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_temporary_errors.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_bug38694.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_idempotency.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_ignore_table.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_row_conflicts.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/t/archive.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/t/csv.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
sql/handler.cc:
If running with --assert-of-crashed-table or --log-warnings > 1 then print engine error to log
sql/sql_select.cc:
Disable not initialized warning from gcc
strings/Makefile.am:
Fixed compiler error on Solaris 10 (duplicate strmov() function)
Aria and MyISAM in create_internal_tmp_table_from_heap()
(safe, as duplicates are impossible).
This gives a HUGE speed boost!
sql/opt_subselect.cc:
Fixed problem with wrong recinfo in create_duplicate_weedout_tmp_tabl()
Tagged the table with 'no_rows' so that when we create the table on disk,
we only store the index data. This gave us a major speedup!
sql/sql_select.cc:
create_tmp_table_from_heap() now uses bulk_insert + repair_by_sort
when creating Aria/MyISAM tables from HEAP tables.
This gives a HUGE speed boost!
storage/maria/ha_maria.cc:
Extended bulk_insert() to recreate UNIQUE keys for
internal temporary tables
storage/maria/ma_open.c:
Initialize m_info->lock.type properly for temporarly tables
(needed for start_bulk_insert())
storage/maria/ma_write.c:
Don't check uniques that are disabled
storage/myisam/ha_myisam.cc:
Extended bulk_insert() to recreate UNIQUE keys for
internal temporary tables.
This will also enable us in the future to collect statistics for
writes to internal tmp tables.
sql/handler.h:
Added ha_write_tmp_row()
sql/opt_subselect.cc:
ha_write_row -> ha_write_tmp_row
sql/sql_class.h:
Added ha_write_tmp_row()
sql/sql_select.cc:
ha_write_row -> ha_write_tmp_row
This makes the keys smaller (no row pointer) and gives us proper errors if we
use the table wrongly.
sql/sql_select.cc:
Use NO_RECORD for tables that doesn't need row data.
storage/maria/Makefile.am:
Added ma_norec.c
storage/maria/ma_check.c:
Added support for NO_RECORD record format (don't store any row data)
storage/maria/ma_norec.c:
Added support for NO_RECORD record format
storage/maria/ma_open.c:
Added support for NO_RECORD record format
storage/maria/ma_search.c:
Added support for 0 size row pointers (used with NO_RECORD)
storage/maria/ma_test1.c:
Added testing of NO_RECORD record format.
storage/maria/maria_chk.c:
Added support for NO_RECORD
storage/maria/maria_def.h:
Added support for NO_RECORD
storage/maria/unittest/ma_test_all-t:
Added testing of NO_RECORD record format
temptables, not "uniques", that are hash-based keys.
sql/sql_expression_cache.cc:
Don't set uniques (we don't want or need an unique
constraint on this table)
mysql-test/suite/handler/heap.result:
New test case
mysql-test/suite/handler/heap.test:
New test case
sql/sql_handler.cc:
If we get a fatal error in handler read, end table/index scan as it's likely it was wrongly used (for example not supported feature for index)
Made sure that the optimal fields are used by TABLE_REF objects
when building index access keys to joined tables.
Fixed a bug in the template function that sorts the elements of
a list using the bubble sort algorithm. The bug caused poor
performance of the function. Also added an optimization that
skips comparison with the most heavy elements that has been
already properly placed in the list.
Made the comparison of the fields belonging to the same Item_equal
more granular: fields belonging to the same table are also ordered
according to some rules.
An assertion failure was triggered for a 6-way join query that used two
join buffers.
The failure happened because every call of JOIN_CACHE::join_matching_records
saved and restored status of all tables that were accessed before the table
join_tab. It must do it only for those of them that follow the last table
using a join buffer.
An assertion failure was triggered for a 6-way join query that uses two
join buffers.
The failure happened because every call of the function flush_cached_records()
saved and restored status of all tables before the table join_tab. It
must do it only for those of them that follow the last table that uses
a join buffer.
Date: Mon, 01 Nov 2010 15:15:25 -0000
3272 Roy Lyseng 2010-11-01
Bug#52068: Optimizer generates invalid semijoin materialization plan
When MaterializeScan semijoin strategy was used and there were one
or more outer dependent tables before the semijoin tables, the scan
over the materialized table was not properly reset for each row of
the prefix outer tables.
Example: suppose we have a join order:
ot1 SJ-Mat-Scan(it2 it3) ot4
Notice that this is called a MaterializeScan, even though there is an
outer table ahead of the materialized tables. Usually a MaterializeScan
has the outer tables after the materialized table, but this is
a special (but legal) case with outer dependent tables both before and
after the materialized table.
For each qualifying row from ot1, a new scan over the materialized
table must be set up. The code failed to do that, so all scans after
the first one returned zero rows from the materialized table.
mysql-test/suite/handler/interface.result:
Test case
mysql-test/suite/handler/interface.test:
Test case
sql/sql_prepare.cc:
Fix for LP#697622 Assertion `! is_set()' failed when preparing a HANDLER statement
Return TRUE if mysql_test_handler_read() fails.
mysql-test/suite/handler/innodb.result:
Added test case
mysql-test/suite/handler/innodb.test:
Added test case
sql/handler.h:
Move setting/resetting of active_index to ha_index_init()/ha_index_end() to simplify handler functions index_init()/index_end()
Fixed that get_index() returns MAX_KEY if index is not inited (this fixed LP#697610)
storage/federated/ha_federated.cc:
Settting of active_index is not needed anymore
storage/maria/ma_pagecache.c:
Added error message if we have too little memory for Maria page cache
Item_func_spatial_collection::fix_length_and_dec didn't call parent's method, so
the maybe_null was set to '0' after it. But in this case the result was
just NULL, that caused wrong behaviour.
per-file comments:
mysql-test/r/gis.result
Bug #57321 crashes and valgrind errors from spatial types
test result updated.
mysql-test/t/gis.test
Bug #57321 crashes and valgrind errors from spatial types
test case added.
sql/item_geofunc.h
Bug #57321 crashes and valgrind errors from spatial types
Item_func_geometry::fix_length_and_dec() called in
Item_func_spatial_collection::fix_length_and_dec().
INVOKER-security view access check wrong".
When privilege checks were done for tables used from an
INVOKER-security view which in its turn was used from
a DEFINER-security view connection's active security
context was incorrectly used instead of security context
with privileges of the second view's creator.
This meant that users which had enough rights to access
the DEFINER-security view and as result were supposed to
be able successfully access it were unable to do so in
cases when they didn't have privileges on underlying tables
of the INVOKER-security view.
This problem was caused by the fact that for INVOKER-security
views TABLE_LIST::security_ctx member for underlying tables
were set to 0 even in cases when particular view was used from
another DEFINER-security view. This meant that when checks of
privileges on these underlying tables was done in
setup_tables_and_check_access() active connection security
context was used instead of context corresponding to the
creator of caller view.
This fix addresses the problem by ensuring that underlying
tables of an INVOKER-security view inherit security context
from the view and thus correct security context is used for
privilege checks on underlying tables in cases when such view
is used from another view with DEFINER-security.
mysql-test/r/view_grant.result:
Added coverage for various combinations of DEFINER and
INVOKER-security views, including test for bug #58499
"DEFINER-security view selecting from INVOKER-security
view access check wrong".
mysql-test/t/view_grant.test:
Added coverage for various combinations of DEFINER and
INVOKER-security views, including test for bug #58499
"DEFINER-security view selecting from INVOKER-security
view access check wrong".
sql/sql_view.cc:
When opening a non-suid view ensure that its underlying
tables will get the same security context as use for
checking privileges on the view, i.e. security context
of view invoker. This context can be different from the
security context which is currently active for connection
in cases when this non-suid view is used from a view with
suid security. Inheriting security context in such situation
allows correctly apply privileges of creator of suid view
in checks for tables of non-suid view (since in this
situation creator/definer of suid view serves as invoker
for non-suid view).
get_year_value() contains code to convert 2-digits year to
4-digits. The fix for Bug#49910 added a check on the size of
the underlying field so that this conversion is not done for
YEAR(4) values. (Since otherwise one would convert invalid
YEAR(4) values to valid ones.)
The existing check does not work when Item_cache is used, since
it is not detected when the cache is based on a Field. The
reported change in behavior is due to Bug#58030 which added
extra cached items in min/max computations.
The elegant solution would be to implement
Item_cache::real_item() to return the underlying Item.
However, some side effects are observed (change in explain
output) that indicates that such a change is not straight-
forward, and definitely not appropriate for an MRU.
Instead, a Item_cache::field() method has been added in order
to get access to the underlying field. (This field() method
eliminates the need for Item_cache::eq_def() used in
test_if_ref(), but in order to limit the scope of this fix,
that code has been left as is.)
mysql-test/r/type_year.result:
Added test case for Bug#59211.
mysql-test/t/type_year.test:
Added test case for Bug#59211.
sql/item.h:
Added function Item_cache::field() to get access to the
underlying Field of a cached field Value.
sql/item_cmpfunc.cc:
Also check underlying fields of Item_cache, not just Item_Field,
when checking whether the value is of type YEAR(4) or not.
tmptable needed
The function DEFAULT() works by modifying the the data buffer pointers (often
referred to as 'record' or 'table record') of its argument. This modification
is done during name resolution (fix_fields().) Unfortunately, the same
modification is done when creating a temporary table, because default values
need to propagate to the new table.
Fixed by skipping the pointer modification for fields that are arguments to
the DEFAULT function.
Added key and file version numbers to MEMORY tables so that we can detect if someone has changed them between HANDLER calls.
mysql-test/suite/handler/aria.result:
Fixed result after test changes
mysql-test/suite/handler/handler.inc:
Changed test to use combined key to ensure rows are returned in a pre-determinated order.
mysql-test/suite/handler/heap.result:
New result
mysql-test/suite/handler/heap.test:
Added test for HANDLER + HEAP
mysql-test/suite/handler/innodb.result:
Fixed result after test changes
mysql-test/suite/handler/myisam.result:
Fixed result after test changes
sql/sql_handler.cc:
Fixed wrong parameter to ha_index_next_same()
storage/heap/ha_heap.cc:
Abort key scan if table has changed.
Abort table scan if table has been recreated.
storage/heap/ha_heap.h:
Added support for HANDLER
storage/heap/hp_clear.c:
Increase version number so that we can notice changes if using HANDLER
storage/heap/hp_delete.c:
Increase key data version number on key changes.
storage/heap/hp_rfirst.c:
Remember version of key data
Give error if using read-first on hash key.
storage/heap/hp_rkey.c:
Remember version of key data
storage/heap/hp_rlast.c:
Remember version of key data
Give error if using read-last on hash key.
storage/heap/hp_rnext.c:
Fixed that we get next key from last search.
storage/heap/hp_rprev.c:
Fixed that we get previous key from last search.
storage/heap/hp_scan.c:
Remember version of key and file data
storage/heap/hp_update.c:
Increase key data version number on key changes.
storage/heap/hp_write.c:
Increase key data version number on key changes.
if max_allowed_packet >= 16M.
This bug was introduced by patch for bug#42503.
This patch restores behaviour that there was before patch
for bug#42503 was applied.
sql/net_serv.cc:
Restored original right condition.
to crash mysqld".
handler::pushed_cond was not always properly reset when table objects where
recycled via the table cache.
handler::pushed_cond is now set to NULL in handler::ha_reset(). This should
prevent pushed conditions from (incorrectly) re-apperaring in later queries.
- Fix for MySQL BUG#52357 added NESTED_JOIN::is_fully_covered() which would
not take into account that MariaDB's table elimination could eliminate tables
from join plan (and so, from join nest).
Fixed the check in the function to compare post-table-elimination numbers.
- Added test case for Aria
- Tested HANDLER with HEAP (changes to HEAP code will be pushed in 5.3)
- Moved all HANDLER test to suite/handler.
mysql-test/Makefile.am:
Added suite/handler
mysql-test/mysql-test-run.pl:
Added suite/handler
mysql-test/r/lock_multi.result:
Remove test that is already in handler test suite
mysql-test/suite/handler/aria.result:
Test for HANDLER with Aria storage engine
mysql-test/suite/handler/aria.test:
Test for HANDLER with Aria storage engine
mysql-test/suite/handler/handler.inc:
Extended the general handler test
Moved interface testing to 'interface.test'
mysql-test/suite/handler/init.inc:
Common init for handler tests.
mysql-test/suite/handler/innodb.result:
New results
mysql-test/suite/handler/innodb.test:
Update to use new include files
mysql-test/suite/handler/interface.result:
Test of HANDLER interface (not storage engine dependent parts)
mysql-test/suite/handler/interface.test:
Test of HANDLER interface (not storage engine dependent parts)
mysql-test/suite/handler/myisam.result:
New results
mysql-test/suite/handler/myisam.test:
Update to use new include files
mysql-test/t/lock_multi.test:
Remove test that is already in handler test suite
mysys/tree.c:
Added missing handling of read previous (showed up in HEAP testing)
sql/handler.cc:
Don't marka 'HA_ERR_RECORD_CHANGED' as fatal (can be used with HANDLER READ, especially with MEMORY ENGINE)
sql/handler.h:
Added prototype for can_continue_handler_scan()
sql/sql_handler.cc:
Re-initialize search if we switch from key to table search.
Check if handler can continue searching between calls (via can_continue_handler_scan())
Don't write common not fatal errors to log
storage/maria/ma_extra.c:
Don't set index 0 as default. This forces call to ma_check_index() to set up index variables.
storage/maria/ma_ft_boolean_search.c:
Ensure that info->last_key.keyinfo is set
storage/maria/ma_open.c:
Don't set index 0 as default. This forces call to ma_check_index() to set up index variables.
storage/maria/ma_rkey.c:
Trivial optimization
storage/maria/ma_rnext.c:
Added missing code from mi_rnext.c to ensure that handler next/prev works.
storage/maria/ma_rsame.c:
Simple optimizations
storage/maria/ma_search.c:
Initialize info->last_key once and for all when we change keys.
storage/maria/ma_unique.c:
Ensure that info->last_key.keyinfo is up to date.
This patch adds options to annotate the binlog (and the mysqlbinlog
output) with the original SQL query for queries that are logged
using row-based replication.
From a user perspective, the problem is that a FLUSH LOGS or SIGHUP
signal could end up associating the stdout and stderr to random
files. In the case of this bug report, the streams would end up
associated to InnoDB ibd files.
The freopen(3) function is not thread-safe on FreeBSD. What this
means is that if another thread calls open(2) during freopen()
is executing that another thread's fd returned by open(2) may get
re-associated with the file being passed to freopen(3). See FreeBSD
PR number 79887 for reference:
http://www.freebsd.org/cgi/query-pr.cgi?pr=79887
This problem is worked around by substituting a internal hook within
the FILE structure. This avoids the loss of atomicity by not having
the original fd closed before its duplicated.
Patch based on the original work by Vasil Dimov.
include/my_sys.h:
Export my_freopen.
mysys/my_fopen.c:
Add a my_freopen abstraction to workaround bugs in specific OSes.
Add a prototype for getosreldate() as older FreeBSD versions did
not define one.
sql/log.cc:
Move freopen abstraction code over to mysys.
The streams are now only reopened for writing.
It includes speed optimizations for HANDLER READ by caching as much as possible in HANDLER OPEN
Other things:
- Added mysqld option --disable-thr-alarm to be able to benchmark things without thr_alarm
- Changed 'Locked' state to 'System lock' and 'Table lock' (these where used in the code but never shown to end user)
- Better error message if mysql_install_db.sh fails
- Moved handler function prototypes to sql_handler.h
- Remove not anymore used 'thd->locked' member
include/thr_alarm.h:
Added my_disable_thr_alarm
include/thr_lock.h:
Add new member to THR_LOCK_DATA to remember original lock type state. This is needed as thr_unlock() resets type to TL_UNLOCK.
mysql-test/include/check_no_concurrent_insert.inc:
Locked -> Table lock
mysql-test/include/handler.inc:
Locked -> Table lock
mysql-test/r/handler_innodb.result:
Updated results for new tests
mysql-test/r/handler_myisam.result:
Updated results for new tests
mysql-test/r/sp-threads.result:
Locked -> Table lock
mysql-test/suite/binlog/t/binlog_stm_row.test:
Locked -> Table lock
mysql-test/suite/funcs_1/datadict/processlist_val.inc:
Locked -> Table lock
mysql-test/suite/pbxt/t/lock_multi.test:
Locked -> Table lock
mysql-test/suite/sys_vars/r/concurrent_insert_func.result:
Locked -> Table lock
mysql-test/suite/sys_vars/t/concurrent_insert_func.test:
Locked -> Table lock
mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test:
Locked -> Table lock
mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test:
Locked -> Table lock
mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test:
Locked -> Table lock
mysql-test/t/insert_notembedded.test:
Locked -> Table lock
mysql-test/t/lock_multi.test:
Locked -> Table lock
mysql-test/t/merge-big.test:
Locked -> Table lock
mysql-test/t/multi_update.test:
Locked -> Table lock
mysql-test/t/query_cache_28249.test:
Locked -> Table lock
mysql-test/t/sp_notembedded.test:
Locked -> Table lock
mysql-test/t/sp_sync.test:
Locked -> Table lock
mysql-test/t/status.test:
Locked -> Table lock
mysql-test/t/trigger_notembedded.test:
Locked -> Table lock
mysys/thr_alarm.c:
Added option to disable thr_alarm
mysys/thr_lock.c:
Detect loops
scripts/mysql_install_db.sh:
Give better error message if something goes wrong
sql/Makefile.am:
Added sql_handler.h
sql/lock.cc:
Split functions to allow one to cache value if store_lock() (for HANDLER functions).
- Split mysql_lock_tables() into two functions, where first one allocates MYSQL_LOCK and other other one uses it.
- Made get_lock_data() an external function.
- Added argument to mysql_unlock_tables() to not free sql_lock.
- Added argument to reset_lock_data() to reset lock structure to initial state (as after get_lock_data())
sql/mysql_priv.h:
Moved handler function prototypes to sql_handler.h
Added new lock functions.
sql/mysqld.cc:
Added --thread-alarm startup option
sql/net_serv.cc:
Don't call vio_blocking() if not needed
sql/sql_base.cc:
include sql_handler.h
sql/sql_class.cc:
include sql_handler.h
Remove not anymore used 'thd->locked' member
sql/sql_class.h:
Remove not anymore used 'thd->locked' member
sql/sql_db.cc:
include sql_handler.h
sql/sql_delete.cc:
include sql_handler.h
sql/sql_handler.cc:
Rewrote all code to use SQL_HANDLER instead of TABLE_LIST (original interface)
Rewrote mysql_ha_open() to cache all things from TABLE_LIST and items for field list, where etc.
In mysql_ha_open() also cache MYSQL_LOCK structure from get_lock_data().
Split functions into smaller sub functions (needed to be able to implement mysql_ha_read_prepare())
Added mysql_ha_read_prepare() to allow one to prepare HANDLER READ.
sql/sql_handler.h:
Interface to sql_handler.cc
sql/sql_parse.cc:
include sql_handler.h
sql/sql_prepare.cc:
Added mysql_test_handler_read(), prepare for HANDLER READ
sql/sql_rename.cc:
include sql_handler.h
sql/sql_show.cc:
Removed usage of thd->locked
sql/sql_table.cc:
include sql_handler.h
sql/sql_trigger.cc:
include sql_handler.h
The patch also fixes a race in rpl_stop_slave.test.
On machines with lots of CPU and memory, something like `mtr --parallel=10`
can speed up the test suite enormously. However, we have a few test cases
that run for long (several minutes), and if we are unlucky and happen to
schedule those towards the end of the test suite, we end up with most
workers idle while waiting for the last slow test to end, significantly
delaying the finish of the entire suite.
Improve this by marking the offending tests as taking "long", and trying
to schedule those tests early. This reduces the time towards the end of
the test suite run where some workers are waiting with nothing to do for
the remaining workers each to finish their last test.
Also, the rpl_stop_slave test had a race which could cause it to take
a 300 seconds debug_sync timeout; this is fixed.
Testing on a 4-core 8GB machine, this patch speeds up the test suite with
around 30% for --parallel=10 (debug build), allowing to run the entire
suite in 5 minutes.
* move a capability from a virtual handler method to table_flags()
* rephrase error messages to avoid hard-coded English parts
* admit in test cases that they need xtradb, not innodb
mysql-test/suite/vcol/t/rpl_vcol.test:
this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test:
this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test:
this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_handler_innodb.test:
this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test:
this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_keys_innodb.test:
this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test:
this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_partition_innodb.test:
this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_select_innodb.test:
this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test:
this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test:
this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_view_innodb.test:
this test needs xtradb, it will fail with innodb
sql/ha_partition.h:
check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
sql/handler.h:
check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
sql/share/errmsg.txt:
no hard-coded english parts in the error messages (ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN)
sql/sql_table.cc:
no hard-coded english parts in the error messages
sql/table.cc:
* check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
* no "csv workaround" is needed
* no hard-coded english parts in the error messages
storage/maria/ha_maria.cc:
check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
storage/maria/ha_maria.h:
check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
storage/myisam/ha_myisam.cc:
check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
storage/myisam/ha_myisam.h:
check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
storage/xtradb/handler/ha_innodb.cc:
check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
storage/xtradb/handler/ha_innodb.h:
check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
mysqlbinlog only prints "use $database" statements to its output stream
when the active default database changes between events. This will cause
"No Database Selected" error when dropping and recreating that database.
To fix the problem, we clear print_event_info->db when printing an event
of CREATE/DROP/ALTER database statements, so that the Query_log_event
after such statements will be printed with the use 'db' anyway except
transaction keywords.
mysql-test/r/mysqlbinlog.result:
Test result for Bug#50914.
mysql-test/t/mysqlbinlog.test:
Added test to verify if the approach of the mysqlbinlog prints
"use $database" statements to its output stream will cause
"No Database Selected" error when dropping and recreating
that database.
sql/log_event.cc:
Updated code to clear print_event_info->db when printing an event
of CREATE/DROP/ALTER database statements, so that the Query_log_event
after such statements will be printed with the use 'db' anyway except
transaction keywords.
- Removed files specific to compiling on OS/2
- Removed files specific to SCO Unix packaging
- Removed "libmysqld/copyright", text is included in documentation
- Removed LaTeX headers for NDB Doxygen documentation
- Removed obsolete NDB files
- Removed "mkisofs" binaries
- Removed the "cvs2cl.pl" script
- Changed a few GPL texts to use "program" instead of "library"
This patch improves the selection of index to use to apply row-based
DELETE and UPDATE events on tables with no primary key (original code
picks the first index unconditionally).
If ANALYZE TABLE is done, the index cardinalities will be compared and
the best index will be used.
Fixes some problems in the original patch:
- Without ANALYZE TABLE, rec_per_key statistics is not available; in this
case the original patch could choose a really bad index, even ignoring
a primary key.
- The original patch did not consider multi-column keys correctly, and
could thus pick a less desirable single-column key over a good
multi-column index.
Also fixes Bug#58997, and adds test cases.
One of the hash functions employed by the BNLH join algorithm
calculates the the value of hash index for key value utilizing
every byte of the key buffer. To make this calculation valid
one has to ensure that for any key value unused bytes of the
buffer are filled with with a certain filler. We choose 0 as
a filler for these bytes.
Added an optional boolean parameter with_zerofill to the function
key_copy. If the value of the parameter is TRUE all unused bytes
of the key buffer is filled with 0.
When the optimizer creates items out of other items it does
not have to call the fix_fields method. Usually in these
cases it calls quick_fix_field() that just marks the
created item as fixed. If the created item is an Item_func
object then calling quick_fix_field() works fine if the
arguments of the created functional item are already fixed.
Otherwise some unfixed nodes remain in the item tree and
it triggers an assertion failure whenever the item is
evaluated.
Fixed the problem by making the method quick_fix_field
virtual and providing an implementation for the class
Item_func objects that recursively calls the method
for unfixed arguments of any functional item.
In some cases the function make_cond_for_index() was mistaken
when detecting index only pushdown conditions for a table:
a pushdown condition that was not index only could be marked
as such.
It happened because the procedure erroneously used the markers
for index only conditions that remained from the calls of
this function that extracted the index conditions for other
tables.
Fixed by erasing index only markers as soon as they are need
anymore.
ASSERT happens due to improper calculation of the max_length
in Item_func_div object, if dividend has max_length == 0 then
Item_func_div::max_length is set to 0 under some circumstances.
The fix:
If decimals == NOT_FIXED_DEC then set
Item_func_div::max_length to max possible
DOUBLE length value.
mysql-test/r/func_math.result:
test case
mysql-test/t/func_math.test:
test case
sql/item_func.cc:
The fix:
If decimals == NOT_FIXED_DEC then set
Item_func_div::max_length to max possible
DOUBLE length value.
multiline inserts into partition
Bug#57071: EXTRACT(WEEK from date_col) cannot be
allowed as partitioning function
Renamed function according to reviewers comments.
sql/item.h:
better name of processor function
sql/item_func.h:
better name of processor function
sql/item_timefunc.h:
better name of processor function
sql/sql_partition.cc:
better name of processor function
Updated comment.
Bug#57071: EXTRACT(WEEK from date_col) cannot be allowed as partitioning function
There were functions allowed as partitioning functions
that implicit allowed cast. That could result in unacceptable
behaviour.
Solution was to check that the arguments of date and time functions
have allowed types (field and date/datetime/time depending on function).
mysql-test/r/partition.result:
Updated result
mysql-test/r/partition_error.result:
Updated result
mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc:
disabled test with not allowed arguments.
mysql-test/suite/parts/r/part_supported_sql_func_innodb.result:
Updated result
mysql-test/suite/parts/r/part_supported_sql_func_myisam.result:
Updated result
mysql-test/t/partition.test:
Fixed typo in bug number and removed non allowed function (bad argument)
mysql-test/t/partition_error.test:
Added tests to verify correct type of argument.
sql/item.h:
Renamed processor since it is no longer only for timezone
sql/item_func.h:
Added help functions for checking date/time/datetime arguments.
sql/item_timefunc.h:
Added processors for argument correctness
sql/sql_partition.cc:
renamed the processor for checking arguments.
Item_sum_max/Item_sum_min incorrectly set null_value flag and
attempt to get result in parent functions leads to crash.
This happens due to double evaluation of the function argumet.
First evaluation happens in the comparator and second one
happens in Item_cache::cache_value().
The fix is to introduce new Item_cache object which
holds result of the argument and use this cached value
as an argument of the comparator.
mysql-test/r/func_group.result:
test case
mysql-test/t/func_group.test:
test case
sql/item.cc:
added assertion that ether we have some result or result is NULL.
sql/item_sum.cc:
introduce new Item_cache object which
holds result of the argument and use this cached value
as an argument of the comparator.
sql/item_sum.h:
introduce new Item_cache object which
holds result of the argument and use this cached value
as an argument of the comparator.