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
Sergei Golubchik
cleanup: remove explicit rounding before decimal2longlong

embed rounding into decimal2longlong instead.
this avoid carry propagation loop on rounding.
and allows decimal2longlong detect truncation correctly
Sergei Golubchik
bump the maturity of caching_sha2_password and parsec plugins
Alessandro Vetere
fixup! MDEV-37070  Implement table options to enable/disable features
Sergei Golubchik
MDEV-38806 Non-debug assertion failure in btr_pcur_t::restore_position upon HANDLER operations

amend the fix from MDEV-37832 to restore old locking behavior for HANDLER,
even if it's not an "updating" command.

Also let's do the same for CHECKSUM/ANALYZE. There is CHECKSUM and
ANALYZE specific code inside that if(), it should be either restored
to work or removed there's no reason to leave dead code there.
I prefer to be conservative here and restore it to work.
Monty
MDEV-37070  Implement table options to enable/disable features

Added ADAPTIVE_HASH_INDEX=DEFAULT|YES|NO table and index option to InnoDB.
The table and index options only have an effect if InnoDB adaptive hash
index feature is enabled.

- Having the ADAPTIVE_HASH_INDEX TABLE option set to NO will disable
  adaptive hash index for all indexes in the table that does not have
  the index option adaptive_hash_index=yes.
- Having the ADAPTIVE_HASH_INDEX TABLE option set to YES will enable the
  adaptive hash index for all indexes in the table that does not have
  the index option adaptive_hash_index=no.
- Using adaptive_hash_index=default deletes the old setting.
- One can also use OFF/ON as the options. This is to make it work similar
  as other existing options.
- innodb.adaptive_hash_index has been changed from a bool to an enum with
  values OFF, ON and IF_SPECIFIED.  If IF_SPECIFIED is used, adaptive
  hash index are only used for tables and indexes that specifies
  adaptive_hash_index=on.
- The following new options can be used to further optimize adaptive hash
  index for an index (default is unset/auto for all of them):
  - complete_fields:
    - 0 to the number of columns the key is defined on (max 64)
  - bytes_from_incomplete_field:
    - This is only usable for memcmp() comparable index fields, such as
      VARBINARY or INT. For example, a 3-byte prefix on an INT will
      return an identical hash value for 0‥255, another one for 256‥511,
      and so on.
    - Range is min 0 max 16383.
  - for_equal_hash_point_to_last_record
    -  Default is unset/auto, NO points to the first record, known as
        left_side in the code; YES points to the last record.
        Example: we have an INT column with the values 1,4,10 and bytes=3,
        will that hash value point to the record 1 or the record 10?
        Note: all values will necessarily have the same hash value
        computed on the big endian byte prefix 0x800000, for all of the
        values 0x80000001, 0x80000004, 0x8000000a. InnoDB inverts the
        sign bit in order to have memcmp() compatible comparison

Example:
CREATE TABLE t1 (a int primary key, b varchar(100), c int,
index (b) adaptive_hash_index=no, index (c))
engine=innodb, adaptive_hash_index=yes;

Notable changes in InnoDB
- btr_search.enabled was changed from a bool to a ulong to be
  able to handle options OFF, ON as IF_ENABLED. ulong is needed
  to compile with MariaDB enum variables.
- To be able to find all instances where btr_search.enabled was used
  I changed all code to use btr_search.get_enabled() when accessing
  the value and used btr_search.is_enabled(index) to test if AHI is
  enabled for the index.
- btr_search.enable() was changed to always take two parameters,
  resize and value of enabled. This was needed as enabled can now
  have values 0, 1, and 2.
