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
Nikita Malyavin
MDEV-37941 Assertion !thd->rgi_slave failed on INSERT w/ parallel slave

Replicas can't crash on the incorrect/unexpected data. It should react
with an error.

Change the assertion to if and return error if the relay log contains
query with GTT access.

Parent issue:
MDEV-35915 Implement Global temporary tables
Sergei Golubchik
MDEV-38827 Assertion `str[strlen(str)-1] != '\n'[ || strlen(str) == 512-1]' failed in my_message_sql

remove trailing '\n' from CONNECT error messages
Nikita Malyavin
MDEV-37957 Assertion lock_type >= TL_READ_SKIP_LOCKED failed on HANDLER

...READ

Don't set lock_type to TL_IGNORE: open_temporary_table intentionally
sets it to TL_WRITE to "simulate locking".

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-38568 GTT: Assertion thd->mdl_context.is_lock_owner failed in CoR

The crash happens on the junction of GTT, CREATE OR REPLACE...SELECT,
LOCK TABLES, and error during select.

1. The parent table should be dropped with drop_open_table, not
quick_rm_table, because it should first be closed.
2. In select_create::abort_result_set, drop the parent table as well.
3. Store parent parent GTT in select_create -- this improves readability
  and access hugely.

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-37872 SIGSEGV on some GTT operations under pseudo_thread_id changed

Deny pseudo_thread_id changing when there are some GTTs are open.
pseudo_thread_id is only used for replication testing. Since GTT child
tables are never opened on replicas, it's fine to do so -- there is no
case to test.

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-37958 SIGSEGV in ha_mroonga::storage_create_foreign_key on INSERT

More a mroonga bug, but doesn't reproduce otherwise.
Use a correct alter_info, not the one stored in lex.

Parent issue:
MDEV-35915 Implement Global temporary tables
Sergei Golubchik
MDEV-38892 not all SRCDEF sprintfs were removed

fix as in 2925d0f2ee98

Discovered by: Aakash Adhikari
Mohammad Tafzeel Shams
MDEV-22186: Add innodb_buffer_pool_in_core_dump to exclude InnoDB buffer pool from cores

Problem:
There is no control to include or exclude large InnoDB buffer pool from
core files, which can lead to unnecessarily large core dumps or prevent
capturing useful memory state.

Solution:
Introduce a new global dynamic system variable innodb_buffer_pool_in_core_dump
that allows excluding InnoDB buffer pool from core dumps using MADV_DONTDUMP
where supported. When enabled the server marks relevant memory regions to be
omitted from core files. The madvise state is dynamically updated when the
variable changes.

This variable is only available on Linux & FreeBSD.

Additionally, a test helper script is introduced to inspect
/proc/<pid>/smaps and verify whether large memory regions are marked
for trimming.

- innodb_buffer_pool_in_core_dump
  Global boolean system variable controlling whether InnoDB buffer
  pool should be excluded from core dumps.
  Default: OFF on non-debug builds with MADV_DONTDUMP support,
  ON otherwise.

- innodb_buffer_pool_in_core_dump_update()
  Update hook that sets innodb_buffer_pool_in_core_dump and triggers runtime
  updates of madvise state for the buffer pool.

- buf_pool_t::in_core_dump
  Variable backing @@innodb_buffer_pool_in_core_dump.

- buf_pool_t::core_advise()
  Advises MADV_DONTDUMP or MADV_DODUMP according to latest
  innodb_buffer_pool_in_core_dump value.

- buf_pool_t::create()
  Updates madvise flag to the buffer pool memory based on
  innodb_buffer_pool_in_core_dump.
  Also moves the mutex initialization at the beginiing of function.

- buf_pool_t::resize()
  Updates the madvise flag for buffer pool to keep it in sync with
  the innodb_buffer_pool_in_core_dump.

- check_core_dump_trim.inc
  Test helper that inspects /proc/<pid>/smaps to detect memory regions
  with the dd VmFlag and determine whether the core file is expected
  to be trimmed based on buffer pool and log buffer sizes.
Alexey Botchkov
MDEV-39210 ExtractValue/UpdateXML crash.

XML parser fixed to handler <! and <? correctly.
Nikita Malyavin
MDEV-38480 GTT: Aria gets error HA_ERR_CRASHED_ON_USAGE after TRUNCATE

Do not call HA_EXTRA_PREPARE_FOR_DROP for the parent table

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-38603 GTT: Failing assertion prebuilt->template_type == ROW_MYSQL_WHOLE_ROW

FLUSH TABLES WITH READ LOCK differs from FLUSH TABLES in that the latter
doesn't open the tables. FLUSH TABLES works fine with temporary tables,
while FLUSH TABLES WITH READ LOCK results in ER_NO_SUCH_TABLE.

So we also shouldn't allow FLUSH TABLES WITH READ LOCK open a child GTT.
Doing so would result in many unpredicted problems, like this assertion.

Particularly: m_prebuilt->select_lock_type stays LOCK_S after
FLUSH TABLE WITH READ LOCK, and then is not reset by
handler::external_lock or handler::start_stmt. However, innodb would
expect LOCK_X in SERIALIZABLE isolation.

In this commit:
Always submit parent GTT to FLUSH TABLES. Since FLUSH TABLES doesn't
open tables, there'll be no difference for it, and FLUSH TABLES WITH
READ LOCK will use a parent table.

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-37956 use-after-free in mysql_ha_close_table on DROP DATABASE

Drop global temporary tables after dropping handlers.

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-37720 use-after-free on CREATE OR REPLACE GTT under pseudo_slave_mode

... and LOCK TABLES.

Global temporary tables data is not replicated, and pseudo_slave_mode is
used internally for partial replication testing.

Hence forbid opening GTT (i.e. create child GTT handles) under
pseudo_slave_mode, and forbid setting pseudo_slave_mode=1 whenever child
GTT handles are open.

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-37798 Incomplete savepoint support with global temporary tables

Add empty savepoint support callbacks to global_temporary_tp
Nikita Malyavin
MDEV-37850 Wrong error on DROP TABLE GTT after DROP DATABASE

Turns out that temporary tables are not dropped as part of DROP
DATABASE.

This patch implements dropping child global temporary tables for the
currently dropping database.

That is, if the child table was opened in this connection, it will be
dropped together with the parent table.

If another connection attempts to drop the database, it will wait while
the table is in use.

Parent issue:
MDEV-35915 Implement Global temporary tables
Mohammad Tafzeel Shams
MDEV-22186: Add innodb_buffer_pool_in_core_dump to exclude InnoDB buffer pool from cores

Problem:
There is no control to include or exclude large InnoDB buffer pool from
core files, which can lead to unnecessarily large core dumps or prevent
capturing useful memory state.

Solution:
Introduce a new global dynamic system variable innodb_buffer_pool_in_core_dump
that allows excluding InnoDB buffer pool from core dumps using MADV_DONTDUMP
where supported. When enabled the server marks relevant memory regions to be
omitted from core files. The madvise state is dynamically updated when the
variable changes.

This variable is only available on Linux & FreeBSD.

Additionally, a test helper script is introduced to inspect
/proc/<pid>/smaps and verify whether large memory regions are marked
for trimming.

- innodb_buffer_pool_in_core_dump
  Global boolean system variable controlling whether InnoDB buffer
  pool should be excluded from core dumps.
  Default: OFF on non-debug builds with MADV_DONTDUMP support,
  ON otherwise.

- innodb_buffer_pool_in_core_dump_update()
  Update hook that sets innodb_buffer_pool_in_core_dump and triggers runtime
  updates of madvise state for the buffer pool.

- buf_pool_t::in_core_dump
  Variable backing @@innodb_buffer_pool_in_core_dump.

- buf_pool_t::core_advise()
  Advises MADV_DONTDUMP or MADV_DODUMP according to latest
  innodb_buffer_pool_in_core_dump value.

- buf_pool_t::create()
  Updates madvise flag to the buffer pool memory based on
  innodb_buffer_pool_in_core_dump.
  Also moves the mutex initialization at the beginiing of function.

- buf_pool_t::resize()
  Updates the madvise flag for buffer pool to keep it in sync with
  the innodb_buffer_pool_in_core_dump.

- check_core_dump_trim.inc
  Test helper that inspects /proc/<pid>/smaps to detect memory regions
  with the dd VmFlag and determine whether the core file is expected
  to be trimmed based on buffer pool and log buffer sizes.
Nikita Malyavin
MDEV-38266 Infinite loop after LOCK+REPAIR

Case:
1. Two tables are locked, one of them is GTT
2. Invoke REPAIR on the last table in the list (not GTT)
3. SELECT from gtt

How the bug works:
1. REPAIR sets tdc->flushed=true
2. LOCK TABLE will prevent eviction
3. In SELECT, open_table will go by locked_tables_mode path
4. GTT is found, goto get_new_table (bug!).
5. This is true: thd->open_tables && thd->open_tables->s->tdc->flushed
6. ot_ctx->request_backoff_action
7. open_table retry (infinite).

Fix:
Straighten the flow.
We shouldn't check thd->open_tables->s->tdc->flushed in LTM, but
actually we should do none under get_new_table label right until
open_global_temporary_table.

get_new_table would access tdc and search for TABLE_SHARE, but actually
we already have it. We also shouldn't configure it from scratch - it's
already done. Overall, we can jump directly to opening GTT, with setting
a few variables.

Because TABLE_SHARE will not be opened through tdc (where acquire would
happen), we shouldn't release it in open_global_temporary_table under
locked_tables_mode+MYSQL_OPEN_GET_NEW_TABLE.

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-37968 GTT: is allowed to us as mysql.help_topic, failing assertions

HELP caused opening a child GTT, whish has table category TEMPORARY,
while only SYSTEM/STATISTICS tables are allowed.

In another assertion, ref_count didn't reach 0 in innodb on shutdown.

We really don't want allowing GTT to work as a system table.

The problem is table->s->table_category is determined at *open* stage,
merely by a name:
share->table_category= get_table_category(share->db, share->table_name)

We could forbid GTT creation when its name maches non-user category.
However, RENAME never opens a table, which means, we anyway can rename
GTT to a system table.

All we can do is make sure we don't open it.

Parent issue:
MDEV-35915
Nikita Malyavin
MDEV-38151 GTT: missing FUNCTION support

open_temporary_table[s] defaulted to searching only local temporary
tables (Tmp_table_kind::TMP). When in function, a temporary table was
"carefully re-opened": it was closed and then opened again, with
open_temporary_table. This resulted in "table not found".

The correct key in most cases is Tmp_table_kind::ANY.
In some cases it should be Tmp_table_kind::TMP:
* When operation is not supported for GTT (ANALYZE/REPAIR)
* When a global handle should be opened (CREATE VIEW)
* If it's a re-open

Apart from this bug, it caused a global temporary table to be always
opened through open_tables, meaning that tdc was queried first. This
means that the earlier code never relied on pre-opening
temporary tables.

This means that all the commands that follow the default
open_temporary_tables path in mysql_execute_command (the standard
temporary tables pre-opening) should be able to handle child GTT share.

This wasn't so for TRUNCATE, hence the changes in sql_truncate.cc.

Also, this broke the lookup order: first a local temporary table should
be looked up. If it doesn't exist, only then a global temporary table
should be looked up.
To fix the latter -- push back global temporary tables' local shares and
push front local temporary tables.

To support push_front, All_tmp_tables_list declaration is changed. It
should use I_P_List_fast_push_back adapter, which adds T **m_last to the
list body.

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-37817 DROP TABLE GTT doesn't succeed for ON COMMIT DELETE ROWS

Drop child GTTs on pre-statement impllicit commit stage.

We can't do that inside trans_commit_implicit, because some implicit
commits are fake and part of a bigger logic, where we'd want to preserve
open GTTs.

We can't call mark_tmp_tables_as_free_for_reuse either, since there
could be tables just opened for this transaction, so only drop
exactly what's needed, assuming that tables were marked for reuse in
prev statement, but not dropped yet. One place where mark for reuse is
still required is after closing HANDLER tables.

Parent issue:
MDEV-35915 Implement Global temporary tables
Sergei Golubchik
CONNECT: suppress \n at the end of the error message
Marko Mäkelä
Merge 10.11 into 11.4
Nikita Malyavin
MDEV-38937 GTT: 1944 Error executing row event with trigger replication

Row events prelock tables for triggers even if those triggers are not
accessed. Write_row event is known to trigger a wider set of row
operations. In IDEMPOTENT mode it is

  trg2bit(TRG_EVENT_INSERT) | trg2bit(TRG_EVENT_DELETE);

So no surprise that AFTER DELETE trigger is prepared for insert event.

If the table in trigger doesn't exist though, the error wouldn't be
triggered.

Make the same for GTT:
ignore its open denials on slave if it's meant so.

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-38448 assertion ...tdc->ref_count > 0 failed on LOCK gtt+open error

If open_global_temporary_table failed, a goto was to an incorrect place.
In locked_tables_mode, an extra acquire didn't happen, so a release on
error shouldn't have happened as well (i.e. goto err_lock).
That is, in locked_tables_mode, just return immediately on error.

The easiest way to reproduce it was with DML while pseudo_slave_mode=1,
but actually any error inside open_global_temporary_table would do.

Parent issue:
MDEV-35915 Implement Global temporary tables
Marko Mäkelä
MDEV-21423: Speed up lf_hash_iterate()

l_find(): Specialize the two distinct cases: callback or key.
The callback is only used by lf_hash_iterate(), which can be
a very CPU intensive function, especially in ReadView::open().
Now that the callback variant uses much fewer parameters and
can be expanded inline, InnoDB trx_sys.rw_trx_hash iterations
in ReadView::open() and elsewhere should become faster.
Nikita Malyavin
MDEV-37871 SIGSEGV in I_P_List_iterator on DROP DATABASE test

Happens on dropping the database on a newly created conneciton.

temporary_tables can be NULL in THD::global_tmp_drop_database.

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-38567 GTT Context corruption on repeated SQL when autocommit=0

Always reset temporary_tables->committed when
drop_on_commit_delete_tables is called. Do it right in that function.

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-37896 global_temporary_table tests are not stable on 2nd run

replace con_id and purge logs

Parent issue:
MDEV-35915 Implement Global temporary tables
Sergei Golubchik
enable connect odbc/jdbc tests that were never run for years

* enable connect.jdbc
* enable connect.odbc_sqlite3 test and fix it to pass
* disable connect.odbc_sqlite3_grant - too broken and obsolete
Nikita Malyavin
MDEV-37934 Assertion `thd->transaction->stmt.is_empty()...' in GRANT

