Commit graph

167147 commits

Author SHA1 Message Date
Sergei Golubchik
1a72c6fefd Merge branch 'bb-5.5-serg' into 5.5 2015-12-09 11:51:59 +01:00
Sergei Golubchik
abf9d35213 Merge branch 'mysql/5.5' into 5.5 2015-12-09 10:00:49 +01:00
Sergey Vojtovich
dac3149f3f MDEV-9001 - [PATCH] Fix DB name quoting in mysqldump --routine
Removed unused variable.
2015-12-08 17:21:07 +04:00
Sergei Golubchik
50a796dcba MDEV-8825 mysql_upgrade leaks the admin password when it spawns a shell process to execute mysqlcheck
don't put common arguments on the command-line,
use a config file instead
2015-12-08 10:16:41 +01:00
Sergei Golubchik
c21b927145 mysql_upgrade cleanup 2015-12-08 10:13:13 +01:00
Sergei Golubchik
f0d774d484 MDEV-9212 ssl-validate-cert incorrect hostname check
Reimplement ssl_verify_server_cert() using the logic
from https://wiki.openssl.org/index.php/Hostname_validation

The bug was discovered by Alex Gaynor.
2015-12-08 09:46:52 +01:00
Sergei Golubchik
544eeda30d MDEV-8644 Using a UDF in a virtual column causes a crash when stopping the server
first close all tables, then unload UDFs
2015-12-08 09:46:52 +01:00
Sergei Golubchik
79d08e682f small cleanup: udf_init()/udf_free() calls 2015-12-08 09:46:52 +01:00
Sergei Golubchik
859a7369c1 MDEV-9161 feedback_plugin_send in debug builds
thd->cleanup_after_query() is needed to destroy all Items
created for this query (and Item destructors free allocated
Strings).
2015-12-08 09:46:52 +01:00
Sergei Golubchik
99774f1501 feedback plugin compilation warnings 2015-12-08 09:46:51 +01:00
Sergei Golubchik
8fd24b418d MDEV-9226 SHOW COLUMNS returns wrong column order for tables with large ENUMs
set keep_row_order=true for temporary tables that
hold results of the SHOW command
2015-12-08 09:46:51 +01:00
Sergei Golubchik
f18599a129 tokudb compilation warnings
5.5 patch only
2015-12-07 15:20:24 +01:00
Sergei Golubchik
d1fe928c4f MDEV-8607 Init script doesn't check all applicable configuration groups
use --mysqld instead of naming all groups explicitly

https://github.com/MariaDB/server/pull/92
2015-12-07 15:20:23 +01:00
Sergei Golubchik
18954ff25d MDEV-8313 Got an error writing communication packets
Don't let network errors from mysql_close() leak into THD.

* remove incorrect upstream fix
** table->in_use can be NULL, must use ha_thd()
** clear_error() may remove earlier errors, don't use it
* fix the bug properly in federated and federatedx
2015-12-07 15:20:23 +01:00
Sergei Golubchik
354e567c23 federatedx small cleanup
* reduce code duplication
* change int->void for the function that doesn't return an error
* use ha_thd()
2015-12-07 15:20:23 +01:00
Sergei Golubchik
e05883bf30 MDEV-7341 mysqld_multi doesn't recognize include directive (not following includes) 2015-12-07 15:20:23 +01:00
Sergei Golubchik
ef47b62551 MDEV-8827 Duplicate key with auto increment
fix innodb auto-increment handling
three bugs:
1. innobase_next_autoinc treated the case of current<offset incorrectly
2. ha_innobase::get_auto_increment didn't recalculate current when increment changed
3. ha_innobase::get_auto_increment didn't pass offset down to innobase_next_autoinc
2015-12-07 15:20:23 +01:00
Sergei Golubchik
c8652eefe5 one more test 2015-12-07 15:20:22 +01:00
Christian Loos
ee2fce5e88 fix debian logrotate slow log filename
debian/additions/my.cnf sets slow_query_log_file to
/var/log/mysql/mariadb-slow.log.

