Commit graph

65868 commits

Author SHA1 Message Date
Georgi Kodinov
1c2c5529c3 merge mysql-5.1 -> mysql-5.1-bugteam 2010-06-01 14:44:31 +03:00
Marko Mäkelä
dfe03adad1 Merge from mysql-5.1-innodb:
------------------------------------------------------------
  revno: 3478.1.4
  revision-id: marko.makela@oracle.com-20100525125352-hgafpmqhrrj7pv5i
  parent: marko.makela@oracle.com-20100525123748-pmpehbg29oyhc1ns
  committer: Marko Mäkelä <marko.makela@oracle.com>
  branch nick: 5.1-innodb
  timestamp: Tue 2010-05-25 15:53:52 +0300
  message:
    row_search_for_mysql(): Add assertions to track down Bug #53627.
2010-06-01 14:40:15 +03:00
Georgi Kodinov
bd9fa7da26 merged mysql-5.0 to mysql-5.0-bugteam 2010-06-01 14:28:58 +03:00
Konstantin Osipov
5fa66315e9 A follow up patch for the fix for Bug#51263 "Deadlock between
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().
2010-06-01 14:49:35 +04:00
Konstantin Osipov
a96d23a57a A follow up patch for the fix for Bug#51263 "Deadlock between
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).
2010-06-01 14:19:05 +04:00
Konstantin Osipov
b9aa51e209 A follow up patch for the fix for Bug#51263 "Deadlock between
transactional SELECT and ALTER TABLE ...  REBUILD PARTITION".

Remove unused code - TL_WRITE_ALLOW_READ thr_lock.c lock.






include/thr_lock.h:
  Remove TL_WRITE_ALLOW_READ.
mysys/CMakeLists.txt:
  Add thr_lock test to the list of CMake executables to build.
mysys/thr_lock.c:
  Remove TL_WRITE_ALLOW_READ thr_lock.c lock.
  Consequently, simplify lock compatibility rules.
  Remove unused code.
sql/sql_test.cc:
  Remove TL_WRITE_ALLOW_READ lock.
2010-06-01 14:13:56 +04:00
Jonathan Perkin
5cf1d38570 Merge 2010-06-01 10:33:01 +01:00
Jonathan Perkin
99b5ca1f20 Add SELinux checks from distribution-specific spec file, missed in
previous.

Convert some shell bits to standard 2-space indent, 80 columns, etc.
2010-06-01 10:24:38 +01:00
He Zhenxing
bee85d74eb Auto merge from trunk 2010-06-01 17:03:55 +08:00
He Zhenxing
84889d030c BUG#52748 Semi-Sync ACK packet isn't check for length
Check the length and use strncpy to make the code safer.
2010-06-01 16:59:48 +08:00
He Zhenxing
9547a63ded BUG#52748 Semi-Sync ACK packet isn't check for length
Check the length and use strncpy to make the code safer.

plugin/semisync/semisync_master.cc:
  replace strcpy with strncpy to make the code safer
2010-06-01 16:54:52 +08:00
Sergey Glukhov
c7624ba167 5.1-bugteam->trunk-merge merge 2010-06-01 11:57:23 +04:00
Sergey Glukhov
4d01771807 test case fix 2010-06-01 11:54:06 +04:00
Mattias Jonsson
37b8ba3952 merge 2010-06-01 09:07:42 +02:00
Mattias Jonsson
8cef620504 post push fix for bug#49161
result file differs on embedded
2010-06-01 09:02:28 +02:00
Alexander Nozdrin
9c960ecff1 Patch for Bug#54123 (Build failure on HPUX). 2010-06-01 07:54:15 +04:00
Davi Arnaut
a8c288054e Bug#53445: Build with -Wall and fix warnings that it generates
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.
2010-05-31 12:29:54 -03:00
Horst.Hunger
e5bcb6f36a merge of patch for bug#52913 from 5.1-bugteam to trunk-bugfixing. Changed $basedir to $bindir in mysql-test-run.pl. 2010-06-04 11:31:03 +02:00
Alexey Kopytov
ae5508a67b Automerge. 2010-06-03 21:29:53 +04:00
Horst.Hunger
6eaf7e6c45 Patch for trunk after merge from 5.1-bugteam of bug52913. 2010-06-03 11:27:27 +02:00
Alexey Kopytov
3e1a792c9b Bug #45882: dtoa.c might not work with gcc 4.4.0
- 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.
2010-06-01 21:37:45 +04:00
Vasil Dimov
567a1246aa Fix Bug #53947 InnoDB: Assertion failure in thread 4224 in file .\sync\sync0sync.c line 324
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
2010-05-31 18:23:41 +03:00
Alexander Nozdrin
fe5bcb475c Backport of
- 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.
2010-05-31 17:38:02 +04:00
Alexey Botchkov
46bc8970c9 test added for the bug #45052 2010-05-31 18:33:38 +05:00
Gleb Shchepa
fefbd756db Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY
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.
2010-05-31 16:52:19 +04:00
Davi Arnaut
77e744f844 Post-merge fix: rename filename in shared make file. 2010-05-31 09:27:10 -03:00
Tor Didriksen
8231f082e5 Bug #49829 Many "hides virtual function" warnings with SunStudio
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.
2010-05-31 12:59:58 +02:00
Vasil Dimov
f31af3125d Fix coding style 2010-05-31 13:59:23 +03:00
Sergey Glukhov
3c9bc58bdc automerge 2010-05-31 13:41:23 +04:00
Sergey Glukhov
27e512d394 5.1-bugteam->mysql_trunk-merge merge 2010-05-31 13:38:10 +04:00
Sergey Glukhov
89b83c05e0 Bug#53942 valgrind warnings with timestamp() function and incomplete datetime values
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
2010-05-31 13:25:11 +04:00
Vasil Dimov
26caf25b0b Null merge mysql-5.1-innodb -> mysql-trunk-merge 2010-05-31 12:18:27 +03:00
Sergey Glukhov
07f07ffed1 test case fix 2010-05-31 12:38:45 +04:00
Vasil Dimov
dc8c8174b4 Merge mysql-5.1-innodb -> mysql-5.1 2010-05-31 11:23:07 +03:00
Dmitry Lenev
7c01868287 Yet another follow-up for the 5.5 version of fix for
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.
2010-05-30 13:27:44 +04:00
Dmitry Lenev
ef9aaa8e2e Follow-up for patch that addresses bug #53976 "ALTER TABLE
RENAME is allowed on views (not documented, broken)".

