Commit graph

65673 commits

Author SHA1 Message Date
Kristian Nielsen
121dc271b0 Make --slave-parallel-workers an alias for --slave-parallel-threads
This is to add compatibility with the similar MySQL option.
2016-01-29 18:41:15 +01:00
Monty
7b14ba63f2 MDEV-8724 Assertion `rc == 0' failed in ma_decrypt on reading an Aria table
Don't assert if decrypt or encrypt fails if my_assert_on_error is not set.
Added failed file name if encryption/decryption fails.
2016-01-28 14:06:05 +02:00
Alexander Barkov
ce40ccaf24 MDEV-9181 (NULLIF(count(table.col)), 0) gives wrong result on 10.1.x
Wrapping args[0] and args[2] into an Item_cache for aggregate functions.
2016-01-28 13:58:39 +04:00
Oleksandr Byelkin
07e9762940 MDEV-8615: Assertion `m_cpp_buf <= begin_ptr && begin_ptr <= m_cpp_buf + m_buf_length' failed in Lex_input_stream::body_utf8_start
Nothing should be done before any keyword recognized.
2016-01-27 21:17:23 +01:00
Vladislav Vaintroub
4b31e6dc95 Address review comments, add unit test 2016-01-27 16:34:05 +01:00
Alexander Barkov
b404b236a2 MDEV-9332 Bug after upgrade to 10.1.10 2016-01-27 11:42:31 +04:00
Alexey Botchkov
a4ff37e912 MDEV-6421 SQL_ERROR_LOG doesn't log comments in Events.
Change parser so it saves all the query line to the ';' in the
    sp_instr::m_query.
2016-01-26 22:33:25 +04:00
Sergei Golubchik
f4faac4d6a Merge branch '10.0' into 10.1 2016-01-25 22:58:57 +01:00
Sergei Golubchik
2ff65ba531 MDEV-9299 Test main.events_2 incompatible with Debian reproducibility testing framework
Debian tests are run in 2017, update the test to
use 2027 as a "future".
2016-01-25 22:57:56 +01:00
Sergei Golubchik
5da7c346c7 MDEV-9428 NO_AUTO_VALUE_ON_ZERO is ignored when a trigger before insert is defined
Don't compare "field == table->next_number_field" because the field
can be special nullable field copy created by the trigger.
Compare field_index values instead.
2016-01-25 22:57:54 +01:00
Sergei Golubchik
68910e7092 MDEV-9273 ERROR 1819 on grant statment for existing user
Cannot do password validation in fix_lex_user(), we don't know
there what "GRANT ... TO user" means - creating a new user with
an empty password (need validation) or granting privileges
to an existing user (no validation needed).

Move validation down into replace_user_table(). And copy into
check_change_password().
2016-01-25 22:57:53 +01:00
Sergei Golubchik
d5b1b1ac60 stack too small on labrador (again!)
increase the thread stack a bit for main.signal_demo3
and sys_vars.max_sp_recursion_depth_func to stop failing
2016-01-25 22:57:47 +01:00
Sergei Golubchik
666b9663f9 update test results 2016-01-25 19:03:33 +01:00
Alexey Botchkov
1793646d78 Merge branch '5.5' into 10.0
Conflicts:
	plugin/server_audit/server_audit.c
2016-01-25 16:37:08 +04:00
Sergei Petrunia
ff8d4009a7 MDEV-9457: Poor query plan chosen for ORDER BY query by a recent 10.1
Undo the change in test_if_skip_sort_order() that set ref_key=-1 when
a variant of index_merge is used (was made in fix for MDEV-9021).

It turned out that test_if_cheaper_ordering() call below assumes that
ref_key=-1 means "no index is used", that is, "an inefficient full table
scan is done".
This is not the same as index_merge, index_merge can actually be quite
efficient. So, ref_key=MAX_KEY denotes the fact that some index is used,
not any given index.
2016-01-24 16:59:41 +03:00
Oleksandr Byelkin
825f51d1aa MDEV-9118 ANALYZE TABLE for Engine independent status fetchs blob/text columns without use
Do not include BLOB fields by default.
2016-01-22 18:07:11 +01:00
Alexander Barkov
7b50447aa6 MDEV-9407 Illegal mix of collation when using GROUP_CONCAT in a VIEW
MDEV-9408 CREATE TABLE SELECT MAX(int_column) creates different columns for table vs view

There were three almost identical pieces of the code:
- Field *Item_func::tmp_table_field();
- Field *Item_sum::create_tmp_field();
- Field *create_tmp_field_from_item();
with a difference in very small details (hence the bugs):
Only Item_func::tmp_table_field() was correct, the other two were not.
Removing the two incorrect pieces of the redundant code.
Joining these three functions/methods into a single virtual method
Item::create_tmp_field().
Additionally, moving Item::make_string_field() and
Item::tmp_table_field_from_field_type() from the public into the
protected section of the class declaration, as they are now not
needed outside of Item.
2016-01-16 18:45:26 +04:00
Kristian Nielsen
2f88b14acd Merge branch 'tmp' into tmp-10.1
Conflicts:
	sql/slave.cc
