Commit graph

167968 commits

Author SHA1 Message Date
Marko Mäkelä
cfb3361748 MDEV-12569 InnoDB suggests filing bugs at MySQL bug tracker
Replace all references in InnoDB and XtraDB error log messages
to bugs.mysql.com with references to https://jira.mariadb.org/.
2017-10-26 11:02:19 +03:00
Marko Mäkelä
439a7c994a MDEV-14051 'Undo log record is too big.' error occurring in very narrow range of string lengths
InnoDB was writing unnecessary information to the
update undo log records. Most notably, if an indexed column is updated,
the old value of the column would be logged twice: first as part of
the update vector, and then another time because it is an indexed column.

Because the InnoDB undo log record must fit in a single page,
this would cause unnecessary failure of certain updates.

Even after this fix, InnoDB still seems to be unnecessarily logging
indexed column values for non-updated columns. It seems that non-updated
secondary index columns only need to be logged when a PRIMARY KEY
column is updated. To reduce risk, we are not fixing this remaining flaw
in GA versions.

trx_undo_page_report_modify(): Log updated indexed columns only once.
2017-10-24 17:00:04 +03:00
Karthik Kamath
a542209b9e BUG#26529369: CREATE INDEX WITH LONG COMMENT CAUSE
UNEXPECTED ERROR

ANALYSIS:
=========
Creating many indexes with large amount of index
information causes a server exit.

FIX:
====
A appropriate error is reported when the cumulative index
information length exceeds the 2 byte range (i.e 65535).
2017-10-23 10:56:20 +05:30
Sreeharsha Ramanavarapu
84c32cdbe7 Bug #26867652: INCORRECT BEHAVIOR WITH PREPARE STATEMENT
AND PARAM IN ORDER BY

Issue:
------
This issue can occur when the ORDER BY list refers to a
column that contains a parameter in the select list.

Solution:
---------
In JOIN::update_depend_map and get_sort_by_table, the
ORDER BY list's used_tables isn't checked for parameters.
This can result in incorrect behavior.

This is a partial backport of Roy's
2017-10-19 10:19:36 +05:30
Daniel Bartholomew
fb5fe497e5 bump the VERSION 2017-10-18 02:36:55 -04:00
Sergei Golubchik
b000e16956 Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME', NULL))
based on:

commit f7316aa0c9
Author: Ajo Robert <ajo.robert@oracle.com>
Date:   Thu Aug 24 17:03:21 2017 +0530

    Bug#26361149  MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
                           COL), NAME_CONST('NAME', NULL))

    Backport of Bug#19143243 fix.

    NAME_CONST item can return NULL_ITEM type in case of incorrect arguments.
    NULL_ITEM has special processing in Item_func_in function.
    In Item_func_in::fix_length_and_dec an array of possible comparators is
    created. Since NAME_CONST function has NULL_ITEM type, corresponding
    array element is empty. Then NAME_CONST is wrapped to ITEM_CACHE.
    ITEM_CACHE can not return proper type(NULL_ITEM) in Item_func_in::val_int(),
    so the NULL_ITEM is attempted compared with an empty comparator.
    The fix is to disable the caching of Item_name_const item.
2017-10-17 11:04:09 +02:00
Sergei Golubchik
df5f25fa7a Merge branch 'mysql/5.5' into 5.5 2017-10-17 10:18:17 +02:00
Sergei Golubchik
b036b6b594 MDEV-13937 Aria engine: Internal Error 160 after partition handling
Partition wasn't setting HA_OPTION_PACK_RECORD on ALTER TABLE
if the row format was PAGE.

(so one bit in the null bitmap was reserved for a deleted bit -
see make_empty_rec - and all actual null bits were one off)
2017-10-17 07:37:39 +02:00
Sergei Golubchik
19a702a85c MDEV-14056 DROP TEMPORARY TABLE IF EXISTS causes error 1290 with read_only option
if it's a DROP TABLE, we cannot detect whether a table is
temporary by looking in thd->temporary_tables - because the
table might simply not exist at all.
2017-10-17 07:37:39 +02:00
Sergei Golubchik
421716391b MDEV-13912 Can't refer the same column twice in one ALTER TABLE
backport ce6c0e584e

MDEV-8960: Can't refer the same column twice in one ALTER TABLE

Problem was that if column was created in alter table when
it was refered again it was not tried to find from list
of current columns.

mysql_prepare_alter_table:
  There is two cases
    (1) If alter table adds a new column and then later alter
        changes the field definition, there was no check from
	list of new columns, instead an incorrect error was given.
    (2) If alter table adds a new column and then later alter
        changes the default, there was no check from list of
	new columns, instead an incorrect error was given.
