Commit graph

25013 commits

Author SHA1 Message Date
Alexey Kopytov
8ae8162403 Manual merge to 5.1. 2009-02-23 14:42:31 +02:00
Alexey Kopytov
0e62c9aa63 Fix for bug #15936: "round" differs on Windows to Unix
Both of our own implementations of rint(3) were inconsistent with the
most common behavior of rint() on those platforms that have it: round
to nearest, break ties by rounding to nearest even.

Fixed by leaving just one implementation of rint() in our source tree,
and changing its behavior to match the most common native
implementations on other platforms.

configure.in:
  Added checks for fenv.h and fesetround().
include/config-win.h:
  Removed the incorrect implementation of rint() for Windows.
include/my_global.h:
  Added an rint() implementation for platforms that do not have it.
mysql-test/r/func_math.result:
  Added a test case for bug #15936.
mysql-test/t/func_math.test:
  Added a test case for bug #15936.
sql/mysqld.cc:
  Explicitly set the FPU rounding mode with fesetround().
2009-02-23 14:28:26 +02:00
Alfranio Correia
2d3ac117a4 Post-fix for BUG#38174. 2009-02-22 13:40:52 +00:00
Alfranio Correia
d822ab8957 BUG#38174 secure-file-priv breaks LOAD DATA INFILE replication in statement mode
If secure-file-priv was set on slave, it became unable to execute
LOAD DATA INFILE statements sent from master using mixed or
statement-based replication.
                  
This patch fixes the issue by ignoring this security restriction
and checking if the files are created and read by the slave in the
--slave-load-tmpdir while executing the SQL Thread.
2009-02-21 09:36:07 +00:00
Mattias Jonsson
e7e5443a01 Backport of patch for bug#40003 from 6.0 to 5.1,
related to the backport of the patch for bug#38719

sql/ha_partition.cc:
  bug#40003, archive does not handle dup_key.
2009-02-20 16:56:32 +01:00
Mattias Jonsson
9eaa51099c merge of updated 51-bugteam before pushing... 2009-02-20 11:45:57 +01:00
Mattias Jonsson
330f9fb5a5 merge into an updated 5.1-bugteam. 2009-02-20 11:21:45 +01:00
Georgi Kodinov
30bb35bcda auto merge 2009-02-20 11:57:33 +02:00
Georgi Kodinov
1f6d6fa905 merged 5.0-bugteam -> 5.1-bugteam 2009-02-20 11:50:50 +02:00
Georgi Kodinov
c1ddc60c69 fixed a warning 2009-02-20 11:42:35 +02:00
Davi Arnaut
664bb23a30 Bug#41098: Query Cache returns wrong result with concurrent insert
The problem is that select queries executed concurrently with
a concurrent insert on a MyISAM table could be cached if the
select started after the query cache invalidation but before
the unlock of tables performed by the concurrent insert. This
race could happen because the concurrent insert was failing
to prevent cache of select queries happening at the same time.

The solution is to add a 'uncacheable' status flag to signal
that a concurrent insert is being performed on the table and
that queries executing at the same time shouldn't cache the
results.

mysql-test/r/query_cache_debug.result:
  Add test case result for Bug#41098
mysql-test/t/disabled.def:
  Re-enable test case.
mysql-test/t/query_cache_debug.test:
  Add test case for Bug#41098
sql/sql_cache.cc:
  Debug sync point for regression testing purposes.
sql/sql_insert.cc:
  Remove meaningless query cache invalidate. There is already
  a preceding invalidate for queries that started before the
  concurrent insert.
storage/myisam/ha_myisam.cc:
  Check for a active concurrent insert.
storage/myisam/mi_locking.c:
  Signal the start of a concurrent insert. Flag is zeroed once
  the state is updated back.
storage/myisam/myisamdef.h:
  Add flag to signal a active concurrent insert.
2009-02-19 18:09:35 -03:00
Georgi Kodinov
901427b241 merged 5.0-bugteam -> 5.1-bugteam 2009-02-19 20:30:05 +02:00
Georgi Kodinov
cf42f6689f merged bug 42419 to 5.0-bugteam 2009-02-19 18:26:19 +02:00
Georgi Kodinov
29476d879f Bug #42419: Server crash with "Pure virtual method called" on two concurrent
connections
The problem is that tables can enter open table cache for a thread without 
being properly cleaned up. This can happen if make_join_statistics() fails 
to read a const table because of e.g. a deadlock. It does set a member of 
TABLE structure to a value it allocates, but doesn't clean-up this setting 
on error nor does it set the rest of the members in JOIN to allow for 
automatic cleanup.
As a result when such an error occurs and the next statement depends re-uses 
the table from the open tables cache it will get it with this 
TABLE::reginfo.join_tab pointing to a memory area that's freed.
Fixed by making sure make_join_statistics() cleans up TABLE::reginfo.join_tab 
on error.