2016-01-15 13:01:19 +01:00
Kristian Nielsen
74b1af19e9 Merge branch 'tmp' into tmp-10.0
Conflicts:
	sql/slave.cc
2016-01-15 12:50:23 +01:00
Kristian Nielsen
06b2e327fc Fix error handling for GTID and domain-based parallel replication
This occurs when replication stops with an error, domain-based parallel
replication is used, and the GTID position contains more than one domain.
Furthermore, it relates to the case where the SQL thread is restarted
without first stopping the IO thread.

In this case, the file/offset relay-log position does not correctly
represent the slave's multi-dimensional position, because other domains may
be far ahead of, or behind, the domain with the failing event. So the code
reverts the relay log position back to the start of a relay log file that is
known to be before all active domains.

There was a bug that when the SQL thread was restarted, the
rli->relay_log_state was incorrectly initialised from @@gtid_slave_pos. This
position will likely be too far ahead, due to reverting the relay log
position. Thus, if the replication fails again after the SQL thread restart,
the rli->restart_gtid_pos might be updated incorrectly. This in turn would
cause a second SQL thread restart to replicate from the wrong position, if
the IO thread was still left running.

The fix is to initialise rli->relay_log_state from @@gtid_slave_pos only
when we actually purge and re-fetch relay logs from the master, not at every
SQL thread start.

A related problem is the use of sql_slave_skip_counter to resolve
replication failures in this kind of scenario. Since the slave position is
multi-dimensional, sql_slave_skip_counter can not work properly - it is
indeterminate exactly which event is to be skipped, and is unlikely to work
as expected for the user. So make this an error in the case where
domain-based parallel replication is used with multiple domains, suggesting
instead the user to set @@gtid_slave_pos to reliably skip the desired event.
2016-01-15 12:48:14 +01:00
Alexey Botchkov
fe4823d28e MDEV-9106 Audit plugin doesnt run with MySQL 5.7.
updata thread_pool_server_audit test result.
2016-01-13 18:02:44 +04:00
Alexey Botchkov
c9552533c9 MDEV-9106 Audit plugin compiled with MariaDB can't install on MySQL 5.7.
The audit API was seriously changed in MySQL 5.7.
        so we had to adapt the plugin's code to that.
2016-01-12 18:43:55 +04:00
Alexander Barkov
454589b67f MDEV-9393 Split Copy_field::get_copy_func() into virtual methods in Field
Also fixes:
MDEV-9391 InnoDB does not produce warnings when doing WHERE int_column=varchar_column
MDEV-9337 ALTER from DECIMAL and INT to DATETIME returns a wrong result
MDEV-9340 Copying from INT/DOUBLE to ENUM is inconsistent
MDEV-9392 Copying from DECIMAL to YEAR is not consistent about warnings
2016-01-11 17:20:16 +04:00
Yashwant Sahu
d9f89fff16 Bug #22295186: CERTIFICATE VALIDATION BUG IN MYSQL MAY ALLOW MITM
Test fix for 5.5 and 5.6
2016-01-11 14:44:49 +05:30
Yashwant Sahu
70f1aa4223 Bug #22295186: CERTIFICATE VALIDATION BUG IN MYSQL MAY ALLOW MITM.
Test Fix
2016-01-11 09:23:31 +05:30
Yashwant Sahu
13380bf81f Bug #22295186: CERTIFICATE VALIDATION BUG IN MYSQL MAY ALLOW MITM 2016-01-11 07:09:13 +05:30
Monty
8fcc0bfefa Fixed bug in semi_sync replication tests.
The problem was that wait_for_slave_io_to_start reported that the io thread
was ready, when it was still initializing. This caused test suite to
continue too early, for example before the semi sync plugin was properly
enabled.

Fixed by introducing a new internal stage: "Preparing". Slave_IO_Running is
now set to "Yes" only when all initializing is done and the IO thread is
ready to read things from the master.

The only test affected by this change is rpl_flsh_tbls, which got stuck in
the preparing phase while trying to read the GTID position from a table.
Fixed by having this test waiting for Preparing instead of Yes.
2016-01-03 13:27:59 +02:00
Sreeharsha Ramanavarapu
cb15cce746 Bug #21564557: INCONSISTENT OUTPUT FROM 5.5 AND 5.6
UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%M"

Issue:
-----
When an invalid date is supplied to the UNIX_TIMESTAMP
function from STR_TO_DATE, no check is performed before
converting it to a timestamp value.

SOLUTION:
---------
Add the check_date function and only if it succeeds,
proceed to the timestamp conversion.

No warning will be returned for dates having zero in
month/date, since partial dates are allowed. UNIX_TIMESTAMP
will return only a zero for such values.