- 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`
  - manipulation of the bit-packed field avoids usage of branches or
    conditional instructions to minimize the performance impact of
    the new options
- in `btr_search_update_hash_ref` apply the per-index AHI options
  using bit-masking to override internal heuristic values with user
  preferences
- add `innodb.index_ahi_option` test:
  - test a combination of per-table and per-index AHI options
  - use a stored procedure which checks if AHI is used during a burst of
    index lookups checking delta in `adaptive_hash_searches` InnoDB
    monitor variable
  - test that the maximum number of fields per (secondary) index is 64
    (32+32)
- add `innodb.index_ahi_option_debug` test:
  - 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
  - test that illegal per-index AHI are non-destructive and just lead to
    no AHI usage

Visible user changes:
- select @@global.adaptive_hash_index will now return a string instead
  of 0 or 1.

Other notable changes:
- In `sql/create_options.cc`:
  - In function `parse_engine_part_options` do allocate table options
    in share root to avoid MSAN/ASAN errors due to use after free of
    `option_struct` in test `parts.partition_special_innodb`.
  - In function `set_one_value` avoid reading after the end of the
    current string.

Co-authored-by: Monty <[email protected]>
Co-authored-by: Marko Mäkelä <[email protected]>
Co-authored-by: Alessandro Vetere <[email protected]>
Co-authored-by: Thirunarayanan Balathandayuthapani <[email protected]>
Sergei Golubchik
cleanup: rename an argument
Lawrin Novitsky
Merge branch 'cpp-1.0' into cpp-1.1
Oleg Smirnov
MDEV-39304 QB_Name hint with path is silently ignored inside view definition

This commit adds an explicit warning message indicating
that QB_NAME hints with path are not supported inside view definitions
Rucha Deodhar
MDEV-39179: Incorrect NULL handling in UPDATE ... RETURNING result

Analysis:
OLD_VALUE() swapped only field->ptr, leaving null_ptr pointing to the
current record. This caused incorrect NULL results.

Fix:
Store null_ptr_old for record[1] and swap it together with ptr to
preserve correct NULL semantics.
Lawrin Novitsky
Introduced UBSAN.supp to supress UBSAN issues beyond our control

(on C/C side). They are quite the same as in C/ODBC
Sergei Golubchik
cleanup: remove explicit rounding before decimal2longlong

embed rounding into decimal2longlong instead.
this avoid carry propagation loop on rounding.
and allows decimal2longlong detect truncation correctly
Rucha Deodhar
MDEV-39119: Improve error handling when using OLD_VALUE as alias name

Analysis:
Since OLD_VALUE_SYM was part of reserved keywords, it did not allow
old_value in the alias.
Fix:
Change OLD_VALUE_SYM from reserved keyword to keyword_sp_var_and_label.
Rucha Deodhar
MDEV-39212: JSON_MERGE_PATCH depth crash

Analysis:
The crash happens because we run out of stack space

Fix:
Add a stack overflow check.
Rucha Deodhar
MDEV-39213: json range syntax crash

Analysis:
When json is being parsed, the step decreases without a out-of-bound check
resulting in failure.
Fix:
Before decreasing the step, check if it will result into out of bound.
Lawrin Novitsky
One more UBSAN silencing.

Same nature "function called using wrong pointer type" for C/C parameters
callback call. In this case besides inclusion in the namespace the
function had accidentally wrong return type.
Sergei Golubchik
MDEV-39141 MariaDB crashes in THD::THD() due to misalignment

fix alloc_root() and my_malloc() to return 16-aligned pointers

(type_assoc_array.sp-assoc-array-64bit prints changes in memory_used,
and my_malloc() uses more memory now)
Rucha Deodhar
MDEV-5092: Implement UPDATE with result set (UPDATE ... RETURNING)

The patch introduces the OLD_VALUE() expression to reference the value
of a column before it was updated. The parser is extended to support
RETURNING and OLD_VALUE(), and RETURNING expressions are stored in a
separate returning_list in SELECT_LEX with independent wildcard tracking.
RETURNING is rejected for multi-table UPDATE.

During setup of RETURNING fields, THD::is_setting_returning is used
when resolving fields, particularly for updates through views.
When resolving view fields, Item_direct_view_ref may point to the
view's item_list, losing the information about whether the value
should be old or new. The original item in returning_list still
contains the correct is_old_value_reference flag, which is copied
back to the resolved item.

OLD_VALUE() is implemented by extending Item_field with a new
Item_old_field class. Item_field::set_field() initializes
Field::ptr_old to the corresponding location in record[1],
which stores the old row during UPDATE execution.

When sending result rows, Item_old_field::send() temporarily switches
the field pointer from record[0] (current row) to ptr_old so
OLD_VALUE() returns the value before the update.

The UPDATE execution path is modified to send a result set when
RETURNING is present instead of an OK packet.
Sergei Golubchik
MDEV-38702 Behaviour of IF() with boolean JSON_EXTRACT as expression is wrong

implement Item_func_json_extract::val_bool()
Sergei Golubchik
MDEV-38199 Optimizer Error with = SOME on UNIQUE Column Using Decimal/Integer Types

return 1 (non-fatal error) when a decimal or float number
was modified when stored in Field_long (= fractional part was lost).

This tells the optimizer that a number with a non-zero fractional
part cannot be found in an index over an integer field.
Oleg Smirnov
MDEV-38045 Add code coverage markers to untestable code paths

MariaDB test suite does not provide tools to test out-of-memory (OOM)
errors, so it is not feasible to cover some paths with test cases.
This commit adds markers /* purecov: inspected */ and
/* purecov: deadcode */ to such paths.
Sergei Golubchik
correct sql_command_flags: add CF_CHANGES_DATA as needed

SQLCOM_REVOKE_ALL needs it because SQLCOM_REVOKE does.
SQLCOM_DROP_ROLE needs it because SQLCOM_DROP_USER does.
SQLCOM_CREATE_SERVER / SQLCOM_ALTER_SERVER / SQLCOM_DROP_SERVER
need it because SQLCOM_CREATE_USER / etc do.
Razvan Liviu Varzaru
Support fedora for static_test linking
Sergei Golubchik
cleanup: change sql_command_flags from uint to cf_flags_t

introduce a dedicated enum type for sql_command_flags
to simplify debugging:

(gdb) p sql_command_flags[SQLCOM_SELECT]
$2 = (CF_REEXECUTION_FRAGILE | CF_CAN_GENERATE_ROW_EVENTS | CF_PREOPEN_TMP_TABLES | CF_CAN_BE_EXPLAINED | CF_OPTIMIZER_TRACE)
Sergei Golubchik
cleanup: rename an argument
Sergei Golubchik
correct sql_command_flags: add CF_CHANGES_DATA as needed

SQLCOM_REVOKE_ALL needs it because SQLCOM_REVOKE does.
SQLCOM_DROP_ROLE needs it because SQLCOM_DROP_USER does.
SQLCOM_CREATE_SERVER / SQLCOM_ALTER_SERVER / SQLCOM_DROP_SERVER
need it because SQLCOM_CREATE_USER / etc do.
rusher
[misc] use DOCKER_LOGIN as user if secret available
Sergei Golubchik
MDEV-38199 Optimizer Error with = SOME on UNIQUE Column Using Decimal/Integer Types

return 1 (non-fatal error) when a decimal or float number
was modified when stored in Field_long (= fractional part was lost).

This tells the optimizer that a number with a non-zero fractional
part cannot be found in an index over an integer field.
Sergei Golubchik
cleanup: change sql_command_flags from uint to cf_flags_t

introduce a dedicated enum type for sql_command_flags
to simplify debugging:

(gdb) p sql_command_flags[SQLCOM_SELECT]
$2 = (CF_REEXECUTION_FRAGILE | CF_CAN_GENERATE_ROW_EVENTS | CF_PREOPEN_TMP_TABLES | CF_CAN_BE_EXPLAINED | CF_OPTIMIZER_TRACE)
Rucha Deodhar
MDEV-39127: UBSAN : downcast of address X which does not point to an object
of type 'multi_update' in sql/sql_update.cc
| Sql_cmd_update::update_single_table

Analysis:
the 'result' object was being incorrectly used which maybe of the type
multi_update.This caused UBSAN error due to an invalid downcast in
Sql_cmd_update::update_single_table().

Fix:
Introduce a dedicated returning_result object for handling RETURNING output
instead of reusing result. This ensures the correct result handler is used
and avoids unsafe casts.
Sergei Golubchik
MDEV-38802 MariaDB server start emits error but continues anyway: Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist

it's not an error, as the server continues anyway
Sergei Golubchik
MDEV-39141 MariaDB crashes in THD::THD() due to misalignment

fix alloc_root() and my_malloc() to return 16-aligned pointers

(type_assoc_array.sp-assoc-array-64bit prints changes in memory_used,
and my_malloc() uses more memory now)
Sergei Golubchik
MDEV-38806 Non-debug assertion failure in btr_pcur_t::restore_position upon HANDLER operations

amend the fix from MDEV-37832 to restore old locking behavior for HANDLER,
even if it's not an "updating" command.

Also let's do the same for CHECKSUM/ANALYZE. There is CHECKSUM and
ANALYZE specific code inside that if(), it should be either restored
to work or removed there's no reason to leave dead code there.
I prefer to be conservative here and restore it to work.
Lawrin Novitsky
Increased cmake min required version to enable build with newest cmake's

Also, fixed UBSAN issue caused by including mysql header inside the
namespace and using pointer to destroyer functions in the smart
pointers. Tha was in ConnectProtocol and TextRowProtocol classes with
MYSQL and MYSQL_RES handles, respectively. Removed unique_ptr use
completely as it's pretty safe and easy to destroy them in the the
respective class destructor.
Added check and exception throw if MYSQL handle could not be allocated -
taht was missing.
Sergei Golubchik
MDEV-39135 JSON_OBJECTAGG(NULL) in decimal context

json_objectagg didn't return NULL if null_value==true
Lawrin Novitsky
More fixes to please UBSAN and MSAN.

For UBSAN it's the similar problem as in prvious commit, for MSAN - it
suddenly had issues afte move of min required cmake version to 3.5.
Seemingly it is connected to policy 0056 and it's new behavior.