Adjusted test cases in funcs_1 suite after removing support
of ALTER TABLE RENAME for views.
2010-05-30 11:48:22 +04:00
Dmitry Lenev
7e63d16436 Fixed typo which was introduced by pre-requisite patch for
bug #51263 "Deadlock between transactional SELECT and ALTER
TABLE ... REBUILD PARTITION" and has been causing compilation
error when server was built with NDB support.
2010-05-30 11:43:19 +04:00
Alexey Kopytov
f3a8307397 Bug #48537: difference of index selection between rpm binary
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.
2010-05-29 22:16:45 +04:00
Davi Arnaut
a1b8e4dc7e Backport: remove dead code.
Reorganize function to reflect that it does not actually uses curses
and that there is no curses variant.
2010-05-28 19:53:26 -03:00
Davi Arnaut
1164841167 Backport: Remove unused and ancient files, functions, and facilities.
client/mysql.cc:
  Remove unused functions.
client/sql_string.cc:
  Remove unused functions.
include/my_pthread.h:
  Remove unused prototype.
mysys/my_pthread.c:
  Remove unused function.
sql/lock.cc:
  Remove unused function.
sql/lock.h:
  Remove unused and duplicated prototypes.
sql/sql_class.h:
  Removed unused variables.
sql/sql_const.h:
  Remove unused defines.
sql/sql_priv.h:
  Remove unused defines.
sql/sql_string.cc:
  Remove unused prototype.
sql/thr_malloc.cc:
  Remove unused function.
sql/thr_malloc.h:
  Remove unused prototype.
storage/myisam/CMakeLists.txt:
  Remove obsolete fulltext file.
storage/myisam/Makefile.am:
  Remove obsolete files (were already commented out).
storage/myisam/ft_eval.c:
  Remove obsolete fulltext file.
storage/myisam/ft_eval.h:
  Remove obsolete fulltext file.
storage/myisam/ft_stem.c:
  Remove obsolete fulltext file.
storage/myisam/ft_test1.c:
  Remove obsolete fulltext file.
storage/myisam/ft_test1.h:
  Remove obsolete fulltext file.
2010-05-28 19:13:31 -03:00
Davi Arnaut
92f659e7a3 Remove build files which relied on the now defunct make-ccc files. 2010-05-28 18:17:02 -03:00
Davi Arnaut
0ef355488b Backport: remove ancient and unused strings files. 2010-05-28 18:11:31 -03:00
Davi Arnaut
ba48581438 Backport a old cleanup patch.
Formatting cleanup: removing tabs and trailing spaces
to conform to MySQL Internals Coding Guidelines.
2010-05-28 18:00:18 -03:00
unknown
229cc4e191 Bug#52168 decimal casting catastrophes: crashes and valgrind errors on simple casts
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.
2010-05-28 17:30:39 +02:00
Daniel Fischer
d6fe8c47b8 post-merge fix 1 2010-05-28 16:50:23 +02:00
Vasil Dimov
bb8a7e66d2 Merge mysql-trunk-innodb from bk-internal into my local tree 2010-05-28 17:16:46 +03:00
Jimmy Yang
d02ec3463e This is to fix a special case for the fix on bug #53592, where the
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.
2010-05-28 06:17:37 -07:00
Mattias Jonsson
f90429ed99 Manual merge of bug#49161 into mysql-trunk-merge
(Added a real error message instead of ER_UNKNOWN_ERROR)
2010-05-28 15:14:43 +02:00
Jonathan Perkin
ba36de4f2e Differentiate between Oracle Enterprise Linux and Red Hat Enterprise Linux. 2010-05-28 13:56:57 +01:00
Mattias Jonsson
9731b3852b merge 2010-05-28 14:49:25 +02:00