Update the filename to rotate the slow log file.
2015-12-07 13:10:43 +04:00
Jan Lindström
0df22a539e MDEV-7050: MySQL#74603 - Assertion `comma_length > 0' failed in mysql_prepare_create_table
Incorrect array lenght for comma buffer.
2015-12-07 09:34:41 +02:00
Jan Lindström
d85168e40d Correct length check in my_wc_mb_filename() 2015-12-07 09:20:31 +02:00
Jan Lindström
e528fe79b8 Fix gcc v5.compiler errors. 2015-12-05 12:21:33 +02:00
Jan Lindström
082b859d0d MDEV-9233: Copying MySQL 5.5 data directory to 10.0 with partition tables crashes on insert
Analysis: There were two problems. (1) if partition table was
created using lower_case_tables = 1 on windows we did find the
correct table but we did not set share->ib_table correctly.
(2) we did open table on dictionary but did not increase
mysql_open_tables.

Fix: In xtradb allow access to tables with incorrect
lower case names (warning is printed to error log). If
table is opened increase mysql_open_tables count to avoid
crash on flush tables.
2015-12-04 14:24:03 +02:00
Alexander Barkov
d87bc55b05 MDEV-8630 Datetime value dropped in "INSERT ... SELECT ... ON DUPLICATE KEY"
Item_func_coalesce::fix_length_and_dec() calls
Item_func::count_string_result_length()) which called agg_arg_charsets()
with wrong flags, so the collation derivation of the COALESCE result was
not properly set to DERIVATION_COERCIBLE. It erroneously stayed
DERIVATION_NUMERIC. So GREATEST() misinterpreted the argument as
a number rather that a string and did not calculate its own length properly.
2015-12-03 20:43:54 +04:00
Sergey Vojtovich
9f07c6b383 MDEV-9001 - [PATCH] Fix DB name quoting in mysqldump --routine
mysqldump --routine fails to dump databases containing backslash ("\")
character. This happened because escaped database name was being used as an
identifier while changing current database. Such identifers are not supposed
to be escaped, they must be properly quoted instead.
2015-12-03 16:33:50 +04:00
Jan Lindström
33589b25ef MDEV-7762 InnoDB: Failing assertion: block->page.buf_fix_count > 0 in buf0buf.ic line 730
Analysis: debug only assertion I_S function (IS is XtraDB feature) is calling
buf_block_get_frame on any page it reads, which debug-asserts that the page is
buffer-fixed, which is not the case in I_S query.

Fixed by holding the buffer page mutex while the fields are read directly.
2015-12-03 13:18:10 +02:00
Oleksandr Byelkin
13ad179c96 MDEV-8756 MariaDB 10.0.21 crashes during PREPARE
Non-select-like queries has no correct JOIN structure connected to top-most SELECT_LEX (and should not).
2015-11-20 14:50:18 +01:00
Sergei Golubchik
43a5090980 MDEV-9051 mysqld got signal 11, after upgrade to 10.1.8
feedback plugin needs to set tables->select_lex properly
2015-11-18 11:23:15 +01:00
Sergei Golubchik
726162989b feedback plugin debug
make it possible to change feedback plugin wait intervals
* only in debug builds
* and force the feedback report to be ignored

update the test to use this feature
2015-11-18 11:23:15 +01:00
Vladislav Vaintroub
e669a5fd87 MDEV-7588 Add thd_wait_begin/end to notify threadpool of binlog waits 2015-11-17 18:33:08 +01:00
Oleksandr Byelkin
7e4da9b370 DEV-8632 Segmentation fault on INSERT
View/derived fields should be taken into account when we build ref_pointer_array constructed.

DBUG_ASSERTs added to avoid memory overrun.
2015-11-09 16:08:06 +01:00
Jan Lindström
5d754fce95 MDEV-8854: New warning messages are unreadable
Improved warning messages by quote marks.
2015-11-09 09:24:52 +02:00
Harin Vadodaria
40ae1b9b61 Bug#21973610: BUFFER OVERFLOW ISSUES
post push fix : Fixing test failures
2015-11-07 22:03:47 +05:30
Oleksandr Byelkin
c88ca2c227 MDEV-8701 Crash on derived query
MDEV-8938 Server Crash on Update with joins

Make unique table check after setup_fields of update because unique table can materialize table and we do not need field resolving after materialization.
2015-11-06 17:56:56 +01:00
Harin Vadodaria
0dbd5a8797 Bug#21973610: BUFFER OVERFLOW ISSUES
Description : Incorrect usage of sprintf/strcpy caused
              possible buffer overflow issues at various
              places.

Solution : - Fixed mysql_plugin and mysqlshow
           - Fixed regex library issues

Reviewed-By : Georgi Kodinov <georgi.kodinov@oracle.com>
Reviewed-By : Venkata S Murthy Sidagam <venkata.sidagam@oracle.com>
2015-11-06 16:41:55 +05:30
Balasubramanian Kandasamy
fd9831410d BUG#21950975 - MYSQL RPM INSTALLER(NEW STYLE) FAILS TO CREATE 'MYSQL' USER FOR EL5
- Remove -N option in useradd for EL5 platforms
2015-11-05 16:33:47 +05:30
Balasubramanian Kandasamy
5f2d3479ff BUG 22005375 - DEVEL PACKAGES INSTALL FAILS IF MYSQL-CONNECTOR-C-DEVEL-6.1.6 IS INSTALLED
As MySQL Connector C 6.1 is end of life, added conflict with mysql-connector-c-devel dependencies
2015-11-04 16:12:27 +05:30
Sreeharsha Ramanavarapu
75bfdea40f Bug #22123583: MYSQL 5.5: MAIN.SP HAS VALGRIND ISSUES
Issue:
-----
When a varchar column is used to fill the record in an
internal temporary table, the length of the string stored
in the column is not taken into account. Instead the
default length of packed data is used to copy with memmove.
This will cause valgrind issues since some bytes are
uninitialized.

SOLUTION:
---------
The solution is to take into account the length of the
string stored in the column while filling the record.

This fix is a backport of BUG#13389854.
2015-11-03 07:59:57 +05:30
Sreeharsha Ramanavarapu
5e9a50efc3 Bug #22023218: MYSQL 5.5: MAIN.FULLTEXT HAS VALGRIND ISSUES.
Issue
-----
This problem occurs when varchar columns are used in a
internal temporary table. The type of the field is set
incorrectly to the generic FIELD_NORMAL type. This in turn
results in an inaccurate calculation of the record length.
Valgrind issues will occur since initialization has not
happend for some bytes.

Fix
----
While creating the temporary table, the type of the field
needs to be to set FIELD_VARCHAR. This will allow myisam
to calculate the record length accurately.

This fix is a backport of BUG#13350136.
2015-11-03 07:43:54 +05:30
Chaithra Gopalareddy
9b6ac73419 Bug#20755389 SERVER CRASHES IN ITEM_FUNC_GROUP_CONCAT::FIX_FIELDS ON
2ND EXECUTION OF PS

Description:
------------
When MySQL calls 'EXECUTE stmt' firstly to deal with ORDER BY clause which is
similar with 'ORDER BY 1,(t2a.f2+1)' in find_order_in_list(), it believes the
first expression is a position, the function replaces the pointer of the first
expression with Item_field object associated with a temporary table field,
then releases it after the end of the execution, that behavior destroys the
pointer of first expression.

After that, when MySQL calls 'EXECUTE stmt' once more, the first expression
points to an invalid pointer, so it crashed.

Fix:
----
If an item of ORDER clause is a location, reset 'args' with a original value.
2015-11-02 16:30:57 +05:30
Shishir Jaiswal
1942506b82 DESCRIPTION
===========
When doing an upgrade, you execute mysql_upgrade. If
mysql_upgrade fails to connect or it connects with a user
without the proper privileges, it will return the error:

    FATAL ERROR: Upgrade failed

which is not very informative.

ANALYSIS
========

In main() and check_version_match(), the condition for
errors are clubbed together and throw the same error msg.
The functions need to be splitted up and the corresponding
error msgs have to be displayed.

FIX
===
Splitted the functions and added the specific error msg.
2015-10-29 13:35:32 +05:30
Srikanth B R
a60740607c BUG#22084221 : TEST IMPROVEMENT FOR MAIN.EVENTS_1
Issue: main.events_1 will fail after 10-10-2015 due
         to hardcoded dates specified with events.
 Fix: Replace harcoded dates with current dates and offset.
2015-10-26 16:19:11 +05:30
Mithun C Y
dea2340866 Bug #20447262: REPEATED EXECUTION OF PREPARED STATEMENTS FAILS, IF DEFAULT DATABASE IS CHANGED.
Issue:
======
While re-preparing the statement in
Prepared_statement::swap_prepared_statement for swapping
the database of PS we only swapped the db string but not
its length. This resulted in mismatch between the actual
string and its length. In one particular case where db
of PS was dropped, we have db as null pointer and length
as non-zero. strdup which used above values resulted in
invalid memory access.

Solution:
=========
In Prepared_statement::swap_prepared_statement also swap
db_length along with db variable. Also, remove
DBUG_ASSERT(db_length == copy->db_length) as this have
no meaning if they are 2 different entities.
2015-10-22 17:02:12 +05:30
Sergei Golubchik
df80420865 fix events_1 test for October 2015
cherry-picked 7454f1c5 from 10.1
2015-10-21 14:57:56 +02:00
Terje Røsten
74a503b4ce BUG#22024764 MAIN.EVENTS_1 FAILS BECAUSE IT USES ENDDATE OF 20151010
Move date 10 years forward to let test pass for some more years.
2015-10-16 09:56:09 +02:00
Arun Kuruvila
a86191c69c Bug #21235226 : THE --ENABLE-CLEARTEXT-PLUGIN IS NOT
IMPLEMENTED IN ALL CLIENT PROGRAMS

Description: Option "enable-cleartext-plugin" is not
available for the following client utilities:-
mysqldump
mysqlimport
mysqlshow
mysqlcheck

Analysis: The unavailability of this option limits the
features like PAM authentication from using the above
mentioned utilities.

Fix: Option "enable-cleartext-plugin" is implemented in the
above mentioned client utilities.
2015-10-14 12:00:39 +05:30
Arun Kuruvila
3846b08552 Bug #21602056 : CONCURRENT FLUSH PRIVILEGES + REVOKE/GRANT
CRASHES IN WILD_CASE_COMPARE!

Description:- Executing FLUSH PRIVILEGES and REVOKE/
GRANT concurrently crashes the server.

Analysis:- Concurrent FLUSH PRIVILEGES and REVOKE/GRANT
might trigger a small time frame in which REVOKE/GRANT
fetches the "acl_proxy_user" information as a part of
"acl_check_proxy_grant_access()". Meanwhile FLUSH PRIVILEGES
deletes the old acl structures as a part of "acl_reload()".
After which REVOKE/GRANT tries to access the hostname in
"wild_case_compare()" which leads to a crash because of the
invalid memory access.

Fix:- Mutex lock on "acl_cache" is acquired before fetching
"acl_proxy_user" information in
"acl_check_proxy_grant_access()".
2015-10-14 11:08:49 +05:30
Mithun C Y
f92dd6ae6f Bug #20007383: HANDLE_FATAL_SIGNAL (SIG=11) IN UPDATE_REF_AND_KEYS.
Issue:
======
The fulltext predicate is inside a subquery and involves
an outer reference; it thus cannot be used for FT index look-up,
but MySQL does not see it, which causes a illegal access.

Solution:
=========
Solution is backported from bug#21140088. Outer reference can
not be used as argument of the MATCH function. Added check for
outer reference.
2015-10-12 12:56:36 +05:30
Nirbhay Choubey
978c2a37c0 MDEV-7640: CHANGE MASTER TO doesn't work with prepared statements
When CHANGE MASTER was executed as a PS, its attributes were wrongly
getting reset toward the end of PREPARE. As a result, the subsequent
executions had no effect. Fixed by making sure that the CHANGE MASTER
attributes are preserved during the lifetime of the PS.
2015-10-11 17:21:51 -04:00
Sergei Golubchik
16c4b3c68b fixes for buildbot:
* OSX (mysqlimport freeing unallocated memory)
* Windows (didn't compile MSI)
* fulltest2 (innodb crashes in --embedded --big)
2015-10-09 16:43:59 +02:00