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
MDEV-40395 MyISAM/Aria silently truncate extensions from filenames, if too long

* move all common fn_format flags that mi_create/maria_create use
  into one single #define.
* simplify (MY_APPEND_EXT is redundant and MY_REPLACE_EXT does nothing
  when no . is present in the filename)
* use MY_SAFE_PATH everywhere (return NULL if too long)
* set my_errno= ENAMETOOLONG on too long
* abort mi_create/maria_create if returned NULL
Sergei Golubchik
more portability fixes for galera.galera_sst_mariabackup_encrypt_with_key_server

make sure pkill doesn't kill itself. it's documented not to do that,
but if it's not called directly (e.g. my_safe_process -> sh -> pkill)
it can still kill its parents.
Sergei Golubchik
MDEV-39812 32-bit size truncation in RocksDB
Sergei Golubchik
MDEV-40328 ASAN error on malformed WKB multipolygon

before `data+= WKB_HEADER_SIZE` verify that there's enough data.

rewrite this line in Gis_multi_line_string::get_mbr to make clear
that it does not need this check.
Georgi (Joro) Kodinov
MDEV-17746: perfschema.dml_threads failed in buildbot with wrong errno

The test was trying to update the performance_schema.threads row for
the current connection. And if that row was not found or was the same,
there's nothing to update hence no update not allowed error.

MariaDB has a device to skip calling ha_update_row() if the old and the
new records are identical.

The connection id is increasing by at least 2 for every test run.
Eventually it will hit the constant 12 in the UPDATE and the server
will not call ha_update_row() at all and won't get the error.
This is not a bug: it's reasonable behavior.

Stablizied the test by changing the UPDATE value to 100k.
In this way we can repeat the test at least 50k times before it breaks.

Stabilized the test as follows:
* Added a SELECT with the same conditon to ensure there's a row to
  be updated by the UPDATE following the select.
* Increased the performance_schema_max_thread_instances to 50k
    for the test.
Dave Gosselin
test updates based on comments from Oleg
Sergei Golubchik
MDEV-40308 single quotes make SHOW CREATE USER invalid

use append_unescaped() for '-quoted strings in SHOW CREATE USER
and SHOW GRANTS. Use append_identifier() for user- and hostnames.
Sergei Golubchik
MDEV-40358 symlinked table name is not encoded

encode table name in file name in DATA/INDEX DIRECTORY
Dave Gosselin
MDEV-39397: Document and clean up dump_leaf_key

Add a docblock for dump_leaf_key that describes each parameter
and the leaf payload layout, and documents the return values and
side effects.

Sprinkle inline comments through the body to explain the LIMIT and
OFFSET bookkeeping, the dual purpose of result_finalized, why
borrowing table->record[1] as scratch space is safe, the offset
translation for skipped null bytes, and why the blob_storage
truncation flag is cleared after raising ER_CUT_VALUE_GROUP_CONCAT.

Implement other code cleanups, too, like dropping the unused tmp2
String object and rename old_length to starting_len so the cut_max_length
call reads more directly.  Other changes include narrowing loop
variables to the loop scope, move declarations next to their
first use, and replacing the C casts with static_cast.

There should be no behavior changes at this commit.
Sergei Golubchik
MDEV-40426 CONNECT writes unvalidated data from remote server into fixed-len buffer

use size-bounded scanf formats
Dave Gosselin
MDEV-35747:  Wrong result from prepared TVC with parameter markers

The setup of column type information in table_value_constr::prepare()
was wrapped in an "if (!holders)" guard so that it runs only once per
statement.  However, the guard was too wide because it bound the
allocation of item holders (which should happen only once) to the
collection of type information (which should happen on each execution).

This leaves the TVC stuck with whatever placeholder type the parameter
had when the holders were first built, which may not match the type of
the next substitution.  A type holder has no actual type until a
value is bound at EXECUTE time.  So both the TVC types and the
corresponding Item_type_holder instance in the SELECT item list must be
computed again on every EXECUTE.

Type holder allocation happens on the first call to the prepare()
function but that doesn't always coincide with a PREPARE.  For a
prepared statement it happens at PREPARE but for a stored procedure it
happens on the first execution of the procedure's statement.  The
corresponding assertion allows both the first execution as well as
PREPARE.

This patch separates the work done once per statement from the work done
on every execution as described above.
Sergei Golubchik
cleanup: main.drop test
Sergei Golubchik
MDEV-40065 bundled command-line clients don't always enforce length limits on server results

replace strmov/strxmov with strnmov, strmake, or my_snprintf
forkfun
MDEV-39522 Query with UNION fails in Oracle sql_mode with ER_BAD_FIELD_ERROR/ER_UNKNOWN_TABLE

MDEV-37325 unconditionally wrapped union subqueries in derived tables,
breaking name resolution of outer-scope/correlated references inside
the unions (producing ER_UNKNOWN_TABLE errors).

