1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00
Commit Graph

199809 Commits

Author SHA1 Message Date
Oleksandr Byelkin
d37e50c6d0 fix long name on view protocol mariadb-10.6.26 2026-05-08 07:24:06 +02:00
Rucha Deodhar
902d05a22a 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.
2026-05-07 14:39:35 -04:00
Sergei Golubchik
200eb5365a MDEV-39516 s3 curl_easy_setopt requires long values otherwise compile failure
update submodule to compile on fc44
2026-05-06 16:03:39 +02:00
Sergei Golubchik
32327e572b MDEV-39540 crash due to narrowing cast in update_ref_and_keys() 2026-05-06 13:28:33 +02:00
Sergei Golubchik
d0501281ec MDEV-39481 ASAN error on malformed WKB polygon
let's make is difficult for wkb and len to desync
2026-05-06 13:28:23 +02:00
Oleksandr Byelkin
bedacb3eeb new CC 3.3 2026-05-05 20:34:36 +02:00
Varun Deep Saini
551c980587 MDEV-35548: Fix out-of-bounds array access in json_get_path_start
json_get_path_start() set p->last_step to p->steps - 1, creating a
pointer before the beginning of the steps[] array. This is undefined
behavior flagged by UBSAN as "index -1 out of bounds for type
json_path_step_t[32]".

Use NULL as the sentinel value instead, and check for NULL in
json_get_path_next() rather than comparing against p->steps.

Backport to 10.6 of commit 4f546897b8.

Additional test case from Rucha Deodhar

Signed-off-by: Varun Deep Saini <varun.23bcs10048@ms.sst.scaler.com>
Signed-off-by: Varun Deep Saini <deepsainivarun@gmail.com>
2026-05-05 15:48:12 +02:00
Sergei Golubchik
05f36e67d3 MDEV-39266 Stack Overflow via alloca() in Privilege Table JSON Parser 2026-04-30 12:10:09 +02:00
Sergei Golubchik
557bd9ef90 MDEV-39498 more fixes
* use max_length=640
* also fix mroonga_highlight_html, mroonga_normalize, mroonga_snippet_html
* remove disable_cursor_protocol from all mroonga tests
2026-04-30 00:08:58 +02:00
Sergei Golubchik
673cc11797 MDEV-39498 mroonga_command() incorrect result length metadata 2026-04-29 17:03:54 +02:00
Sergei Golubchik
c0fb844833 MDEV-39493 FILE privilege isn't checked for derived
check global privileges separately,
before checking for per-table SELECT_ACL
2026-04-29 15:38:03 +02:00
Sergei Golubchik
7984408bbd MDEV-39481 ASAN error on malformed WKB polygon 2026-04-29 15:38:03 +02:00
Sergei Golubchik
92641e4aa8 MDEV-39478 COM_STMT_EXECUTE incorrectly checks for parameter value length
* remove redundant checks for `len` in `get_param_length()`
* validate return value `length` in `get_param_length()`
* fix all `Item_param::set_param_XXX()` methods to never read past `len`

note that all `Item_param::set_param_XXX()` methods correctly handle
zero-length values.
2026-04-29 15:38:03 +02:00
Sergei Golubchik
ce44ae3ec6 MDEV-39292 set architecture before it's used
followup for 29453945ba
2026-04-29 14:51:57 +02:00
Oleksandr Byelkin
4fad03c70a new CC 3.3 2026-04-29 10:16:24 +02:00
Aquila Macedo
dc4b5d480f MDEV-39479 Mroonga: avoid hang on invalid index flags
Stop parsing index flags after reporting an invalid flag in
mrn_parse_grn_index_column_flags().

Otherwise, an invalid index comment such as flags "COMPRESS_ZSTD" can
make CREATE TABLE loop forever while emitting warnings. Add a regression
test for this case and check that the invalid flag is reported once and
the default index flags are used.
2026-04-29 10:07:03 +02:00
Alexey Botchkov
de14631413 MDEV-15479 Empty string is erroneously allowed as a GEOMETRY column value.
Empty string disallowed.
2026-04-28 00:41:52 +04:00
Thirunarayanan Balathandayuthapani
9f6152b141 MDEV-39261 MariaDB crash on startup in presence of indexed virtual columns
Problem:
========
Purge threads computing virtual columns could crash due to:
1. Stale TABLE* pointers when tables are flushed/rebuilt during purge
2. open_purge_table() called close_thread_tables() on failure, making
MDL tickets invalid before purge could release them
3. Purge coordinator opened TABLE* but workers accessed it with wrong
TABLE->in_use
4. No retry mechanism when open_purge_table() failed due to concurrent
FLUSH TABLES, BACKUP STAGE, or ALTER TABLE operations

