Commit graph

171880 commits

Author SHA1 Message Date
Sergei Golubchik
7436c3d6ab 5.6.34-79.1 2016-12-02 10:22:18 +01:00
Vicențiu Ciorbaru
e99990c631 MDEV-10744: Roles are not fully case sensitive
Due to the collation used on the roles_mapping_hash, key comparison
would work in a case-insensitive manner. This is incorrect from the
roles mapping perspective. Make use of a case-sensitive collation for that hash,
the same one used for the acl_roles hash.
2016-12-01 15:01:33 +01:00
Vicențiu Ciorbaru
525e214111 Remove labs() warning from maria and myisam storage engines 2016-12-01 15:01:33 +01:00
Igor Babaev
748d993cca Fixed bug mdev-11364.
The function Item_func_isnull::update_used_tables() must
handle the case when the predicate is over not nullable
column in a special way.
This is actually a bug of MariaDB 5.3/5.5, but it's probably
hard to demonstrate that it can cause problems there.
2016-11-29 11:29:07 -08:00
Jan Lindström
b209bc3eed MDEV-10427: innodb.innodb-wl5522-debug-zip fails sporadically in buildbot
Test intentionally crashes the server, thus corrupted pages possible.
2016-11-29 09:01:46 +02:00
Alexander Barkov
dd0ff30278 MDEV-11343 LOAD DATA INFILE fails to load data with an escape character followed by a multi-byte character
Partially backporting MDEV-9874 from 10.2 to 10.0

READ_INFO::read_field() raised the ER_INVALID_CHARACTER_STRING error
when reading an escape character followed by a multi-byte character.

Raising wellformedness errors in READ_INFO::read_field() was wrong,
because the main goal of READ_INFO::read_field() is to *unescape* the
data which was presumably escaped using mysql_real_escape_string(),
using the same character set with the one specified in
"LOAD DATA INFILE ... CHARACTER SET ..." (or assumed by default).

During LOAD DATA, multi-byte characters are not always scanned as a single
entity! In case of escaped data, parts of a multi-byte character can be
scanned on different loop iterations. So the old code erroneously tested
welformedness in the middle of a multi-byte character.

Moreover, the data after unescaping can go into a BLOB field, not a text field.
Wellformedness tests are meaningless in this case.

Ater this patch, wellformedness is only checked later, during
Field::store(str,length,cs) time. The loop that scans bytes only
makes sure to revert the changes made by mysql_real_escape_string().