The problem has been handled in 5.6+ with WL#946.
2015-12-31 07:31:12 +05:30
Vladislav Vaintroub
250ab81200 Fix process handle leak in buildbot. GenerateConsoleCtrlEvent sent to non-existing process will add a process handle to this non-existing process to console host process conhost.exe 2015-12-30 20:59:44 +01:00
Vladislav Vaintroub
56e0de0411 Merge branch '10.0' into 10.1 2015-12-30 20:56:52 +01:00
Vladislav Vaintroub
ae7b39a13a Merge branch '5.5' into 10.0 2015-12-30 20:55:12 +01:00
Vladislav Vaintroub
ff24820269 Fix process handle leak in buildbot. GenerateConsoleCtrlEvent sent to non-existing process will add a process handle to this non-existing process to console host process conhost.exe 2015-12-30 20:52:42 +01:00
Sergey Vojtovich
f8dd40eec6 MDEV-8491 - On shutdown, report the user and the host executed that.
Fixed main.shutdown failure on Windows.
2015-12-30 13:34:15 +04:00
Alexander Barkov
2ba7ed77aa Merge remote-tracking branch 'origin/10.1' into 10.2 2015-12-29 19:37:11 +04:00
Alexander Barkov
4282ac48c6 Merge remote-tracking branch 'origin/10.0' into 10.1 2015-12-29 15:22:33 +04:00
Alexander Barkov
6d7362eeb8 Merge remote-tracking branch 'origin/5.5' into 10.0 2015-12-29 15:18:55 +04:00
Alexander Barkov
e1b9be5417 MDEV-9319 ALTER from a bigger to a smaller blob type truncates too much data 2015-12-29 14:17:31 +04:00
Sergey Vojtovich
ea578c9d6f MDEV-8491 - On shutdown, report the user and the host executed that. 2015-12-29 14:17:02 +04:00
Sergey Vojtovich
09cf0a6213 MDEV-7780 - Support for faking server version
Embedded now supports "--version=<version>", while "--version" is still silently
ignored. Also only run protocol check in non-embedded mode.
2015-12-24 20:08:42 +04:00
Sergei Golubchik
8efdfc8b58 update results
innodb 32-bit
funcs_1 embedded
2015-12-23 16:22:48 +01:00
Sergei Golubchik
d8e127f9f4 Merge branch '10.1' into bb-10.1-serg 2015-12-22 15:19:51 +01:00
Sergei Golubchik
7697bf0bd7 Merge branch 'github/10.0-galera' into 10.1
Note: some tests fail, just as they failed before the merge!
2015-12-22 10:32:33 +01:00
Sergei Golubchik
0686c34d22 MDEV-8605 MariaDB not use DEFAULT value even when inserted NULL for NOT NULLABLE column
NOT NULL constraint must be checked *after* the BEFORE triggers.
That is for INSERT and UPDATE statements even NOT NULL fields
must be able to store a NULL temporarily at least while
BEFORE INSERT/UPDATE triggers are running.
2015-12-21 21:30:54 +01:00
Sergei Golubchik
de7636e147 32-bit test fixes 2015-12-21 21:30:15 +01:00
Sergei Golubchik
ab64d674e8 fix innodb-get-fk test
incorrect option name and doing ALTER TABLE under read-only:
the test "passed" in 10.0 only because $restart_parameters
was first implemented in 10.1
2015-12-21 21:24:53 +01:00
Sergei Golubchik
a2bcee626d Merge branch '10.0' into 10.1 2015-12-21 21:24:22 +01:00
Alexey Botchkov
d58a770201 MDEV-7540 Information Schema SPATIAL_REF_SYS contents don't match the expected contents.
Table content filled appropriately.
        Thare are still just two records as we don't have geodetics yet.
2015-12-21 22:34:30 +04:00
Vicențiu Ciorbaru
afc2fb1bf8 MDEV-8627: SHOW GRANTS does not work for a replicated role
The bug was caused by accessing uninitialized fields within the LEX related to
ssl by mysql_show_grants() -> get_current_user() -> has_auth() function.
2015-12-21 13:42:19 +02:00
Nirbhay Choubey
8dfd157bb2 Merge branch '5.5-galera' into 10.0-galera 2015-12-19 19:19:32 -05:00
Nirbhay Choubey
dad555a09c Merge tag 'mariadb-10.0.23' into 10.0-galera 2015-12-19 14:24:38 -05:00
Sergei Golubchik
392d557901 MDEV-9183 MariaDB 10.1 crash on mysqld --verbose --help
plugin_init() works like this:
1. init MyISAM
2. load plugins from mysql.plugin, if it's a MyISAM table
3. init all not initialized plugins
4. all done, if step 2 loaded mysql.plugin,
   otherwise:
5. load plugins from mysql.plugin
6. init all not initialized plugins

now, with --help --verbose, step 3 will not actually
initialize them, and if mysql.plugin is unreadable,
step 6 will try to initialize existing plugins again.
Fix: when skipping initialization because of --help,
change plugin status from PLUGIN_IS_UNINITIALIZED.
2015-12-19 13:59:29 +01:00
Daniel Black
3b9423fda2 MDEV-7384: Add --persistent option for mysqlcheck
10.0 has an "analyze table .. persistent for all" syntax. This adds
--persistent to mysqlcheck(mysqlanalyize) to perform this extended
analyze table option.

Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
2015-12-18 21:59:47 +02:00
Nirbhay Choubey
58b54b7d1a MDEV-9044 : Binlog corruption in Galera
While refreshing the IO_CACHE, do not update its parameters (read_pos,
read_end & pos_in_file) if there is nothing left to read.
2015-12-18 14:35:56 -05:00
Sergey Vojtovich
5efb8f1677 Filter out unix-socket from unrelated test cases 2015-12-18 22:51:12 +04:00
Nirbhay Choubey
3f515a09ff MDEV-9290 : InnoDB: Assertion failure in file trx0sys.cc line 353
As a fix for MDEV-8208, for initial wsrep threads, the
invocation of init_for_queries() was moved after plugins
were initialized. Due to which, OPTION_BEGIN bit of wsrep
applier THD (originally set in wsrep_replication_process)
got reset due to implicit commit within init_for_queries().
As a result, events from a multi-statement transaction from
another node were committed separately by the applier thread,
which leads to an assertion as they all carry same seqno.