Solution:
========
1. Removed close_thread_tables() from open_purge_table(). Purge
coordinator thread should close explicitly in close_and_reopen()

2. Added retry logic: when open_purge_table() returns NULL due to
table flush/rebuild, set must_wait() flag and retry in
close_and_reopen()

3. Update close_and_reopen() with purge_table parameter to
close the failed table. Pass it to trx_purge_close_tables()
for proper cleanup

4. Properly set and reset TABLE::in_use during purge operations:
- Set to coordinator_thd in row_purge_parse_undo_rec() when opening
- Reset in trx_purge_close_table() when closing

5. The auto_increment initialization now happens unconditionally for
purge threads , ensuring the auto_increment counter is always
properly initialized when purge opens tables with virtual columns
2026-04-27 15:32:11 +05:30
Thirunarayanan Balathandayuthapani
8c930cdc5a MDEV-39261 MariaDB crash on startup in presence of indexed virtual columns
Problem:
========
A single InnoDB purge worker thread can process undo logs from different
tables within the same batch. But get_purge_table(), open_purge_table()
incorrectly assumes that a 1:1 relationship between a purge worker thread
and a table within a single batch. Based on this wrong assumtion,
InnoDB attempts to reuse TABLE objects cached in thd->open_tables for
virtual column computation.

1) Purge worker opens Table A and caches the TABLE pointer in thd->open_tables.
2) Same purge worker moves to Table B in the same batch, get_purge_table()
retrieves the cached pointer for Table A instead of opening Table B.
3) Because innobase::open() is ignored for Table B, the virtual column
template is never initialized.
4) virtual column computation for Table B aborts the server

Solution:
========
- Introduced purge_table class which has the following
purge_table: Stores either TABLE* (for tables with indexed virtual
columns) or MDL_ticket* (for tables without) in a single union
using LSB as a flag.
For tables with indexed virtual columns: opens TABLE*, accesses
MDL_ticket* via TABLE->mdl_ticket
For tables without indexed virtual columns: stores only MDL_ticket*.

trx_purge_attach_undo_recs(): Coordinator opens both dict_table_t*
and TABLE* with proper MDL protection. Workers access cached
table pointers from purge_node_t->tables without opening
their own handles

purge_sys.coordinator_thd: Distinguish coordinator from workers
in cleanup logic. Skip innobase_reset_background_thd() for
coordinator thread to prevent premature table closure during
batch processing. Workers still call cleanup to release their
thread-local resources

trx_purge_close_tables():
Rewrite for purge coordinator thread
1) Close all dict_table_t* objects first
2) Call close_thread_tables() once for all TABLE* objects
3) Release MDL tickets last, after tables are closed

Added table->lock_mutex protection when reading (or) writing
vc_templ->mysql_table and mysql_table_query_id. Clear cached
TABLE* pointers before closing tables to prevent stale pointer
access

Declared open_purge_table() and close_thread_tables() in trx0purge.cc
Declared reset_thd() in row0purge.cc and dict0stats_bg.cc.
Removed innobase_reset_background_thd()
2026-04-27 15:32:11 +05:30
Raghunandan Bhat
a73d1f3b1e MDEV-39265: Assertion (mem_root->flags & 4) == 0 failed upon 2nd execution USING DEFAULT with sequence
Problem:
  When a prepared statement uses `DEFAULT` with sequence, on its
  second or subsequent execution, server tries to allocate TABLE_LIST
  object (used for adding sequence table to `internal_tables` list) on
  statement's memory root. This fails with an assert because statement's
  memory root is marked read-only after the first execution.

  CREATE SEQUENCE s;
  CREATE TABLE t (a INT DEFAULT(NEXTVAL(s)));
  PREPARE stmt FROM "UPDATE t SET a = ?";

  EXECUTE stmt USING 3; -- first execution, marks mem_root read-only
  EXECUTE stmt USING DEFAULT;  -- tries to allocate on second execution

Fix:
  Temporarily clear the read-only flag on the statement memory root to
  allow the allocation. Also adds a debug hook to verify allocation
  happens not more than once per prepared statement and per internal
  table added to the list.
2026-04-27 11:40:10 +02:00
Oleksandr Byelkin
a6575e2a1d new wolfssl v5.9.1-stable 2026-04-27 10:00:54 +02:00
Oleksandr Byelkin
94bfbfeeb9 new CC 3.3 2026-04-27 10:00:54 +02:00
Sergei Golubchik
3730b92be0 zlib 1.3.2 2026-04-24 22:19:40 +02:00
Sergei Golubchik
3e3c5d72c8 MDEV-39413 wsrep unsafe handling of parameters
introduce safe() wrapper for parameters that can later be interpolated
into command line.
Use as

