Commit graph

171483 commits

Author SHA1 Message Date
Sergei Golubchik
f1aae861ee 5.6.30 2016-04-26 19:05:10 +02:00
Sergey Vojtovich
4f1ad43992 MDEV-9987 - gen_lex_hash leaks memory, making LeakSanitizer builds fail
Fixed memory leaks in gen_lex_hash.
2016-04-26 16:15:15 +04:00
Sergei Golubchik
29868de2ff MDEV-9986 Full-text search of the utf8mb4 column causes crash
take into account that agg_arg_charsets_for_comparison()
can replace Item_field's with Item_func_conv_charset
2016-04-26 12:58:14 +02:00
Alexey Botchkov
44554d6111 MDEV-9605 mysqlbinlog does not accept ssl-ca option as expected.
Added SSL support to the mysqlbinlog.
2016-04-26 14:37:19 +04:00
Sergei Golubchik
7f5ceb7768 disable main.wait_timeout_not_windows for embedded 2016-04-26 11:49:35 +02:00
Monty
0dbc66498d Fix for MDEV-9679 main.delayed fails sporadically
Problem was that notify_shared_lock() didn't abort an insert delayed thread
if it was in thr_upgrade_write_delay_lock().

ALTER TABLE first takes a weak_mdl_lock, then a thr_lock and then tries to upgrade
the mdl_lock.
Delayed insert thread first takes a mdl lock followed by a
thr_upgrade_write_delay_lock()
This caused insert delay to wait for alter table in thr_lock, while
alter table was waiting for the mdl lock by insert delay.

Fixed by telling mdl to run thr_lock_abort() for the insert delay thread table.
We also set thd->mysys_var->abort to 1 for the delay thread when it's killed
by alter table to ensure it doesn't ever get locked in thr_lock.
2016-04-26 12:22:02 +03:00
Sergei Golubchik
2220480731 MDEV-7775 Wrong error message (Unknown error) when idle sessions are killed after wait_timeout
restore the error message that was removed by mistake in ec38c1bbd7
2016-04-25 22:46:43 +02:00
Sergei Golubchik
a98ecc2aaf support SEARCH_RANGE in search_pattern_in_file.inc
Backport a part of

commit 439f75f
Author: Kristian Nielsen <knielsen@knielsen-hq.org>
Date:   Mon Jun 30 13:59:21 2014 +0200

    Fix test failures in rpl.rpl_checksum and rpl.rpl_gtid_errorlog.
2016-04-25 22:46:43 +02:00
Monty
f6cc7f1bdc Fixed failing test cases and compiler warnings
- Fixed wait condition in kill_processlist-6619
- Updated Ssl_chiper for openssl tests
- Added supression for valgrinds when using libcrypto
- Fixed wrong argument to pthread_mutex in server_audit.c when compiling with debug
- Adding missing debug_sync_update() to debug_sync.h
- Added initializers to some variables and fixed error handling in jsonudf.cpp
- Fixed cluster_filter_unpack_varchar which doesn't have a stable index type.
- Updated compiler_warnings.supp
2016-04-25 15:37:24 +03:00
Olivier Bertrand
10de43866f Merge branch 'ob-10.0' into 10.0 2016-04-25 11:41:48 +02:00
Olivier Bertrand
26adbb2dd5 - Fix an error causing MYSQL table to fail saying "no result set"
when joining a table to a MYSQL indexed table.
  modified:   storage/connect/myconn.cpp
  modified:   storage/connect/myconn.h
  modified:   storage/connect/tabmysql.cpp

- Add more tests to the mysql_index.test file
  modified:   storage/connect/mysql-test/connect/r/mysql_index.result
  modified:   storage/connect/mysql-test/connect/t/mysql_index.test

- Fix and error causing remote indexing to fail when for not unique index.
  Was experienced with MYSQL, ODBC and JDBC tables.
  modified:   storage/connect/connect.cc

- Fix MDEV-9966 (zero lines returned)
  modified:   storage/connect/ha_connect.cc
  modified:   storage/federatedx/ha_federatedx.cc
2016-04-25 00:13:06 +02:00
Sergey Vojtovich
2b7573ecdd MDEV-9975 - main.partition_innodb_plugin fails sporadically
Fixed wait condition to wait for InnoDB to actually acquire row locks instead
of waiting for thread to enter "Searching rows for update" state (which happens
earlier).

