Commit graph

196896 commits

Author SHA1 Message Date
Dave Gosselin
b519fb6937 MDEV-35847 mariadb client --wait flag broken
Wire up the --wait flag in the mariadb client, making it behave
like the same flag from mariadb-admin.  The wait time is hard-coded
to five seconds.  --wait with no argument will retry forever.
Supply an argument like this: --wait=X where X is the number of
retry attempts.
2025-02-07 08:28:20 -05:00
Dave Gosselin
fbb6b50499 MDEV-35117 Improve error message on unexpected geometries for st_distance_sphere
When invoking st_distance_sphere with unexpected geometries, the error
message now given is:
  ERROR HY000: Internal error: Point or multipoint geometries expected
This commit fixes a few formatting issues in the affected function.
2025-02-06 13:17:47 +11:00
Daniel Bartholomew
3a1f9dfda9
bump the VERSION 2025-02-04 07:50:30 -05:00
Yuchen Pei
0ca98e834d
MDEV-35959 Store the error message at the net layer when reading a packet from the server
This ensures that the error message is populated when the reading
fails with ER_NET_READ_INTERRUPTED, which at the client layer returns
without storing any error message as there is no corresponding CR_
error code.

Patch originally by Sergei Golubchik <serg@mariadb.com>
2025-02-04 11:44:16 +11:00
Alexander Barkov
583b39811c MDEV-35620 UBSAN: runtime error: applying zero offset to null pointer
in _ma_unique_hash, skip_trailing_space, my_hash_sort_mb_nopad_bin and my_strnncollsp_utf8mb4_bin

UBSAN detected the nullptr-with-offset in a few places
when handling empty blobs.

Fix:
- Adding DBUG_ASSERT(source_string) into all hash_sort() implementations
  to catch this problem in non-UBSAN debug builds.
- Fixing mi_unique_hash(), mi_unique_comp(),
  _ma_unique_hash(), _ma_unique_comp() to replace NULL pointer to
  an empty string ponter..

Note, we should also add DBUG_ASSERT(source_string != NULL) into
all implementations of strnncoll*(). But I'm afraid the patch
is going to be too long and too dangerous for 10.5.
2025-02-03 16:45:02 +04:00
Daniele Sciascia
10fd2c207a MDEV-35946 Assertion `thd->is_error()' failed in Sql_cmd_dml::prepare
Fix a regression that caused assertion thd->is_error() after
sync wait failures. If wsrep_sync_wait() fails make sure a appropriate
error is set. Partially revert 75dd0246f8.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-02-03 10:03:50 +01:00
Jan Lindström
81e5077185 MDEV-34738 : Upgrade 10.11 -> 11.4 fails when wsrep_provider_options socket.ssl_cipher is set
Problem was in Galera library where wsrep_provider socket.ssl_cipher
parameter was defined as type_bool when it should have been string
type.

Therefore, this test requires Galera library version 26.4.21 where
fix is. Here we just verify that we can upgrade ssl parameters
so that socket.cipher = AES256-SHA and we use OpenSSL.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-02-03 01:39:35 +01:00
Jan Lindström
a1d2dfa656 MDEV-35941 : galera_bf_abort_lock_table fails with wait for metadata lock
Test fixes only.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-02-03 01:13:39 +01:00
Jan Lindström
22414d2ed0 MDEV-27861: Creating partitioned tables should not be allowed with wsrep_osu_method=TOI and wsrep_strict_ddl=ON
Problem was incorrect handling of partitioned tables,
because db_type == DB_TYPE_PARTITION_DB
wsrep_should_replicate_ddl incorrectly marked
DDL as not replicatable. However, in partitioned
tables we should check implementing storage engine
from table->file->partition_ht() if available because
if partition handler is InnoDB all DDL should be allowed
even with wsrep_strict_ddl. For other storage engines
DDL should not be allowed and error should be issued.

This is 10.5 version of the fix.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-02-02 04:54:42 +01:00
Julius Goryavsky
de216618e2 MDEV-29775 addendum: Relaxation of unnecessary restrictions
+ cosmetic corrections taken from the 10.6+ branch
of the fix (to simplify merge).
2025-02-02 04:52:33 +01:00
Jan Lindström
7d69902d83 MDEV-29775 : Assertion `0' failed in void Protocol::end_statement() when adding data to the MyISAM table after setting wsrep_mode=replicate_myisam
If wsrep_replicate_myisam=ON we allow wsrep_forced_binlog_format
to be [DEFAULT|ROW].

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-02-02 04:16:05 +01:00
Jan Lindström
3f5b6a9837 MDEV-35748 : Attempting to create a CONNECT engine Table results in non-InnoDB sequences in Galera cluster error
Problem was incorrect condition on wsrep_check_sequence
when ENGINE!=InnoDB.

