Commit graph

66318 commits

Author SHA1 Message Date
Marko Mäkelä
d9277732d7 Merge 10.1 into 10.2
This should also fix the MariaDB 10.2.2 bug
MDEV-13826 CREATE FULLTEXT INDEX on encrypted table fails.

MDEV-12634 FIXME: Modify innodb-index-online, innodb-table-online
so that they will write and read merge sort files. InnoDB 5.7
introduced some optimizations to avoid using the files for small tables.

Many collation test results have been adjusted for MDEV-10191.
2017-09-17 11:05:33 +03:00
Marko Mäkelä
a07b537b39 Field_varstring: Declare get_data() and get_length() as public
The underlying data members are declared public, so there is no
point in hiding these const accessors.
2017-09-15 20:09:41 +03:00
Alexander Barkov
65d26d1f31 MDEV-10191 non convertible chars convert() resulted in Null instead "?" on Windows
The problem was introduced by the patch for MDEV-7661,
which (in addition to the fix itself) included an attempt to make
CONVERT/CAST work in the same way with fields
(i.e. return NULL in strict mode if a non-convertable character found).
It appeared to be a bad idea and some users were affected by this
behavior change. Changing CONVERT/CAST not depend on sql_mode
(restoring pre-10.1.4 behavior).
2017-09-15 20:59:04 +04:00
sjaakola
a8b3c603c6 MW-394
* recorded new result file, original was copied from MariaDB
  which produces syntactically a bit different result
* semantics are same in MariaDB and ours result file
2017-09-15 09:45:55 +03:00
sjaakola
ed9f68f6ad MW-394
* changed thd_binlog_format to return configured binlog format in wsrep execution,
  regardless of binlogging setting (i.e. with or without binlogging)
* thd_binlog_format is used in innobase::write_row(), and would return confusing
  result there when log_bin==OFF
2017-09-15 09:22:54 +03:00
sjaakola
f3435fc37e MW-394
* ported the partition.test from MariaDB 10.3 code tree
* fix to TOI replicate ALTER TABLE EXCHANGE PARTITION statement
2017-09-15 09:09:26 +03:00
Alexander Barkov
250ca1c1d2 MDEV-13707 Server in ORACLE mode crashes on ALTER with wrong DEFAULT clause 2017-09-13 16:45:42 +04:00
Alexey Botchkov
dc82f70e9f MDEV-13633 JSON_ARRAY() - bad output with some UTF8 characters.
set_charset() calls added for Item_func_json_arran
        and Item_func_json_object::val_str-s.
2017-09-13 15:17:28 +04:00
Alexey Botchkov
a237a92099 MDEV-12877 Wrong result from JSON native function.
Set default charset for temporary paths so UDF call don't crash.
2017-09-13 00:36:09 +04:00
Alexey Botchkov
80a3837283 MDEV-12877 Wrong result from JSON native function.
JSON_QUOTE return type set to be JSON.
2017-09-12 19:15:31 +04:00
Alexey Botchkov
30db4e1fc7 MDEV-13786 compiler complains about uninitialized variable.
'=0' added to meke the compiler happy.
2017-09-12 15:33:30 +04:00
Alexey Botchkov
0cd731864e MDEV-13104 Json functions.
An extra ',' added to the JSON_MERGE result making it invalid.
2017-09-12 15:21:53 +04:00
Alexey Botchkov
467acc2119 MDEV-13324 JSON_SET returns NULL instead of object.
Superfluous ',' was added to the JSON_SET result so it became
        invalid.
2017-09-12 14:40:18 +04:00
Alexey Botchkov
ea876b39f3 MDEV-13716 point_big test fails in 10.2.
Implementation for the reverse spatial predicates was lost
        somehow.
