Commit graph

178867 commits

Author SHA1 Message Date
Vladislav Vaintroub
b652430f00 Fix tests 2017-09-22 23:59:28 +02:00
Alexander Barkov
884bd1d61b MDEV-13863 sql_mode=ORACLE: DECODE does not treat two NULLs as equivalent 2017-09-23 00:55:28 +04:00
Alexander Barkov
c39a744616 MDEV-13864 (final) Change Item_func_case to store the predicant in args[0] 2017-09-22 12:45:34 +04:00
Alexander Barkov
e12390a3bd MDEV-13864 (partial) Change Item_func_case to store the predicant in args[0]
This is a preparatory step for MDEV-13864.
It does not change behavior in any ways. It simply splits methods into smaller peaces.
The intent of this separate patch is to make more readable the main patch for
MDEV-13864 (which will actually move the predicant to args[0]).

1. Splitting fix_length_and_dec() into smaller pieces, adding:
  - bool aggregate_then_and_else_arguments(THD *thd);
  - bool aggregate_switch_and_when_arguments(THD *thd);

2. Splitting find_item() into smaller pieces, adding:
  - Item *find_item_searched();
  - Item *find_item_simple();

3. Splitting print() into smaller pieces, adding:

  - void print_when_then_arguments(String *str, enum_query_type query_type,
                                   Item **items, uint count);
  - void print_else_argument(String *str, enum_query_type query_type, Item *item)

4. Moving the maybe_null handling part related to ELSE from fix_length_and_dec()
   to fix_fields(), as in all other Item_func's.

5. Removing the unused String* argument from find_item().

6. Moving find_item() from public to private, as it's not needed outside.
2017-09-22 10:51:36 +04:00
Vladislav Vaintroub
c027717adb MDEV-12583 post-fix
Fix description of version_source_revision
2017-09-21 09:14:01 +00:00
Vladislav Vaintroub
0f3735842f MDEV-12583 : Bake the git hash into the binaries.
Added version_source_revision server "variable", for the git revision.
Also , mysql -V will show git revision.

"make dist" will now pack source_revision.h into the source package.
2017-09-21 08:48:46 +00:00
Marko Mäkelä
f70865bc9e Merge 10.2 into bb-10.2-ext 2017-09-21 08:10:43 +03:00
Marko Mäkelä
c7cc3d04da After-merge fix: Adjust one more result 2017-09-21 08:10:38 +03:00
Marko Mäkelä
916cd7846b Merge 10.2 into bb-10.2-ext 2017-09-21 07:58:25 +03:00
Marko Mäkelä
72a8024217 After-merge fix: Adjust some results. 2017-09-21 07:58:08 +03:00
Sergei Golubchik
f3b6c49f8f MDEV-13589 libmariadbclient18 is broken when using mariadb repo instead of debian's
followup for b5ead3a658

libmariadb3 does not replace 10.1's libmariadbclient18 anymore,
but it still conflicts with it, both install dialog.so
2017-09-20 23:13:50 +02:00
Marko Mäkelä
dc112d2f48 Fix -Wimplicit-fallthrough warnings (no functional change) 2017-09-20 22:46:25 +03:00
Marko Mäkelä
47cd984a3a Fix ut_ad(!leaf) failure in rec_get_offsets_func() with spatial index
This fixes a regression that only affects debug builds, caused by
commit 48192f963a which is necessary
preparation for MDEV-11369 instant ADD COLUMN. (Although that is a
10.3 task, to ease merges between 10.2 and 10.3, this change that
improves debug checks was pushed to 10.2 already.)

Unlike btr_pcur_restore_position(), rtr_cur_restore_position()
can create a search tuple out of a non-leaf page record. So,
we must pass 'bool leaf' parameter to dict_index_build_data_tuple().

dict_index_build_data_tuple(): Add a debug-only parameter 'bool leaf'.

rec_copy_prefix_to_dtuple(): Make the parameter debug-only.

row_sel_get_clust_rec_for_mysql(): In the debug code for spatial index,
remove an unnecessary call to buf_page_get_gen(), and use the already
latched block directly.
2017-09-20 22:38:37 +03:00
Marko Mäkelä
625951cb28 After-merge fix: Adjust some results. 2017-09-20 20:47:18 +03:00
Marko Mäkelä
a1e47974b7 Avoid comparison of unsigned to signed 2017-09-20 18:10:01 +03:00
Marko Mäkelä
fc3b1a7d2f Merge 10.2 into bb-10.2-ext 2017-09-20 17:47:49 +03:00
Marko Mäkelä
96f06f952d MDEV-13847 Allow ALTER TABLE…ADD SPATIAL INDEX…ALGORITHM=INPLACE
MDEV-13851 Always check table options in ALTER TABLE…ALGORITHM=INPLACE