mysql-test/r/innodb_mysql.result:
  Bug #42419: test case
mysql-test/t/innodb_mysql-master.opt:
  Bug #42419: increase the timeout so it covers te conservative 
  sleep 3 in the test
mysql-test/t/innodb_mysql.test:
  Bug #42419: test case
sql/sql_select.cc:
  Bug #42419: clean up the members of TABLE on failure in 
          make_join_statisitcs()
2009-02-19 17:30:03 +02:00
Sergey Glukhov
e89fddc636 automerge 2009-02-19 18:52:49 +04:00
Sergey Glukhov
fafeaf460b 5.0-bugteam->5.1-bugteam merge 2009-02-19 17:59:00 +04:00
Sergey Glukhov
c2e23208ef Bug#37601 Cast Is Not Done On Row Comparison
In case of ROW item each compared pair does not
check if argumet collations can be aggregated and
thus appropiriate item conversion does not happen.
The fix is to add the check and convertion for ROW
pairs.


mysql-test/r/row.result:
  test result
mysql-test/t/row.test:
  test case
sql/item.cc:
  added agg_item_set_converter() function which was a part of
  agg_item_charsets() func. The only difference is that
  agg_item_set_converter() checks and converts items 
  using already known collation.
sql/item.h:
  added agg_item_set_converter() function
sql/item_cmpfunc.cc:
  In case of ROW item each compared pair does not
  check if argumet collations can be aggregated and
  thus appropiriate item conversion does not happen.
  The fix is to add the check and convertion for ROW
  pairs.
2009-02-19 17:20:44 +04:00
Alexey Kopytov
c814ccbf41 Automerge. 2009-02-19 12:03:23 +03:00
Alexey Kopytov
0c96241b15 Automerge. 2009-02-19 12:02:11 +03:00
Alexey Kopytov
45e3327f9f Automerge. 2009-02-19 11:56:16 +03:00
Alexey Kopytov
321646095d Fix for bug #41078: With CURSOR_TYPE_READ_ONLY mysql_stmt_fetch()
returns short string value. 
 
Multibyte character sets were not taken into account when 
calculating max_length in Item_param::convert_str_value(). As a 
result, string parameters of a prepared statement could be 
truncated later when calculating string length in characters by 
dividing length in bytes by the charset's mbmaxlen value (e.g. in 
Field_varstring::store()). 
 
Fixed by taking charset's mbmaxlen into account when calculating 
max_length in Item_param::convert_str_value().


sql/item.cc:
  Multiply string's length in characters by charset's mbmaxlen when 
  calculating max_length.
tests/mysql_client_test.c:
  Added a test case for bug #41078.
2009-02-19 11:49:35 +03:00
Mattias Jonsson
830c42a06a Backport of bug#38719 from 6.0 to 5.1
handler::get_dup_key used the called handler for the
info call, but used table->file handler for errkey.
Fixed by using table->file->info instead.

mysql-test/r/partition_error.result:
  Bug#38719: Partitioning returns a different error code for
  a duplicate key error
  
  Added test for verification
mysql-test/t/partition_error.test:
  Bug#38719: Partitioning returns a different error code for
  a duplicate key error
  
  Added test for verification
2009-02-18 21:29:30 +01:00
Mattias Jonsson
85cc17d3cd Bug#36001: Partitions: spelling and using some error messages
Backport from 6.0

Changed error message to show that it is partitioning
that does not support foreign keys yet.

Changed spelling from British english to American english.

mysql-test/r/partition.result:
  Bug#36001: Partitions: spelling and using some error messages
  
  Backport from 6.0
  
  Changed spelling from British english to American english.
mysql-test/r/partition_mgm_err.result:
  Bug#36001: Partitions: spelling and using some error messages
  
  Backport from 6.0
  
  Changed spelling from British english to American english.
mysql-test/t/partition.test:
  Bug#36001: Partitions: spelling and using some error messages
  
  Backport from 6.0
  
  Added test for verifying error message
sql/share/errmsg.txt:
  Bug#36001: Partitions: spelling and using some error messages
  
  Backport from 6.0
  
  Changed spelling from British english to American english.
sql/sql_table.cc:
  Bug#36001: Partitions: spelling and using some error messages
  
  Backport from 6.0
  
  Using a better error message.
2009-02-18 21:10:19 +01:00
Sergey Glukhov
d0ece331a2 5.0->bugteam->5.1-bugteam merge 2009-02-18 16:09:46 +04:00
Sergey Glukhov
544fa7593b Bug#25830 SHOW TABLE STATUS behaves differently depending on table name(for 5.0 only)
replace wild_case_compare with my_wildcmp which is multibyte safe function


mysql-test/r/lowercase_utf8.result:
  test result
