transactional SELECT and ALTER TABLE ... REBUILD PARTITION".
Make open flags part of Open_table_context.
This allows to simplify some code and (in future)
enforce the invariant that we don't, say, request a back
off on the table when there is MYSQL_OPEN_IGNORE_FLUSH
flag.
sql/sql_base.cc:
open_table() flags are part of Open_table_context.
Remove dead code that would check for OPEN_VIEW_NO_PARSE,
which is not an open table flag.
sql/sql_base.h:
Move flags to Open_table_context. Reorder Open_table_context
members to compact the structure footprint.
sql/sql_insert.cc:
Update with a new calling signature of open_table().
sql/sql_table.cc:
Update with a new calling signature of open_table().
transactional SELECT and ALTER TABLE ... REBUILD PARTITION".
Move declarations of sql_base.cc classes to sql_base.h
(previously declared in sql_class.h).
Became possible after a header file split.
sql/sql_base.cc:
Make sql_base.h the first include in sql_base.cc.
sql/sql_base.h:
Add declarations of Prelocking_strategy and Open_table_context.
sql/sql_class.h:
Remove declarations of Prelocking_strategy and Open_table_context
(moved).
Fix various mismatches between function's language linkage. Any
particular function that is declared in C++ but should be callable
from C must have C linkage. Note that function types with different
linkages are also distinct. Thus, if a function type is declared in
C code, it will have C linkage (same if declared in a extern "C"
block).
client/mysql.cc:
Mismatch between prototype and declaration.
client/mysqltest.cc:
mysqltest used to be C code. Use C linkage where appropriate.
cmd-line-utils/readline/input.c:
Isolate unreachable code.
include/my_alloc.h:
Function type must have C linkage.
include/my_base.h:
Function type must have C linkage.
include/my_global.h:
Add helper macros to avoid spurious namespace indentation.
include/mysql.h.pp:
Update ABI file.
mysys/my_gethwaddr.c:
Remove stray carriage return and fix coding style.
plugin/semisync/semisync_master_plugin.cc:
Callback function types have C linkage.
plugin/semisync/semisync_slave_plugin.cc:
Callback function types have C linkage.
sql/derror.cc:
Expected function type has C linkage.
sql/field.cc:
Use helper macro and fix indentation.
sql/handler.cc:
Expected function type has C linkage.
sql/item_sum.cc:
Correct function linkages. Remove now unnecessary cast.
sql/item_sum.h:
Add prototypes with the appropriate linkage as otherwise they
are distinct.
sql/mysqld.cc:
Wrap functions in C linkage mode.
sql/opt_range.cc:
C language linkage is ignored for class member functions.
sql/partition_info.cc:
Add wrapper functions with C linkage for class member functions.
sql/rpl_utility.h:
Use helper macro and fix indentation.
sql/sql_class.cc:
Change type of thd argument -- THD is a class.
Use helper macro and fix indentation.
sql/sql_class.h:
Change type of thd argument -- THD is a class.
sql/sql_select.cc:
Expected function type has C linkage.
sql/sql_select.h:
Move prototype to sql_test.h
sql/sql_show.cc:
Expected function type has C linkage.
sql/sql_test.cc:
Fix required function prototype and fix coding style.
sql/sql_test.h:
Removed unnecessary export and add another.
storage/myisammrg/ha_myisammrg.cc:
Expected function type has C linkage.
storage/perfschema/pfs.cc:
PSI headers are declared with C language linkage, which also
applies to function types.
- Ported relevant changes from the upstream version to not
break strict-aliasing rules and to fix compiler warnings and
and infinite loops caused by that issue.
- Fixed compilation with Honor_FLT_ROUNDS defined.
- Fixed an unused variable warning.
Destroy the rw-lock object before freeing the memory it is occupying.
If we do not do this, then the mutex that is contained in the rw-lock
object btr_search_latch_temp->mutex gets "freed" and subsequently
mutex_free() from sync_close() hits a mutex whose memory has been
freed and crashes.
Approved by: Heikki (via IRC)
Discussed with: Calvin
- revid:sp1r-svoj@mysql.com/june.mysql.com-20080324111246-00461
- revid:sp1r-svoj@mysql.com/june.mysql.com-20080414125521-40866
BUG#35274 - merge table doesn't need any base tables, gives
error 124 when key accessed
SELECT queries that use index against a merge table with empty
underlying tables list may return with error "Got error 124 from
storage engine".
The problem was that wrong error being returned.
mysql-test/r/merge.result:
Backport of
- revid:sp1r-svoj@mysql.com/june.mysql.com-20080324111246-00461
- revid:sp1r-svoj@mysql.com/june.mysql.com-20080414125521-40866
A test case for BUG#35274.
Modified a test case according to fix for BUG#35274. Key based
reads are now allowed for merge tables with no underlying tables
defined.
mysql-test/t/merge.test:
Backport of
- revid:sp1r-svoj@mysql.com/june.mysql.com-20080324111246-00461
- revid:sp1r-svoj@mysql.com/june.mysql.com-20080414125521-40866
A test case for BUG#35274.
Modified a test case according to fix for BUG#35274. Key based
reads are now allowed for merge tables with no underlying tables
defined.
storage/myisammrg/myrg_queue.c:
Backport of
- revid:sp1r-svoj@mysql.com/june.mysql.com-20080324111246-00461
- revid:sp1r-svoj@mysql.com/june.mysql.com-20080414125521-40866
Return "end of file" error instead of "wrong index" error when
we got a merge table with empty underlying tables list.
In 5.1 we cannot rely on info->open_tables value when checking
if a merge table has no underlying tables defined.
Use info->tables instead.
when it should use index
Sometimes the LEFT/RIGHT JOIN with an empty table caused an
unnecessary filesort.
Sample query, where t1.i1 is indexed and t3 is empty:
SELECT t1.*, t2.* FROM t1 JOIN t2 ON t1.i1 = t2.i2
LEFT JOIN t3 ON t2.i2 = t3.i3
ORDER BY t1.i1 LIMIT 5;
The server erroneously used an item of empty outer-joined
table as a common constant of a Item_equal (multi-equivalence
expression).
By the fix for the bug 16590 the constant status of such
an item has been propagated to st_table::const_key_parts
map bits related to other Item_equal argument-related
key parts (those are obviously not constant in our case).
As far as test_if_skip_sort_order function skips constant
prefixes of testing keys, this caused an ignorance of
available indices, since some prefixes were marked as
constant by mistake.
mysql-test/r/order_by.result:
Test case for bug #38745.
mysql-test/t/order_by.test:
Test case for bug #38745.
sql/item.h:
Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY
when it should use index
Item::is_outer_field() has been added and overloaded for
Item_field and Item_ref classes.
sql/item_cmpfunc.cc:
Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY
when it should use index
Item_equal::update_const() and Item_equal::update_used_tables()
have been updated to not take into account the constantness
of outer-joined table items.
Backport from mysql-pe (of those parts which have not been upmerged from 5.1)
sql/field.cc:
Local scope variable or method argument same as class attribute.
sql/item.cc:
Rename auto variable to avoid name clash.
sql/item.h:
Item_ref::basic_const_item had wrong signature (missing const)
and was thus never called.
sql/partition_info.cc:
Rename, to avoid name clashes.
sql/sql_load.cc:
Rename, to avoid name clashes.
Field_time::get_date method does not initialize MYSQL_TIME::time_type field.
The fix is to init this field.
mysql-test/r/type_time.result:
test case
mysql-test/t/type_time.test:
test case
sql/field.cc:
--use Field_time::get_time in Field_time::get_date
--removed duplicated code in Field_time::get_date method
bug #46947 "Embedded SELECT without FOR UPDATE is causing
a lock".
Fixed comments in tests. Improved comments and performance of
auxiliary scripts.
mysql-test/include/check_concurrent_insert.inc:
Changed script to use temporary table for backing up data in
order to make this operation less expensive. Made script more
a bit generic by allowing to use multi-column tables with it.
Improved comments.
mysql-test/include/check_no_concurrent_insert.inc:
Changed script to use temporary table for backing up data in
order to make this operation less expensive. Made script more
a bit generic by allowing to use multi-column tables with it.
Improved comments.
mysql-test/include/check_no_row_lock.inc:
Improved comments in auxiliary script.
mysql-test/r/innodb_mysql_lock2.result:
Fixed errors in comments for test.
mysql-test/r/lock_sync.result:
Fixed typo in comments for test.
mysql-test/t/innodb_mysql_lock2.test:
Fixed errors in comments for test.
mysql-test/t/lock_sync.test:
Fixed typo in comments for test.
bug #51263 "Deadlock between transactional SELECT and ALTER
TABLE ... REBUILD PARTITION" and has been causing compilation
error when server was built with NDB support.
and .tar.gz, windows vs linux..
On Intel x86 machines index selection by the MySQL query
optimizer could sometimes depend on the compiler version and
optimization flags used to build the server binary.
The problem was a result of a known issue with floating point
calculations on x86: since internal FPU precision (80 bit)
differs from precision used by programs (32-bit float or 64-bit
double), the result of calculating a complex expression may
depend on how FPU registers are allocated by the compiler and
whether intermediate values are spilled from FPU to memory. In
this particular case compiler versions and optimization flags
had an effect on cost calculation when choosing the best index
in best_access_path().
A possible solution to this problem which has already been
implemented in mysql-trunk is to limit FPU internal precision
to 64 bits. So the fix is a backport of the relevant code to
5.1 from mysql-trunk.
configure.in:
Configure check for fpu_control.h
mysql-test/r/explain.result:
Test case for bug #48537.
mysql-test/t/explain.test:
Test case for bug #48537.
sql/mysqld.cc:
Backport of the code to switch FPU on x86 to 64-bit precision.
The problem is that if a NULL is stored in an Item_cache_decimal object,
the associated my_decimal object is not initialized. However, it is still
accessed when val_int() is called. The fix is to check for null_value
within val_int(), and return without accessing the my_decimal object when
the cached value is NULL.
Bug#52122 reports the same issue for val_real(), and this patch also includes
fixes for val_real() and val_str() and corresponding test cases from that
bug report.
Also, NULL is returned from val_decimal() when value is null. This will
avoid that callers access an uninitialized my_decimal object.
Made similar changes to all other Item_cache classes. Now all val_*
methods should return a well defined value when actual value is NULL.
mysql-test/r/type_decimal.result:
Updated result file with test cases for Bug#52168 and Bug#52122.
mysql-test/t/type_decimal.test:
Added test cases for Bug#52168 and Bug#52122.
sql/item.cc:
In Item_cache_*::val_* methods, return a well defined value
when actual value is NULL.
This is especially important for Item_cache_decimal since
otherwise one risk accessing an uninitialized my_decimal object.
sql/item.h:
Added method Item_cache::has_value() which returns TRUE if cache
object contains a non-null value.
err_index could be not a member of the share structure or prebuilt
structure passed from MySQL. For now, we resort to the traditional
way of scanning index->table for the index number.