In the merge of MySQL 5.7.9 to MariaDB 10.2.2, some code was included
that prevents ADD SPATIAL INDEX from being executed with ALGORITHM=INPLACE.

Also, the constant ADD_SPATIAL_INDEX was introduced as an alias
to ADD_INDEX. We will remove that alias now, and properly implement
the same ADD SPATIAL INDEX restrictions as MySQL 5.7 does:

1. table-rebuilding operations are not allowed if SPATIAL INDEX survive it
2. ALTER TABLE…ADD SPATIAL INDEX…LOCK=NONE is not allowed

ha_innobase::prepare_inplace_alter_table(): If the ALTER TABLE
requires actions within InnoDB, enforce the table options (MDEV-13851).
In this way, we will keep denying ADD SPATIAL INDEX for tables
that use encryption (MDEV-11974), even if ALGORITHM=INPLACE is used.
2017-09-20 16:53:34 +03:00
Marko Mäkelä
e53e58d4e4 Add a missing const qualifier 2017-09-20 16:53:34 +03:00
Marko Mäkelä
48192f963a Add the parameter bool leaf to rec_get_offsets()
This should affect debug builds only. Debug builds will check that
the status bits of ROW_FORMAT!=REDUNDANT records match the is_leaf
parameter.

The only observable change to non-debug should be the addition of
the is_leaf parameter to the function rec_copy_prefix_to_dtuple(),
and the removal of some calls to update the adaptive hash index
(it is only built for the leaf pages).

This change should have been made in MySQL 5.0.3, instead of
introducing the status flags in the ROW_FORMAT=COMPACT record header.
2017-09-20 16:53:34 +03:00
Vicențiu Ciorbaru
2d9f5f69d4 Merge branch '10.1' into 10.2 2017-09-20 10:46:09 +03:00
Vicențiu Ciorbaru
c9e111202e Merge branch '10.0' into 10.1 2017-09-20 10:35:11 +03:00
Vicențiu Ciorbaru
246d321f67 Merge branch '10.2' of github.com:MariaDB/server into 10.2 2017-09-20 10:33:13 +03:00
Vicențiu Ciorbaru
78f6f2b73b Merge branch 'bb-10.1-vicentiu' into 10.1 2017-09-20 10:25:51 +03:00
Vicențiu Ciorbaru
20d4cac6db Merge branch 'bb-10.0-vicentiu' into 10.0 2017-09-20 10:24:31 +03:00
Jan Lindström
0b9437951c MDEV-13850: Uninitialized variable at wsrep_binlog.cc:455 2017-09-20 09:57:39 +03:00
Marko Mäkelä
c53f57c390 Remove DICT_UNIVERSAL
The only universal index in InnoDB was the change buffer.
It suffices to keep the DICT_IBUF flag (which, like DICT_UNIVERSAL,
is not written to any persistent data structure).
2017-09-20 08:44:40 +03:00
Marko Mäkelä
5792b016f1 Fix a typo
The function check_mdl_lock_works() is for debug builds only.
2017-09-20 08:44:40 +03:00
Marko Mäkelä
6b687a0fde Introduce page_rec_is_leaf() and clean up page0page.h
Define some page accessor functions inline in page0page.h,
reducing code duplication in page0page.ic.

Use page_rec_is_leaf() instead of page_is_leaf() where possible.
2017-09-20 08:42:44 +03:00
Vicențiu Ciorbaru
e42c6d1afe Update libmariadb submodule 2017-09-20 00:46:18 +03:00
Vicențiu Ciorbaru
d66856c4f7 Update testcase post merge 2017-09-20 00:46:08 +03:00
Vicențiu Ciorbaru
325718c996 Remove libmariadbclient18.links post merge
It is only valid for 10.1
2017-09-20 00:46:01 +03:00
Marko Mäkelä
77b241eb10 Correct a test result 2017-09-19 20:32:33 +03:00
Oleksandr Byelkin
97c2a7354b MDEV-13290: Assertion Assertion !is_set() || (m_status == DA_OK_BULK && is_bulk_op())' or ! is_set()' failed
Check error status which can be set by conversion procedures.
2017-09-19 16:19:06 +02:00
Vicențiu Ciorbaru
a1e589be9b MDEV-13354: Server crashes in find_field_in_tables upon PS with window function and subquery
When creating an Item_direct_view_ref we were setting the
Name_resolution_context based on TABLE_LIST::view member variable.
However, for derived tables this member is NULL. To not set a wrong
context, if TABLE_LIST::view is empty, use THD::lex instead.
2017-09-19 15:14:10 +03:00
Vicențiu Ciorbaru
454b9b1bdc MDEV-13774: Server Crash on Execute of SQL Statement
Window functions can not be used as arguments to aggregate functions, as
the aggregation happens before window function computation. Disallow
such constructs by returning an error.