mysql-test/t/lowercase_utf8-master.opt:
  test case
mysql-test/t/lowercase_utf8.test:
  test case
sql/sql_show.cc:
  replace wild_case_compare with my_wildcmp which is multibyte safe function
2009-02-17 18:22:48 +04:00
Davi Arnaut
d3a10ec6ef Bug#41077: Warning contains wrong future version
Substitute all references of MySQL version "5.2" to "6.0" in
deprecation warning messages.Deprecated constructs are being
removed in the 6.0 tree.
2009-02-16 08:38:15 -03:00
Ramil Kalimullin
c647f777b8 Auto-merge 2009-02-14 14:47:33 +04:00
Ramil Kalimullin
0e4333f6cc Fix for bug#21476: stack overflow crashes server; error-message
stack reservation too small

Problem: some tests fail on HP-UX due to insufficient stack reservation.

Fix: increase stack reservation.


sql/mysql_priv.h:
  Fix for bug#21476: stack overflow crashes server; error-message
  stack reservation too small
    - raised STACK_MIN_SIZE to pass execution_constants.test on HP-UX.
2009-02-14 14:40:22 +04:00
Alexey Kopytov
d8ac91387b Merge from dev tree. 2009-02-14 12:11:32 +03:00
Alexey Kopytov
fb3e5910ec Merge from dev tree. 2009-02-14 12:09:35 +03:00
Alexey Kopytov
dd35a152f9 Merge mysql-5.0-bugteam -> mysql-5.1-bugteam. 2009-02-13 19:20:56 +03:00
Alexey Kopytov
9373b1b880 Merge from dev tree. 2009-02-13 19:17:07 +03:00
Georgi Kodinov
cc5809f055 merged additional fix for bug 33813 to 5.1-bugteam 2009-02-12 17:30:38 +02:00
Georgi Kodinov
47c53135fd merged 5.0-bugteam to a working tree 2009-02-12 16:39:33 +02:00
Georgi Kodinov
1c5fa3b6a9 Bug #33813: Schema names are case-sensitive in DROP FUNCTION
Additional fix:
 1. Revert the unification of DROP FUNCTION
and DROP PROCEDURE, because DROP FUNCTION can be used to
drop UDFs (that have a non-qualified name and don't require
database name to be present and valid).
 2. Fixed the case sensitivity problem by adding a call to 
check_db_name() (similar to the sp_name production).
2009-02-12 16:36:43 +02:00
Sergey Vojtovich
e994c4f97b Merge 5.0-bugteam -> 5.1-bugteam. 2009-02-12 14:10:07 +04:00
Georgi Kodinov
ccca4feca8 merged bug 33813 to 5.1-bugteam 2009-02-12 11:52:01 +02:00
Sergey Vojtovich
5803e10628 BUG#36737 - having + full text operator crashes mysql
MATCH() function accepts column list as an argument. It was possible to override
this requirement with aliased non-column select expression. Which results in
server crash.

With this fix aliased non-column select expressions are not accepted by MATCH()
function, returning an error.

mysql-test/r/fulltext.result:
  A test case for BUG#36737.
mysql-test/t/fulltext.test:
  A test case for BUG#36737.
sql/item_func.cc:
  Only accept fields as arguments to MATCH().
2009-02-12 13:49:44 +04:00
Georgi Kodinov
7df0e72c7f merged bug 33813 to 5.0-bugteam 2009-02-12 11:27:06 +02:00
Chad MILLER
b8149f09d6 Merge from bug tree. 2009-02-11 23:44:32 -05:00
Chad MILLER
d880862549 Bug#30261: "mysqld --help" no longer possible for root
The check for root-ness would signal an error.  Errors would make the
server exit before usage (help) information was printed.

Now, test for whether we want help regardless of whether we're going
to exit with an error.  If plugins are not initialized by the time we 
print usage information, inform the user that some parameters are 
missing.
2009-02-10 09:41:55 -05:00
Alexey Kopytov
1571f06196 Merge into dev tree. 2009-02-10 16:27:35 +03:00
Alexey Kopytov
fd8bf58ca9 Fix for bug #41868: crash or memory overrun with concat + upper,
date_format functions

String::realloc() did not check whether the existing string data fits in
the newly allocated buffer for cases when reallocating a String object
with external buffer (i.e.alloced == FALSE).  This could lead to memory
overruns in some cases.

client/sql_string.cc:
  Fixed String::realloc() to check whether the existing string data fits
  in the newly allocated buffer for cases when reallocating a String
  object with external buffer.
mysql-test/r/func_str.result:
  Added a test case for bug #41868.
mysql-test/t/func_str.test:
  Added a test case for bug #41868.
sql/sql_class.cc:
  After each call to Item::send() in select_send::send_data() reset
  buffer to its original state to reduce unnecessary malloc() calls. See
  comments for bug #41868 for detailed analysis.