Fixed by making sure that variable.option_bits are restored
post init_for_queries(). Also restored server_status.
Added a test case.
2015-12-16 20:07:12 -05:00
Oleksandr Byelkin
71eee693b2 MDEV-9167: COLUMN_CHECK fails on valid decimal data
Check now allows zero length decimals too.

(backporting Adam Chainz patch to 10.0)
2015-12-16 11:09:54 +01:00
Sergei Golubchik
2116649dee after-merge fix replication tests
* mostly update result files
* also updating test/include files to match 5.6
2015-12-15 20:25:06 +01:00
Sergei Golubchik
7a21364332 after-merge fix partitioning tests
* use --sort_result in test files as needed
* remove old and wrong mariadb-5.3 related partitioning hack
   from ha_tokudb.cc
2015-12-15 20:25:04 +01:00
Oleksandr Byelkin
a75ac82c2f MDEV-9147: Character set is ignored in Dynamic Column for saved string
Fixed moving charset from definition to the value.
2015-12-15 14:08:29 +01:00
Jan Lindström
477c84d51e Add new sysvar. 2015-12-15 11:34:20 +02:00
Jan Lindström
98c9fbfa21 MDEV-8297: information_schema.innodb_sys_tablestats.modified_counter doesn't change on UPDATE
Update modified-counter also if update effects non-indexed columns.
2015-12-15 11:29:15 +02:00
Jan Lindström
efeb905736 Rename test files. 2015-12-15 09:46:53 +02:00
Jan Lindström
b63bf7368b MDEV-8923: port innodb_buffer_pool_dump_pct from MySQL
Backport pull request #125 from grooverdan/MDEV-8923_innodb_buffer_pool_dump_pct to 10.0

WL#6504 InnoDB buffer pool dump/load enchantments

This patch consists of two parts:

    1. Dump only the hottest N% of the buffer pool(s)
    2. Prevent hogging the server duing BP load

From MySQL - commit b409342c43ce2edb68807100a77001367c7e6b8e

Add testcases for innodb_buffer_pool_dump_pct_basic.

Part of the code authored by Daniel Black
2015-12-15 09:35:22 +02:00
Jan Lindström
16f0d996c3 Merge pull request #125 from grooverdan/MDEV-8923_innodb_buffer_pool_dump_pct
MDEV-8923: port innodb_buffer_pool_dump_pct from MySQL

WL#6504 InnoDB buffer pool dump/load enchantments

This patch consists of two parts:

1. Dump only the hottest N% of the buffer pool(s)
2. Prevent hogging the server duing BP load

From MySQL - commit b409342c43ce2edb68807100a77001367c7e6b8e

Add testcases for innodb_buffer_pool_dump_pct.

Part of the code authored by Daniel Black.
2015-12-15 08:53:57 +02:00
Jan Lindström
99404c3437 MDEV-9276: MySQL Bug #78754: FK definitions missing from SHOW CREATE TABLE in "innodb_read_only" mode 2015-12-14 22:10:37 +02:00
Sergei Golubchik
b418e97826 Merge branch 'merge/merge-perfschema-5.6' into 10.0 2015-12-13 17:19:18 +01:00
Sergei Golubchik
6bb292f1bc 5.6.28 2015-12-13 10:15:55 +01:00
Sergei Golubchik
1623995158 Merge branch '5.5' into 10.0 2015-12-13 00:10:40 +01:00
Sergei Golubchik
0ed474484c fix main.mysqldump test on windows 2015-12-11 23:25:20 +01:00
Sergei Golubchik
ca28d9011c MDEV-7655 SHOW CREATE TABLE returns invalid DDL when using virtual columns along with a table collation 2015-12-11 23:25:20 +01:00
Sergei Golubchik
4a450928e0 fix a few spelling mistakes
https://github.com/MariaDB/server/pull/56
2015-12-11 15:21:42 +01:00
Jan Lindström
c19972fc87 MDEV-9251: Fix MySQL Bug#20755615: InnoDB compares column names case sensitively,
while according to Storage Engine API column names should be compared
case insensitively. This can cause FRM and InnoDB data dictionary to
go out of sync.
2015-12-11 14:33:41 +02:00
Nirbhay Choubey
ca07ee85ea Merge tag 'mariadb-5.5.47' into 5.5-galera 2015-12-10 13:00:08 -05:00
Oleksandr Byelkin
537c750e32 MDEV-8521 Drastic loss of precision in COLUMN_JSON() on DOUBLEs
fixed conversion
2015-12-10 16:18:15 +01:00
Oleksandr Byelkin
6eb8676361 MDEV-7215 EXPLAIN REPLACE produces an error: Column count doesn't match value count
removed outdated code which was causing error (no need reassign result for subqueries & Co)
2015-12-10 13:36:58 +01:00
Monty
44b107da90 Fixed a bug in galera + some failing galera tests
- Added missning setting of table->rpl_write_set in record_gtid(), required by galera
- Removed output of WSREP_PATCH_VERSION from galera_defaults, as this can change over time
- Limit galera_many_tables_pk and galera_many_tables_nopk to 900, as
  on many systems the default open table limit is 1024