Also use default wait timeout, 2 seconds can be too few for threads to enter
appropriate state.
2016-04-24 20:35:27 +04:00
Sergei Golubchik
ce38adddfa MDEV-9617 solaris sparc build fails on 10.0
Spider:
  SunPro only supports array declarations with
  constant size. Spider already has a workaround for
  that, inside #ifdef _MSC_VER. Enable this code
  also for __SUNPRO_CC

Connect:
  Don't use anonymous union.
  Cast for mmap.
  Don't pass gcc-ish -W... options to SunPro
2016-04-24 18:15:20 +02:00
Sergei Golubchik
7b58fd5ef0 tests -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
This fixes:
MDEV-7693 MariaDB - mysql-test - SUITE:funcs_1 - funcs_1.is_tables_mysql is failing on TABLE_COLLATION /DATABASE_COLLATION
MDEV-8487 mysql-test - main.information_schema 'xtradb' fails
MDEV-8486 mysql-test - main.bootstrap fails
2016-04-24 18:15:20 +02:00
Sergei Golubchik
0ee919b86e MDEV-8480 mysql-test - main.func_encrypt_ucs2 fails if FIPS=1
disable the test when DES doesn't work
2016-04-24 18:15:20 +02:00
Sergei Golubchik
797cadce47 MDEV-8482 mysql-test - main.func_encrypt fails if FIPS=1
* check for openssl errors in DES_ENCRYPT/DES_DECRYPT
* disable the test when DES doesn't work
* also disable main.func_des_encrypt
2016-04-24 18:15:20 +02:00
Sergei Golubchik
906f97d310 MDEV-8481 mysql-test - main.func_crypt fails if FIPS=1
disable the test when crypt(3) doesn't work
2016-04-24 18:15:20 +02:00
Sergei Golubchik
78989b67d1 MDEV-9168 altering a column comment does a full copy
add a test case
2016-04-24 18:15:20 +02:00
Sergei Golubchik
b233b15ccd MDEV-9868 Altering a partitioned table comment does a full copy
let handler::check_if_supported_inplace_alter()
(that detects frm-only changes) to work for partitioned
tables too.
2016-04-24 18:15:20 +02:00
Sergei Golubchik
97728e107a comment
clarify Alter_inplace_info::ALTER_PARTITIONED
2016-04-24 18:15:20 +02:00
Sergei Golubchik
d821dd106a MDEV-9580 SHOW GRANTS FOR <current_user> fails
use get_current_user() to distinguish user name without
a hostname and a role name.

move privilege checks inside mysql_show_grants() to remove
duplicate get_current_user() calls
2016-04-24 18:15:20 +02:00
Andrew McDonnell
23b1b69b10 Comment from https://github.com/MariaDB/server/pull/153 2016-04-24 18:15:20 +02:00
Andrew McDonnell
6651005e62 Fix for MDEV-8206, as per Jira comments of 2015-11-16 and 2015-11-30 2016-04-24 18:15:20 +02:00
Sergei Golubchik
011497bd60 MDEV-9869 INSTALL SONAME 'ha_connect'
make storage engine RPMs require the exact server
version RPM: "MariaDB = %{version}-%{release}",
other plugins require simply "MariaDB", as before.
2016-04-24 18:15:20 +02:00
Jan Lindström
19e3597e0c MDEV-9142 :Adding Constraint with no database reference
results in ERROR 1046 (3D000) at line 13: No database selected.

Use database from create table to foreign key database if
nothing else is given.
2016-04-23 13:05:15 +03:00
Sergey Vojtovich
0ea4c73dae Fixed compilation failure due to unused var. 2016-04-23 12:15:18 +04:00
Sergey Vojtovich
618e300bce MDEV-9970 - main.sp-threads fails sporadically
Added proper waiting for thread to enter required state. Also reduced amount of
information dumped from processlist.
2016-04-23 00:28:50 +04:00
Daniel Bartholomew
bd75ee748b bump the VERSION 2016-04-22 09:10:00 -04:00
Alexander Barkov
3f0d07e55b MDEV-9372 select 100 between 1 and 9223372036854775808 returns false
Integer comparison of INT expressions with different signess in BETWEEN
is not safe. Switching to DECIMAL comparison in case if INT arguments
have different signess.
2016-04-22 16:04:20 +04:00
Sergey Vojtovich
250a89cfec MDEV-9283 - Debian: the Lintian complains about "shlib-calls-exit" in
ha_oqgraph.so

