Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Console View


Categories: connectors experimental galera main
Legend:   Passed Failed Warnings Failed Again Running Exception Offline No data

connectors experimental galera main
KhaledR57
MDEV-37072: Implement IS JSON predicate

Add support for the SQL standard IS JSON predicate with the syntax:
expr IS [ NOT ] JSON [ { VALUE | ARRAY | OBJECT | SCALAR } ]
[ { WITH | WITHOUT } UNIQUE [ KEYS ] ]

The predicate allows checking if an expression is valid JSON
and optionally constrains the JSON type (VALUE, ARRAY, OBJECT,
SCALAR) and whether object keys are unique.

The implementation includes:
- Basic IS JSON validation
- Support for NOT operator
- Type constraints (VALUE, ARRAY, OBJECT, SCALAR)
- Unique keys constraint (WITH/WITHOUT UNIQUE KEYS)
Aleksey Midenkov
MDEV-37275 Cannot remove default value of NOT NULL column

Run-time has semantics duplication in unireg_check, default_value and
flags, so all three must be in sync before FRM creation. Special
unireg_check values for temporal field types was introduced by
32b28f92980 WL#1266 "Separate auto-set logic from TIMESTAMP type."
Vladislav Vaintroub
make this brilliant piece of code compiled

- proper dependencies, if it is going to use all server plugins, it needs
to depend on all server plugins (build time)

- Remove C++ for directory creation, scanning the whole build directory
and what not. CMake can do it , better. CMake knows what plugins are there,
and their paths. CMake knows what plugins belong to what config in
multi-config builds.

- Allow ':' as plugin separator in the list on Windows. It was previously
  wrongly disabled, citing it is used after drive letter. We do not have
  paths in plugin_load, and ':' can't even be used in file names on Windows

  This simplifies plugin-load passing in cmake custom command, passing
  semicolon delimited things is a mess, because both CMake and unix shell
  try to interpret it.

- Remove mariadb-migrate-config-file from minbuild list, it is
  there by mistake, it forces max-build due to its dependencies

- Fix the test case, so it skips if the thing is not built
- Do not test on Windows, there are extensive Unixisms in the test case

Hopefully the constant rebuilds of the utility (it depends on the whole
server including all plugins!) will annoy everyone so something better is
going to be written. Hint - extract the variables etc information at
runtime, not at the compile time.
Vladislav Vaintroub
make this brilliant piece of code compiled

- proper dependencies, if it is going to use all server plugins, it needs
to depend on all server plugins (build time)

- Remove C++ for directory creation, scanning the whole build directory
and what not. CMake can do it , better. CMake knows what plugins are there,
and their paths. CMake knows what plugins belong to what config in
multi-config builds.

- Allow ':' as plugin separator in the list on Windows. It was previously
  wrongly disabled, citing it is used after drive letter. We do not have
  paths in plugin_load, and ':' can't even be used in file names on Windows

  This simplifies plugin-load passing in cmake custom command, passing
  semicolon delimited things is a mess, because both CMake and unix shell
  try to interpret it.

- Remove mariadb-migrate-config-file from minbuild list, it is
  there by mistake, it forces max-build due to its dependencies

- Fix the test case, so it skips if the thing is not built
- Do not test on Windows, there are extensive Unixisms in the test case

Hopefully the constant rebuilds of the utility (it depends on the whole
server including all plugins!) will annoy everyone so something better is
going to be written. Hint - extract the variables etc information at
runtime, not at the compile time.
bsrikanth-mariadb
MDEV-31255: Crash with fulltext search subquery in explain delete/update

ft_handler isn't getting initialized for subqueries inside explain
delete/update queries. However, ft_handler is accessed inside ha_ft_read(),
and is the reason for NULL pointer exception.
This is not the case with non-explain delete/update queries, as
well as explain/non-explain select queries.

Follow the approach the SELECT statements are using in
JOIN::optimize_constant_subqueries(): remove SELECT_DESCRIBE
flag when invoking optimization of constant subqueries.