2017-10-17 07:37:39 +02:00
Sergei Golubchik
93144b9e92 MDEV-13440 mysql_install_db fails with hard-coded langdir
always search in compile-time specified paths
INSTALL_BINDIR, INSTALL_SBINDIR, INSTALL_MYSQLSHAREDIR. User
can set them to arbitrary values, it's not enough to search only
in their usual values of bin, sbin and libexec, share and share/mysql.
2017-10-17 07:37:39 +02:00
Sergei Golubchik
52516706c8 cleanup mysql_install_db
1. detect resolveip location, don' assume it's in $basedir/bin
2. don't guess $scriptdir to (incorrectly) construct the $0 path
3. rename find_in_basedir -> find_in_dirs, don't prepend $basedir
   automatically. This allows to use identical path lists in
   find_in_dirs and in cannot_find_file.
4. move search path lists to CMakeLists.txt to avoid specifying the
   same path list twice (in find_in_dirs and in cannot_find_file).
2017-10-17 07:37:39 +02:00
Sergei Golubchik
d76f5774fe MDEV-13459 Warnings, when compiling with gcc-7.x
mostly caused by -Wimplicit-fallthrough
2017-10-17 07:37:39 +02:00
Nawaz Nazeer Ahamed
6ca6899683 Merge branch 'mysql-5.5.58-release' into mysql-5.5 2017-10-16 15:21:04 +05:30
Oleksandr Byelkin
3b7aa3017b Cleanup usage of DBUG_ASSERTS. 2017-10-13 19:32:38 +02:00
Oleksandr Byelkin
235b68299b MDEV-9619: Assertion `null_ref_table' failed in virtual table_map Item_direct_view_ref::used_tables() const on 2nd execution of PS
Refer left expression indirectly in case it changes from execution to execution.
2017-10-13 19:32:38 +02:00
Igor Babaev
2bab29ebba Fixed the bug mdev-13135.
For each SELECT the list sj_nests is built by the
function simplify_joins() when scanning different
join nests. This function may be called several
times for the same join nest. That's why before
adding a new member to sj_nests it is necessary
to check if it's already in the list.
The code of simplify_joins() lacked this check and
as a result it could cause memory overwright for
some queries.
2017-10-13 07:24:54 -07:00
Sergey Vojtovich
8be76a6a90 MDEV-10892 - rpl.rpl_semi_sync_uninstall_plugin fails with Assertion `0' failure
in buildbot

Removed plugin_array_version: it is being checked without mutex protection and
thus is prone to data race and race conditions. In effect plugins are not
protected from concurrent destruction.

Removed state_mask inversion: doesn't seem to make any sense.

When collecting local plugins list, only add plugins that match state_mask.

Use plugin ref counting to protect against concurrent plugin destruction.
2017-10-13 16:50:58 +04:00
Oleksandr Byelkin
a4868c3509 MDEV-9208: Function->Function->View = Mysqld segfault (Server crashes in Dependency_marker::visit_field on 2nd execution with merged subquery)
Prevent crossing name resolution border in finding item tables.
2017-10-13 12:35:17 +02:00
Alexander Barkov
991b9ee735 MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535 2017-10-13 07:06:09 +04:00
Vesa Pentti
93aadda513 MDEV-13149 -- show function status now works with PAD_CHAR_TO_FULL_LENGTH 2017-10-10 16:16:12 +03:00
Alexander Barkov
c2509a1588 MDEV-13972 crash in Item_func_sec_to_time::get_date 2017-10-10 10:35:12 +04:00
Tor Didriksen
aa6e69db10 Backport patch for Bug#16877045 5.6-CLUSTER-7.3 WIN32 SQL_YACC.CC BUILD PROBLEM
Building with ninja shows the problem:
cmake .. -G Ninja
ninja
ninja: error: dependency cycle: sql/GenServerSource -> sql/CMakeFiles/GenServerSource -> sql/sql_builtin.cc -> cmake_order_depends_target_sq
 sql/GenServerSource

Bug#16877045 5.6-CLUSTER-7.3 WIN32 SQL_YACC.CC BUILD PROBLEM
 - Somewhat circular dependency caused by the configured files sql_builtin.cc  being included as
    part of the files to generate in sql/
 - Move sql_builtin.cc out of GEN_SOURCES variable.
 - Create new variable CONF_SOURCES to be used for configured files.