- var="foo$BAR"
+ var="foo$(safe BAR)"

A parameter is safe, if it contains no spaces, single quotes or backticks
2026-04-24 12:36:24 +02:00
Sergei Golubchik
12bb87f4a9 cleanup: remove galera test certificates from mtr
use server certs instead. galera CA didn't have a key saved in std_data,
so they could not be regenerated when needed.
2026-04-23 15:53:26 +02:00
Sergei Golubchik
2bbfcb1876 MDEV-39408 mbstream insufficient path validation
reject paths that could not have been written by mariadb-backup
2026-04-23 15:53:26 +02:00
Sergei Golubchik
d56b6b6ea1 MDEV-39404 Gtid_log_event crash
validate xid.gtrid_length and xid.bqual_length just like XID_EVENT does
2026-04-23 15:53:26 +02:00
Alexey Botchkov
855ee88362 MDEV-39210 ExtractValue/UpdateXML crash.
test and a comment fixed.
2026-04-22 21:05:46 +04:00
Oleksandr Byelkin
8f308454b6 MDEV-39389 Memory leaks in _db_set_init
Handle forgotten case of resetting parameters
(free command_line before assigning a new one).
2026-04-22 13:27:23 +02:00
Oleksandr Byelkin
ceabbd5492 zlib 1.3.2 2026-04-22 13:12:54 +02:00
Raghunandan Bhat
c8a38cd5cb MDEV-34951: InnoDB index corruption when renaming key name with same letter to upper case.
Problem:
  InnoDB index corruption occurs when an index is renamed to a name that
  differs only in case (e.g., 'b' to 'B'). The SQL layer uses
  case-insensitive comparison and fails to recognize the change.

Fix:
  Use case-sensitive comparison when matching index names during
  ALTER TABLE to correctly identify and handle case changes.
2026-04-21 16:02:30 +02:00
Alexey Yurchenko
02e6b8c0a0 MDEV-38787 wsrep_slave_fk_checks=OFF results in inconsistency
Since ATM wsrep does not replicate any cascaded changes (because they are
not binlogged in the upstream code) we have to rely on foreign checks on
replicas to reproduce the cascade. Thus setting wsrep_slave_fk_checks=OFF
will result in inconsistency in any setup where there are cascading relations.
Mark this option as deprecated and make it a NOOP.
2026-04-21 09:52:03 +02:00
Marko Mäkelä
3c1d6b108c Fix GCC-16 -Wmaybe-uninitialized 2026-04-20 14:30:04 +03:00
Marko Mäkelä
bba3146acf MDEV-39263 innodb_snapshot_isolation fails to prevent lost updates under contention
lock_clust_rec_read_check_and_lock(): Refine the check whether
the transaction that last modified the record is still active.
The only thing that should matter is whether we are allowed to see
the record. If the implicit lock holder transaction was active and
we succeeded in acquiring the lock, this means that the transaction
had been committed. We must return DB_RECORD_CHANGED (ER_CHECKREAD)
in that case. We want to avoid returning it before the lock wait,
in case the other transaction will be rolled back.

Thanks to Vadim Tkachenko of Percona for reporting this bug,
as well as Kyle Kingsbury for the broader testing that led to this
finding. Vadim's test case was simplified by me and the root cause
analyzed with https://rr-project.org and an additional patch that
added std::this_thread::yield() at the start of
trx_t::commit_persist(). An even better spot should have been
right after the call to trx_t::commit_state().

The addition to the test innodb.lock_isolation is based on the work
by Teemu Ollakka, which was essential for refining this fix.

Reviewed by: Thirunarayanan Balathandayuthapani
2026-04-20 08:08:20 +03:00
Alexey Botchkov
8d0feb2072 MDEV-39210 ExtractValue/UpdateXML crash.
XML parser fixed to handle <! and <? correctly.
2026-04-19 00:45:57 +04:00
Daniel Black
f12ff3600f MDEV-34902: debian-start erroneously reports issues
Remove the complexity of check_for_crashed_tables
by removing it all together. When check_for_crashed_tables
was written there was a desire to recover MyISAM tables.

With Aria being default from 10.4 for system tables,
and all non-MyISAM engines being able to do crash
recovery there isn't the need to autocheck as part
of a system service.