Single-table UPDATE/DELETEs have SELECT_LEX but don't have JOIN.
So, we make optimize_constant_subqueries() not to be a member
of JOIN class, and instead move it to SELECT_LEX, and then
invoke it from single-table UPDATE/DELETE as well as for SELECT queries.
Aleksey Midenkov
MDEV-32317 ref_ptrs exhaust on multiple ORDER by func from winfunc

Each ORDER and WHERE slot may generate split, see code like this:

  if ((item->with_sum_func() && item->type() != Item::SUM_FUNC_ITEM) ||
    item->with_window_func())
  item->split_sum_func(thd, ref_ptrs, all_fields, SPLIT_SUM_SELECT);

Such kind of code is done in JOIN::prepare(), setup_order(),
setup_fields(), setup_group() and split_sum_func2() itself.

Since we are at the phase of ref_ptrs allocation, items are not fixed
yet and we cannot calculate precisely how much ref_ptrs is needed. We
can estimate at most how much is needed. In the worst case each window
function generates split on each ORDER BY field, GROUP BY field and
WHERE field, so the counts of these should be multiplied by window
funcs count.

As the split can be done in both setup_without_group() and
JOIN::prepare() simultaneously, the factor of window funcs should be
multiplied by 2.

The similar case may be with inner sumfunc items as of the condition

  item->with_sum_func() && item->type() != Item::SUM_FUNC_ITEM

but factor of these is harder to predict at the stage of unfixed
items.
Sergei Golubchik
MDEV-37481 empty value inserted if BEFORE trigger and ENUM NOT NULL field

must use field->make_empty_rec_reset() for resetting a field
to its type default value. ENUM is historically weird.
Aleksey Midenkov
MDEV-37275 Cannot remove default value of NOT NULL column

Run-time has semantics duplication in unireg_check, default_value and
flags, so all three must be in sync before FRM creation. Special
unireg_check values for temporal field types was introduced by
32b28f92980 WL#1266 "Separate auto-set logic from TIMESTAMP type."
Sergei Golubchik
MDEV-38506 fix the test

followup for 11f228cbb2b3
Sergei Golubchik
MDEV-38209 REFERENCES permission on particular schema is sometimes ignored

some I_S tables require "any non-SELECT privilege on the table".
If only SELECT was granted on the global level and something non-SELECT
on the schema level, then we need to check schema level privileges
explicitly, because check_grant() doesn't do that and get_all_tables()
doesn't look deeper if SELECT is present on the global level.
Sergei Golubchik
MDEV-37326 Assertion failure upon update on versioned partitioned table with long unique under READ COMMITTED

if ha_partition::position() is asked for a position of a closed partition,
don't ask the underlying engine, just set the partition number.

in fact, the partition is open and can be perfectly used, the assert
is over-zealous. but in the future it might be actually closed.
Sergey Vojtovich
MDEV-38471 - funcs_1.processlist_val_no_prot fails sporadically

Test output was affected by incompletely closed preceding connections.

Wait for connections to leave I_S.PROCESSLIST before issuing
SHOW PROCESSLIST.

Also fixes similar failures in funcs_1.processlist_val_ps.
Alexander Barkov
MDEV-10152 Add support for TYPE .. IS REF CURSOR

Version#2

In progress
Sergei Golubchik
MDEV-37506 Assertion if FLUSH PRIVILEGES is interrupted in --skip-grant-tables

* fail acl_load() if it was killed, this will cause all privileges to
  be reset to their original pre-load values.
* only increment grant_version if privileges were, in fact, updated
Vladislav Vaintroub
make this brilliant piece of code compiled

- proper dependencies, if it is going to use all server plugins, it needs
to depend on all server plugins (build time)

- Remove C++ for directory creation, scanning the whole build directory
and what not. CMake can do it , better. CMake knows what plugins are there,
and their paths. CMake knows what plugins belong to what config in
multi-config builds.

- Allow ':' as plugin separator in the list on Windows. It was previously
  wrongly disabled, citing it is used after drive letter. We do not have
  paths in plugin_load, and ':' can't even be used in file names on Windows

  This simplifies plugin-load passing in cmake custom command, passing
  semicolon delimited things is a mess, because both CMake and unix shell
  try to interpret it.

- Remove mariadb-migrate-config-file from minbuild list, it is
  there by mistake, it forces max-build due to its dependencies

