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
Daniel Black
innodb: token free of memory before YY_FATAL_ERROR

yy_load_buffer_state(x2) was notionally leaking memory
if the second memory allocation failed. The next
YY_FATAL_ERROR results in exit, so its not saving
much.

This was found by Infer and was corrected to
aid the workflows around it.

The change is a cherry-picked change out of the
Bison-3.8.2 generated files. Other generated
changes where overall not meaningful impacting
on the functionality of the parser or where
potentially much more impacting requiring
extensive validation of this lex parsing which
is intended to be removed.
Marko Mäkelä
MDEV-39142 InnoDB fails to start up with CONFIG_ARM64_VA_BITS_39=y

Some 64-bit ARM targets, such as the Raspberry Pi 4, use a Linux kernel
build option that limits the width of virtual addresses to 39 bits,
corresponding to 512 GiB. This would prevent a reservation of
the default innodb_buffer_pool_size_max=8t.

buf_pool_t::create(): If we fail to allocate virtual address space
for the default innodb_buffer_pool_size_max=8TiB on a 64-bit system,
let us retry with 128 GiB or innodb_buffer_pool_size,
whichever is greater.

buf_pool.size_in_bytes_max_default, buf_pool.size_in_bytes_max_minimum:
These constexpr size_t replace innodb_buffer_pool_size_max_default and
innodb_buffer_pool_size_max_minimum, respectively.

my_large_virtual_alloc(): Do not report EE_OUTOFMEMORY becaues we are
not actually running out of memory but only virtual address space.
buf_pool_t::create() will already report an appropriate error message.

On AMD64, POWER and SPARC, the size of the virtual address space
should always be at least 47 bits.

For 64-bit ARM, Linux also offers CONFIG_ARM64_VA_BITS_36, which would
limit the virtual address space to 16 GiB. This setting should be rare
even on embedded systems, such as OpenWrt.

For RISC-V, the minimum appears to be CONFIG_VA_BITS_SV39.

On MIPS, the virtual address space could be 40 bits or less, but we
don't know how much less. On the MIPS based LoongArch, the Linux
kernel will read the VALEN bits from the first cpucfg register.

We will assume that 39 bits is a sensible least common denominator for
64-bit ARM, RISC-V, MIPS, and LoongArch.

If this logic fails and InnoDB fails to start up on some 64-bit platform,
it will always be possible to specify a smaller value than the default
innodb_buffer_pool_size_max=8t.

Reviewed by: Thirunarayanan Balathandayuthapani
Aleksey Midenkov
MDEV-38710 Assertion is_lock_owner on error returning from auto-create in mysql_admin_table

Followup commit for 4802bfe4f90.

After returning error from check_vers_constants() the stack
immediately returns error status up to mysql_admin_table() where it
does close_thread_tables(). The latter expects MDL acquired.

The bug discloses the generic problem of fallback mechanism throwing
an error when the upper frame does close_thread_tables().
Aleksey Midenkov
MDEV-25365 Cleanups
Aleksey Midenkov
MDEV-28619 Server crash and UBSAN null-pointer-use in Window_funcs_sort::setup

Optimization in st_select_lex_unit::prepare() removes ORDER BY for
certain subqueries. That excludes ORDER BY items from being fixed, but
sl->window_funcs still contains window function items and those
related to optimized out ORDER BY are unfixed. The error about missing
window spec is thrown when the item is fixed. Hence we get redundant
processing of window function items without checking window spec
existence.

The fix removes the related window function items when ORDER BY is
optimized out. ORDER accumulates window_funcs at parser stage which
are then removed from SELECT_LEX::window_funcs. The fix also updates
similar optimization in mysql_make_view().
Marko Mäkelä
MDEV-11426 fixup: Remove fil_node_t::init_size

