Commit graph

183026 commits

Author SHA1 Message Date
Otto Kekäläinen
788314ddf8 Deb: Rename all 10.3 files into 10.4 as this is a 10.4 branch now 2018-08-04 23:43:07 -05:00
Igor Babaev
0f9efd54ce MDEV-16359 wrong result (extra rows) on the query with UNION and brackets
Due to an obvious bug in st_select_lex_unit::reset_distinct() a union
without duplicates of more than 2 selects could return a result set
containing duplicate rows if this union was enclosed in ().
2018-08-03 23:27:24 -07:00
Alexander Barkov
980aa3e71d MDEV-16888 Add virtual Type_handler::cond_notnull_field_isnull_to_field_eq_zero() 2018-08-03 07:55:50 +04:00
Alexander Barkov
8ecc75373f MDEV-16884 Remove tests for field_type() in Item_cache_temporal 2018-08-02 17:49:28 +04:00
Alexander Barkov
c7115428ed MDEV-16881 Remove Item::get_temporal_with_sql_mode() and val_xxx_from_date() 2018-08-02 15:36:13 +04:00
Rasmus Johansson
41acca8bfa Added -j option to dpkg-buildpackage to speed up build 2018-08-02 11:28:59 +00:00
Alexander Barkov
54fc47960d MDEV-16874 Implement class Item_handled_func 2018-08-01 16:15:16 +04:00
Galina Shalygina
af46c25760 MDEV-16727: Server crashes in Item_equal_iterator<List_iterator_fast, Item>::get_curr_field()
The bug appeares because of the lamely saved list of multiple equalities.
To fix it and_new_conditions_to_optimized_cond() was changed.
2018-08-01 14:42:47 +03:00
Alexander Barkov
b1ae4e7e15 MDEV-16864 Implement class Item_func_timestamp 2018-07-31 16:58:02 +04:00
Alexander Barkov
2bbee0e1ec MDEV-16861 Split Item::update_null_value() into a new virtual method in Type_handler 2018-07-31 10:09:53 +04:00
Alexander Barkov
28ff7e89c6 MDEV-16852 Get rid of Item_temporal_hybrid_func::fix_temporal_type()
- Implementing the task according to the MDEV description.
- Adding a helper class Sec6_add to share the code in type-specific
  branches in Item_func_add_time::get_date().