2017-09-12 11:58:49 +04:00
Alexey Botchkov
6352ec2184 MDEV-12982 JSON_EXTRACT returns data for invalid JSON.
Let's check the validity to the end of the JSON.
2017-09-12 11:20:30 +04:00
Oleksandr Byelkin
6b5c0effe4 MDEV-13436 PREPARE doesn't work as expected & throws errors but MySQL is working fine
Now we allow derived in the from clause of subqueries so set
flag which prevent optimisation of subqueries during view
creation before derived processing so subquery will be
correctly printed in the view .frm.
2017-09-11 09:51:51 +02:00
Vladislav Vaintroub
d471469bd2 MDEV-13466 Implement --export option for MariaDB Backup
full server recovery is performed .
We start "mysqld" with  --bootstrap
and pass bootstrap script consisting of several FLUSH TABLES FOR export/
UNLOCK TABLES
2017-09-07 22:54:06 +00:00
Marko Mäkelä
3c45aa5895 Fix a typo to silence -Wimplicit-fallthrough 2017-09-06 19:32:56 +03:00
Marko Mäkelä
70db1e3b8a Merge 10.1 into 10.2 2017-09-06 19:28:51 +03:00
Marko Mäkelä
cd694d76ce Merge 10.0 into 10.1 2017-09-06 15:32:56 +03:00
andrelkin
8592ff9e8d MDEV-12731
Was reported as 'rpl.rpl_gtid_stop_start fails with Valgrind in buildbot and outside'.
The 'Conditional jump or move depends on uninitialized value' valgrind complaint is valid
and means THD::m_current_stage_key that is not initialized indeed by constructor.

Fixed with its initialization added to the initializer list of
THD::THD.  Double checked with mysql to have found a similar fixes for
the very same issue which was discovered after P_S merge to Maria
(60589aeee where the member is introduced) had been done.
2017-09-04 18:54:03 +03:00
Oleksandr Byelkin
17589989ee MDEV-10972: Insert from select / view / union -- repeatable crash in 10.1, 10.2 Linux/Mac/Windows
save thd->select_number between parsing and executions (in case it was not complete executed due to errors (for example epsent table))
2017-09-04 16:45:02 +02:00
Marko Mäkelä
7f99381288 Fix compiler warnings
metadata_lock_info_duration[]: Remove the unused variable.

Add some comments /* fall through */ to silence -Wimplicit-fallthrough
2017-09-01 15:40:49 +03:00
Marko Mäkelä
5660c061fa Merge 10.1 into 10.2 2017-08-31 18:06:11 +03:00
Marko Mäkelä
be45f083e6 Merge 10.0 into 10.1 2017-08-31 18:04:44 +03:00
Vladislav Vaintroub
6be93c3b8a MDEV-13693 : Fix parameter passing to my_error.
char* parameter is expected by the message ER_KEY_COLUMN_DOES_NOT_EXITS,
thus pass char*, rather than LEX_STRING.
2017-08-31 14:57:56 +00:00
Marko Mäkelä
4386ee8ccc Add ATTRIBUTE_NORETURN and ATTRIBUTE_COLD
ATTRIBUTE_NORETURN is supported on all platforms (MSVS and GCC-like).
It declares that a function will not return; instead, the thread or
the whole process will terminate.

ATTRIBUTE_COLD is supported starting with GCC 4.3. It declares that
a function is supposed to be executed rarely. Rarely used error-handling
functions and functions that emit messages to the error log should be
tagged such.
2017-08-31 09:30:55 +03:00
Marko Mäkelä
a36c369bda Merge 10.1 into 10.2
For running the Galera tests, the variable my_disable_leak_check
was set to true in order to avoid assertions due to memory leaks
at shutdown.

Some adjustments due to MDEV-13625 (merge InnoDB tests from MySQL 5.6)
were performed. The most notable behaviour changes from 10.0 and 10.1
are the following:

* innodb.innodb-table-online: adjustments for the DROP COLUMN
behaviour change (MDEV-11114, MDEV-13613)

* innodb.innodb-index-online-fk: the removal of a (1,NULL) record
from the result; originally removed in MySQL 5.7 in the
Oracle Bug #16244691 fix
377774689b