The field fil_node_t::init_size that had been added in
mysql/mysql-server@38e3aa74d8d2bf882863d9586ad8c9e9ed2c4f00
should have been removed in 0b66d3f70d365bbb936aae4ca67892c17d68d241.
Daniel Black
Connect: TDBXML::ReadDB - remove deadstore

Remove an assignement that is never read because
the return happens next.
Christian Hesse
MDEV-35969 wsrep: add more details in service manager status (10.11)

Let's show the difference between donor and joiner.

Signed-off-by: Julius Goryavsky <[email protected]>
Abhishek Bansal
MDEV-34079: ST_AsGeoJSON returns incorrect value for empty geometry

ST_AsGeoJSON stripped the first '[' bracket when serializing an EMPTY
GeometryCollection, outputting '{"type": "GeometryCollection",
"geometries":]}'.

This occurred because several Gis_*::get_data_as_json functions
unconditionally truncated the last 2 characters of their String buffer
to remove the trailing ', ' appended inside their element loops. For
empty collections, the loop doesn't execute and there is no trailing
comma, causing the truncate to strip the initial '[' bracket.

Fixed by checking if the last character in the buffer is ' ' before
truncating.
Marko Mäkelä
MDEV-16926 fixup: GCC 16 -Wmaybe-uninitialized

Year::year_precision(): Make static, so that VYear::VYear
and VYear_op::VYear_op() will avoid invoking this function with
an unnecessary "this" pointer to an uninitialized object.
bsrikanth-mariadb
MDEV-37904: Use of un-initialized value

valgrind reported use of an un-initialized value, when trying to write
analyzed plan to json. Instead of fetching c_str() from the string
object and passing it to the writer object's add_string() method, one could
use an overridden add_string() that accepts a different string object.
This would avoid the valgrind warnings.
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.
Vladislav Vaintroub
MDEV-34482 threads running events are not visible for definer

Fixed to additionally show event worker threads, in SHOW PROCESSLIST
and I_S.PROCESSLIST, if event worker runs under current user context.
Vladislav Vaintroub
MDEV-33083 AFTER UPDATE trigger sometimes does not fire "ON DUPLICATE KEY UPDATE"

Prior to this change, AFTER UPDATE did not fire, if data was unchanged.

Now this is fixed. Also added a test to verify that trigger behavior for
on-duplicate-update is the same as normal update, in case data does not
change.
Christian Hesse
MDEV-35969 wsrep: set new status for service manager (10.11 backport)

On WSREP state transfer the status in service manager changes to:

    WSREP state transfer (role ...) ongoing...

This status was not changed after state transfer was complete. Let's
change it again to reflect now situation:

    WSREP state transfer (role ...) comleted.

Signed-off-by: Julius Goryavsky <[email protected]>
Abhishek Bansal
MDEV-38264: Fix failed assertion in json_find_path with trailing commas

The function json_skip_array_and_count() was trapping syntax errors
(e.g., trailing commas) in a local engine copy. Because the error state
wasn't propagated back to the main engine, json_find_path() would
proceed with an inconsistent state, eventually triggering an assertion
failure.

This patch ensures that any error encountered during the lookahead
scan is propagated to the primary engine. This allows the parser to
fail gracefully with a syntax error instead of crashing.
Vladislav Vaintroub
MDEV-37256 Add permission check for LOAD INDEX INTO CACHE and CACHE INDEX

Previously, no access check was done for these commands. Now, we require
any table-level permission, which consistent with other admin commands
like CHECKSUM.
Marko Mäkelä
Merge 10.11 into 11.4
Fariha Shaikh
MDEV-36386 Fix connect.csv and connect.ini tests in view-protocol mode

The tests connect.csv and connect.ini were failing in view-protocol mode
due to different column naming behavior for complex expressions.

Without explicit column aliases, view-protocol mode generates automatic
names (Name_exp_1) while normal mode uses the full expression as the
column name.