sql/sql_string.cc:
  Fixed String::realloc() to check whether the existing string data fits
  in the newly allocated buffer for cases when reallocating a String
  object with external buffer.
2009-02-10 15:38:56 +03:00
Luis Soares
b7b6773f69 BUG#13684: SP: DROP PROCEDURE|FUNCTION IF EXISTS not binlogged if routine does not exist
There is an inconsistency with DROP DATABASE IF EXISTS, DROP
TABLE IF EXISTS and DROP VIEW IF EXISTS: those are binlogged even
if the DB or TABLE does not exist, whereas DROP PROCEDURE IF
EXISTS does not. It would be nice or at least consistent if DROP
PROCEDURE/STATEMENT worked the same too.
      
Fixed DROP PROCEDURE|FUNCTION IF EXISTS by adding a call to
write_bin_log in mysql_execute_command. Checked also if all
documented "DROP (...) IF EXISTS" get binlogged. Left out DROP
SERVER IF EXISTS because it seems that it only gets binlogged when
using row event (see BUG#25705).
2009-02-10 11:52:19 +01:00
Georgi Kodinov
0669b79363 Bug #33813: Schema names are case-sensitive in DROP FUNCTION
The parser was not using the correct fully-qualified-name
production for DROP FUNCTION.
Fixed by copying the production from DROP PROCEDURE.
Tested in the windows specific suite to make sure it's 
tested on a case-insensitive file system.

mysql-test/r/windows.result:
  Bug #33813: test case
mysql-test/t/windows.test:
  Bug #33813: test case
sql/sql_yacc.yy:
  Bug #33813: use the correct production for the name in
  DROP PROCEDURE
2009-02-10 11:58:19 +02:00
Ramil Kalimullin
13b564e461 Fix for bug #40757: Starting server on Windows with
innodb_flush_method=wrong_value causes crash

Problem: after a failed plugin initialization, incompletely 
initialized data remained in the plugin and handlerton data 
structures. These were used later and caused the crash.

Fix: clean-up plugin related data if initialization failed.

Note: no test case added, hand tested.


sql/handler.cc:
  Fix for bug #40757: Starting server on Windows with 
  innodb_flush_method=wrong_value causes crash
    - free allocated hton and set plugin->data 
      (pointing to handlerton) to NULL if plugin->init() fails,
      as we use it as a sign that ha_initialize_handlerton() is failed,
      which is used in ha_finalize_handlerton().
    - do the same if there's no free slot for a plugin in the
      hton2plugin[] array or there are too many storage engines.
    - call plugin->deinit() in such cases as we successfully
      called plugin->init() before.
2009-02-10 12:37:27 +04:00
Mats Kindahl
8a98664d3b Merging with 5.1-bugteam. 2009-02-09 23:51:59 +01:00
Davi Arnaut
86a11e6a39 Merge from upstream 5.1-bugteam. 2009-02-09 16:27:45 -02:00
Davi Arnaut
bab4ff1ae5 Bug#42634: % character in query can cause mysqld signal 11 segfault
The problem is that a unfiltered user query was being passed as
the format string parameter of sql_print_warning which later
performs printf-like formatting, leading to crashes if the user
query contains formatting instructions (ie: %s). Also, it was
using THD::query as the source of the user query, but this
variable is not meaningful in some situations -- in a delayed
insert, it points to the table name.

The solution is to pass the user query as a parameter for the
format string and use the function parameter query_arg as the
source of the user query.

mysql-test/suite/binlog/r/binlog_unsafe.result:
  Add test case result for Bug#42634
mysql-test/suite/binlog/t/binlog_unsafe.test:
  Add test case for Bug#42634
sql/sql_class.cc:
  Don't pass the user query as a format string.
2009-02-09 16:17:58 -02:00
Sergey Glukhov
4d0557a2e6 Bug#42610 Dynamic plugin broken in 5.1.31
added ignore-builtin-innodb option which disabled
initialization of builtin InnoDB plugin

mysql-test/r/innodb_ignore_builtin.result:
  test case
mysql-test/t/innodb_ignore_builtin-master.opt:
  test case
mysql-test/t/innodb_ignore_builtin.test:
  test case
sql/mysql_priv.h:
  added ignore-builtin-innodb option which disabled
  initialization of builtin InnoDB plugin
sql/mysqld.cc:
  added ignore-builtin-innodb option which disabled
  initialization of builtin InnoDB plugin
sql/set_var.cc:
  added ignore-builtin-innodb option which disabled
  initialization of builtin InnoDB plugin
sql/sql_plugin.cc:
  added ignore-builtin-innodb option which disabled
  initialization of builtin InnoDB plugin
2009-02-09 19:03:52 +04:00