* innodb.create-index-debug: disabled due to MDEV-13680
(the MySQL Bug #77497 fix was not merged from 5.6 to 5.7.10)

* innodb.innodb-alter-autoinc: MariaDB 10.2 behaves like MySQL 5.6/5.7,
while MariaDB 10.0 and 10.1 assign different values when
auto_increment_increment or auto_increment_offset are used.
Also MySQL 5.6/5.7 exhibit different behaviour between
LGORITHM=INPLACE and ALGORITHM=COPY, so something needs to be tested
and fixed in both MariaDB 10.0 and 10.2.

* innodb.innodb-wl5980-alter: disabled because it would trigger an
InnoDB assertion failure (MDEV-13668 may need additional effort in 10.2)
2017-08-31 09:30:40 +03:00
Vladislav Vaintroub
43b262af55 One more attempt to fix dependencies with mysqld import/export libraries
with Visual Studio

simplify logic, VS generator seems to have problems if generated file
(with ADD_CUSTOM_COMMAND) depends on another generated file.

So, the fix is just to have mysqld_lib.{def,lib,exp} to be generated in a
single ADD_CUSTOM_COMMAND rather than two steps.
2017-08-30 14:44:18 +00:00
Vladislav Vaintroub
91826970c5 Fix threadpool to report connections aborted due to wait timeout.
Update wait_timeout.test to add test case for this.
2017-08-30 14:37:16 +00:00
Marko Mäkelä
829752973b Merge branch '10.0' into 10.1 2017-08-30 13:06:13 +03:00
Marko Mäkelä
4c91fd4cd6 Galera after-merge fixes
wsrep_drop_table_query(): Remove the definition of this ununsed function.

row_upd_sec_index_entry(), row_upd_clust_rec_by_insert():
Evaluate the simplest conditions first. The merge could have slightly
hurt performance by causing extra calls to wsrep_on().
2017-08-30 12:29:47 +03:00
Jan Lindström
01209de763 Merge remote-tracking branch 'origin/bb-10.1-jplindst' into 10.1 2017-08-29 20:30:18 +03:00
Andrei Elkin
888a8b69bd MDEV-13437 InnoDB fails to return error for XA COMMIT or XA ROLLBACK in read-only mode
Assertions failed due to incorrect handling of the --tc-heuristic-recover
option when InnoDB is in read-only mode either due to innodb_read_only=1
or innodb_force_recovery>3. InnoDB failed to refuse a XA COMMIT or
XA ROLLBACK operation, and there were errors in the error handling in
the upper layer.

This was fixed by making InnoDB XA operations respect the
high_level_read_only flag. The InnoDB part of the fix and
parts of the test main.tc_heuristic_recover were provided
by Marko Mäkelä.

LOCK_log mutex lock/unlock had to be added to fix MDEV-13438.
The measure is confirmed by mysql sources as well.

For testing of the conflicting option combination, mysql-test-run is
made to export a new $MYSQLD_LAST_CMD. It holds the very last value
generated by mtr.mysqld_start().  Even though the options have been
also always stored in $mysqld->{'started_opts'} there were no access
to them beyond the automatic server restart by mtr through the expect
file interface.

Effectively therefore $MYSQLD_LAST_CMD represents a more general
interface to $mysqld->{'started_opts'} which can be used in wider
scopes including server launch with incompatible options.

Notice another existing method to restart the server with incompatible
options relying on $MYSQLD_CMD is is aware of $mysqld->{'started_opts'}
(the actual options that the server is launched by mtr). In order to use
this method they would have to be provided manually.

NOTE: When merging to 10.2, the file search_pattern_in_file++.inc
should be replaced with the pre-existing search_pattern_in_file.inc.
2017-08-29 11:59:59 +03:00
Marko Mäkelä
f192b48d62 Merge 10.1 into 10.2 2017-08-29 10:07:33 +03:00
Marko Mäkelä
11352d52cd Merge 10.0 into 10.1 2017-08-28 15:05:46 +03:00
Sachin Setiya
5077cc0b1a Fix Merge Error 2017-08-23 16:49:42 +05:30
Jan Lindström
0aeff8c36a Fix compiler error. 2017-08-21 14:48:30 +03:00
Jan Lindström
c23efc7d50 Merge remote-tracking branch 'origin/10.0-galera' into 10.1 2017-08-21 13:35:00 +03:00
Jan Lindström
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-08-18 10:11:54 +03:00
Oleksandr Byelkin
c548fb0667 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-17 11:41:46 +02:00
Sergei Golubchik
cb1e76e4de Merge branch '10.1' into 10.2 2017-08-17 11:38:34 +02:00
Sergei Golubchik
a4885dde4c MDEV-13535 Query on MyISAM table corrupts the table
don't assume that the table always has a primary key,
head->s->primary_key might be MAX_KEY, which won't start keyread.
2017-08-16 18:44:17 +02:00
Igor Babaev
a28152aafc Fixed the bug mdev-13346.
The bug was caused by a defect of the patch for the bug 11081.
The patch was actually a port of the fix this bug from the mysql
code line. Later a correction of this fix was added to the
mysql code. Here's the comment this correction was provided with:

  Bug#16499751: Opening cursor on SELECT in stored procedure causes segfault
  This is a regression from the fix of bug#14740889.
  The fix started using another set of expressions as the source for
  the temporary table used for the materialized cursor. However,
  JOIN::make_tmp_tables_info() calls setup_copy_fields() which creates
  an Item_copy wrapper object on top of the function being selected.
  The Item_copy objects were not properly handled by create_tmp_table -
  they were simply ignored. This patch creates temporary table fields
  based on the underlying item of the Item_copy objects.

The test case for the bug 13346 was taken from mdev-13380.
2017-08-15 16:20:48 -07:00
Jan Lindström
5017c261d4 Fix test failure on test MW-86 and remove MW-360 test.
Merged from mysql-wsrep-bugs following:

GCF-1058 MTR test galera.MW-86 fails on repeated runs
Wait for the sync point sync.wsrep_apply_cb to be reached before
executing the test and clearing the debug flag sync.wsrep_apply_cb.

The race scenario:

Intended behavior:
node2: set sync.wsrep_apply_cb in order to start waiting in the background INSERT
node1: INSERT start
node2 (background): INSERT start
node1: INSERT end
node2: send signal to background INSERT: "stop waiting and continue executing"
node2: clear sync.wsrep_apply_cb as no longer needed
node2 (background): consume the signal
node2 (background): INSERT end
node2: DROP TABLE
node2: check no pending signals are left - ok

What happens occasionally (unexpected):
node2: set sync.wsrep_apply_cb in order to start waiting in the background INSERT
node1: INSERT start
node2 (background): INSERT start
node1: INSERT end
// The background INSERT still has _not_ reached the place where it starts
// waiting for the signal:
// DBUG_EXECUTE_IF("sync.wsrep_apply_cb", "now wait_for...");
node2: send signal to background INSERT: "stop waiting and continue executing"
node2: clear sync.wsrep_apply_cb as no longer needed
// The background INSERT reaches DBUG_EXECUTE_IF("sync.wsrep_apply_cb", ...)
// but sync.wsrep_apply_cb has already been cleared and the "wait" code is not
// executed. The signal remains unconsumed.
node2 (background): INSERT end
node2: DROP TABLE
node2: check no pending signals are left - failure, signal.wsrep_apply_cb is
pending (not consumed)

Remove MW-360 test case as it is not intended for MariaDB (uses
MySQL GTID).
2017-08-15 13:57:15 +03:00
=Ian Gilfillan
f066c89a97 MDEV-8579 Expand system variable documentation 2017-08-15 10:13:57 +04:00
Sergei Golubchik
b2af0ddcf9 enable innodb tests for virtual indexed columns (sic!)
collateral changes:
* remove a test from innodb_virtual_basic that is already present in
  gcol_keys_innodb
* set thd->abort_on_warning for inplace alter, just like it's set
  for copy_data_between_tables - to have warnings converted into
  errors identically in all alter algorithms
* don't ignore errors in TABLE::update_virtual_field
2017-08-14 19:45:59 +02:00
Sergei Golubchik
399e14f066 MDEV-13435 Crash when selecting virtual columns generated using JSON functions
don't allocate memory on thd->mem_root in every fix_fields(),
do it once and reuse.
2017-08-14 19:45:59 +02:00
Sergei Golubchik
d924e0b993 MDEV-13375 back_log ignored
doing SYSVAR_AUTOSIZE() because of back_log > max_connections
enabled "autosized" flag, and that made IS_SYSVAR_AUTOSIZE()
true, which triggered the second SYSVAR_AUTOSIZE.

Remove back_log <= max_connections limit, back_log
doesn't *always* have to be smaller than max_connections.
2017-08-14 19:45:59 +02:00
Sergei Golubchik
d07daa3125 MDEV-13313 JSON type alias is insufficiently compatible
make JSON an alias for LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin

(same collation that item_jsonfunc.cc is using internally)
2017-08-14 19:45:59 +02:00