2015-12-10 12:39:54 +02:00
Oleksandr Byelkin
d289ba808d MDEV-8401 COLUMN_CREATE(name, value as DOUBLE) results in string
Double representation fixed (JSON is valid even with 'e' in the number)
2015-12-10 10:19:56 +01:00
Sergei Golubchik
abf9d35213 Merge branch 'mysql/5.5' into 5.5 2015-12-09 10:00:49 +01:00
Sergei Golubchik
c21b927145 mysql_upgrade cleanup 2015-12-08 10:13:13 +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
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
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
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
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
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
Venkatesh Duggirala
2735f0b920 Bug#21205695 DROP TABLE MAY CAUSE SLAVES TO BREAK
Problem:
    ========
    1) Drop table queries are re-generated by server
    before writing the events(queries) into binlog
    for various reasons. If table name/db name contains
    a non regular characters (like latin characters),
    the generated query is wrong. Hence it breaks the
    replication.
    2) In the edge case, when table name/db name contains
    64 characters, server is throwing an assert
    assert(M_TBLLEN < 128)
    3) In the edge case, when db name contains 64 latin
    characters, binlog content is interpreted badly
    which is leading replication failure.

    Analysis & Fix :
    ================
    1) Parser reads the table name from the query and converts
    it to standard charset(utf8) and stores it in table_name variable.
    When drop table query is regenerated with the same table_name
    variable, it should be converted back to the original charset
    from standard charset(utf8).

    2) Latin character takes two bytes for each character. Limit
    of the identifier is 64. SYSTEM_CHARSET_MBMAXLEN is set to '3'.
    So there is a possiblity that tablename/dbname contains 3 * 64.
    Hence assert is changed to
    (M_TBLLEN <= NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN)

    3) db_len in the binlog event header is taking 1 byte.
       db_len is ranged from 0 to 192 bytes (3 * 64).
       While reading the db_len from the event, server
       is casting to uint instead of uchar which is leading
       to bad db_len. This problem is fixed by changing the
       cast type to uchar.
2015-12-01 15:38:11 +05:30
Monty
c3018b0ff4 Fixes to get all test to run on MacosX Lion 10.7
This includes fixing all utilities to not have any memory leaks,
as safemalloc warnings stopped tests from passing on MacOSX.

- Ensure that all clients takes character-set-dir, as the
  libmysqlclient library will use it.
- mysql-test-run now passes character-set-dir to all external clients.
- Changed dynstr_free() so that it can be called twice (made freeing code easier)
- Changed rpl_global_gtid_slave_state to be allocated dynamicly as it
  includes a mutex that needs to be initizlied/destroyed before my_end() is called.
- Removed rpl_slave_state::init() and rpl_slave_stage::deinit() as
  their job are better handling by constructor and delete.
- Print alias instead of table_name in check_duplicate_key as
  table_name may have been converted to lower case.

Other things:
- Fixed a case in time_to_datetime_with_warn() where we where
  using && instead of & in tests
2015-11-29 17:51:23 +02:00
Daniel Black
804a59e408 MDEV-8923: innodb_buffer_pool_dump_pct add test cases
Add testcases for innodb_buffer_pool_dump_pct
2015-11-29 18:10:58 +11:00
Sergey Vojtovich
9d5c9379a6 MDEV-7780 - Support for faking server version
Added --version=str (optional argument sets server version string).
2015-11-27 11:32:30 +04:00
Monty
654547b5b4 Fixed problems found by buildbot:
- Better error from check_slave_param
- Better error message from TokuDB if it can't be compiled.
- Marked rpl_mixed_drop_create_temp_table and
  rpl_stm_drop_create_temp_table as big tests to stop timeout
  failures on power8
- Added sync_slave_with_master to semisync_future-7591 to
  ensure that slave is up to date with master before calling
  rpl_end.
- Disabled compiler warnings from connect and mroonga and on
  MacOSX.

Mroonga:
- Fixed bug when testing if file is a normal file that can be deleted
- Marked a lot of date and datetime test to not run on macosx.
  This is because mktime() can't handle negative years and this
  restricts mroonga so that it can only store dates after the year 1900.
2015-11-27 02:06:58 +02:00
Sergey Vojtovich
e4212898a6 MDEV-8542 - The "aria_recover" variable should be renamed "aria_recover_options"
to match MyISAM