Fix is not use DB_TYPE_XXX because it is not correct
on dynamic storage engines. Instead used storage engine
name is looked from thd->lex->m_sql_cmd->option_storage_engine_name.

For CREATE TABLE allow anyting except ENGINE=SEQUENCE.
For CREATE SEQUENCE only ENGINE=InnoDB is supported.
For ALTER TABLE if original table contains sequence information
only ENGINE=InnoDB is supported.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-02-01 16:53:39 +01:00
Alexey Botchkov
47908d3f77 MDEV-32619 Fix setting SRID with ST_*FromWKB().
second argument is handled in Item_func_geometry_from_wkb::val_str.
  contributed by Maximilian Krög <maxi_kroeg@web.de>
2025-01-29 00:43:40 +04:00
Sergei Golubchik
7eded23be6 ColumnStore 5.6.9-1 2025-01-28 19:31:29 +01:00
Sergei Golubchik
1fec4fc4f8 more C API methods in the service_sql
for columnstore
2025-01-28 19:31:29 +01:00
Sergei Golubchik
ffff702623 C/C 3.1.27 2025-01-28 19:31:29 +01:00
Sergei Golubchik
fafa10dbc4 update HeidiSQL to 12.10
also, switch to https
2025-01-28 19:31:29 +01:00
Sergei Golubchik
66cf3c6974 MDEV-35612 fix for system-versioning
only ignore fully invisible fields
2025-01-28 19:31:29 +01:00
Sergei Golubchik
c1933b46e4 MDEV-33285 make the test deterministic
need to clear old signals
before waiting for new signals with the same name
2025-01-28 19:31:29 +01:00
Sergei Golubchik
caec03cb79 MDEV-35907 debian-start script fails when using non-standard socket path
consistently use --defaults-extra-file for all command-line tools
2025-01-28 19:29:54 +01:00
Sergei Golubchik
9a0ac0cdf7 MDEV-35911 Assertion `marked_for_write_or_computed()' failed in bool Field_new_decimal::store_value(const my_decimal*, int*)
disable the assert.

also, use the same check for check_that_all_fields_are_given_values()
as it's used in not_null_fields_have_null_values() - to avoid
issuing the same warning twice.
2025-01-28 19:29:54 +01:00
Dave Gosselin
b8b77177c2 MDEV-35964 fix cast warnings on mac in mysql_file.h
Cast create_flags to mode_t when passing to my_create and
my_create_with_symlink
2025-01-28 11:19:52 +11:00
Julius Goryavsky
bcb87f5ccb fix for galera_query_cache_invalidate test results 2025-01-27 23:07:23 +01:00
Daniele Sciascia
0018df2b55 galera fix: Assertion WSREP(thd) failed in wsrep_restore_kill_after_commit()
Wsrep_commit_empty happens too early when wsrep is disabled. Let the
cleanup happen at end of statement.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-01-27 19:05:27 +01:00
Julius Goryavsky
50d49493db galera: fixes for mtr test for performance schema 2025-01-27 19:05:27 +01:00
Daniele Sciascia
c43db43a7c MENT-2038 Assert WSREP(thd) fails in wsrep_restore_kill_after_commit
Fix wrong assertion: function wsrep_restore_kill_after_commit()
asserts `WSREP(thd)`, however for the caller (wsrep_after_statement())
it is enough that the THD  has an active transaction. Fixed the
assertion accordingly.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-01-27 19:05:27 +01:00
Julius Goryavsky
479a5832f0 galera fix: MSAN reports use-of-uninitialized-value on binlog_encryption
This commit fixes a bug in MSAN verification in debug builds
related to the member of a lex->definer structure field that may
be uninitialized for some SET statements. The bug is caused by
debug output in a wsrep-specific insert and does not affect
server functionality.
2025-01-27 19:05:26 +01:00
Julius Goryavsky
862d1be2e6 MDEV-25718 addendum: stabilization of test success (especially for 11.4+)
Added DEBUG_SYNC_С("ha_write_row_end") in the WSREP branch,
and added a new status to the list of pending statuses in
the mtr test.
2025-01-27 19:05:26 +01:00
Julius Goryavsky
779ae4c511 wsrep mtr tests: fix for MDEV-23081 failure
Sometimes a database can be created with --log-bin
but then the .combinations file causes a switch to
start without --log-bin causing a failure on recovery.
This commit fixes this issue.
2025-01-27 19:05:26 +01:00
Julius Goryavsky
331975c5c5 galera: disable problematic test (galera_nbo_master_non_prim_failure) 2025-01-27 19:05:26 +01:00
Julius Goryavsky
5af1f69a84 MDEV-26266 addendum: more stable test
This test must be performed on newly launched
nodes and then a restart must be performed.
2025-01-27 19:05:26 +01:00
Julius Goryavsky
0a5d6cf478 galera: disable problematic test (galera_sequences) 2025-01-27 19:05:26 +01:00
Julius Goryavsky
acf7b000ff fixes for galera_as_slave replication tests 2025-01-27 19:05:26 +01:00
Jan Lindström
e53ffdee96 MDEV-35804 : galera_ddl_fk_conflict test failed due to timeout
Test case changes only. Use better wait_conditions.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-01-27 19:05:26 +01:00
Julius Goryavsky
2cfad396ee galera tests: more informative messages about the number of variables 2025-01-27 19:05:26 +01:00
Jan Lindström
0ddaefcc76 galera fix : MW-402 galera test fails sporadically
Test was using after certification sync point when it was
intended to use before certification sync point. This
caused sporadic failures.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-01-27 19:05:26 +01:00
Jan Lindström
6e3274e814 MENT-31857 post-fix: fix for timeouts in the galera_as_slave_ctas test
Caused by MDEV-31857 enable --ssl-verify-server-cert by default in
the internal client. Fixed by disabling master_ssl_verify_server_cert
because account is passwordless.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-01-27 19:05:26 +01:00
Hemant Dangi
c0b11e75ff MDEV-34218: Mariadb Galera cluster fails when replicating from Mysql 5.7 on use of DDL
Issue:
Mariadb Galera cluster fails to replicate from
Mysql 5.7 when configured with MASTER_USE_GTID=no
option for CHANGE MASTER.

HOST: mysql, mysql 5.7.44 binlog_format=ROW
HOST: m1, mariadb 10.6 GALERA NODE replicating from HOST mysql, Using_Gtid: No (log file and position)
HOST: m2 mariadb 10.6 GALERA NODE
HOST: m3 mariadb 10.6 GALERA NODE

Error on m1:
2024-05-22 16:11:07 1 [ERROR] WSREP: Vote 0 (success) on 78cebda7-1876-11ef-896b-8a58fca50d36:2565 is inconsistent with group. Leaving cluster.

Error on m2 and m3:
2024-05-22 16:11:06 2 [ERROR] Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 42, event_type: -94
2024-05-22 16:11:06 2 [ERROR] WSREP: applier could not read binlog event, seqno: 2565, len: 482

It fails in Gtid_log_event::is_valid() check on
secondary node when sequence number sent from primary
is 0. On primary for applier or slave thread sequence
number is set to 0, when both thd->variables.gtid_seq_no
and thd->variables.wsrep_gtid_seq_no have value 0.

Solution:
Skip adding Gtid Event on primary for applier or
slave thread when both thd->variables.gtid_seq_no
and thd->variables.wsrep_gtid_seq_no have value 0.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-01-27 17:17:11 +01:00
Marko Mäkelä
746471b8d8 MDEV-33978 P_S.THREADS is not showing all server threads
page_encrypt_thread_key: The key for fil_crypt_thread().

All other InnoDB threads should already have been registered for
performance_schema ever since
commit a2f510fccf
2025-01-27 12:11:47 +02:00
Galina Shalygina
dffe3d1fb2 MDEV-35910 Conditions with SP local variables are not pushed into derived table
This bug prevented building conditions that could be pushed into a derived
table if the derived table was used in a query of a stored procedure and
the conditions contained local variables of the procedure. This could lead
to a slow execution of the procedure.
Also in some cases the bug prevented building conditions that could be
pushed from the HAVING condition into the WHERE condition of a query if
the conditions to be built used local variables of a stored procedure.

To failure to build such pushable conditions was due to lack of a proper
implementation of the virtual method to copy items for the objects of the
class Item_splocal.

Approved by Igor Babaev <igor@mariadb.com>
who had to change the original fix that just added the regular copying of
the nodes of the Item_splocal class to take into account the wrappers
do_get_copy() and do_build_clone() introduced after the fix had been
prepared. He also changed the test case to demonstrate that the fix
was really needed for pushdown from HAVING into WHERE.
2025-01-26 20:42:17 -08:00
Nikita Malyavin
765458c93c fix my_error usage 2025-01-26 16:15:46 +01:00
Nikita Malyavin
e7cc1a3047 MDEV-33658 2/2 Cannot add a foreign key on a table with a matching long UNIQUE
Cannot add a foreign key on a table with a long UNIQUE multi-column index, that
contains a foreign key as a prefix.

Check that index algorithms match during the "generated" keys duplicate removal.
2025-01-26 16:15:46 +01:00
Nikita Malyavin
ecaedbe299 MDEV-33658 1/2 Refactoring: extract Key length initialization
mysql_prepare_create_table: Extract a Key initialization part that
relates to length calculation and long unique index designation.

append_system_key_parts call also moves there.

Move this initialization before the duplicate elimination.

Extract WITHOUT OVERPLAPS check into a separate function. It had to be moved
earlier in the code to preserve the order of the error checks, as in the tests.
2025-01-26 16:15:46 +01:00
Nikita Malyavin
e33064e0fc MDEV-27769 Assertion failed in Field::ptr_in_record upon UPDATE in ORACLE mode
table->move_fields has some limitations:
1. It cannot be used in cascade
2. It should always have a restoring pair

In this case, an error has occurred before the field ptr was restored, returning
from the function in that state. Even in case of an error, the table can be
reused afterwards and table->field[i]->ptr is not reset in between.

The solution is to restore the field pointers immanently whenever they've been
deviated.

Also add an assertion that ensures that table fields are restored after the use
in close_thread_tables.
2025-01-26 16:15:46 +01:00
Brandon Nesterenko
cb5dd76959 MDEV-35938: rpl.rpl_parallel_gco_wait_kill fails - "Can't initialize replace ..."
Test rpl.rpl_parallel_gco_wait_kill has a race condition where
it identifies that SQL using its state as
"Slave has read all relay log", and immediately tries to save
the thread id of the SQL thread by querying for threads with
that same state. However, the state of the SQL thread may
change in-between this time, leading to the query that saves
the SQL thread finding no thread id that matches that state.

Commit 3ee6f69d49 aimed to fix
this in 10.11+ by simplifying the query string to
"%relay log%"; however, it could still fail (though less
often).

This commit instead changes the query to find the SQL thread
from using some state, to using the command "Slave_SQL", which
will not change
2025-01-25 15:54:37 -07:00
Oleksandr Byelkin
47f87c5f88 MDEV-20281 "[ERROR] Failed to write to mysql.slow_log:" without error reason
Add "backup" (in case of absence issued by error) reasons for failed logging.
2025-01-25 20:37:51 +01:00
Jan Lindström
d598ee3cf9 MDEV-32780 : galera_as_slave_replay: assertion in the wsrep::transaction::before_rollback()
Test changes only because assertion reported is not
reproducable anymore.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-01-24 17:17:12 +01:00
sjaakola
552cba92de MDEV-35710 support for threadpool
When client connections use threadpool, i.e. configuration has:
thread_handling = pool-of-threads it turned out that during wsrep
replication shutdown, not all client connections could be closed.
Reason was that some client threads has stmt_da in state DA_EOF,
and this state was earlier used to detect if client connection
was issuing SHUTDOWN command.

To fix this, the connection executing SHUTDOWN is now detected by
looking at the actual command being executed:
thd->get_command() == COM_SHUTDOWN
During replication shutdown, all other connections but the
SHUTDOWN executor, are terminated.

This commit has new mtr test galera.galera_threadpool, which
opens a number of threadpool client connections, and then
restarts the node to verify that connections in threadpool are
terminated during shutdown.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-01-24 17:09:34 +01:00
Julius Goryavsky
50cf189717 MDEV-35018 addendum: improved warnings handling
Fixed regression after original MDEV-35018 fix related
to warnings appearing when running MDEV-26266 test and
other possible problems with warnings.
2025-01-24 17:09:21 +01:00
Daniele Sciascia
841a7d391b MDEV-35018 MDL BF-BF conflict on DROP TABLE
DROP TABLE on child and UPDATE of parent table can cause an MDL BF-BF
conflict when applied concurrently.
DROP TABLE takes MDL locks on both child and its parent table, however
it only it did not add certification keys for the parent table.
This patch adds the following:
 * Append certification keys corresponding to all parent tables
   before DROP TABLE replication.
 * Fix wsrep_append_fk_parent_table() so that it works when it is
   given a table list containing temporary tables.
 * Make sure function wsrep_append_fk_parent_table() is only called
   for local transaction. That was not the case for ALTER TABLE.
 * Add a test case that verifies that UPDATE parent depends on
   preceeding DROP TABLE child.
 * Adapt galera_ddl_fk_conflict test to work with DROP TABLE as well.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2025-01-24 17:02:44 +01:00