2017-10-09 16:24:11 +02:00
Alexander Barkov
e30b6a983f MDEV-11819 NO_ZERO_IN_DATE: Incorrect generated column value 2017-10-06 18:23:40 +04:00
Oleksandr Byelkin
bea99275de MDEV-13595: mariadb-10.2.8/storage/maria/ma_loghandler.c:2730]: (style) Array index 'chunk_offset' is used before limits check.
In fact just a cosmetic fix, code was safe because translog_get_first_chunk_offset return offsets inside the page.
2017-10-05 15:07:21 +02:00
Marko Mäkelä
028d253dd7 MDEV-13980 InnoDB fails to discard record lock when discarding an index page
btr_cur_pessimistic_delete(): Discard a possible record lock also in
the case when the record was the only one in the page. Failure to
do this would corrupt the record lock data structures in a partial
rollback (ROLLBACK TO SAVEPOINT or rolling back a row operation due
to some error, such as a duplicate key in a unique secondary index).
2017-10-02 10:38:35 +03:00
Alexey Botchkov
a47d16907d MDEV-13137 MySQL 5.6.23 Crashes when SET GLOBAL server_audit_logging=OFF;
The MySQL 5.6 doesn't always send the MYSQL_AUDIT_GENERAL_LOG
        notification. So we have to suppress the log_current_query()
        in this case.
2017-09-19 13:08:24 +04:00
Vicențiu Ciorbaru
e7bb818116 Merge remote-tracking branch 'merge/merge-xtradb-5.5' into 5.5 2017-09-19 00:31:15 +03:00
Vicențiu Ciorbaru
f534eef794 5.5.57-38.9 2017-09-19 00:25:34 +03:00
mysql-builder@oracle.com
1da916c37e 2017-09-13 20:45:34 +05:30
Anushree Prakash B
5ac61b2af0 Bug#26372491 - RCE THROUGH THE MISHANDLE OF BACKSLASH
DESCRIPTION:
===========
The bug is related to incorrect parsing of SQL queries
when typed in on the CLI. The incorrect parsing can
result in unexpected results.

ANALYSIS:
========
The scenarios mainly happens for identifier names
with a typical combination of backslashes and backticks.
The incorrect parsing can either result in executing
additional queries or can result in query truncation.
This can impact mysqldump as well.

FIX:
===
The fix makes sure that such identifier names are
correctly parsed and a proper query is sent to the
server for execution.

(cherry picked from commit 31a372aa1c2b93dc75267d1f05a7f7fca6080dc0)
2017-09-13 20:44:55 +05:30
mysql-builder@oracle.com
cf3fe5a2df 2017-09-13 12:14:06 +05:30
Tor Didriksen
d52edb75bb Bug#23072792 MYSQL_GROUP_SUFFIX DOES NOT WORK
Reintroduce environment variable MYSQL_GROUP_SUFFIX to be used as
--default-group-suffix value if not already set.

The environment variable was accidentally renamed to DEFAULT_GROUP_SUFFIX_ENV
in MySQL server 5.5.
2017-09-08 16:48:15 +02:00
Anushree Prakash B
43632f4cd5 Bug#26372491 - RCE THROUGH THE MISHANDLE OF BACKSLASH
DESCRIPTION:
===========
The bug is related to incorrect parsing of SQL queries
when typed in on the CLI. The incorrect parsing can
result in unexpected results.

ANALYSIS:
========
The scenarios mainly happens for identifier names
with a typical combination of backslashes and backticks.
The incorrect parsing can either result in executing
additional queries or can result in query truncation.
This can impact mysqldump as well.

FIX:
===
The fix makes sure that such identifier names are
correctly parsed and a proper query is sent to the
server for execution.
2017-09-08 18:29:07 +05:30
Balasubramanian Kandasamy
14176f7147 Bug#26742748 - 8.0 DOCKER IMAGE RPM GENERATES 5.7 DOC URL IN /ETC/MY.CNF 2017-09-07 16:11:15 +05:30
Balasubramanian Kandasamy
91e9770f72 Bug#26747305 - HOSTNAME: COMMAND NOT FOUND WHILE STARTING CONTAINER WITH 5.5 DOCKER IMAGE
- Add hostname package for docker rpm builds.
2017-09-06 17:48:42 +05:30
Sreeharsha Ramanavarapu
ad00de4077 Bug #26704451: INCORRECT BEHAVIOR WITH USE OF CERTAIN
CHARSETS AND SHA2

Missed pushing to 5.5.
2017-09-06 06:45:50 +05:30
Aakanksha Verma
9ae160af76 2017-08-31 15:44:42 +05:30
Balasubramanian Kandasamy
5cb6382a6c Raise version number after cloning 5.5.58 2017-08-29 15:42:38 +05:30
Ajo Robert
f7316aa0c9 Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME', NULL))

Backport of Bug#19143243 fix.