- Fix the test case, so it skips if the thing is not built
- Do not test on Windows, there are extensive Unixisms in the test case

Hopefully the constant rebuilds of the utility (it depends on the whole
server including all plugins!) will annoy everyone so something better is
going to be written. Hint - extract the variables etc information at
runtime, not at the compile time.
KhaledR57
MDEV-37072: Implement IS JSON predicate

Add support for the SQL standard IS JSON predicate with the syntax:
expr IS [ NOT ] JSON [ { VALUE | ARRAY | OBJECT | SCALAR } ]
[ { WITH | WITHOUT } UNIQUE [ KEYS ] ]

The predicate allows checking if an expression is valid JSON
and optionally constrains the JSON type (VALUE, ARRAY, OBJECT,
SCALAR) and whether object keys are unique.

The implementation includes:
- Basic IS JSON validation
- Support for NOT operator
- Type constraints (VALUE, ARRAY, OBJECT, SCALAR)
- Unique keys constraint (WITH/WITHOUT UNIQUE KEYS)
Marko Mäkelä
fixup! f3ce97242605b9651d1cbf1e4be64f57a647d306

Some notes on debugging the checkpoint races
Aleksey Midenkov
MDEV-32317 ref_ptrs exhaust on multiple ORDER by func from winfunc

Each ORDER and WHERE slot may generate split, see code like this:

  if ((item->with_sum_func() && item->type() != Item::SUM_FUNC_ITEM) ||
    item->with_window_func())
  item->split_sum_func(thd, ref_ptrs, all_fields, SPLIT_SUM_SELECT);

Such kind of code is done in JOIN::prepare(), setup_order(),
setup_fields(), setup_group() and split_sum_func2() itself.

Since we are at the phase of ref_ptrs allocation, items are not fixed
yet and we cannot calculate precisely how much ref_ptrs is needed. We
can estimate at most how much is needed. In the worst case each window
function generates split on each ORDER BY field, GROUP BY field and
WHERE field, so the counts of these should be multiplied by window
funcs count.

As the split can be done in both setup_without_group() and
JOIN::prepare() simultaneously, the factor of window funcs should be
multiplied by 2.

The similar case may be with inner sumfunc items as of the condition

  item->with_sum_func() && item->type() != Item::SUM_FUNC_ITEM

but factor of these is harder to predict at the stage of unfixed
items.
Michael Widenius
MDEV-19683 Add support for Oracle TO_DATE()

Syntax:
TO_DATE(string_expression [DEFAULT string_expression ON CONVERSION ERROR],
        format_string [,NLS_FORMAT_STRING])
The format_string has the same format elements as TO_CHAR(), except a
few elements that are not supported/usable for TO_DATE().
TO_DATE() returns a datetime or date value, depending on if the format
element FF is used.

Allowed separators, same as TO_CHAR():
space, tab and any of !#%'()*+,-./:;<=>

'&' can also be used if next character is not a character a-z or A-Z
"text' indicates a text string that is verbatim in the format. One cannot
use " as a separator.

Format elements supported by TO_DATE():
AD          Anno Domini ("in the year of the Lord")
AD_DOT      Anno Domini ("in the year of the Lord")
AM          Meridian indicator (Before midday)
AM_DOT      Meridian indicator (Before midday)
DAY        Name of day
DD          Day (1-31)
DDD        Day of year (1-336)
DY          Abbreviated name of day
FF[1-6]    Fractional seconds
HH          Hour (1-12)
HH12        Hour (1-12)
HH24        Hour (0-23)
MI          Minutes (0-59)
MM          Month (1-12)
MON        Abbreviated name of month
MONTH      Name of Month
PM          Meridian indicator (After midday)
PM_DOT      Meridian indicator (After midday)
RR          20th century dates in the 21st century. 2 digits
            50-99 is assumed from 2000, 0-49 is assumed from 1900.
RRRR        20th century dates in the 21st century. 4 digits
SS          Seconds
SYYYY      Signed 4 digit year; MariaDB only supports positive years
Y          1 digit year
YY          2 digits year
YYY        3 digits year
YYYY        4 digits year