2018-07-30 20:40:48 +04:00
Galina Shalygina
aee3d162d2 MDEV-16730: Server crashes in Bitmap<64u>::merge
The problem appears because of the pushdown of a non-pushable condition 'cond'
into the materialized derived table/view. To prevent pushdown a map of
tables that are used in 'cond' should be updated. This call is missing
because of the MDEV-12387 changes. The call is added in the
setup_jtbm_semi_joins() method.
2018-07-29 14:40:58 +02:00
Galina Shalygina
2a3d3e052f MDEV-16721: Assertion `ctx.compare_type_handler()->cmp_type() != STRING_RESULT'
failed

The bug appeared as in MDEV-12387 setup_jtbm_semi_joins() procedure had been
devided into two functions, one called before optimization of WHERE clause
and another after this optimization. When the second function was called for
a degenerated jtbm semi join equalities connecting the subselect and
the parent select were created but invocation of fix_fields() for these
equalities was missing.
2018-07-27 19:00:53 +02:00
Alexander Barkov
998c97e865 MDEV-16823 Add Type_handler::Column_definition_reuse_fix_attributes()
Adding new methods:

- virtual void Type_handler::Column_definition_reuse_fix_attributes()
  according to the MDEV description

- virtual uint32 Field::character_octet_length()
  To simplify handling of Column_definition::length for
  TEXT and VARCHAR columns (with and without compression).
2018-07-25 13:08:01 +04:00
Alexander Barkov
9c0f5a252b Merge remote-tracking branch 'origin/10.3' into 10.4 2018-07-25 08:25:57 +04:00
Jacob Mathew
d6594847cf MDEV-16246: insert timestamp into spider table from mysqldump gets wrong time zone.
The problem occurred because the Spider node was incorrectly handling
timestamp values sent to and received from the data nodes.

The problem has been corrected as follows:
- Added logic to set and maintain the UTC time zone on the data nodes.
  To prevent timestamp ambiguity, it is necessary for the data nodes to use
  a time zone such as UTC which does not have daylight savings time.
- Removed the spider_sync_time_zone configuration variable, which did not
  solve the problem and which interfered with the solution.
- Added logic to convert to the UTC time zone all timestamp values sent to
  and received from the data nodes.  This is done for both unique and
  non-unique timestamp columns.  It is done for WHERE clauses, applying to
  SELECT, UPDATE and DELETE statements, and for UPDATE columns.
- Disabled Spider's use of direct update when any of the columns to update is
  a timestamp column.  This is necessary to prevent false duplicate key value
  errors.
- Added a new test spider.timestamp to thoroughly test Spider's handling of
  timestamp values.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.

Merged:
  Commit 97cc9d3 on branch bb-10.3-MDEV-16246
2018-07-24 15:57:13 -07:00
Alexander Barkov
294a426088 Merge remote-tracking branch 'origin/10.2' into 10.3 2018-07-24 18:44:49 +04:00
Alexander Barkov
a8227a1543 MDEV-16814 CREATE TABLE SELECT JSON_QUOTE(multibyte_charset_expr) makes a field of a wrong length 2018-07-24 18:15:15 +04:00
Alexander Barkov
f74d2a9faa MDEV-16729 VARCHAR COMPRESSED is created with a wrong length for multi-byte character sets
Field_varstring::sql_type() did not calculate character length correctly.
Using char_length() instead of the bad code.
2018-07-24 13:21:19 +04:00
Alexander Barkov
a78d1aaaa3 MDEV-16806 Add Type_handler::create_literal_item() 2018-07-24 12:00:17 +04:00
Jacob Mathew
45ab00f097 MDEV-15786: ERROR 1062 (23000) at line 365: Duplicate entry 'spider' for key 'PRIMARY'
The problem occurs on Ubuntu where a Spider package is installed on the system
separately from the MariaDB package.  MariaDB and Spider upgrades leave the
Spider plugin improperly installed.  Spider is present in the mysql.plugin
table but is not present in information_schema.

The problem has been corrected in Spider's installation script.  Logic has
been added to check for Spider entries in both information_schema and
mysql.plugin.  If Spider is present in mysql.plugin but is not present in
information_schema, then Spider is first removed from mysql.plugin.  The
subsequent plugin install of Spider will insert entries in both mysql.plugin
and information_schema.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.

Cherry-Picked:
  Commit 0897d81 on branch bb-10.3-MDEV-15786
2018-07-23 14:14:23 -07:00
Jacob Mathew
a86a02a844 MDEV-15786: ERROR 1062 (23000) at line 365: Duplicate entry 'spider' for key 'PRIMARY'
The problem occurs on Ubuntu where a Spider package is installed on the system
separately from the MariaDB package.  MariaDB and Spider upgrades leave the
Spider plugin improperly installed.  Spider is present in the mysql.plugin
table but is not present in information_schema.

The problem has been corrected in Spider's installation script.  Logic has
been added to check for Spider entries in both information_schema and
mysql.plugin.  If Spider is present in mysql.plugin but is not present in
information_schema, then Spider is first removed from mysql.plugin.  The
subsequent plugin install of Spider will insert entries in both mysql.plugin
and information_schema.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.

Cherry-Picked:
  Commit 0897d81 on branch bb-10.3-MDEV-15786
2018-07-23 13:57:35 -07:00
Marko Mäkelä
f418661efa Merge 10.2 into 10.3 2018-07-23 18:56:52 +03:00
Marko Mäkelä
9d1f3bf2e9 row_purge_poss_sec(): Add debug instrumentation
This helped fix MDEV-16779.
2018-07-23 18:34:06 +03:00
Marko Mäkelä
c5ba13dda0 MDEV-15855 cleanup: Privatize purge_vcol_info_t
Declare all fields of purge_vcol_info_t private, and add
accessor functions.
2018-07-23 18:31:42 +03:00
Marko Mäkelä
a7a0c533c2 Follow-up to MDEV-15855: Remove bogus debug assertions
During a table-rebuilding operation, the function table_name_parse()
can encounter a table name that starts with #sql. Here is an example
of a failure:

CURRENT_TEST: gcol.innodb_virtual_basic
mysqltest: At line 1204: query 'alter table t drop column d ' failed:
2013: Lost connection to MySQL server during query

Let us just remove these bogus debug assertions.

If the final renaming phase during ALTER TABLE never fails, it
should not do any harm to skip the purge. If it does fail, then
we might end up 'leaking' some delete-marked records in the
indexes on virtual columns of the original table, and these
garbage records would keep consuming space until the indexes are
dropped or the table is successfully rebuilt.
2018-07-23 17:50:56 +03:00
Thirunarayanan Balathandayuthapani
730f6c912c MDEV-16779 Assertion !rw_lock_own failed upon purge
This is a regression caused by the fix of MDEV-15855.

purge_vcol_info_t::set_used(): Add a missing condition.

row_purge_poss_sec(): Invoke set_used() in order to
have !is_first_fetch() when retrying.
2018-07-23 17:50:20 +03:00
Marko Mäkelä
b660261be1 ut_print_buf_hex(): Correctly dump the hex
This should affect at least rec_printer() output.
2018-07-23 17:49:01 +03:00
Marko Mäkelä
73af075366 Reduce the number of rw_lock_own() calls
Replace pairs of rw_lock_own() calls with
calls to rw_lock_own_flagged().

These calls are only present in debug builds.
2018-07-23 17:49:01 +03:00
Marko Mäkelä
b9865b289a Follow-up to MDEV-12266: Remove latch_t::m_temp_fsp
There is only one temporary tablespace. Reserving a data member in
each read-write lock object for a Boolean flag seems like a huge waste,
especially because this field was only actually used in debug builds.

LatchDebug::check_order(): Compare to fil_system.temp_space->latch.
2018-07-23 12:09:59 +03:00
Igor Babaev
d0d073b1aa Corrected and added back the test case for MDEV-15151. 2018-07-20 19:32:28 -07:00
Alexander Barkov
fee4632387 MDEV-15758 Split Item_bool_func::get_mm_leaf() into virtual methods in Field and Type_handler 2018-07-20 11:07:19 +04:00
Alexander Barkov
6bfeace10b MDEV-15759 Expect "Impossible WHERE" for indexed_int_column=out_of_range_int_constant 2018-07-19 17:09:24 +04:00
Sachin
9827c5e103 MDEV-16192 Table 't' is specified twice, both as a target for 'CREATE' and...
as a separate source for data

Actually MDEV-15867 and MDEV-16192 are same, Slave adds "or replace" to create
table stmt. So create table t1 is create or replace on slave. So this bug
is not because of replication, We can get this bug on general server if we
manually add or replace to create query.

Problem:- So if we try to create table t1 (same name as of temp table t1 ) via
   CREATE or replace TABLE t AS SELECT * FROM t;
Since in this query we are creating table from select * from t1 , we call
unique_table function to see whether if source and destination table are same.
But there is one issue unique_table does not account if source table is tmp table
in this case source and destination table can be same.

Solution:- We will change find_dup_table to not to look for temp table if
CHECK_DUP_SKIP_TEMP_TABLE flag is on.
2018-07-18 20:58:59 +05:30
Alexey Botchkov
25410d448d MDEV-15473 Isolate/sandbox PAM modules, so that they can't crash the server.
mysql_install_db.sh script fixed.
2018-07-14 23:06:49 +04:00
Monty
141a5b2484 rpl_row_001.test failed in internal check
Problem was as part of SET PASSWORD FOR ROOT, mysql.user table changed
compared to how it was originally created. (plugin changed value)
2018-07-14 20:05:46 +03:00
Monty
7fda6161bc Update version to 10.4.0 2018-07-14 19:49:59 +03:00
Monty
a9ca819897 Call alloc() instead of realloc()
Use alloc() if we don't need original string (avoid copy)
Removed not needed test of str_length in sql_string.cc
2018-07-13 20:14:27 +03:00
Alexander Barkov
5180eda342 Adding forgotten "include/have_debug.inc" into type_temporal_mysql56_debug.test
This is a post-fix for MDEV-16542
2018-07-10 17:19:02 +04:00
Jacob Mathew
813b739850 MDEV-16246: insert timestamp into spider table from mysqldump gets wrong time zone.
The problem occurred because the Spider node was incorrectly handling
timestamp values sent to and received from the data nodes.

The problem has been corrected as follows:
- Added logic to set and maintain the UTC time zone on the data nodes.
  To prevent timestamp ambiguity, it is necessary for the data nodes to use
  a time zone such as UTC which does not have daylight savings time.
- Removed the spider_sync_time_zone configuration variable, which did not
  solve the problem and which interfered with the solution.
- Added logic to convert to the UTC time zone all timestamp values sent to
  and received from the data nodes.  This is done for both unique and
  non-unique timestamp columns.  It is done for WHERE clauses, applying to
  SELECT, UPDATE and DELETE statements, and for UPDATE columns.
- Disabled Spider's use of direct update when any of the columns to update is
  a timestamp column.  This is necessary to prevent false duplicate key value
  errors.
- Added a new test spider.timestamp to thoroughly test Spider's handling of
  timestamp values.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.

Cherry-Picked:
  Commit 97cc9d3 on branch bb-10.3-MDEV-16246
2018-07-09 16:09:20 -07:00
Alexander Barkov
29da7a1a9a MDEV-16542 Fix ALTER TABLE FORCE to upgrade temporal types 2018-07-09 18:50:06 +04:00
Marko Mäkelä
bbf780efcd Merge 10.2 into 10.3 2018-07-07 11:39:38 +03:00
Marko Mäkelä
1cc1d0429d MDEV-16664: Change the default to innodb_lock_schedule_algorithm=fcfs
The parameter innodb_lock_schedule_algorithm was introduced in
MariaDB Server 10.1.19, 10.2.13, 10.3.4 as part of MDEV-11039.
In MariaDB 10.1, the default value of the parameter is 'fcfs',
that is, the existing algorithm is used by default. But in
later versions of MariaDB Server, the parameter was 'vats',
enabling the new algorithm.

Because the new algorithm is triggering a debug assertion failure
that suggests corruption of the transactional lock data structures,
we will revert to the old algorithm by default until we have
resolved the problem.
2018-07-07 11:34:26 +03:00
Marko Mäkelä
934d5f95d3 Merge 10.2 into 10.3 2018-07-06 22:18:35 +03:00
Oleksandr Byelkin
aa01f51bde Fix of feedback plugin.
Assign "SELECT" to the table before it usage.
2018-07-06 16:26:19 +02:00
Thirunarayanan Balathandayuthapani
8b0d4cff07 MDEV-15855 Deadlock between purge thread and DDL statement
Problem:
========
Truncate operation holds MDL on the table (t1) and tries to
acquire InnoDB dict_operation_lock. Purge holds dict_operation_lock
and tries to acquire MDL on the table (t1) to evaluate virtual
column expressions for indexed virtual columns.
It leads to deadlock of purge and truncate table (DDL).

Solution:
=========
If purge tries to acquire MDL on the table then it should do the following:

i) Purge should release all innodb latches (including dict_operation_lock)
before acquiring metadata lock on the table.

ii) After acquiring metadata lock on the table, it should check whether the
table was dropped or renamed. If the table is dropped then purge should
ignore the undo log record. If the table is renamed then it should
release the old MDL and acquire MDL on the new name.

iii) Once purge acquires MDL, it should use the SQL table handle for all
the remaining virtual index for the purge record.

purge_node_t: Introduce new virtual column information to know whether
the MDL was acquired successfully.

This is joint work with Marko Mäkelä.
2018-07-06 17:13:53 +03:00
Oleksandr Byelkin
0e531581e0 A fix moved from sql_yacc.yy to sql_yacc_ora.yy. 2018-07-06 10:33:00 +02:00
Oleksandr Byelkin
6fae04ea7d Fixed compile warning of windows. 2018-07-06 09:03:13 +02:00
Oleksandr Byelkin
f9849766b3 Added new warnings for windows specific test. 2018-07-06 09:02:40 +02:00
Marko Mäkelä
e3207b6c13 MDEV-14188 mariabackup.incremental_encrypted wrong result
Add an explicit redo log flush. In this test
innodb_flush_log_at_trx_commit was 2 by default.
It is also possible that this failure occurs because of MDEV-15740.
2018-07-06 09:07:52 +03:00