Delay the wrap until a following operator has a different linkage.
In Oracle mode all set operators share one priority and bind
left-to-right, so wrapping the accumulated prefix on each operator
change enforces it. This also corrects the row multiplicity of mixed
set operations toward left-to-right order.

create_priority_nest(): when the nest covers the whole prefix, point
the wrapper's first_nested at itself. Cut the prefix with
cut_next() before wrapping and re-register it on the outer unit;
run fix_distinct() before re-registering so select masters are settled.
Kristian Nielsen
MDEV-35691, intermediate commit, test case

Signed-off-by: Kristian Nielsen <[email protected]>
Dave Gosselin
MDEV-39397: GROUP_CONCAT of BIT returns decimal, not packed bytes

When DISTINCT or ORDER BY is in play, GROUP_CONCAT builds an
internal temp table and converts BIT arguments to integers so records
can be compared by memcmp.  Calling val_str() on that field
then returned the decimal form ("0", "1", "3") instead of the
packed bit bytes that Field_bit::val_str() emits everywhere else,
including the "plain" GROUP_CONCAT path.

Override get_str_from_field() for Item_func_group_concat to detect
when the argument is BIT, read the value as an integer from the
temp table field, and pack it into (max_length + 7) / 8 bytes,
mirroring Field_bit::val_str().  This makes DISTINCT and ORDER BY
agree with the plain path.

Before this change, BIT fields in group_concat were rendered
as ASCII which was incorrect and produced the wrong result as
described in the ticket.  With this fix, we also update the
existing test cases to wrap BIT columns with '+0' so the recorded
output stays in ASCII format.  Now, with this patch and the test
case from the ticket, MariaDB and MySQL produce identical resultset
of a single row, single column having value 08.

By default, a group_concat including BIT fields on MySQL returns a
hexified value for its resultset whereas MariaDB requires the
hex() function to wrap group_concat for the same result:

Setup:
  create table t1(a bit(2), b varchar(10), c bit);
  insert into t1 values (1, 'a', 0), (0, 'b', 1);

MySQL:
  mysql> select group_concat(a, c) from t1;
  +----------------------------------------+
  | group_concat(a, c)                    |
  +----------------------------------------+
  | 0x01002C0001                          |
  +----------------------------------------+
  1 row in set (0.001 sec)

MariaDB:
  MariaDB [test]> select hex(group_concat(a, c)) from t1;
  +-------------------------+
  | hex(group_concat(a, c)) |
  +-------------------------+
  | 01002C0001              |
  +-------------------------+
  1 row in set (0.001 sec)
Sergei Golubchik
MDEV-40362 #mysql50# mixes up with table names in the table cache and on disk

1.
Only allow #mysql50# prefix on table names that
can not be decoded from a file name to a table name.
It is an error to put this prefix on a name that can be accessed
as a valid table name without a prefix. Use `t1` not `#mysql50#t1`,
use `a-b` not `#mysql50#a@002db`.

2.
Don't allow creation of new tables with the #mysql50# prefix.

Except when in SQLCOM_ALTER_DB_UPGRADE - main.upgrade test runs
ALTER DATABASE `#mysql50#mysqltest-1` UPGRADE DATA DIRECTORY NAME;
This command moves tables from the old db name to the new db name,
and some of these tables also have old #mysql50# names.

3.
ALso don't allow to create such databases, views, partitions,
subpartitions, sequences, triggers.
Sergei Golubchik
MDEV-40311 also fix mariadb-show and mariadb-convert-table-format
Alessandro Vetere
MDEV-40427 lock_move_reorganize_page() early exit check is useful only with lock elision

After MDEV-40128, the early exit check in lock_move_reorganize_page()
is useful only with lock elision support.
This is because, when lock elision is not supported, TMLockGuard falls
back to behave like LockGuard.
The same check would be done using LockGuard later, in any case.
Hence, the early exit check can be skipped when lock elision is not
supported.
Raghunandan Bhat
MDEV-38075: Make sysV init script check for actual function presence

Problem:
  The current implementation of the sysvinit script only creates
  `log_success_msg()` and `log_failure_msg()` fallback functions when
  not finding an /etc/init.d/functions file to include.

  Newer RHEL releases do not define those functions in that file
  anymore.

Fix:
  Check if the functions are defined and provide fallback functions if
  they are not defined.
Georgi (Joro) Kodinov
MDEV-17746: perfschema.dml_threads failed in buildbot with wrong errno

The test was trying to update the performance_schema.threads row for
the current connection. And if that row was not found or was the same,
there's nothing to update hence no update not allowed error.

MariaDB has a device to skip calling ha_update_row() if the old and the
new records are identical.