Note that if there is a missing part of the date, the current date is used!
For example if 'MM-DD HH-MM-SS' then the current year will be used.
(Oracle behaviour)

Not supported options:
- BC, D, DL, DS, E, EE, FM, FX, RM, SSSSS, TS, TZD, TZH, TZR, X,SY
  BC is not supported by MariaDB datetime.
- Most of the other are exotic formats does not make sence in MariaDB as
  we return datetime or datetime with fractions, not string.
- D (day-of-week) is not supported as it is not clear exactly how it would
  map to MariaDB. This element depends on the NLS territory of the session.
- RR only works with 2 digit years (In Oracle RR can also work with 4
  digit years in some context but the rules are not clear).

Extensions / differences compared to Oracle;
- MariaDB supports FF (fractional seconds).  If FF[#] is used,
  then TO_DATE will return a datetime with # of subseconds.
  If FF is not used a datetime will be returned.
  There is warning (no error) if string contains more digts than what
  is specified with F(#]
- Names can be shortened to it's unique prefix. For example January and Ja
  works fine.
- No error if the date string is shorter format_string and the next
  not used character is not a number.. This is useful to get a date
  from a mixed set of strings in date or datetime format.
  Oracle gives an error if date string is too short.
- MariaDB supports short locales as language names
- NLS_DATE_FORMAT can use both " and ' for quoting.
- NLS_DATE_FORMAT must be a constant string.
  - This is to ensure that the server knows which locale to use
    when executing the function.

New formats handled by TO_CHAR():
FF[1-6]    Fractional seconds
DDD        Daynumber 1-366
IW          Week 1-53 according to ISO 8601
I          1 digit year according to ISO 8601
IY          2 digit year according to ISO 8601
IYY        3 digit year according to ISO 8601
IYYY        4 digit year according to ISO 8601
SYYY        4 digit year according to ISO 8601 (Oracle can do signed)

Supported NLS_FORMAT_STRING options are:
NLS_CALENDAR=GREGORIAN
NLS_DATE_LANGUAGE=language

Support languages are:
- All MariaDB short locales, like en_AU.
- The following Oracle language names:
ALBANIAN, AMERICAN, ARABIC, BASQUE, BELARUSIAN, BRAZILIAN PORTUGUESE
BULGARIAN, CANADIAN FRENCH, CATALAN, CROATIAN, CYRILLIC SERBIAN CZECH,
DANISH, DUTCH, ENGLISH, ESTONIAN, FINNISH, FRENCH, GERMAN,
GREEK, HEBREW, HINDI, HUNGARIAN, ICELANDIC, INDONESIAN ITALIAN,
JAPANESE, KANNADA, KOREAN, LATIN AMERICAN SPANISH, LATVIAN,
LITHUANIAN, MACEDONIAN, MALAY, MEXICAN SPANISH, NORWEGIAN, POLISH,
PORTUGUESE, ROMANIAN, RUSSIAN, SIMPLIFIED CHINESE, SLOVAK, SLOVENIAN,
SPANISH, SWAHILI, SWEDISH, TAMIL, THAI, TRADITIONAL CHINESE, TURKISH,
UKRAINIAN

Development bugs fixed:
MDEV-38403 Server crashes in Item_func_to_date::fix_length_and_dec upon
          using an invalid argument
MDEV-38400 compat/oracle.func_to_date fails with PS protocol and cursor
          protocol (Fixed by Serg)
MDEV-38404 TO_DATE: MTR coverage omissions, round 1
MDEV-38509 TO_DATE: AD_DOT does not appear to be supported
MDEV-38513 TO_DATE: NULL value for format string causes assertion failure
MDEV-38521 TO_DATE: Date strings with non-ASCII symbols cause warnings
          and wrong results
MDEV-38578  TO_DATE: Possibly unexpected results upon wrong input
MDEV-38582  TO_DATE: NLS_DATE_LANGUAGE=JAPANESE does not parse values which work in Oracle

Known issues:
- Format string character matches inside quotes are done
  one-letter-to-one-letter, like in LIKE predicate. That means things
  like expansions and contractions do not work.
  For example 'ss' does not match 'ß' in collations which treat them
  as equal for the comparison operator.
  Match is done taking into account case and accent sensitivity
  of the subject argument collation, so for example this now works:
  MariaDB [test]> SELECT TO_DATE('1920á12','YYYY"a"MM') AS c;
  +---------------------+
  | c                  |
  +---------------------+
  | 1920-12-17 00:00:00 |
  +---------------------+

Co-author and reviewer: Alexander Barkov <[email protected]>
Sergei Golubchik
MDEV-37341 Assertion failures `null_ptr < ptr' and `ptr - null_ptr <= (int)table->s->rec_buff_length' with BEFORE trigger and UPDATE

in SIMULTANEOUS_ASSIGNMENT there is no need to switch value items
to new nullable copies of table Field's - they must refer to old
values in the row, which can never be null anyway.

skipping this redundant step simplifies moving field to record[1]
and back in fill_record()
Sergei Golubchik
MDEV-38654 Assertion `str[strlen(str)-1] != '\n'' failed upon federated discovery error

relax the assert, allowing '\n' at the end if the string is exactly
MYSQL_ERRMSG_SIZE-1 bytes long. It likely doesn't end with '\n' but
was truncated at the middle.

also, use MYSQL_ERRMSG_SIZE in my_error.c not a separate define
that must be "kept in sync"
Alessandro Vetere
fixup: implement and test per-index AHI options

- make per-table/per-index `adaptive_hash_index` and per-index
  `for_equal_hash_point_to_last_record` options have 3 possible values:
  DEFAULT (0), YES (1), NO (2)
- renamed `bytes_from_incomplete_fields` to
  `bytes_from_incomplete_field`
- per-index `complete_fields` and `bytes_from_incomplete_field` options
  now default to `ULONGLONG_MAX` (which means DEFAULT/unset) and
  can be set to any legal value including 0
  - `complete_fields` in [0, 64]
  - `bytes_from_incomplete_field` in [0, 16383]
- store all AHI related options in per-index `dict_index_t::ahi`
  bit-packed 32-bit atomic field `ahi_enabled_fixed_mask`
  - static assertions and debug assertions ensure that all options fit
    into the 32-bit field
  - packing details:
    - `enabled`, `adaptive_hash_index` (first 2 bits)
    - `fields`, `complete_fields` (7 bit)
    - `bytes`, `bytes_from_incomplete_field` (14 bits)
    - `left`, `~for_equal_hash_point_to_last_record` (1 bit)
    - `is_fields_set`, `fields` set flag (1 bit)
    - `is_bytes_set`, `bytes` set flag (1 bit)
    - `is_left_set`, `left` set flag (last 1 bit)
    - 5 bits spare after `is_left_set`
- remove unused per-table `ahi_enabled` option in `dict_table_t`
- in `innodb_ahi_enable` set per-index options in any case to avoid
  stale values being picked up later
- in `innodb_ahi_enable` ensure that the primary key is not updated
  twice if both per-table and per-index options are set
- in `btr_sea::resize` avoid losing the previous `btr_sea::enabled`
  setting
- in `btr_search_update_hash_ref` apply the per-index AHI options
  using bit-masking to override internal heuristic values with user
  preferences
- in `innodb.index_ahi_option` replace `ANALYZE FORMAT=JSON` on
  `SELECT` over warmed-up AHI with a stored procedure which
  checks if AHI is used during a burst of index lookups checking
  delta in `adaptive_hash_searches` InnoDB monitor variable as this
  is more stable
- in `innodb.index_ahi_option` test a combination of per-table
  and per-index AHI options
- in `innodb.index_ahi_option` test that the maximum number of fields
  per (secondary) index is 64 (32+32)
- in `innodb.index_ahi_option_debug` test debug builds with
  `index_ahi_option_debug_check` debug variable enabled to verify that
  the proper per-index AHI options are applied during index lookups
- in `innodb.index_ahi_option_debug` test that illegal per-index AHI
  are non-destructive and just lead to no AHI usage
- in `sys_vars.innodb_adaptive_hash_index_basic` replace:
  - `for_equal_hash_point_to_last_record=1`
  with
  - `for_equal_hash_point_to_last_record=no`
  to reflect the new 3-value logic
- in `sys_vars.innodb_adaptive_hash_index_basic check that both
  `complete_fields` and `bytes_from_incomplete_field` can be set to 0
Sergei Golubchik
MDEV-37503 UBSAN: downcast Item_func_plus to Item_field invalid in sql_prepare.cc:1516

use reinterpret_cast to silence UBSAN.
add a debug check to make sure the wrong value is never used.
Vlad Lesin
MDEV-31956 SSD based InnoDB buffer pool extension

After hash chain is unlocked it's list can be changed by concurent
thread, that's why we need zero out extended buffer pool page pointer
every time chain lock is released.
Vladislav Vaintroub
make this brilliant piece of code compiled

- proper dependencies, if it is going to use all server plugins, it needs
to depend on all server plugins (build time)

- Remove C++ for directory creation, scanning the whole build directory
and what not. CMake can do it , better. CMake knows what plugins are there,
and their paths. CMake knows what plugins belong to what config in
multi-config builds.

- Allow ':' as plugin separator in the list on Windows. It was previously
  wrongly disabled, citing it is used after drive letter. We do not have
  paths in plugin_load, and ':' can't even be used in file names on Windows

  This simplifies plugin-load passing in cmake custom command, passing
  semicolon delimited things is a mess, because both CMake and unix shell
  try to interpret it.

- Remove mariadb-migrate-config-file from minbuild list, it is
  there by mistake, it forces max-build due to its dependencies

- Fix the test case, so it skips if the thing is not built
- Do not test on Windows, there are extensive Unixisms in the test case

Hopefully the constant rebuilds of the utility (it depends on the whole
server including all plugins!) will annoy everyone so something better is
going to be written. Hint - extract the variables etc information at
runtime, not at the compile time.
Raghunandan Bhat
MDEV-37243: SP memory root protection disappears after a metadata change

Problem:
  When a stored routine involes a cursor and metadata of table on which
  cursor is defined changes, the SP instr has to be reparsed. For ex:
  CREATE OR REPLACE TABLE t1 (a INT);

  CREATE OR REPLACE FUNCTION f1() RETURNS INT
  BEGIN
    DECLARE vc INT DEFAULT 0;
    DECLARE cur CURSOR FOR SELECT a FROM t1;
    OPEN cur;
    FETCH cur INTO vc;
    CLOSE cur;
    RETURN vc;
  END;

  SELECT f1(); - first execution, sp-mem_root marked read-only on exec
  SELECT f1(); - read-only sp-mem_root
  ALTER TABLE t1 MODIFY a TEXT; - metadta change
  SELECT f1(); - first execution after metadata change
  SELECT f1(); - sp-mem_root should be marked read-only

  sp_lex_instr is re-parsed after the metadta change, which sets up a
  new mem_root for reparsing, which will be in writable state. Once the
  instr is re-parsed and re-run (via reset_lex_and_exec_core) it is left
  writable.

Fix:
  Mark the sp instr is re-parsed and re-run, mark the memory root as
  READ_ONLY.
Alexander Barkov
MDEV-10152 Add support for TYPE .. IS REF CURSOR

Version#2

In progress
Sergei Petrunia
Debugging aid: add functions to check which MEM_ROOT the data is on

Add two functions:
bool dbug_is_mem_on_mem_root(MEM_ROOT *mem_root, void *ptr);
const char *dbug_which_mem_root(THD *thd, void *ptr);

Also collect a list of other functions targeted for debugger use in
sql/debug.h.
Daniel Black
MDEV-37615: Clang based static analysis false postive reports on UNINIT_VAR

Clang upstream bug https://github.com/llvm/llvm-project/issues/173210
shows that a "int x=x" construct will in the intermediate representation
have code to read from x. With this generated sanitizer=undefined and
static analyzers will all see the uninitialized read and write.

Because clang has a stronger implementation of following paths to
uninitialized variables, "#define UNINIT_VAR(x) x" is the which
is what our release binaries use is the ideal path for this compiler.

Clang based compilers with error during compilation if any
uninitialized behaviour is detected at compile time because of
0c80ddb519bd06efbd7ccf2a2487b2503cd16db5.

Corrects MDEV-36542 - 6fd57f478f585249bdca242b1576ac0a7bd7aacf.
bsrikanth-mariadb
MDEV-35815: use-after-poison_in_get_hash_symbol

DRAFT COMMENT:
in find_field_in_view(), we call field_it.create_item() which
creates item on a statement mem_root.

Then we set its name. Make sure the name is allocated on a statement
mem_root, too.
Sergey Vojtovich
MDEV-38076 - main.mdev375 fails sporadically

Test was affected by incompletely closed preceding connections.

Wait for preceding connections to decrement Threads_connected
before testing ER_CON_COUNT_ERROR condition.
Sergei Golubchik
MDEV-36787 Error 153: No savepoint with that name upon ROLLBACK TO SAVEPOINT, assertion failure

1. InnoDB should return HA_ERR_ROLLBACK if it aborts a transaction internally
2. the server should recognize it and perform an automatic rollback
Sergei Golubchik
cleanup: remove unused argument
Oleg Smirnov
MDEV-32868 Cleanup (no change of logic)

Switch branches of the `if` condition to make the code
flow more naturally.
Oleg Smirnov
MDEV-32868 SELECT NULL,NULL IN (SUBQUERY) returns 0 instead of NULL

When evaluating (SELECT NULL, NULL) IN (SELECT 1, 2 FROM t), the result
was incorrectly 0 instead of NULL.

The IN-to-EXISTS transformation wraps comparison predicates with
trigcond() guards:

  WHERE trigcond(NULL = 1) AND trigcond(NULL = 2)

During optimization, make_join_select() evaluated this as a "constant
condition". With guards ON, the condition evaluated to FALSE (NULL
treated as FALSE), triggering "Impossible WHERE". At runtime, guards
would be turned OFF for NULL columns, but the optimizer had already
marked the subquery as returning no rows.

Fix: check can_eval_in_optimize() instead of is_expensive() in
make_join_select(). Unlike is_expensive(), can_eval_in_optimize()
also verifies const_item(), which returns FALSE for Item_func_trig_cond
Vladislav Vaintroub
make this brilliant piece of code compiled

- proper dependencies, if it is going to use all server plugins, it needs
to depend on all server plugins (build time)

- Remove C++ for directory creation, scanning the whole build directory
and what not. CMake can do it , better. CMake knows what plugins are there,
and their paths. CMake knows what plugins belong to what config in
multi-config builds.

- Allow ':' as plugin separator in the list on Windows. It was previously
  wrongly disabled, citing it is used after drive letter. We do not have
  paths in plugin_load, and ':' can't even be used in file names on Windows

  This simplifies plugin-load passing in cmake custom command, passing
  semicolon delimited things is a mess, because both CMake and unix shell
  try to interpret it.

- Remove mariadb-migrate-config-file from minbuild list, it is
  there by mistake, it forces max-build due to its dependencies

Hopefully the constant rebuilds of the utility (it depends on the whole
server including all plugins!) will annoy everyone so something better is
going to be written. Hint - extract the variables etc information at
runtime, not at the compile time.
Aleksey Midenkov
MDEV-28619 Server crash and UBSAN null-pointer-use in Window_funcs_sort::setup

Optimization in st_select_lex_unit::prepare() removes ORDER BY for
certain subqueries. That excludes ORDER BY items from being fixed, but
sl->window_funcs still contains window function items and those
related to optimized out ORDER BY are unfixed. The error about missing
window spec is thrown when the item is fixed. Hence we get redundant
processing of window function items without checking window spec
existence.

The fix removes the related window function items when ORDER BY is
optimized out. ORDER accumulates window_funcs at parser stage which
are then removed from SELECT_LEX::window_funcs. The fix also updates
similar optimization in mysql_make_view().
Aleksey Midenkov
MDEV-28619 with_flags cleanup

The best practice is to init as much info as possible in class
constructor. with_flags access may be needed before fix_fields() or
fix_fields() may be not called at all like it takes place in
MDEV-28619. The fix for MDEV-28619 requires WINDOW_FUNC check on
unfixed item.