Renamed aria_recover to aria_recover_options.
2015-11-26 11:34:17 +04:00
Sergei Golubchik
4434c5cee8 followup for optimizer_search_depth change
see commit 81e4ce5
2015-11-24 22:21:41 +01:00
Nirbhay Choubey
b88c67d5f2 Update galera suite global_suppressions. 2015-11-24 14:24:23 -05:00
Alexander Barkov
310c718cff MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
Also, fixing compilation warnings in ctype-mb.ic (Windows).
2015-11-24 22:47:42 +04:00
Monty
f813a00029 Fixed failing test cases and compiler warnings found by buildbot
- Added some extra command to rpl_start_stop to ensure that the
  IO thread has connected to the master before we shut down the server.
- if signal returns signalhandler_t, use this with the alarm code
- Added missing tests to sys_vars
- Fixed some possible overflow bugs in tabxml.cpp
2015-11-24 20:04:12 +02:00
Nirbhay Choubey
22b594267c MDEV-9033: Incorrect statements binlogged on slave with do_domain_ids=(...)
Post-fix: The test case pushed with the fix had each node
acting as slave to the other two nodes with different set
of filters on server_id's. The slave's gtid_slave_pos is
updated after it processes the events received from master
nodes irrespective of whether the events were filtered
or not. Thus, sync_with_master_gtid.inc could unblock even
on filtered events.
As a result, sync_with_master_gtid.inc would fail to block
until the desired changes have been replicated.  Fixed by
simplifying the topology.
Also, modified CHANGE MASTER commands to ignore based
on gtid_domain_id instead of server_id.
2015-11-23 16:23:10 -05:00
Alexander Barkov
6b97b0c5e0 MDEV-9166 Wrong error message and shift/reduce conflicts in the RETURNS clause 2015-11-23 14:49:23 +04:00
Nirbhay Choubey
4d1a4bc3e5 Increase default MTR_PORT_GROUP_SIZE to 20.
Some Galera tests can require more than 10 ports.
2015-11-20 12:35:28 -05:00
Nirbhay Choubey
75afa93eb1 Fix galera.galera_as_slave_nonprim test. 2015-11-20 12:32:31 -05: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
d0dc7b3e92 Merge branch '10.1' into 10.2 2015-11-20 11:18:16 +01:00
Sergei Golubchik
87c306802b update test results 2015-11-20 09:16:36 +01:00
Sreeharsha Ramanavarapu
f3554bf148 Bug #22214867: MYSQL 5.5: MAIN.SUBSELECT AND OTHERS FAIL
WITH NEW VALGRIND

Issue:
------
Function signature in valgrind.supp requires a change with
valgrind 3.11. Static function is replaced with wild card.
2015-11-20 05:40:39 +05:30
Sergei Golubchik
7f19330c59 Merge branch 'github/10.0-galera' into 10.1 2015-11-19 17:48:36 +01:00
Sergei Golubchik
4046ed12bc rbr and savepoint in a subtatement
Apply MySQL fix for bug#76727:
https://github.com/mysql/mysql-server/commit/69d4e72c

  Bug#20901025: SLAVE ASSERTION IN UNPACK_ROW WITH ROLLBACK TO
  SAVEPOINT IN ERROR HANDLER
2015-11-19 17:04:19 +01:00
Sergei Golubchik
d4017d498f fix for windows builders 2015-11-19 15:53:36 +01:00
Sergei Golubchik
beded7d9c9 Merge branch '10.0' into 10.1 2015-11-19 15:52:14 +01:00
Oleksandr Byelkin
81e4ce5e31 Removed depricated optimizer_search_depth. 2015-11-19 10:56:30 +01:00
Venkatesh Duggirala
bb56c30ad7 Bug#17047208 REPLICATION DIFFERENCE FOR MULTIPLE TRIGGERS
Problem & Analysis: If DML invokes a trigger or a
    stored function that inserts into an AUTO_INCREMENT column,
    that DML has to be marked as 'unsafe' statement. If the
    tables are locked in the transaction prior to DML statement
    (using LOCK TABLES), then the same statement is not marked as
    'unsafe' statement. The logic of checking whether unsafeness
    is protected with if (!thd->locked_tables_mode). Hence if
    we lock the tables prior to DML statement, it is *not* entering
    into this if condition. Hence the statement is not marked
    as unsafe statement.

    Fix: Irrespective of locked_tables_mode value, the unsafeness
    check should be done. Now with this patch, the code is moved
    out to 'decide_logging_format()' function where all these checks
    are happening and also with out 'if(!thd->locked_tables_mode)'.
    Along with the specified test case in the bug scenario
    (BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS), we also identified that
    other cases BINLOG_STMT_UNSAFE_AUTOINC_NOT_FIRST,
    BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT, BINLOG_STMT_UNSAFE_INSERT_TWO_KEYS
    are also protected with thd->locked_tables_mode which is not right. All
    of those checks also moved to 'decide_logging_format()' function.