The connection id is increasing by at least 2 for every test run.
Eventually it will hit the constant 12 in the UPDATE and the server
will not call ha_update_row() at all and won't get the error.
This is not a bug: it's reasonable behavior.

Stablizied the test by changing the UPDATE value to 100k.
In this way we can repeat the test at least 50k times before it breaks.
Sergei Golubchik
MDEV-40360 CONNECT REST can pass arguments to curl via HTTP parameter

tell curl to not try to interpret url as a parameter
Mohammad Tafzeel Shams
MDEV-39800: Assertion `!(mode & 2048U) || (mode & 512U) || is_supremum' failed

ISSUE:

Lock bypassing optimization allows an X-lock request to skip
waiting locks when the requesting transaction already holds an
S-lock on the same record. This optimization is designed for
regular B-tree record locks that use heap-number-based conflict
detection.

Spatial index predicate locks use different semantics. They
perform MBR (Minimum Bounding Rectangle) overlap checks for
conflict detection and must not participate in bypass
optimization.

The assertion failure occurred because predicate insert
intention locks is not considered inside lock bypass code,
which assumed all insert intention locks must be either gap
locks or on the supremum record (MDEV-34877).

ut_ad(!(insert_intention) || (gap) || is_supremum)

Additionally, predicate locks could incorrectly enable
bypass_mode because the existing checks did not explicitly
exclude LOCK_PREDICATE locks.

FIX:

- lock_t::is_predicate(): Add a helper to identify spatial
  index locks.

- lock_t::can_be_bypassed(): Return false for predicate
  locks.

- lock_rec_has_to_wait_in_queue(): Update the assertion to
  allow predicate insert intention locks. Also add a
  !is_predicate() check to bypass_mode calculation.

- lock_rec_queue_validate_bypass(): Add an early return to
  skip bypass validation for predicate locks.
Sergei Golubchik
MDEV-39818 backtick in FK names breaks SHOW CREATE TABLE

InnoDB used to have two versions of innobase_quote_identifier().
One that handled embedded backticks and one that didn't.

Let's use just one implementation that handles backticks.
Keep the other one as a helper that writes to FILE but does not
implement the quoting logic.
Sergei Golubchik
MDEV-40329 Binary_string::qs_append(char): Assertion `str_length + (uint32) (1) <= Alloced_length' failed in AsText

Geometry::as_wkt() didn't take into account bytes written into the
result string in the recusrive call of get_data_as_wkt().
Gis_geometry_collection::get_data_as_wkt() didn't reserve space at all.
Thus nested geometry collections could overflow the buffer.
Sergei Golubchik
MDEV-39816 MyISAM crash on corrupted MYI with invalid keyseg length

check that the keyseg lengths are sane.

fix Aria too.
Dave Gosselin
MDEV-39397: Document and clean up dump_leaf_key

Add a docblock for dump_leaf_key that describes each parameter
and the leaf payload layout, and documents the return values and
side effects.

Sprinkle inline comments through the body to explain the LIMIT and
OFFSET bookkeeping, the dual purpose of result_finalized, why
borrowing table->record[1] as scratch space is safe, the offset
translation for skipped null bytes, and why the blob_storage
truncation flag is cleared after raising ER_CUT_VALUE_GROUP_CONCAT.

Implement other code cleanups, too, like dropping the unused tmp2
String object and rename old_length to starting_len so the cut_max_length
call reads more directly.  Other changes include narrowing loop
variables to the loop scope, move declarations next to their
first use, and replacing the C casts with static_cast.

There should be no behavior changes at this commit.
Raghunandan Bhat
MDEV-38075: Make sysV init script check for actual function presence

Problem:
  The current implementation of the sysvinit script only creates
  `log_success_msg()` and `log_failure_msg()` fallback functions when
  not finding an /etc/init.d/functions file to include.

  Newer RHEL releases do not define those functions in that file
  anymore.

Fix:
  Check if the functions are defined and provide fallback functions if
  they are not defined.
Dmitry Shulga
MDEV-36481: Abnormal server termination on second execution of stored routine that runs a cursor after table metadata in the query was changed

On parsing the statement 'DECLARE var1,...,varN TYPE OF cur DEFAULT value'
an instance of the class Item_splocal that created on handling the clause
'DEFAULT value' is shared between two classes sp_instr_cursor_copy_struct and
sp_instr_set. In result, in case metadata changed and cursor has to be re-parsed,
items associated with the SP instruction sp_instr_cursor_copy_struct
are deallocated and one of deallocated items is the one representing the value
the `DEFAULT value` clause. On the other hand, the data member
sp_instr_set::m_value still references the deallocated item. It leads to server
abnormal termination on second run of a stored routine containing the statement
'DECLARE ... TYPE OF ... DEFAULT value'