exit() was called by Judy error handler. This patch overrides Judy error handler
so that it calls abort() instead of exit().
2016-04-22 15:30:10 +04:00
Sergey Vojtovich
994030c0e2 MDEV-8889 - Assertion `next_insert_id == 0' failed in handler::ha_external_lock
There was a race condition between delayed insert thread and connection thread
actually performing INSERT/REPLACE DELAYED. It was triggered by concurrent
INSERT/REPLACE DELAYED and statements that flush the same table either
explicitely or implicitely (like FLUSH TABLE, ALTER TABLE, ...).

This race condition was caused by a gap in delayed thread shutdown logic,
which allowed concurrent connection running INSERT/REPLACE DELAYED to change
essential data consequently leaving table in semi-consistent state.

Specifically query thread could decrease "tables_in_use" reference counter in
this gap, causing delayed insert thread to shutdown without releasing auto
increment and table lock.

Fixed by extending condition so that delayed insert thread won't shutdown
until there're locked tables.

Also removed volatile qualifier from tables_in_use and stacked_inserts since
they're supposed to be protected by mutexes.
2016-04-22 13:01:15 +04:00
Jan Lindström
298e1d3f71 Improve error diagnostics on I/O errors. If node->name is NULL
try to use space->name instead.
2016-04-22 11:36:10 +03:00
Jan Lindström
628bc576b3 MDEV-9918: [ERROR] mysqld got signal 11 during ALTER TABLE name COLUMN ADD
Problem was that in-place online alter table was used on a table
that had mismatch between MySQL frm file and InnoDB data dictionary.
Fixed so that traditional "Copy" method is used if the MySQL frm
and InnoDB data dictionary is not consistent.
2016-04-22 08:57:07 +03:00
Nisha Gopalakrishnan
3b6f9aac02 BUG#23135731: INSERT WITH DUPLICATE KEY UPDATE REPORTS
INCORRECT ERROR.

Analysis
========
INSERT with DUPLICATE KEY UPDATE and REPLACE on a table
where foreign key constraint is defined fails with an
incorrect 'duplicate entry' error rather than foreign
key constraint violation error.

As part of the bug fix for BUG#22037930, a new flag
'HA_CHECK_FK_ERROR' was added while checking for non fatal
errors to manage FK errors based on the 'IGNORE' flag. For
INSERT with DUPLICATE KEY UPDATE and REPLACE queries, the
foreign key constraint violation error was marked as non-fatal,
even though IGNORE was not set. Hence it continued with the
duplicate key processing resulting in an incorrect error.

Fix:
===
Foreign key violation errors are treated as non fatal only when
the IGNORE is not set in the above mentioned queries. Hence reports
the appropriate foreign key violation error.
2016-04-22 10:25:16 +05:30
Igor Pashev
e5410da190 SEGFAULT in get_column_grant()
Due to a typo, the wrong grant_table was used when fetching privileges
for roles.

Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
2016-04-21 08:18:54 -07:00
Sergei Golubchik
0991e19e9d Merge branch 'bb-5.5-serg' into 5.5 2016-04-20 20:25:46 +02:00
Vladislav Vaintroub
2a45fa900b MDEV-9836 Connection lost when using SSL
Don't read from socket in yassl in SSL_pending().
Just return size of the buffered processed data.
This is what OpenSSL is documented to do too:

  SSL_pending() returns the number of bytes which have been processed,
  buffered and are available inside ssl for immediate read.
2016-04-20 19:03:59 +02:00
Sergei Golubchik
63c834e7c4 Merge branch 'merge-xtradb-5.5' into 5.5 2016-04-20 18:56:41 +02:00
Sergei Golubchik
24ac546d0f use consistent error messaging for IGNORE
1. the same message text for INSERT and INSERT IGNORE
2. no new warnings in UPDATE IGNORE yet (big change for 5.5)

and replace a commonly used expression with a
named constant
2016-04-20 18:27:23 +02:00
Sergey Vojtovich
072ca71d26 MDEV-9281 - Debian: the Lintian complains about "shlib-calls-exit" in handlersocket.so
MDEV-9278 - Debian: the Lintian complains about "shlib-calls-exit" in ha_spider.so

Handlersocket handles errors in a way that it aborts program execution. In most
cases it is done via abort(). One exception was host/service resolution failure,
which was aborted with exit().

As a workaround replaced this exit() with abort() for symmetry with other error
handling.
2016-04-20 18:20:31 +04:00
Sergei Golubchik
9e826bfa36 trivial optimization
don't call write_bin_log() when binlog is known
to be disable
2016-04-20 15:28:44 +02:00
Sergei Golubchik
8f1f869f68 another test case for ER_DATA_OUT_OF_RANGE on insert
tests it with a non-const table too
2016-04-20 15:26:37 +02:00
Sergei Golubchik
b069d19284 Merge branch 'mysql/5.5' into 5.5 2016-04-20 15:25:55 +02:00
Sergey Vojtovich
0c0a865fad MDEV-9943 - TokuDB fails to compile with gcc 5.2.1
For some reason check_cxx_compiler_flag() passes result variable name down to
compiler:
https://github.com/Kitware/CMake/blob/master/Modules/CheckCXXSourceCompiles.cmake#L57

But compiler doesn't permit dashes in macro name, like in
-DHAVE_CXX_-fimplicit-templates.

Workarounded by renaming HAVE_CXX_-fimplicit-templates to
HAVE_CXX_IMPLICIT_TEMPLAES.
2016-04-20 15:59:19 +04:00
Elena Stepanova
62122ba5d5 MDEV-9953 Debian packages install broken 'maria' test suite which cannot be run
Debian packages create empty maria/t and maria/r directories,
and MTR cannot run maria.* tests
2016-04-20 10:51:34 +03:00
Alexander Barkov
e90f8b7a68 MDEV-9413 "datetime >= coalesce(c1(NULL))" doesn't return expected NULL
The patch for MDEV-9521 earlier fixed the problem reported in MDEV-9413.
Only adding tests.
2016-04-20 11:11:13 +04:00
Alexander Barkov
2564650fb9 MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
The patch for MDEV-9745 earlier fixed the problem reported in MDEV-9662 as well.
Only adding tests.
2016-04-20 11:02:34 +04:00
Alexander Barkov
9a987142f9 MDEV-9745 Crash with CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END
This is a backport of the patch for MDEV-9653 (fixed earlier in 10.1.13).

The code in Item_func_case::fix_length_and_dec() did not
calculate max_length and decimals properly.

In case of any numeric result (DECIMAL, REAL, INT) a generic method
Item_func_case::agg_num_lengths() was called, which could erroneously result
into a DECIMAL item with max_length==0 and decimals==0, so the constructor of
Field_new_decimals tried to create a field of DECIMAL(0,0) type,
which caused a crash.

Unlike Item_func_case, the code responsible for merging attributes in
Item_func_coalesce::fix_length_and_dec() works fine: it has specific execution
branches for all distinct numeric types and correctly creates a DECIMAL(1,0)
column instead of DECIMAL(0,0) for the same set of arguments.

The fix does the following:
- Moves the attribute merging code from Item_func_coalesce::fix_length_and_dec()
  to a new method Item_func_hybrid_result_type::fix_attributes()
- Removes the wrong code from Item_func_case::fix_length_and_dec()
  and reuses fix_attributes() in both Item_func_coalesce::fix_length_and_dec()
  and Item_func_case::fix_length_and_dec()
- Fixes count_real_length() and count_decimal_length() to get an array
  of Items as an argument, instead of using Item::args directly.
  This is needed for Item_func_case::fix_length_and_dec().
- Moves methods Item_func::count_xxx_length() from "public" to "protected".
- Removes Item_func_case::agg_num_length(), as it's not used any more.
- Additionally removes Item_func_case::agg_str_length(),
  as it also was not used (dead code).
2016-04-20 08:53:30 +04:00
Sergey Vojtovich
6c0e231c02 MDEV-9945 - main.kill_processlist-6619 fails sporadically
SHOW PROCESSLIST output can be affected by not completed concurrent queries.
Removed this affected SHOW PROCESSLIST since it doesn't seem to affect original
problem.
2016-04-19 14:05:52 +04:00
Sergei Golubchik
1bc0b0b524 fix a couple of dbug tests not to write to /tmp 2016-04-19 11:27:00 +02:00