In order to detect this case a change was needed in the base
Item_sum_xxx::fix_fields to propagate the with_window_func flag.

Item_func_group_concat requires the same change.
2017-09-19 15:14:10 +03:00
Vicențiu Ciorbaru
33209350f7 MDEV-13649: Server crashes in set_field_to_null_with_conversions or in Field::set_notnull
Item_cond did not correctly propagate with_window_func flag in the Item
tree. Without it, we would not call Item::split_sum_func correctly and the
window function's result_field would remain NULL.
2017-09-19 15:14:10 +03:00
Vicențiu Ciorbaru
02eda36e4e MDEV-13358: FIRST_V throw SQL Fehler (1292): Incorrect datetime value
This is backport of 25ad623d64 for 10.2.

The issue is similar to the one from MDEV-13240. Item::save_in_field()
returns an error during tmp table population in a create table from select query
as we try to save an empty string as a date value when
force_return_blank is set to true for window functions.

    MDEV-13240 Wrong warning with MAX(datetime_field) OVER (...)

    The problem resided in Item_window_func implementation,
    and it was revealed by bb-10.2-ext specific changes:

    Item_window_func::save_in_field() works differently in bb-10.2-ext vs 10.2:

    - 10.2 goes through val_str()
    - bb-10.2-ext goes through get_date(), due to Type_handler related changes.
      get_date() tries to convert empty string to DATETIME, hence the warning.

    During a discussion with Vicentiu, it was decided to fix
    Item_window_func::val_xxx() to return NULL
    (instead of an "empty" value, such as 0 for numbers and '' for strings)
    when force_return_blank is set.
2017-09-19 15:14:10 +03:00
Vicențiu Ciorbaru
5b9c32ede0 Merge remote-tracking branch 'connect/10.2' into 10.2 2017-09-19 15:13:53 +03:00
Alexey Botchkov
99fbf3eb59 MDEV-13137 MySQL 5.6.23 Crashes when SET GLOBAL server_audit_logging=OFF;
The MySQL 5.6 doesn't always send the MYSQL_AUDIT_GENERAL_LOG
        notification. So we have to suppress the log_current_query()
        in this case.
2017-09-19 14:01:12 +04:00
Alexey Botchkov
389f7cdf3c MDEV-13137 MySQL 5.6.23 Crashes when SET GLOBAL server_audit_logging=OFF;
The MySQL 5.6 doesn't always send the MYSQL_AUDIT_GENERAL_LOG
        notification. So we have to suppress the log_current_query()
        in this case.
2017-09-19 13:43:36 +04:00
Vicențiu Ciorbaru
22c322c649 Merge branch '10.1' into 10.2 2017-09-19 12:43:02 +03:00
Vicențiu Ciorbaru
ec6042bda0 Merge branch '10.0' into 10.1 2017-09-19 12:06:50 +03:00
Vicențiu Ciorbaru
b337a06829 Revert d9bc5e03d788b958ce8c76e157239953db60adb2 from Oracle (in XtraDB) 2017-09-19 11:53:59 +03:00
Vicențiu Ciorbaru
dab6f56098 Revert Bug #25175249 ASSERTION: (TEMPL->IS_VIRTUAL && !FIELD) || (FIELD && FIELD->PREFIX_LEN ? FIELD
We don't want this in innodb/xtradb
2017-09-19 11:46:38 +03:00
Vicențiu Ciorbaru
cbd62feee5 Merge branch 'merge-xtradb-5.6' into 10.0 2017-09-19 11:35:09 +03:00
Vicențiu Ciorbaru
745cd57ae7 Merge branch 'merge-tokudb-5.6' into 10.0 2017-09-19 11:18:17 +03:00
Vicențiu Ciorbaru
0e15396341 Fix fall-through warning 2017-09-19 11:17:35 +03:00
Vicențiu Ciorbaru
618d8fdf37 5.6.37-82.2 2017-09-19 10:58:12 +03:00
Vicențiu Ciorbaru
ba0ee91077 Merge branch '10.0-galera' into 10.1 2017-09-19 10:20:01 +03:00
Vicențiu Ciorbaru
b2c0cca6b0 Fix connect merge problems
* CMakeLists.txt erroneous duplicated lines.
* Unneded differences in tabjson.cpp
* Unneded space differences in jdbconn.{cpp|h}
2017-09-19 09:37:17 +03:00