To fix the issue pass owning of an instance of the class Item_splocal to
the class sp_instr_cursor_copy_struct and deallocated it explicitly on
closing the stored routine.
Raghunandan Bhat
MDEV-40099: MSAN: use-of-uninitialized-value in `TABLE::delete_row<true>(bool)`

Problem:
  REPLACE DELAYED into a system-versioned table read an uninitialized
  lex->vers_conditions.delete_history in TABLE::delete_row().

  Delayed_insert has its own THD, and hence its own LEX, of which the
  constructor copies only a few fields from the parser LEX.
  vers_conditions was not copied, so it stayed uninitialized. It is read
  when a REPLACE resolves a duplicate on a versioned table.

Fix:
  Copy vers_conditions from the parser LEX in the Delayed_insert
  constructor.
Alessandro Vetere
MDEV-40408 btr_page_reorganize_low() uses the buffer pool just to obtain a scratch block

Add a pool of scratch blocks, btr_scratch_pool_t, to be used instead
of the global buffer pool in the page-reorganization operations,
when a scratch block is needed.
Removes the needs of obtaining the buf_pool.mutex in such functions,
and any delay while holding at least page X-latch that it might have
caused.
Sergei Golubchik
MDEV-39817 JSON_ARRAYAGG() returns garbage because of off-by-one error

don't truncate to a position somewhere between
[old_length, max_length-1] if old_length == max_length.
Simply set the length to old_length in this case.

Also, max_length cannot be zero.
Alexander Barkov
MDEV-40396 open SYS_REFCURSOR crash, if too many cursors

When THD::m_statement_cursor was resized by a call of alloc_dynamic,
the memory location of all sp_cursor::result changed.
Therefore all members "select_result *Server_side_cursor::select"
previously initialized in the constructor to addresses of
sp_cursor::result became invalid.

Fix:
- Removing the member "select_result *result;" from Server_side_cursor.
- Passing instead a new "select_result *" parameter to
  methods open() and fetch() of Server_side_cursor and its descendant
  Materialized cursor.

So now, for example, when sp_cursor::fetch() is called, it executes:

    server_side_cursor->fetch(&result/*new parameter*/, 1);

The address value `&result` is now always correct.
Sergei Golubchik
MDEV-40311 mariadb-dump doesn't always quote identifiers

covers:
* DROP TRIGGER
* CHANGE MASTER
* CREATE FUNCTION
Sergei Golubchik
MDEV-39776 SHOW CREATE TABLE corrupts `-quoted table options

Three problems:

1. Option value specified as `foo bar` was not quoted,
  printed as foo bar, breaking CREATE TABLE.
2. Option value that included */ was printed as is, in unknown
  options when the whole option was commented out, this broke the
  comment: /* opt='val*/ue' */
3. Option names can include */ too, `opt*/ion`=1

Fix: simplify value printing, ignore the original quoting, always
print the value quoted as a string. Break comment markers with an
escape (as *\/) if inside a comment. As \-escapes don't work inside,
backticks, we cannot use `-quoting for option values at all.

For the same reason we cannot allow */ inside option names, thus
let's only allow keywords for option names and reject fancy names
even if IGNORE_BAD_TABLE_OPTIONS is in force.
Sergei Golubchik
fixup! MDEV-39841
Raghunandan Bhat
MDEV-40099: MSAN: use-of-uninitialized-value in `TABLE::delete_row<true>(bool)`

Problem:
  REPLACE DELAYED into a system-versioned table read an uninitialized
  lex->vers_conditions.delete_history in TABLE::delete_row().

  Delayed_insert has its own THD, and hence its own LEX, of which the
  constructor copies only a few fields from the parser LEX.
  vers_conditions was not copied, so it stayed uninitialized. It is read
  when a REPLACE resolves a duplicate on a versioned table.

Fix:
  Copy vers_conditions from the parser LEX in the Delayed_insert
  constructor.
Georgi (Joro) Kodinov
MDEV-17746: perfschema.dml_threads failed in buildbot with wrong errno

The test was trying to update the performance_schema.threads row for
the current connection. And if that row was not found or was the same,
there's nothing to update hence no update not allowed error.

MariaDB has a device to skip calling ha_update_row() if the old and the
new records are identical.

The connection id is increasing by at least 2 for every test run.
Eventually it will hit the constant 12 in the UPDATE and the server
will not call ha_update_row() at all and won't get the error.
This is not a bug: it's reasonable behavior.

Stablizied the test by changing the UPDATE value to 100k.
In this way we can repeat the test at least 50k times before it breaks.

Co-authored-by: Grok
Sergei Golubchik
MDEV-40425 handlersocket crashes on read with huge number of fields

* fix handlersocket to unlink it's THD, this apparently was broken
  for years
* add a check for fldnum
* add a first ever handlersocket test
Sergei Golubchik
MDEV-40409 ST_GeomFromText stack overrun on deeply nested GeometryCollection