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
gkodinov
MDEV-38642: Missing Null terminator in the definition of mysqldump's --system typelib

There was a missing NULL element terminator for --system's type
library definition.

This was causing a crash in find_type_eol when e.g. an incomplete
value was passed to --system where it keeps iterating until it
finds the NULL as a typelib element.

Fixed by appending a NullS to the definition.
Test case added.
Marko Mäkelä
recv_sys_t::find_checkpoint_archived(): Add a sanity check
Marko Mäkelä
Improve the checkpoint

TODO:
mysql-test/mtr --mysqld=--innodb-log-archive innodb.insert_into_empty

log0log.cc:1078: Assertion ‘!resize_log.is_opened()’ failed.
buf0flu.cc:1903: InnoDB: Failing assertion: d <= lsn_t{~uint32_t{0}}
Thirunarayanan Balathandayuthapani
MDEV-38631 Remove unused FTS debug directives and dead code

Remove several unused debugging preprocessor directives from the FTS
module that were never effectively used for debugging purposes and
represent dead code.

Removed debug directives:
- DEBUG_FTS_SORT_PRINT: FTS sorting debug output macros
- FTS_INTERNAL_DIAG_PRINT: Internal FTS diagnostic printing
- FTS_OPTIMIZE_DEBUG: FTS optimization debugging functions
- MYSQL_STORE_FTS_DOC_ID: Store fts doc id in FTS_DOC_ID field
- FTS_DEBUG: Debug for fulltext index
- FTS_CACHE_SIZE_DEBUG: Assign max and min fulltext cache size
- FTS_MULT_INDEX: Updated fulltext index
- Removed FTS_OPTIMIZE_START_TIME and FTS_OPTIMIZE_END_TIME constants

These debug directives were never properly integrated into the build
system and provided no value for production debugging and also
improves code clarity for the FTS module.
Sergei Golubchik
squash! MDEV-37815

removed Mroonga support for CONNECTION=
as requested by the maintainer in MDEV-38530
Marko Mäkelä
Use a less overloaded variable name last_lsn
Sergei Golubchik
MDEV-37832 The IF operator implicitly sets SHARED LOCK

InnoDB was supposed to take shared lock only for reads that are
part of data-modifying statement. 20+ years ago, when this logic
was implemented the only way to check for that was
`sql_command != SQLCOM_SELECT` which is overly broad.