2015-11-19 13:59:27 +05:30
Sergei Golubchik
ab476a8d10 Merge branch '5.5' into 10.0 2015-11-18 22:03:02 +01:00
Sergei Petrunia
f91798dd1c MDEV-7370: Server deadlocks on renaming a table for which persistent statistics exists
RENAME TABLE code tries to update EITS statistics. It hung, because
it used an index on (db_name,table_name) to find the table, and attempted
to update these values at the same time. The fix is do what SQL UPDATE
statement does when updating index that it's used for scanning:
- First, buffer the rowids of rows to be updated,
- then make the second pass to actually update the rows

Also fixed the call to rename_table_in_stat_tables() in sql_rename.cc
to pass the correct new database (before, it passed old db_name so cross-
database renames were not handled correctly).

Variant #2, with review feedback addressed.
2015-11-18 21:31:45 +03:00
Monty
c2ec897745 Fixed buildbot failures on Solaris 64 bit
rpl/rpl_mdev382     ; Wrong replace in show_binlog_events2.inc
binlog/database     ; Different error on Solaris if file exists
mroonga/repair_table_no_index_file ; Different system error on Solaris
partition_not_blackhole ; Different error on Solaris
partition_myisam     ; Different error on Solaris

Some other failures in mroonga was because have_32bit.inc didn't correctly
detect 64 bits on Solaris. Fixed using DEFAULT_MACHINE instead of MACHINE_TYPE
for Sys_version_compile_machine.
2015-11-18 17:42:39 +02:00
Monty
f383cbcb03 Added some selects to rpl_parallel2.test to find out where it fails in buildbot 2015-11-18 14:46:30 +02: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
Nirbhay Choubey
f47124c9ef Incorrect statements binlogged on slave with do_domain_ids=(...)
In domain ID based filtering, a flag is used to filter-out
the events that belong to a particular domain. This flag gets
set when IO thread receives a GTID_EVENT for the domain on
filter list and its reset at the last event in the GTID group.
The resetting, however, was wrongly done before the decision to
write/filter the event from relay log is made. As a result, the
last event in the group will always pass through the filter.
Fixed by deferring the reset logic. Also added a test case.
2015-11-18 02:11:20 -05:00
Alexey Botchkov
836275bb20 MDEV-4829 BEFORE INSERT triggers dont issue 1406 error.
Turn the 'abort_on_warning' on for assigning value to fields.
2015-11-17 22:09:42 +04:00
Monty
905613f825 Fixed wrong tests found by buildbot 2015-11-17 18:19:59 +02:00
Jan Lindström
c0216f1d02 MDEV-9099: Test encryption.innodb_encryption_discard_import fails on buildbot 2015-11-17 09:46:40 +02:00
Nirbhay Choubey
f4421c893b Fix for some failing tests. 2015-11-16 12:39:56 -05:00
Sergei Golubchik
296338147c MDEV-8453 Alter table not returning engine errors
remove ~15 years old print_lock_error() function, use
handler::print_error() instead
2015-11-16 07:55:55 +01:00
Sergei Golubchik
a716433da3 MDEV-7298 plugins.cracklib_password_check test fails
remove the test that depended on the current cracklib dictionary
2015-11-16 07:55:55 +01:00
Nirbhay Choubey
dcb7996cb7 Fix/disable failing tests. 2015-11-15 17:24:47 -05:00
Kristian Nielsen
d85490afab Merge branch 'bb-10.1-knielsen' into 10.1 2015-11-14 10:19:53 +01:00
Kristian Nielsen
4008a3e55b Merge branch 'bb-10.0-knielsen' into 10.0 2015-11-14 10:11:09 +01:00
Monty
063a51ca5d Fixed buildbot failures with system_mysql_db_fix 2015-11-14 07:21:03 +02:00
Monty
1774230c24 Fixed regexp to fix buildbot failures 2015-11-13 19:47:31 +02:00
Kristian Nielsen
8f2e05f41c Merge branch 'mdev7818-4' into 10.1
Conflicts:
	mysql-test/suite/perfschema/r/stage_mdl_global.result
	sql/rpl_rli.cc
	sql/sql_parse.cc
2015-11-13 14:24:40 +01:00
Kristian Nielsen
6bf88cdd9d Merge branch 'mdev7818-4' into bb-10.0-knielsen 2015-11-13 14:08:38 +01:00
Elena Stepanova
1e63a81a3b Follow-up for a change MDEV-9040: fixed the 32-bit rdiff 2015-11-13 15:07:45 +02:00
Kristian Nielsen
ba02550166 MDEV-7818: Deadlock occurring with parallel replication and FTWRL
Problem is that FLUSH TABLES WITH READ LOCK first blocks threads from
starting new commits, then waits for running commits to complete. But
in-order parallel replication needs commits to happen in a particular
order, so this can easily deadlock.

To fix this problem, this patch introduces a way to temporarily pause
the parallel replication worker threads. Before starting FTWRL, we let
all worker threads complete in-progress transactions, and then
wait. Then we proceed to take the global read lock. Once the lock is
obtained, we unpause the worker threads. Now commits are blocked from
starting by the global read lock, so the deadlock will no longer occur.
2015-11-13 14:02:15 +01:00
Ajo Robert
15de3c6275 Bug#19817021 CRASH IN TABLE_LIST::PREPARE_SECURITY WHEN
DOING BAD DDL IN PREPARED STATEMENT

