Commit graph

3 commits

Author SHA1 Message Date
Michael Widenius
a7abddeffa Create 'main' test directory and move 't' and 'r' there 2018-03-29 13:59:44 +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
0992be927e MDEV-13068 Crash in Item::split_sum_func2 with INSERT SELECT using window functions
When running setup fields during the final step of insert using select
the final setup_fields does not have any sum functions. Our current
condition for calling split_sum_func however would attempt to use an empty
NULL sum_func_list, if the item contained a window function.

The solution is to not perform another split_sum_func for the item
containing a window function if we do not actually have a sum_func_list.
2017-06-20 13:38:35 +03:00