Let's use `is_update_query(sql_command)` instead. It uses per-statement
flag (that didn't exist back then) and is much more fine-grained.

Update main.innodb_mysql_lock2 test changing many test cases that used
to say "this shouldn't take shared lock, but in practice InnoDB does".

Also, remove an impossible condition
`(lock_type == TL_READ_HIGH_PRIORITY && in_lock_tables)`:
this lock level can only come from `SELECT HIGH_PRIORITY`,
and never from `LOCK TABLES` statement.
Sergei Golubchik
MDEV-38604 Assertion `thd->utime_after_query >= thd->utime_after_lock' failed in query_response_time_audit_notify on 2nd execution of SP with query cache

even when PS is served from a query cache, thd->utime_after_query
must be updated.

also, backport the assert from 11.8
Rucha Deodhar
MDEV-38620: Server crashes in setup_returning_fields upon 2nd execution
of multi-table-styled DELETE from a view

Analysis:
The item_list of builtin_select stores the fields that are there in the
RETURNING clause.
During the "EXECUTE" command, a "dummy item" is added into the item_list
of the select_lex(builtin_select) representing DELETE during
Sql_cmd_delete::precheck(). This snippet that adds a dummy item is added
because columnstore needs for temporary table. Results are put into a
temporary table and to create a temporary table we need to know what
columns are there which we get from the select_lex->item_list.
As a result, the item_list now has an item even when there is not really
RETURNING clause, resulting in execution of the setup_returning_fields()
when it should have exited already.

Fix:
Instead of checking whether builint_select's item_list is empty to determine
whether there is RETURNING clause, use a flag.
Sergei Golubchik
MDEV-38365 SHA2 auth plugin crash on large packets

use my_safe_alloca() as the key_len comes directly from the client

Reported by Pavel Kohout, Aisle Research, www.aisle.com
Aleksey Midenkov
MDEV-36876 Crash during the Item_subselect::init - outer_select is NULL

Comparison between vector and scalar is invalid (ER_OPERAND_COLUMNS)
and handled by the parser. The problem is outer_context is missing
because relink_hack() cannot recover it due to
!builtin_select.first_inner_unit() condition. This condition was set
by previous relink hack called for previous expression some(select 1).

Since there can be arbitrary number of such expressions there seems to
be no point in such a limitation. MTR test do not fail without that
condition, so the fix proposes to remove it.
Rex Johnston
MDEV-31632 Unresolvable outer reference causes null pointer exception

SELECT 1 union select 2 UNION SELECT 1 from a JOIN a b ON
  (SELECT 1 FROM dual WHERE AAA)

Crashes during fix_outer_field while resolving field item AAA

In our resolver, once we have determined that a field item isn't
local to our select, we call Item::fix_outer_field(), which
iterates outwards towards the top level select, looking for where
our Item_field might be resolvable.

In our example here, the item isn't resolvable and we expose
fragility in the loop, which i will detail here.

After we initialize the variable 'outer_context' (to a context
containing /* select#3 */ select 1 AS `1` from (a join a b on
((subquery#4))) ) we enter a loop

│    5927  for (;
│    5928        outer_context;
│    5929        outer_context= outer_context->outer_context)
│    5930  {
│    5931    select= outer_context->select_lex;
│    5932    Item_subselect *prev_subselect_item=
│    5933      last_checked_context->select_lex->master_unit()->item;
│    5934    last_checked_context= outer_context;

here 'last_checked_context' is the context inner to the current
'outer_context', and we initialize prev_subselect_item to the
Item enclosing the unit containing this inner select.

So for the first iteration of the loop,
  select: select #3
  last_checked_context: from select #4 to select #3.
  prev_subselect_item: item enclosing select #4 (where
    field item AAA is defined)

The rest of the loop calls find_field_in_tables() /
resolve_ref_in_select_and_group() in an attempt to
resolve this item with this 'outer_context'.

After the item fails resolution, we move to an outer context
  select: select #4294967295 (fake_select_lex)
  last_checked_context: from select #3 to the fake select lex
    containing the union (i.e. outermost)
  prev_subselect_item: null, there is no Item that contains this,
    it is the outermost select.

We still need to execute the rest of the loop to determine whether
AAA is resolvable here, but executing

│    5937    place= prev_subselect_item->parsing_place;

We are now following a null pointer.  We introduce a test for this
null pointer, indicating that we are now evaluating the outermost
select and we are not to try accessing the enclosing subselect item.

Approved by: Oleksandr "Sanja" Byelkin ([email protected])
gkodinov
MDEV-38642: Missing Null terminator in the definition of mysqldump's --system typelib

There was a missing NULL element terminator for --system's type
library definition.

This was causing a crash in find_type_eol when e.g. an incomplete
value was passed to --system where it keeps iterating until it
finds the NULL as a typelib element.

Fixed by appending a NullS to the definition.
Test case added.
Alexander Barkov
MDEV-38626 Unexpected `Data too long` error on subselect as a multiplication argument

Item_singerow_subselect::fix_length_and_dec() incorrectly calculated
its Item::max_length when the underlying expression was Item_int.

The reason of the problem:
Item_int has an optimized max_length to make CONCAT(1) create a VARCHAR(1)
column rather than a VARCHAR(2) column. Its max_length does not include one
extra character for the sign in case the value is positive but the value
is not marked as Item::unsigned==true.

So copying max_length from the underlying Item_int (with value==9)
in cases like this:
  SELECT CONCAT((SELECT 9 FROM t0));
was not correct.

Implementing a new virtual method
  Type_handler::Item_type_std_attributes_generic(const Item *item)

- The default implementation just copies attributes from "item" as is.

- In case of Type_handler_int_result it evaluates max_length
  using item->decimal_precision() rather than item->max_length.
  This works correctly for both "optimized" items like Item_int and
  non-"optimized" Items whose max_length includes +1 for the sign
  in case of signed expressions.
Thirunarayanan Balathandayuthapani
MDEV-38631 Remove unused FTS debug directives and dead code

Remove several unused debugging preprocessor directives from the FTS
module that were never effectively used for debugging purposes and
represent dead code.

Removed debug directives:
- DEBUG_FTS_SORT_PRINT: FTS sorting debug output macros
- FTS_INTERNAL_DIAG_PRINT: Internal FTS diagnostic printing
- FTS_OPTIMIZE_DEBUG: FTS optimization debugging functions
- MYSQL_STORE_FTS_DOC_ID: Store fts doc id in FTS_DOC_ID field
- FTS_DEBUG: Debug for fulltext index
- FTS_CACHE_SIZE_DEBUG: Assign max and min fulltext cache size
- FTS_MULT_INDEX: Updated fulltext index
- Removed FTS_OPTIMIZE_START_TIME and FTS_OPTIMIZE_END_TIME constants

These debug directives were never properly integrated into the build
system and provided no value for production debugging and also
improves code clarity for the FTS module.
Aleksey Midenkov
MDEV-28650 Server crashes in Item_func_nextval::val_int after select from view

default_used was missing as view is parsed on its own
lex. extend_table_list() decides maybe_need_prelocking based on
default_used and prelocking_strategy->handle_table() was skipped for
view, so internal_tables was not updated (they could be stale from
previous statement).
gkodinov
MDEV-38642: Missing Null terminator in the definition of mysqldump's --system typelib

There was a missing NULL element terminator for --system's type
library definition.

This was causing a crash in find_type_eol when e.g. an incomplete
value was passed to --system where it keeps iterating until it
finds the NULL as a typelib element.

Fixed by appending a NullS to the definition.
Test case added.
Alexey Botchkov
MDEV-15479 Empty string is erroneously allowed as a GEOMETRY column value.

Empty string disallowed.
Aleksey Midenkov
MDEV-33985 Server crashes at Item_func_nextval::val_int

Pure aliases are not handled properly by Item_func_nextval::val_int().

add_table_to_list() does not create MDL request for pure aliases,
i.e. when there is no table_list->db set or TL_OPTION_ALIAS was
set. When the expression is not inside CTE the case with empty db is
handled by:

  else if (!lex->with_cte_resolution && lex->copy_db_to(&db))
    DBUG_RETURN(0);

So, table_list gets current database name and the query is failed with
ER_NO_SUCH_TABLE error.

The fix adds the case of is_pure_alias() for
Item_func_nextval::val_int() and fails it with ER_NOT_SEQUENCE2 error.

Note: semantics for TL_OPTION_ALIAS cannot be based on empty db, only
parser can set TL_OPTION_ALIAS as resolve_references_to_cte() relies
on TL_OPTION_ALIAS after copy_db_to().
Rex Johnston
MDEV-38473 Incorrect Empty Set with HAVING clause when SELECT and GROUP BY use different aliases for the same column

MDEV-29300 fix causes a wrong result by incorrectly removing a wrapper to
an item that needed to be wrapped for the correct result.  Direct access
to the item causes an incorrect table reference to be used during
join evaluation.  We revert that fix.

Our original problem query is this
SELECT (SELECT 0 GROUP BY c1 HAVING (SELECT c1)) FROM t1 group by c1;

JOIN::prepare on
/* select#2 */ select 0 group by t1.c1 having (subquery#3)

fixing t1.c1 in group by clause, calls fix_outer_field()
this item is resolved in an outer select (#1) and it is a grouping select,
so we wrap it in Item_outer_ref and set this item to unfixed for later
fixing in fix_inner_refs().

JOIN::prepare continues onto the having clause and fixes (subquery#3) which
calls initiates the prepare series of calls, leading to setup_fields on the
fields in this JOIN, one of which is an outer reference c1.
This is resolved to the item in the next most outer select in the group by
clause. This item has been wrapped with an unfixed Item_outer_ref.
It is found in resolve_ref_in_select_and_group() is it expected that
this item will have already been fixed, hence this call in

Item_field::fix_outer_field()

DBUG_ASSERT(*ref && (*ref)->fixed());

but as explained above, it isn't fixed and debug builds assert here.

Because this wrapper cannot be resolved here for reasons detailed in
fix_inner_refs, and we cannot remove this wrapper without potentially
returning an incorrect result, we have to relax this assertion.

Approved by: Oleksandr "Sanja" Byelkin ([email protected])
Rucha Deodhar
MDEV-38620: Server crashes in setup_returning_fields upon 2nd execution
of multi-table-styled DELETE from a view

Analysis:
The item_list of builtin_select stores the fields that are there in the
RETURNING clause.
During the "EXECUTE" command, a "dummy item" is added into the item_list
of the select_lex(builtin_select) representing DELETE during
Sql_cmd_delete::precheck(). This snippet that adds a dummy item is added
because columnstore needs for temporary table. Results are put into a
temporary table and to create a temporary table we need to know what
columns are there which we get from the select_lex->item_list.
As a result, the item_list now has an item even when there is not really
RETURNING clause, resulting in execution of the setup_returning_fields()
when it should have exited already.

Fix:
Instead of checking whether builint_select's item_list is empty to
determine whether there is RETURNING clause, use a flag.
gkodinov
MDEV-38642: Missing Null terminator in the definition of mysqldump's --system typelib

There was a missing NULL element terminator for --system's type
library definition.

This was causing a crash in find_type_eol when e.g. an incomplete
value was passed to --system where it keeps iterating until it
finds the NULL as a typelib element.

Fixed by appending a NullS to the definition.
Test case added.
Aleksey Midenkov
MDEV-33289 INTERVAL partitioning by system time does not work close to the end of timestamp range

1. Fix empty part_elem->id in prep_alter_part_table().

  On auto-create newly added partition has id 0. It came from
  set_up_default_partitions() for new part_info
  (thd->work_part_info). vers_update_el_ids() can work only with
  unassigned ids (UINT_MAX32), so we assign it explicitly on pushing
  into tab_part_info.

2. If range value is out of TIMESTAMP_MAX_VALUE set it to
  TIMESTAMP_MAX_VALUE, but only if the history partition is the last
  one, otherwise push ER_DATA_OUT_OF_RANGE. Error is to create
  multiple out-of-range partitions (e.g. with PARTITIONS clause in
  CREATE TABLE).
Sergei Golubchik
MDEV-38532 followup

include private server headers into libmariadbd-dev,
where plugin server headers already were.
Not in libmariadb-dev. It's different from RPMs, but
RPMs don't have a dedicated embedded devel package.
gkodinov
MDEV-38642: Missing Null terminator in the definition of mysqldump's --system typelib

There was a missing NULL element terminator for --system's type
library definition.

This was causing a crash in find_type_eol when e.g. an incomplete
value was passed to --system where it keeps iterating until it
finds the NULL as a typelib element.

Fixed by appending a NullS to the definition.
Test case added.
Sergei Golubchik
MDEV-38283 Incorrect results for NULLIF function

narrow a historical hack in convert_const_compared_to_int_field()
to apply only to bigint-vs-string comparison as it was supposed to.
Aleksey Midenkov
MDEV-32724 Segmentation fault due to Deep Recursion in table.cc and sql_lex.cc

Recursive CTE wrongly detected anchor because inner non-recursive CTE
wrongly assigned with-element table to itself due to inner-outer name
clash.
gkodinov
MDEV-38642: Missing Null terminator in the definition of mysqldump's --system typelib

There was a missing NULL element terminator for --system's type
library definition.

This was causing a crash in find_type_eol when e.g. an incomplete
value was passed to --system where it keeps iterating until it
finds the NULL as a typelib element.

Fixed by appending a NullS to the definition.
Test case added.
bsrikanth-mariadb
MDEV-36353: Crash with explain for connection

SHOW EXPLAIN FOR, and EXPLAIN/DESC FOR CONNECTION should behave
identically. However, for a query with an addition expression containing
INTERVAL and NOT IN sub-select SHOW EXPLAIN FOR was correctly throwing
parse error, where as EXPLAIN/DESC FOR CONNECTION was crashing.

The reason for the crash is that select block was not initialized and
was being accessed inside the NOT IN sub-select in the EXPLAIN/DESC FOR
CONNECTION case.
Mohammad Tafzeel Shams
MDEV-38079: Crash Recovery Fails After ALTER TABLE…PAGE_COMPRESSED=1

Issue:
Recovery fails because the expected space ID does not match the space
ID stored in the page.

Root Cause:
- Before the crash, the nth page (n != 0) gets flushed to disk as a
  compressed page.
- Page 0 remains unflushed, and the compressed flag for the space is
  made durable only in the redo logs.
- During recovery, the compressed flag is first set to indicate a
  compressed space.
- Later, while applying redo logs, an earlier LSN may reset it to
  non-compressed and then back to compressed.
- If the nth page is read during this intermediate state, a compressed
  page may be read as non-compressed, causing a space ID mismatch.

Fix:
- recv_sys_t::space_flags_lsn : Added a map to track the last applied
  LSN for each space and avoid stale updates from earlier LSNs.
- recv_sys_t::update_space_flags() : Updates space->flags during
  recovery only if the update comes from the latest LSN.
Raghunandan Bhat
MDEV-37474: Privilege check of information_schema.TRIGGERS does not correspond to the standards

According to SQL standard, rows from `INFORMATION_SCHEMA.TRIGGERS` table
should be visible to users with non-SELECT privileges on the columns.
`ACTION_CONDITION`, `ACTION_STATEMENT` and `DEFINER` columns should be
visible only if the user is the owner of the schema.
MariaDB uses `TRIGGER` privilege instead of owner, which controls the
visibilty of all columns, including those which only need non-SELECT
privileges.

This fix
- Allows users with non-SELECT privileges- INSERT, DELETE or UPDATE,
  to see rows in `INFORMATION_SCHEMA.TRIGGERS` table.
- Ensure `ACTION_CONDITION`, `ACTION_STATEMENT` and `DEFINER` columns
  are `NULL` unless the user is the owner of the schema or has `TRIGGER`
  privilege.
Brandon Nesterenko
MDEV-38506: Failed GRANT on a procedure breaks replication

When GRANT EXECUTE ON PROCEDURE fails on the master, it will
erroneously be replicated and executed successfully on the slave.
This both breaks replication and is a security violation.

The underlying issue is that a failed GRANT EXECUTE ON PROCEDURE will
still be replicated when sql_mode does not have NO_AUTO_CREATE_USER.
This is because the function mysql_routine_grant() does not check if an
error occured while performing the GRANT before binlogging, it simply
always binlogs.

This patch fixes this problem by checking if an error happened
previously before binlogging, and if so, then skip binlogging.

Note there is still a broader issue in this area leading to replication
divergence. Reported in MDEV-29848, a partially-completed GRANT
statment (where some earlier GRANTS succeed and a later fails) will not
binlog. Note this affects all grant types, whereas the issue addressed
in this patch is limited to GRANT EXECUTE ON PROCEDURE. This patch
makes GRANT EXECUTE ON PROCEDURE binlogging behavior consistent with
the other grant types. A separate follow-up patch will address the
broader MDEV-29848 issue.

Also note that a test case in rpl_do_grant.test took advantage of
MDEV-38506 so a partially-failing REVOKE EXECUTE ON PROCEDURE would
still replicate.  This test case is disabled with a TODO note to
re-enable it once MDEV-29848 is fixed

Reviewed-by: Sergei Golubchik <[email protected]>
Signed-off-by: Brandon Nesterenko <[email protected]>
Sergei Golubchik
MDEV-35541 UBSAN: runtime error: addition of unsigned offset to X overflowed to Y in my_b_flush_io_cache

/home/buildbot/server/mysys/mf_iocache.c:1793:39: runtime error: addition of unsigned offset to 0x7e1586a239fb overflowed to 0x7e1586a239fa
SUMMARY: UndefinedBehaviorSanitizer: pointer-overflow /home/buildbot/server/mysys/mf_iocache.c:1793:39
Sergei Golubchik
MDEV-27277 update test results
Oleg Smirnov
MDEV-38129 Match probability