Add explicit column aliases to SELECT statements with LOAD_FILE
expressions to ensure consistent column names across both normal and
view-protocol modes.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
ShenLin
MDEV-39041: Execute permissions required to make dh_link execute this to expand $DEB_HOST_MULTIARCH
Aleksey Midenkov
MDEV-28619 with_flags cleanup

The best practice is to init as much info as possible in class
constructor. with_flags access may be needed before fix_fields() or
fix_fields() may be not called at all like it takes place in
MDEV-28619. The fix for MDEV-28619 requires WINDOW_FUNC check on
unfixed item.
Aleksey Midenkov
MDEV-38798 Assertion `mdl_key->length() == 3' failed in MDL_map::find_or_insert

Originally two MDL_EXCLUSIVE are used for pure alias of derived table
and its schema which is empty db name. It is concurrency performance
overhead and there is no obvious reason why such MDL should exist.

MDEV-33985 changed pure alias check from `db.str` to `db.length` and
that allowed `empty_c_string` to be pure alias too. It is important
for MDEV-33985 fix with sequences. Now such kind of pure alias skips
MDL initialization and thus derived table fails falsely on BACKUP
namespace as it is default namespace for 0-filled structure (see TODO
comments).

The fix a) keeps MDL_NOT_INITIALIZED for uninitialized MDL and that
was the consequence of MDL_INTENTION_EXCLUSIVE value 0 (see TODO
comment).

And b) does not update MDL type for pure alias when view is
initialized, so it is MDL_NOT_INITIALIZED. `lock_table_names()` code
naturally skips such kind of MDL with (mdl_request.type <
MDL_SHARED_UPGRADABLE) condition when processing tables list.
Vladislav Vaintroub
MDEV-38954 - do not use any charset conversions for session tracker info.

MySQL converts neither variables nor database name in session tracker info.
And hence we should not do any conversions, in order to keep protocol
compatible.

De-facto though, strings in session tracker are always UTF8,  more
exactly, character_set_system=utf8mb3, which is both schema name and
system variables are encoded in.
Michal Schorm
MDEV-18359, MDEV-26905: Fix invalid XML in charsets Index.xml

Summary:
The charset definition files sql/share/charsets/Index.xml and
mysql-test/std_data/ldml/Index.xml contained duplicate "flag" attributes
on single <collation> elements, violating XML well-formedness rules.
Standard XML parsers (xmllint, libxml2, etc.) reject duplicate attributes,
making these files unparseable by any spec-compliant tool.

Root Cause:
When nopad_bin collations were added, their flags were specified as
XML attributes: flag="binary" flag="nopad". The XML specification
(Section 3.1, Well-Formedness Constraint: Unique Att Spec) prohibits
duplicate attribute names on a single element. MariaDB's custom XML
parser in strings/xml.c happened to process both duplicates because
it handles attributes sequentially in a while loop, but this is
non-standard behavior that breaks interoperability with standard
XML tooling.

What the patch does:
Converts all 24 occurrences of duplicate flag attributes from
self-closing elements with duplicate attributes to elements with
child <flag> nodes. This follows the existing pattern already used
by many collations in the same file (e.g., big5_chinese_ci,
latin1_swedish_ci, utf8mb3_general_ci).

Before (invalid XML):
  <collation name="latin2_nopad_bin" id="1101" flag="binary" flag="nopad"/>

After (valid XML):
  <collation name="latin2_nopad_bin" id="1101">
    <flag>binary</flag>
    <flag>nopad</flag>
  </collation>

No C code changes are required. The _CS_FLAG handler in
strings/ctype.c (around line 621) already processes <flag> child
elements using bitwise OR (|=) to accumulate flags, so both "binary"
(MY_CS_BINSORT) and "nopad" (MY_CS_NOPAD) flags are correctly applied.

Files modified:
- sql/share/charsets/Index.xml (23 collations fixed)
- mysql-test/std_data/ldml/Index.xml (1 collation fixed)

Complete list of 24 collations fixed:

sql/share/charsets/Index.xml:
1. latin2_nopad_bin    (id=1101)
2. dec8_nopad_bin      (id=1093)
3. cp850_nopad_bin      (id=1104)
4. hp8_nopad_bin        (id=1096)
5. koi8r_nopad_bin      (id=1098)
6. swe7_nopad_bin      (id=1106)
7. ascii_nopad_bin      (id=1089)
8. cp1251_nopad_bin    (id=1074)
9. hebrew_nopad_bin    (id=1095)
10. latin7_nopad_bin    (id=1103)
11. koi8u_nopad_bin      (id=1099)
12. greek_nopad_bin      (id=1094)
13. cp1250_nopad_bin    (id=1090)
14. cp1257_nopad_bin    (id=1082)
15. latin5_nopad_bin    (id=1102)
16. armscii8_nopad_bin  (id=1088)
17. cp866_nopad_bin      (id=1092)
18. keybcs2_nopad_bin    (id=1097)
19. macce_nopad_bin      (id=1067)
20. macroman_nopad_bin  (id=1077)
21. cp852_nopad_bin      (id=1105)
22. cp1256_nopad_bin    (id=1091)
23. geostd8_nopad_bin    (id=1117)

mysql-test/std_data/ldml/Index.xml:
24. ascii2_nopad_bin    (id=325)

Validation:
- xmllint --noout passes cleanly on both files after the fix
- Zero duplicate flag attributes remain (verified with grep)
- The fix is consistent with the existing pattern used by other
  collations in the same files

Co-Authored-By: Claude AI <[email protected]>
Marko Mäkelä
Merge 11.8 into 12.3
Thirunarayanan Balathandayuthapani
MDEV-24356 InnoDB: Failing assertion: len < sizeof(tmp_buff) in get_foreign_key_info

get_foreign_key_info(): Changed tmp_buff size from NAME_LEN+1
to MAX_DATABASE_NAME_LEN+1 to accommodate encoded database names.
The buffer stores the database name extracted from
referenced_table_name and foreign_table_name, which can contain
encoded special characters (In this case dots encoded as @002e).
With encoding, database names can exceed NAME_LEN (64 bytes) even
if the logical name is within limits.
Aleksey Midenkov
MDEV-25365 Server hangs or crashes in Query_cache::move_by_type upon FLUSH QUERY CACHE

Caused by Bug#988 in 702b5ad.

How it works

QUERY blocks has all its tables in the array coming after
Query_cache_block header. Each such table element
(Query_cache_block_table) is also an element of doubly-linked circular
list associated with TABLE block used to find all queries by a
table. TABLE block data() is actually Query_cache_table: identificator
for table elements by real name. Every element in the circular list
has `parent` set to such Query_cache_table, except the list root. The
list root is the only Query_cache_block_table element owned by a TABLE
block, all other elements are owned by QUERY blocks. Thus TABLE block
n_tables is always 1.

FREE blocks are transformed into gap pointed by `border`. All the
QUERY and TABLE blocks are moved in place of the gap providing free
space defragmentation. Moving is done by creating new block at the
location of the gap and then doing memmove() from an old block to new
block. This may involve blocks overlap when the distance between the
blocks is less than the block size.

What was broken

When the old and the new QUERY blocks overlap, pointer can be in range
of both of them and checking the range does not guarantee affiliation
of the pointer with the old block. Such intra-block checks added by
Bug#988 can wrongly work on an already updated pointer.

In the test case small gap allows both tables 16 and 17 to be in the
overlapping region of old and new blocks. Iteration 16 updated
`prev->next` on the normal manner and the `prev` was table 17.
Iteration 17 sees this `next` as a pointer coming from an old block
though really it is already for a new block (as small gap shift allows
table 16 to be in both blocks), and it shifts it to the wrong
location. That have broken TABLE block circular chain.

How it was fixed

The fix modifies intra-block checks to work only in the forward
direction. F.ex., current table jx references intra-block by `next`
another table jy in later iteration (jx < jy) and we shift this `next`
pointer. Then by normal code (pre-Bug#988) we update `next->prev`. At
iteration jy we skip intra-block check for `prev` as it is in the past
iteration and was updated by iteration jx. The same happens for the
opposite direction, there is no semantic difference between `next` and
`prev` pointers.
Oleg Smirnov
MDEV-37792 MSAN: use-of-uninitialized-value on DELETE from sequence table

SEQUENCE is a pseudo-engine intended to produce sequential numbers.
This engine has HTON_HIDDEN flag, and optimizer costs for such engines
are zeroed and marked with MEM_UNDEFINED() macro.

However, some code paths still examine optimizer costs during
execution of queries involving SEQUENCE tables. For example,
deletion from a sequence table, despite being invalid, still evaluates
costs of access to the table before producing an error. This makes
MSAN trigger on the error "use-of-uninitialized-value".

Not to overcomplicate the logic for handling such scenarios,
this patch simply removes MEM_UNDEFINED() macro for engines with
HTON_HIDDEN flag.
Raghunandan Bhat
MDEV-38562: `mariabackup` exits with success (0) despite "No space left on device" errors

Problem:
  `mariabackup` ignores `my_close()` failures, resulting in false
  success report with a 'completed OK!' message.

Fix:
  Update `local_close()` function in `mariabackup` to check `my_close()`
  failures and enusre errors are reported.
Sergei Golubchik
let's be explicit about what abs() to use

fixes main.mysqltest_string_functions failure on centos7
with gcc 4.8.5
Vladislav Vaintroub
MDEV-28115 Hashicorp MTR tests aren't runnable on WIndows

- Fixed detection of "vault" utility
- Removed include/not_windows.inc from common include
- On Windows, skip 2 tests that rely on "grep"
- in mtr, set PATH to include mtr plugin directory (this is necessary
  to load vcpkg dependencies)
Fariha Shaikh
MDEV-36386 Fix connect *udf* and grant tests in view-protocol mode

Add --source include/no_view_protocol.inc to bson_udf, json_udf, and
json_udf_bin tests to disable view-protocol testing.

Add --disable_view_protocol around the DIR table SELECT in grant.test.

Based on 6e8dbb9693346274f0998e99f3fea38e9fd86a59.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
Marko Mäkelä
Merge 10.6 into 10.11
Aleksey Midenkov
MDEV-25365 More query cache debug trace

Usage:

mtr --mysqld=--debug=d,qcache,query:i:O,/tmp/qcache_full.log
sed -nre '/(move_by_type|dispatch_command|pack_cache)/ p' \
    < /tmp/qcache_full.log \
    > /tmp/qcache.log
forkfun
MDEV-36183 mariadb-dump backup corrupt if stored procedure ends with comment

When a stored procedure, trigger, or event ends with a line comment (#comment
or --comment), mariadb-dump would append the custom delimiter (;;) on the same line.
This caused the comment to "comment out" the delimiter, leading to syntax errors
during restoration.

Fixed by ensuring a newline is inserted before the delimiter in the dump output.
Marko Mäkelä
Merge 11.4 into 11.8
Jan Lindström
MDEV-38917 : Galera test failure on galera.galera_sst_mysqldump

This regression is caused by commit c380e165973 (MDEV-38833 "Suboptimal
or dead code at server startup"). Problem is that there should never
be an expectation that InnoDB bootstrap is crash-safe. Therefore,
after wsrep has initialized wsrep schema force checkpoint. This
ensured that InnoDB has successfully bootstrapped and wsrep chema
is initialized. This checkpoint ensures that wsrep-recover
is successful.

Other changes:
* Splitted galera_sst_mysqldump to two parts wsrep_sst_mysqldump
  and wsrep_sst_mysqldump_debug that is run only on debug builds.
* Changed wserp_schema initialization not to use std::string
  because it is unnecessary.
* Force checkpoint after wsrep_schema has been created.
* Make test wsrep_sst_mysqldump_with_key smaller
* Stabilize test cases
forkfun
MDEV-32770 mariadb-dump produces not loadable dump due to temporary view structure

When mariadb-dump produces a dump, it first creates a temporary placeholder for views
to satisfy potential dependencies before their actual creation later in the dump file.
Previously, these views were populated with int literals for their columns (1 AS `col_name`).
This could cause syntax or type-resolution errors during restoration if another view depended
on this placeholder view.

This commit changes the placeholder column values from 1 to NULL, as it is more permissive
and allowing the dump to be restored successfully.
Aleksey Midenkov
Compilation: writing to an object of type ‘ORDER’

/home/buildbot/amd64-last-N-failed/build/sql/sql_window.cc: In function ‘ORDER* concat_order_lists(MEM_ROOT*, ORDER*, ORDER*)’:
/home/buildbot/amd64-last-N-failed/build/sql/sql_window.cc:2976:13: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘ORDER’ {aka ‘struct st_order’} with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
2976 |      memcpy(copy, cur, sizeof(ORDER));
      |      ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/buildbot/amd64-last-N-failed/build/sql/field.h:29,
                from /home/buildbot/amd64-last-N-failed/build/sql/sql_class.h:32,
                from /home/buildbot/amd64-last-N-failed/build/sql/sql_acl.h:21,
                from /home/buildbot/amd64-last-N-failed/build/sql/sql_parse.h:19,
                from /home/buildbot/amd64-last-N-failed/build/sql/sql_window.cc:18:
/home/buildbot/amd64-last-N-failed/build/sql/table.h:236:16: note: ‘ORDER’ {aka ‘struct st_order’} declared here
  236 | typedef struct st_order {
      |                ^~~~~~~~
/home/buildbot/amd64-last-N-failed/build/sql/sql_window.cc: In member function ‘bool Window_funcs_sort::setup(THD*, SQL_SELECT*, List_iterator<Item_window_func>&, JOIN_TAB*)’:
/home/buildbot/amd64-last-N-failed/build/sql/sql_window.cc:3151:11: error: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘ORDER’ {aka ‘struct st_order’} with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess]
3151 |    memset(order, 0, sizeof(*order));
      |    ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/buildbot/amd64-last-N-failed/build/sql/field.h:29,
                from /home/buildbot/amd64-last-N-failed/build/sql/sql_class.h:32,
                from /home/buildbot/amd64-last-N-failed/build/sql/sql_acl.h:21,
                from /home/buildbot/amd64-last-N-failed/build/sql/sql_parse.h:19,
                from /home/buildbot/amd64-last-N-failed/build/sql/sql_window.cc:18:
/home/buildbot/amd64-last-N-failed/build/sql/table.h:236:16: note: ‘ORDER’ {aka ‘struct st_order’} declared here
  236 | typedef struct st_order {
      |                ^~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [sql/CMakeFiles/sql.dir/build.make:2640: sql/CMakeFiles/sql.dir/sql_window.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:10639: sql/CMakeFiles/sql.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
Yewon Kwak
MDEV-30354 Fix JSON escaping in optimizer trace

The expanded_query field in optimizer trace could produce invalid JSON when
queries contained special characters. Use st_append_escaped() to properly
handle quotes, backslashes and other special characters in the output.
If st_append_escaped() fails, emit an error message in the expanded_query.

Example:
Before: "expanded_query": "select length('a') AS `LENGTH("a")`"
After:  "expanded_query": "select length('a') AS `LENGTH(\"a\")`"

The output is now properly escaped and valid JSON while maintaining
readability.

Added test cases to mysql-test/main/opt_trace.test to verify the fix.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license