...on GTT failed

Open a parent handle for GTT on GRANT.
ON COMMIT PRESERVE ROWS does not register handlerton, so it will work
fine.

Parent issue:
MDEV-35915 Implement Global temporary tables
bsrikanth-mariadb
MDEV-32758: TRIM uses memory after freed

When there are multiple references to the same TRIM() function
inside other functions such as LOCATE(), LEFT(), one of the
reference's buffer is being cleaned before the other tries to access it.
Hence the valgrind warning.

Instead of making use of the String#set() inside Item_func_trum#trimmed_value()
make a copy of the necessary trimmed value.
Nikita Malyavin
MDEV-37929 Assertion !thd->rgi_slave' failed on REPAIR TABLE on replica

1. REPAIR TABLES is logged even if open_table is failed. In this case,
we cannot determine whether it was opened for a global temporary table,
so we cannot make sure it is not replicated.

2. Also REPAIR/ANALYZE/CHECK can include more that one table, and has no
ability co control statement logging per-table, so anyway relying on
that it's not logged is incorrect.

Hence, enable writing to binlog for these three statements. Keep replica
to be able to handle these commands.
As such, force REPAIR/ANALYZE/CHECK to open a parent handle of global
temporary table.

Extract sql_command_flags flag CF_USE_PARENT_GTT_SHARE for global
temporary tables, as a critical mass of statements has been reached.