With check_for_crashed_tables removed there is no need
for a mailx package recommendation.
2026-04-16 17:53:39 +02:00
Daniel Black
29453945ba MDEV-39292 Debian build compiles Columnstore aarch64
But doesn't package it. The devel-6 branch of columnstore
is in a low maintaince state. We can't readd aarch64.

To prevent our CI resources building aarch64 columnstore
on the 10.6 and 10.11 branches we adjust our autobake-deb.sh
to keep the disable there.

The version check to 10 is so that when this is merged to
11.4 it becomes no longer impacting.
2026-04-16 12:21:44 +02:00
Sergei Golubchik
c454ba882b MDEV-39319 crash with ST_GeomFromGeoJSON(, NULL)
one cannot check item->null_value before evaluating item's value
2026-04-14 15:07:43 +02:00
Oleksandr Byelkin
31be75cbcb MDEV-39287 (10.6 part) Fix compilation problems with glibc 2.43/gcc 16/fedora 44
Use 'const' where possible.
Use string copy to make dbug usage safe
Check safetiness of myisam/aria usage (made by Monty)
2026-04-14 11:32:09 +02:00
Daniel Black
a2f9a0cd9c MDEV-39015 Debian - remove libboost-system-dev dependency
In all supported Debian versions, which are all 1.69+,
this package only provided a library stub. The header
files where moved into libboost-dev when upstream removed
the need for a library.
2026-04-14 09:17:09 +02:00
Sergei Golubchik
8229217206 don't create build files like mysqlserver-$<CONFIG>.mri.tpl
cmake generator expressions are expanded *during the build step*.
If the file is created *during the configuration step* its name
cannot use generator expressions.
2026-04-13 10:50:37 +02:00
Sergei Golubchik
3895ad97a9 fix compilation failure for embedded with bundled pcre2
sql_embedded must be linked with pcre2-8 so that cmake knew
that sql_embedded needs pcre2-8's INTERFACE include path
2026-04-13 10:50:37 +02:00
Thirunarayanan Balathandayuthapani
be0bb9db40 MDEV-38822 Lock wait timeout during CREATE TABLE AS SELECT FROM mysql.innodb_table_stats
Analysis:
=========
1) Starts the CREATE TABLE ... SELECT and acquires an Intent Shared lock on
mysql.innodb_table_stats to read the rows. (Transaction: T1)

2) The table t1 is populated. As part of the post-copy phase
(introduced by MDEV-35163), InnoDB triggers the statistics update.

3) InnoDB opens a new internal transaction to update the statistics.
This transaction(T2) attempts to acquire an LOCK_X on the same
table in mysql.innodb_table_stats. T2 (x-lock) must wait for T1 to
commit or rollback because X-locks are incompatible with
IS locks from other trasnaction.

Solution:
========
Currently, Intermediate tables don't trigger dict_stats_update_if_needed(),
so they require explicit stats update via alter_stats_rebuild().
For CREATE...SELECT stats are updated automatically through the normal DML
path via dict_stats_update_if_needed()

Skip calling dict_stats_update() in alter_stats_rebuild() for
non-intermediate tables when using copy algorithm, since their statistics will
be updated automatically via dict_stats_update_if_needed().
2026-04-13 11:41:00 +05:30
Sergei Golubchik
628da62272 MDEV-39177 When tests are skipped, number of variations seem random
sort the result of mtr_misc.pl::uniq() (which is just values %seen)
to process combinations in the deterministic order
2026-04-12 18:07:59 +02:00
Sergei Golubchik
aca6743d53 MDEV-39289 CONNECT REST support on Windows doesn't escape the url
let's use _spawnlp that doesn't need args to be escaped

Reported by Aisle Research
2026-04-12 18:07:59 +02:00
Sergei Golubchik
04e993f0bf MDEV-39281 CONNECT OEM tables don't check subtype length
copy the coresponding check from OEMColumns()

Reported by Aisle Research
2026-04-12 18:07:59 +02:00
Sergei Golubchik
f81c247f97 MDEV-39279 ASAN error on malformed WKB
Discovered by Riley Scott Jacob
2026-04-12 18:07:59 +02:00
Sergei Golubchik
d1d48c9185 MDEV-38892 not all SRCDEF sprintfs were removed
fix as in 2925d0f2ee

Discovered by: Aakash Adhikari
2026-04-12 18:07:59 +02:00
Sergei Golubchik
caa04d038c 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
2026-04-12 18:07:59 +02:00
Sergei Golubchik
2abbea88fb CONNECT: suppress \n at the end of the error message 2026-04-12 18:07:59 +02:00