NAME_CONST item can return NULL_ITEM type in case of incorrect arguments.
NULL_ITEM has special processing in Item_func_in function.
In Item_func_in::fix_length_and_dec an array of possible comparators is
created. Since NAME_CONST function has NULL_ITEM type, corresponding
array element is empty. Then NAME_CONST is wrapped to ITEM_CACHE.
ITEM_CACHE can not return proper type(NULL_ITEM) in Item_func_in::val_int(),
so the NULL_ITEM is attempted compared with an empty comparator.
The fix is to disable the caching of Item_name_const item.
2017-08-24 17:03:21 +05:30
Arun Kuruvila
f2f6025a44 Bug#26482173: TLS CIPHER NEGOTIATION INCORRECTLY MATCHES ON
LAST BYTE ONLY (YASSL)


Description:- TLS cipher negociation happens incorrectly
leading to the use of a different

Analysis:- YaSSL based MySQL server will compare only the
last byte of each cipher sent in the Client Hello message.
This can cause TLS connections to fail, due to the server
picking a cipher which the client doesn't actually support.

Fix:- A fix for detecting cipher suites with non leading
zeros is included as YaSSL only supports cipher suites with
leading zeros.
2017-08-24 14:19:38 +05:30
Nisha Gopalakrishnan
be901b60ae Bug#26390632: CREATE TABLE CAN CAUSE MYSQL TO EXIT.
Analysis
========
CREATE TABLE of InnoDB table with a partition name
which exceeds the path limit can cause the server
to exit.

During the preparation of the partition name,
there was no check to identify whether the complete
path name for partition exceeds the max supported
path length, causing the server to exit during
subsequent processing.

Fix
===
During the preparation of partition name, check and report
an error if the partition path name exceeds the maximum path
name limit.

This is a 5.5 patch.
2017-08-23 12:59:38 +05:30
Tor Didriksen
ebd96c3149 Bug#19875294 ASSERTION `SRC' FAILED IN MY_STRNXFRM_UNICODE (SIG 6 -STRINGS/CTYPE-UTF8.C:5151)
Backport from 5.7 to 5.5 Field_set::val_str()
should return String("", 0, cs) rather than String(NULL, 0, cs)
2017-08-23 07:32:49 +02:00
Venkatesh Duggirala
d75f8a1742 Bug#24763131 LOCAL-INFILE DEFAULT SHOULD BE DISABLED
Problem & Analysis: Slave's Receiver thread, Applier thread and worker
    threads are created with LOCAL-INFILE option enabled. As the document
    says https://dev.mysql.com/doc/refman/5.7/en/load-data-local.html,
    there are some issues if a thread enables local infile.
    This flag should be enabled with care. But for the above mentioned
    internal threads, server is enabling it at the time of creation.

Fix: Further analysis on the code shows that none of threads really
    need this flag to be enabled at any time as Slave never executes
    "LOAD DATA LOCAL INFILE" after reading it from Relay log.
    Applier thread removes "LOCAL" before start executing the query.
2017-08-23 09:16:12 +05:30
Elena Stepanova
d947d1bf6e Do not stop repeating a test even if some executions are skipped 2017-08-18 13:35:40 +03:00
Oleksandr Byelkin
bcc1ba9218 MDEV-11240: Server crashes in check_view_single_update or Assertion `derived->table' failed in mysql_derived_merge_for_insert
Before "merge" view shoud be inited to maintaing transitive attributes like "multitable".
2017-08-16 19:18:39 +02:00
Elena Stepanova
e866e4cdbe MTR's internal check of main.log_tables-big failed
The test wasn't restoring log_output properly.
Also added output of query_time in case of wrong result, to
investigate the failure described in MDEV-13408
2017-08-15 20:10:04 +03:00
Varun Gupta
0739179857 MDEV-13458: Wrong result for aggregate function with distinct clause when the value for tmp_table_size is small
Fixed by making sure that the sort buffer would have atleast MERGEBUFF2 keys.
Also fixed MDEV-13457 by making sure that an empty tree is never dumped to the disk
2017-08-09 18:09:04 +05:30
Deepa Dixit
6a6d5bc98a Bug#26161247: MTR: --NOREORDER IS SEARCHING FOR TEST SCRIPT ONLY IN MAIN SUITE
Issue:
------
Running MTR with the --no-reorder option by specifying test cases on the
command line, without prefixing the suite name results in an error saying the
test case was not found in the main suite. This is because MTR looks for the
test case only in the main suite, and no other suites.

Fix:
----
The fix involves searching for the test in every suite if only the test name
is specified. This back-ports two bug fixes: Bug#24967869 and Bug#24365783

Reviewed-by: Pavan Naik <pavan.naik@oracle.com>
RB: 16812
2017-07-25 12:09:33 +05:30
Daniel Bartholomew
c8a0244e95 bump the VERSION 2017-07-19 11:47:59 -04:00