Also fixes:
MDEV-37929 Assertion !thd->rgi_slave' failed on REPAIR TABLE on replica

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-38481 GTT: Assertion failed in ha_maria::start_stmt on ANALYZE

Assertion 'file->trn == trn' failed in ha_maria::start_stmt on
ANALYZE TABLE, also assertion 'trn' failed in another test.

file->trn is NULL for a newly opened table and is normally assigned by
st_thr_lock::start_trans in mysql_lock_tables.

Same for thd->ha_data[maria_hton->slot].ha_ptr aka 'trn', which is
NULLed when the old table is dropped as part of OR REPLACE action, if
that was the only table in the aria locked tables. Similarly, it is
restored back on st_thr_lock::start_trans in mysql_lock_tables.

Since ANALYZE is registered as operating on the parent table,
open_only_one_table opens and locks the latter. lock_tables doesn't
issue a table lock in locked tables mode, but issues
table->file->start_stmt(...), which asserts for ha_maria.

Solution: lock the parent GTT table as well in
select_create::create_table_from_items. It will be unlocked altogether
within the lock saved in select_create as m_plock.

Parent issue:
MDEV-35915 Implement Global temporary tables
Sergei Golubchik
MDEV-38777 mariadb-test Build regression in FreeBSD - 2026Q1 releases
Nikita Malyavin
MDEV-38931 GTT error: Table was locked with a READ lock after CREATE OR REPLACE

update table-lock TL for a parent table as well.

Parent issue:
MDEV-35915
Raghunandan Bhat
verify test for ipv4-mapped addresses
Nikita Malyavin
MDEV-37660 Make Global Temporary Tables DDL errors more specific

Add ER_TABLE_IN_USE code.
Use it for ALTER, DROP and RENAME when a child Global temporary table
exists in the same connection (effectively blocking the statement)

Parent issue:
MDEV-35915 Implement Global temporary tables
Sergei Golubchik
MDEV-38868 Assertion `*str != '\0'' failed in my_message_sql on CREATE TABLE

avoid empty error messages in failed CONNECT assisted discovery
Nikita Malyavin
MDEV-37898 No release GTT MTR tests due to debug_sync injection

Parent issue:
MDEV-35915 Implement Global temporary tables
Nikita Malyavin
MDEV-38468 GTT: use-after-free after failed BINLOG event in XA mode

Deny setting pseudo_slave_mode for GTT even when rli_fake is set.

Parent issue:
MDEV-35915 Implement Global temporary tables