Analysis
========
A repeat execution of the prepared statement 'ALTER TABLE v1
CHECK PARTITION' where v1 is a view leads to server exit.

ALTER TABLE ... CHECK PARTITION is not applicable for views
and check for the same check is missing. This leads to
further execution and creation of derived table for the view
(Allocated under temp_table mem_root). Any reference to open
 view or related pointers from second execution leads to
server exit as the same was freed at previous execution closure.

Fix:
======
Added check for view in mysql_admin_table() on PARTITION
operation. This will prevent mysql_admin_table() from
going ahead and creating temp table and related issues.
Changed message on admin table view operation error to
be more appropriate.
2015-11-13 17:51:18 +05:30
Elena Stepanova
2828c2be55 MDEV-9124 mysqldump does not dump data if table name is same as view earlier on
While querying INFORMATION SCHEMA, check for a table's engine
only used table name, but not schema name; so, if there were different
rows with the same table name, a wrong one could be retrieved.
The result of the check affected the decision whether the contents
of the table should be dumped, and whether a DELAYED option can be used.
Fixed by adding a clause for table_schema to the query.
2015-11-13 03:23:22 +02:00
Sergei Petrunia
2776159e42 MDEV#7383: Update test results 2015-11-12 22:21:47 +03:00
Monty
2f63e2e2a0 MDEV-8426 mysqlbinlog: "Corrupted replication event was detected.
Not printing the value" with binlog-row-image=minimal"

Merged Rows_log_event::print_verbose_one_row() and log_event_print_value()
with MySQL 5.7
Added flush after writing of Table_map_log_event() to fix wrong order of
lines in output. This causes a lot of changes in some test results.
2015-11-10 13:46:57 +02:00
Monty
78ffeaa988 Fix that one can run rpl_binlog_errors with --debug 2015-11-10 13:46:57 +02: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
Sergei Petrunia
9f862ce026 MDEV#7383: engine-independent-stats column_stats has limited values for max/min values
Patch from Daniel Black:
- Change the charset of mysql.column_stats.{min_value, max_value} from
  utf8_bin varchar to varbinary
- Adjust the code that saves/reads the data accordingly.
- Also provide upgrade statement in mysql_system_tables_fix.sql
2015-11-09 17:58:35 +03:00
Nirbhay Choubey
7ec6558503 MDEV-9021: MYSQLD SEGFAULTS WHEN BUILT USING --WITH-MAX-INDEXES=128
The bitmap implementation defines two template Bitmap classes. One
optimized for 64-bit (default) wide bitmaps while the other is used for
all other widths.

In order to optimize the computations, Bitmap<64> class has defined its
own member functions for bitmap operations, the other one, however,
relies on mysys' bitmap implementation (mysys/my_bitmap.c).

Issue 1:
In case of non 64-bit Bitmap class, intersect() wrongly reset the
received bitmap while initialising a new local bitmap structure
(bitmap_init() clears the bitmap buffer) thus, the received bitmap was
getting cleared.

Fixed by initializing the local bitmap structure by using a temporary
buffer and later copying the received bitmap to the initialised bitmap
structure.

Issue 2:
The non 64-bit Bitmap class had the Iterator missing which caused
compilation failure.

Also added a cmake variable to hold the MAX_INDEXES value when supplied
from the command prompt. (eg. cmake .. -DMAX_INDEXES=128U). Checks have
been put in place to trigger build failure if MAX_INDEXES value is
greater than 128.

Test modifications:
* Introduced include/have_max_indexes_[64|128].inc to facilitate
skipping of tests for which the output differs with different
MAX_INDEXES.

* Introduced include/max_indexes.inc which would get modified by cmake
to reflect the MAX_INDEXES value used to build the server. This file
simply sets an mtr variable '$max_indexes' to show the MAX_INDEXES
value, which will then be consumed by the above introduced include file.

* Some tests (portions), dependent on MAX_INDEXES value, have been moved
to separate test files.
2015-11-09 09:28:00 -05: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
Elena Stepanova
125cf485b1 Fixed engine test results in accordance with changes made in scope of
commit 6b20342651
2015-11-06 17:52:57 +02:00
Oleksandr Byelkin
5041de97e1 MDEV-8701 Crash on derived query
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-05 17:50:59 +01:00
Jan Lindström
25f8738112 MDEV-9040: 10.1.8 fails after upgrade from 10.0.21
Analysis: Lengths which are not UNIV_SQL_NULL, but bigger than the following
number indicate that a field contains a reference to an externally
stored part of the field in the tablespace. The length field then
contains the sum of the following flag and the locally stored len.

This was incorrectly set to

define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_MAX)

When it should be

define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_DEF)

Additionally, we need to disable support for > 16K page size for
row compressed tables because a compressed page directory entry
reserves 14 bits for the start offset and 2 bits for flags.
This limits the uncompressed page size to 16k. To support
larger pages page directory entry needs to be larger.
2015-11-05 10:30:48 +02:00
Nirbhay Choubey
e947a52697 Update global_suppressions. 2015-11-04 21:58:07 -05:00