Note, in some cases users can supply data which did not really go through
mysql_real_escape_string() and was escaped by some other means,
or was not escaped at all. The file reported in this MDEV contains
the string "\ä", which is an example of such improperly escaped data, as
- either there should be two backslashes:   "\\ä"
- or there should be no backslashes at all: "ä"
mysql_real_escape_string() could not generate "\ä".
2016-11-29 06:51:12 +04:00
Alexander Barkov
9976223c00 MDEV-11171 Assertion `m_cpp_buf <= ptr && ptr <= m_cpp_buf + m_buf_length' failed in Lex_input_stream::body_utf8_append(const char*, const char*) 2016-11-28 17:28:37 +04:00
Balasubramanian Kandasamy
c8f0eeb9c8 Bug#25159791 BASEDIR: COMMAND NOT FOUND ERROR WHILE STARTING SERVER WITH INIT SCRIPTS
(cherry picked from commit 7a39efab8a59ebdcd562fb788bc004ff338796ea)
2016-11-28 17:26:28 +05:30
Olivier Bertrand
2d78b25c49 - Fix null pointer java error when connecting to jdbc:drill driver.
By setting the context class loader.
  modified:   storage/connect/JavaWrappers.jar
  modified:   storage/connect/JdbcInterface.java
  modified:   storage/connect/mysql-test/connect/std_data/JdbcMariaDB.jar
2016-11-27 14:42:37 +01:00
Balasubramanian Kandasamy
64cc76bbf8 Followup fix for Bug#25088048 - ADDITIONAL ISSUES IN MYSQLD_SAFE
- Removed mysql.conf, mysqld.service and mysql-systemd-start from sles spec file

(cherry picked from commit 35c1adc17c1a99b2c256d374500437a6ce21339e)
2016-11-26 22:26:40 +05:30
Alexander Barkov
099ce1dda1 MDEV-11348 LOAD DATA LOCAL INFILE crashes the server on loading a backslash followed by a multi-byte character
The crash happened when if my_error() was called for any reasons during loading
(e.g. a bad multi-byte sequence or a bad GEOMETRY value was found).
The server sent both error and progress packets, so the client disconnected.
The server then crashed on a assert about a wrong packet order in Debug build.
The server also tried to read from a closed socket when calling
READ_INFO::skip_data_till_eof().

As the crash happened only with "mysql" running in interactive mode,
no tests are possible. The problem was not reproducible with
"mysqltest" or "mysql" in batch mode.
2016-11-25 15:59:47 +04:00
mysql-builder@oracle.com
202355104f 2016-11-25 14:55:15 +05:30
Dyre Tjeldvoll
42732cc195 Bug#25092566: CREATE TABLE WITH DATA DIRECTORY CLAUSE DOES NOT REQUIRE SPECIAL
PRIVILEGES

Require FILE privilege when creating tables using external data directory or
index directory.
2016-11-25 14:55:01 +05:30
Terje Rosten
53230ba274 Bug#25088048 ADDITIONAL ISSUES IN MYSQLD_SAFE
Don't read --ledir option from config file.
Ignore current working for finding location of mysqld
Remove use of chown/chmod in scripts.
Be helpful only when basedir is /var/log or /var/lib.
Removed unused systemd files for SLES.
Set explicit basedir in scripts.
2016-11-25 14:54:08 +05:30
Jan Lindström
03ddc19ab2 MDEV-6424: MariaDB server crashes with assertion failure in file ha_innodb.c line 11652
This is not a fix, this is instrumentation to find out is MySQL frm dictionary
and InnoDB data dictionary really out-of-sync when this assertion is fired,
or is there some other reason (bug).
2016-11-17 15:15:20 +02:00
Alexander Barkov
42a398b59b Fixing a typo in the patch for MDEV-10780, which caused default.test failure.
Fixing the "connect" command to use "localhost" instead of "127.0.0.1"
to make it work with both "mtr" and "mtr --embedded".
2016-11-17 12:04:39 +04:00
Kristian Nielsen
390f2a013b Fix incorrect reading of events from relaylog in parallel replication.
The SQL thread keeps track of the position in the current relay log from
which to read the next event. This position is not normally used, but a
certain interaction with the IO thread can cause the SQL thread to re-open
the relay log and seek to the stored position.

In parallel replication, there were a couple of places where the position
was not updated. This created a race where a re-open of the relay log could
seek to the wrong position and start re-reading and processing events
already handled once, causing various kinds of problems.

Fix this by moving the position update into a single place in
apply_event_and_update_pos(), which should ensure that the position is
always updated in the parallel replication case.

This problem was found from the testcase of MDEV-10863, but it is logically
a separate problem.
2016-11-16 11:00:38 +01:00
Kristian Nielsen
f1fcc1fc10 Back-port Master_info::using_parallel() to 10.0.
This has no functional changes, but it helps avoid merge problems from 10.0
to 10.1. In 10.0, code that checks for parallel replication uses
opt_slave_parallel_threads > 0, but this check needs to be
mi->using_parallel() in 10.1. By using the same check in 10.0 (with
unchanged semantics), merge problems to 10.1 are avoided.
2016-11-15 23:00:11 +01:00
Kristian Nielsen
9a09072880 Merge branch 'mdev10863' into 10.0 2016-11-15 11:08:01 +01:00
Olivier Bertrand
aae67535cc - MDEV-11051 place Java classes ApacheInterface and JdbcInterface into single jar file.
Try to fix the INSTALL command.
  modified:   storage/connect/CMakeLists.txt

- Make some JDBC tests available on Windows
  modified:   storage/connect/mysql-test/connect/t/jdbc.test
  modified:   storage/connect/mysql-test/connect/t/jdbc_new.test
  added:      storage/connect/mysql-test/connect/t/windows.inc
2016-11-14 19:20:40 +01:00
Vladislav Vaintroub
adc38ed811 Restore MY_WME flag for my_pread in read_ddl_log_entry, fix errors in buildbot 2016-11-14 08:02:35 +01:00
Igor Babaev
96b62b5514 Fixed bug mdev-11161.
The flag TABLE_LIST::fill_me must be reset to false at the prepare
phase for any materialized derived table used in the executed query.
Otherwise if the optimizer decides to generate a key for such a table
it is generated only for the first execution of the query.
2016-11-11 20:55:25 -08:00
Vladislav Vaintroub
10aee66896 MDEV-11248 Fix passing offset parameter to my_file_pread in read_ddl_log_file_entry 2016-11-10 23:47:42 +00:00
Alexander Barkov
1d9b043a1f A join patch for MDEV-10780 and MDEV-11265
MDEV-10780 Server crashes in in create_tmp_table
MDEV-11265 Access defied when CREATE VIIEW v1 AS SELECT DEFAULT(column) FROM t1

Item_default_value and Item_insert_value erroneously derive from Item_field
but forgot to override some methods that apply only to true fields,
so the server code mixes Item_{default|insert}_value instances with real
table fields (i.e. true Item_field) in some cases.
Overriding a few methods to avoid this.

TODO: we should eventually derive Item_default_value (and Item_insert_value)
directly from Item, as they don't really need the entire Item_field,
Item_ident and Item_result_field functionality.
Only the member "Field *field" related functionality is actually needed,
like val_xxx(), is_null(), get_geometry_type(), charset_for_protocol(), etc.
2016-11-10 18:15:36 +04:00
Olivier Bertrand
5884aa15d4 - Fix MDEV-11234. Escape quoting character. Should be doubled.
Now it is also possible to escape it by a backslash.
  modified:   storage/connect/tabfmt.cpp

- Prepare making VEC table type support conditional.
  VEC tables might be unsupported in future versions
  modified:   storage/connect/CMakeLists.txt
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/xindex.cpp

- MDEV-11067 suggested to add configuration support to the Apache wrapper.
  Was added but commented out until prooved it is really useful.
  modified:   storage/connect/ApacheInterface.java
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jdbccat.h
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jdbconn.h
  modified:   storage/connect/tabjdbc.cpp
  modified:   storage/connect/tabjdbc.h

- Remove useless members.
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jdbconn.h

- New UDF countin.
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
2016-11-06 14:57:27 +01:00
Kristian Nielsen
717f212840 MDEV-10863: parallel replication tries to continue from wrong position
This occured when the SQL thread (but not the IO thread) stops while
GTID and parallel replication are used with multiple domain ids in the
GTID position, and is restarted.

In this case, the SQL needs to start some way back in the relay log,
applying or skipping events within each replication domain as
appropriate.

The SQL threads starts at the beginning of an old relay log file, and
this position may be in the middle of an event group. The bug was that
such partial event group could be re-applied, causing replication
corruption.

This patch fixes the issue, by making sure to skip any initial events
that were part of an earlier (already applied) event group.
2016-11-04 12:33:42 +01:00
Vladislav Vaintroub
e0f48e5ce9 MDEV-11214 Windows : MSI installation fails, if run by a service user (e.g LocalSystem)
Skip  permission for data directory for LogonUser, if installation
runs by one of the service accounts (determined from their well-known SID).
There is no real LogonUser in this case.
2016-11-03 16:21:48 +00:00
Jan Lindström
9741e0ea72 Initialize zip_dict_ids table and avoid referencing array items
as currently MariaDB does not support compressed columns.
2016-11-01 07:52:28 +02:00
Jan Lindström
923a7f8675 MDEV-11188: rpl.rpl_parallel_partition fails with valgrind warnings in buildbot and outside 2016-10-31 12:16:53 +02:00
Daniel Bartholomew
425d341b98 bump the VERSION 2016-10-28 11:46:15 -04:00
Thayumanavar S
c3cf7f47f0 BUG#24487120 - SLAVE'S SLAVE_SQL_RUNNING IS STOPPED DURING
LOAD DATA AT MASTER.

Revert "BUG#23080148 - BACKPORT BUG 14653594 AND BUG 20683959 TO"

This reverts commit 1d31f5b3090d129382b50b95512f2f79305715a1.
The commit causes replication incompatibility between minor revisions
and based on discussion with Srinivasarao, the patch is reverted.
2016-10-28 14:45:03 +02:00
Sergey Vojtovich
cb7b03b00d MDEV-11164 - hardening-wrapper has been removed from Debian Sid
The hardening-wrapper package has been removed from Debian Sid. Remove
dependency and relevant settings.
2016-10-28 13:34:13 +04:00
Vladislav Vaintroub
2a2e79b702 MDEV-11157 Windows - Upgrade installer to use HeidiSQL 9.4 2016-10-27 19:45:44 +00:00
Vladislav Vaintroub
d8cb6822bc VS2015 build fixes
- new location of signtool
- silence a nonsensical warning from stl  header
(complain about noexcept() function attribute, if /EHsc is not set)
2016-10-27 19:45:44 +00:00
Vladislav Vaintroub
aec43216c8 MDEV-9409 Windows - workaround VS2015 CRT bug that makes
mysqldump/mysql_install_db.exe fail

The bug is described in
https://connect.microsoft.com/VisualStudio/Feedback/Details/1902345

When reading from a pipe in text mode, using CRT function such as fread(),
some newlines may be lost. Workaround is to use binary mode on reading side
and if necessary, replace \r\n with \n.
2016-10-27 19:45:44 +00:00
Oleksandr Byelkin
eca8c324e9 Typo fixed. 2016-10-27 19:07:55 +02:00
Sergei Golubchik
a0795655ab MDEV-10846 Running mysqldump backup twice returns error: Table 'mysql.proc' doesn't exist.
Update test results after 26b87c3
2016-10-27 12:23:31 +02:00
Igor Babaev
d451d772fd Fixed bug mdev-9628.
In the function create_key_parts_for_pseudo_indexes()
the key part structures of pseudo-indexes created for
BLOB fields were set incorrectly.
Also the key parts for long fields must be 'truncated'
up to the maximum length acceptable for key parts.
2016-10-26 20:45:35 -07:00
Igor Babaev
9d4a0dde0a Fixed bug mdev-11096.
1. When min/max value is provided the null flag for it must be set to 0
in the bitmap Culumn_statistics::column_stat_nulls.
2. When the calculation of the selectivity of the range condition
over a column requires min and max values for the column then we
have to check that these values are provided.
2016-10-26 20:45:35 -07:00
Alexey Botchkov
26b87c332f MDEV-10846 Running mysqldump backup twice returns error: Table
'mysql.proc' doesn't exist.

        The mysql_rm_db() doesn't seem to expect the 'mysql' database
        to be deleted. Checks for that added.
        Also fixed the bug MDEV-11105 Table named 'db'
        has weird side effect.
        The db.opt file now removed separately.
2016-10-27 00:04:26 +04:00
Sergei Golubchik
22490a0d70 MDEV-8345 STOP SLAVE should not cause an ERROR to be logged to the error log
cherry-pick from 5.7:
  commit 6b24763
  Author: Manish Kumar <manish.4.kumar@oracle.com>
  Date:   Tue Mar 27 13:10:42 2012 +0530

  BUG#12977988 - ON STOP SLAVE: ERROR READING PACKET FROM SERVER: LOST CONNECTION
                 TO MYSQL SERVER
  BUG#11761457 - ERROR 2013 + "ERROR READING RELAY LOG EVENT" ON STOP SLAVEBUG#12977988 - ON STOP SLAVE: ERROR READING PACKET FROM SERVER: LOST CONNECTION
               TO MYSQL SERVER
2016-10-26 18:44:34 +02:00
Sergei Golubchik
25932708b1 backport include/search_pattern_in_file.inc from 10.1 2016-10-26 18:44:34 +02:00
Jan Lindström
5569ac0059 MDEV-11126: Crash while altering persistent virtual column
Problem was that if old virtual column is computed and stored there
was no check if new column is really virtual column.
2016-10-26 16:46:55 +03:00
Sergey Vojtovich
59a7bc35fc Removed duplicate open_strategy assignments
It is set in sql_yacc.yy.
2016-10-26 14:12:02 +04:00
Sergey Vojtovich
a3c980b381 MDEV-10824 - Crash in CREATE OR REPLACE TABLE t1 AS SELECT spfunc()
Code flow hit incorrect branch while closing table instances before removal.
This branch expects thread to hold open table instance, whereas CREATE OR
REPLACE doesn't actually hold open table instance.

Before CREATE OR REPLACE TABLE it was impossible to hit this condition in
LTM_PRELOCKED mode, thus the problem didn't expose itself during DROP TABLE
or DROP DATABASE.

Fixed by adjusting condition to take into account LTM_PRELOCKED mode, which can
be set during CREATE OR REPLACE TABLE.
2016-10-26 14:12:02 +04:00
Daniel Black
9155cc7090 MDEV-10292: Tokudb - PerconaFT - compile error in recent gcc
The following directives to ignore warnings where in the PerconaFT build in tokudb.
These generate errors when g++ ... -o xxx.so is used to compile are shared object.

As these don't actually hit any warnings they have been removed.

* -Wno-ignored-attributes
* -Wno-pointer-bool-conversion

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2016-10-26 11:51:56 +02:00
Vladislav Vaintroub
ad5b88a892 Fix build error in XtraDB on Windows.
coming from Percona's workaround for glibc bug
http://bugs.mysql.com/bug.php?id=82886
2016-10-26 09:26:34 +00:00
Sergei Golubchik
bd4568a111 Merge branch 'bb-10.0-serg' into 10.0 2016-10-26 10:49:31 +02:00
Vladislav Vaintroub
82ab92bd66 MDEV-10951 Field_newdate::cmp access violation
The crash is caused by macro uint3korr() accessing memory (1 byte) past
the end of allocated page. The macro is written such it reads 4 bytes
instead of 3 and discards the value of the last byte.

However, it is not always guaranteed that all uint3korr accesses will be
valid (i.e that the caller allocates an extra byte after the value).

In particular, the tree in Item_func_group_concat does not account for
any extra bytes that it would need for comparison of keys in some cases
(Field_newdate::cmp, Field_medium::cmp)

The fix change uint3korr so it does not access extra bytes.
2016-10-25 22:35:35 +00:00
Sergei Golubchik
2cfccbe433 Merge branch 'connect/10.0' into 10.0 2016-10-25 21:59:06 +02:00