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
Yuchen Pei
MDEV-25848 Call hlindex_read_end in the QUICK_RANGE_SELECT_ARRAY destructor

In QUICK_RANGE_SELECT_ARRAY::get_next, hlindex_read_end() is only
called when the read result is EOF. This is skipped with LIMIT clause
not reading all rows. For an DELETE ... LIMIT ... statement this means
inited is not restored to NONE and delete_handler is not deleted
(leak). We fix this by calling hlindex_read_end in the
QUICK_RANGE_SELECT_ARRAY destructor, just like in JOIN_TAB::cleanup().
Rucha Deodhar
MDEV-42694: SIGABRT in Type_handler_composite::Item_sum_sum_fix_length_and_dec on SUM(NEW) in trigger on single-column table

SUM(NEW) in a trigger on a single-column table aborted the server. It now fails with ER_OPERAND_COLUMNS, because NEW is a row and not a single value.

Analysis:
Item_trigger_row::check_cols(1) accepted a row with one column as a scalar,
so SUM(NEW) on a single-column table passed the scalar check and reached
Item_sum_sum::fix_length_and_dec(), where the row type handler aborts.

Fix:
Do not accept NEW/OLD as a scalar in Item_trigger_row::check_cols() even if it
has one column (unless it was replaced by a column), as Item_splocal does for
ROW variables. The error is ER_OPERAND_COLUMNS.
Rucha Deodhar
MDEV-40130: SIGSEGV in Field_iterator_table::set_table at sql/table.h:3350

A trigger that assigns a row to NEW, for example SET NEW = ROW(NEW.a, NEW.a), crashed the server on INSERT, and again after FLUSH TABLES. The statement now works and the inserted row gets the values from the ROW().

Analysis:
The if...else block in sp_head::add_instr_core() checks for existence of
items in m_cur_instr_trig_row_items. Since we also have elements in
m_cur_instr_trig_field_items, the block where we check for
m_cur_instr_trig_row_items and populate m_trg_table_row gets skipped
entirely. Additionally the missing iterate_trigger_row_and_run_func
over m_trg_table_row does not setup table and trigger values either.
This eventually causes crash while setting table for field iterator
during trigger execution. This patch also fixes the list-transfer logic in
sp_head::add_instr_core() to prevent row items from being dropped and
adds a corresponding create-time setup_field() loop in
Table_triggers_list::create_trigger() to ensure trigger row items are
properly initialized.

Fix:
Check for m_cur_instr_trig_row_items exclusively. Also added
iterate_trigger_row_and_run_func over m_trg_table_row to set up the table
and over relevant values correctly.
Vladislav Vaintroub
main.mysql_client_test: show client output on failure

The output goes to var/log/mysql_client_test.out.log, so it is missing
from the test failure report and CI logs. Print the last 200 lines when
mysql_client_test fails.

Assisted-by: Claude:claude-sonnet-5-5
Rucha Deodhar
MDEV-41815: SIGSEGV in Item_trigger_row::cleanup on FLUSH TABLES after a
trigger runs DECLARE ROW TYPE OF cursor DEFAULT NEW

A trigger that declares a cursor and a ROW TYPE OF cursor variable with DEFAULT NEW crashed the server on FLUSH TABLES after the trigger had run. The server no longer crashes.
Rucha Deodhar
MDEV-42711: UBSAN: downcast of Item_trigger_row to Item_row in
Item_func_in::get_func_row_mm_tree on (x,y) IN (NEW, ...) in trigger

(x,y) IN (NEW, ...) in a trigger query performed an invalid cast that UBSAN reports. The query now runs without it.

Analysis:
Item_func_in::get_func_row_mm_tree() casts every element of the IN list to
Item_row. In a trigger, NEW/OLD are Item_trigger_row, not Item_row, so
(x,y) IN (NEW,(1,2)) caused an invalid downcast (reported by UBSAN).

Fix:
Use the elements as plain Item and call the virtual element_index()/addr(),
which Item_trigger_row overrides, instead of casting to Item_row.
Rucha Deodhar
MDEV-42385: Wrong result for whole-row OLD in trigger on table with
virtual columns: OLD = (...) returns NULL

On a table with virtual columns, comparing the whole OLD row in a trigger, for example OLD = (1, 1, 'b1', 10, 'b1!'), returned NULL because the virtual columns were not computed. The comparison now returns the right result.

Analysis:
The Virtual columns are not calculated for a table for NEW and OLD.

Fix:
Mark all columns along with the columns they depend on whenever whole row
is referenced in OLD and NEW.
Rucha Deodhar
MDEV-41983: SIGSEGV in Item_cache_row::store on CASE NEW WHEN in a trigger

CASE NEW WHEN ... in a trigger on a single-column table crashed the server. It now fails with ER_OPERAND_COLUMNS, because NEW is a row and not a single value.

Analysis:
Running CASE NEW WHEN ... in a trigger on a single-column table crashed the
server with a SIGSEGV in Item_cache_row::store. Even with one column,
NEW is a row rather than a scalar value, while sp_rcontext::set_case_expr()
attempted to store it in a scalar CASE expression holder.

Fix:
Reject the non-scalar NEW row expression in CASE with ER_OPERAND_COLUMNS.
Prevent sp_rcontext::set_case_expr() from storing the row in a scalar CASE
holder.
Mohammad Tafzeel Shams
MDEV-42647 Non-core dictionary tables not loaded with innodb_force_recovery=6

Fix for MDEV-32042 moved the loading of the InnoDB data dictionary
tables from dict_boot() to srv_start(), after recv_sys.apply(true).
This code was placed inside a block that is skipped when
innodb_force_recovery=6, so dict_sys.sys_virtual, sys_foreign and
sys_foreign_cols would remain NULL. Opening a table with virtual
columns would crash, and FOREIGN KEY constraints would be ignored.

Changes :
srv_start(): Invoke srv_load_tables() also when the redo log apply
is skipped, like dict_boot() did before MDEV-32042.

dict_load_virtual_col(): Return DB_CORRUPTION if SYS_VIRTUAL is
not available.

innodb.sys_virtual_missing_debug : Added new test to cover missing
SYS_VIRTUAL table.
Yuchen Pei
MDEV-25848 Call hlindex_read_end in the QUICK_RANGE_SELECT_ARRAY destructor

In QUICK_RANGE_SELECT_ARRAY::get_next, hlindex_read_end() is only
called when the read result is EOF. This is skipped with LIMIT clause
not reading all rows. For a DELETE ... LIMIT ... statement this means
inited is not restored to NONE and delete_handler is not deleted
(leak). We fix this by calling hlindex_read_end in the
QUICK_RANGE_SELECT_ARRAY destructor, just like in JOIN_TAB::cleanup().

This closes finding #8.
Rucha Deodhar
MDEV-42699: DEFAULT(OLD) / DEFAULT(NEW) in trigger accepted at CREATE TRIGGER,
then fails with "Field '(null)' doesn't have a default value"

DEFAULT(OLD) or DEFAULT(NEW) in a trigger was accepted by CREATE TRIGGER and then failed when the trigger ran with "Field '(null)' doesn't have a default value". When the trigger runs it now fails with ER_WRONG_COLUMN_NAME (Incorrect column name 'OLD'). CREATE TRIGGER still accepts the statement.

Analysis:
The parser rejects DEFAULT(<SP variable>) via get_item_splocal(), but
Item_trigger_row returns null there, so DEFAULT(OLD) is accepted. At
execution Item_default_value::tie_field() sees a non-field argument and
reports ER_NO_DEFAULT_FOR_FIELD with the unset item name, i.e. '(null)'.

Fix:
In tie_field(), if the argument is still a trigger row (not a column named
new/old), report ER_WRONG_COLUMN_NAME with OLD/NEW, as for SP variables.

Assisted-by: Claude Sonnet 5.5
Rucha Deodhar
MDEV-41761: SIGSEGV in sp_head::bind_input_param when trigger passes
NEW/OLD row as OUT parameter to CALL

A trigger that calls a stored procedure with NEW as an argument, CALL p(NEW), crashed the server on INSERT. The server no longer crashes.

Analysis:
When passing Item_trigger_row trigger (NEW) to an OUT parameter,
bind_input_param called get_item_splocal(). Because it returned a valid
pointer, the engine attempted to access rcontext_handler(), which is null
for trigger rows, causing a segmentation fault.

Fix:
Overriding get_item_splocal() in Item_trigger_row to return nullptr ensures
the engine safely skips the invalid context handler lookup, preventing
the crash.
Rucha Deodhar
MDEV-41765: Assertion m_sp == m_thd->spcont->m_sp failed in
Item_splocal::this_item / SIGSEGV in Item_splocal::get_rcontext on
SIGNAL ... SET MESSAGE_TEXT = NEW in trigger

SIGNAL ... SET MESSAGE_TEXT = NEW in a trigger crashed the server. The statement now raises the SIGNAL error and uses the value of NEW as the message.

Analysis
When using Item_trigger_row in a null-checking or scalar string context
it resulted in fall back on Item_splocal functions, causing a crash or
improper evaluation.

Fix
Implemented Item_trigger_row::is_null() to correctly evaluate nullness
across constituent fields following standard row semantics.
Added Item_trigger_row::val_str() to delegate to the underlying field
when cols() == 1 or throw an ER_OPERAND_COLUMNS error for
multi-column rows.
bsrikanth-mariadb
MDEV-38303: Accept constant expressions in HAVING early-stop

Addressed the following TODO items in opt_having_shortcut.cc: -

A constant expression such as COUNT(*) < 5+5 or COUNT(*) = ABS(0) is
wrapped by the comparator in an Item_cache whose example is not a basic
const item, so the HAVING shortcut was never applied to it.

Accept an Item_cache whose example is const_item() and passes
check_vcol_func_processor(), so no user variables, stored functions or
subqueries are involved. "@v + 0" is still rejected, since a stored
function in WHERE can change @v during the scan.

Also replace the sum_funcs scan in is_having_shortcut_cond() with a
DBUG_ASSERT, as the aggr_sel == select_lex check already implies it, and
reword the comments about <cache> and NULL constants.

Update having_early_stop: "COUNT(*) < 5 + 5" now stops early, and add a
COUNT(*) = ABS(0) case.
Yuchen Pei
MDEV-25848 Do not ask the engine for the key of HA_ERR_BAD_FIELD_VALUE

get_dup_key() called info(HA_STATUS_ERRKEY) for HA_ERR_BAD_FIELD_VALUE,
so print_error() named a key column for engine geometry errors. InnoDB
sets the error key to the clustered index when an UPDATE makes a
geometry column empty, so the error named the first PRIMARY KEY column
("Incorrect int value: '1' for column id"), and a multi-column PRIMARY
KEY failed the usable_key_parts == 1 assertion in print_error().
Rucha Deodhar
MDEV-42702: Assertion m_sp == m_thd->spcont->m_sp in
Item_splocal::this_item / SIGSEGV on FOR SYSTEM_TIME AS OF NEW in trigger

A trigger query that uses FOR SYSTEM_TIME AS OF NEW crashed the server (an assertion failure in debug builds). It now fails with "Illegal parameter data type row for operation 'FOR SYSTEM_TIME'".

Analysis:
Item_trigger_row derives from Item_splocal but did not override this_item(),
so Vers_history_point::check_unit() ended up in Item_splocal::this_item(),
which looks up an SP variable in the routine context. A trigger row has no
such variable (its rcontext handler is null), hence the assertion/crash.

Fix:
Override this_item() (const and non-const) in Item_trigger_row to return
this, as is already done for this_item_addr().

Assisted-by: Claude Sonnet 5.5
Rucha Deodhar
MDEV-41825: SIGSEGV in THD::sp_fix_func_item when a ROW variable's
DEFAULT is an EXISTS subquery

A ROW variable whose DEFAULT is an EXISTS subquery, as in DECLARE r ROW(a INT) DEFAULT EXISTS(SELECT 1), crashed the server. It now fails with ER_OPERAND_COLUMNS.

Analysis:
The check blocked non-ROW_RESULT subselects with single field. This
eventually resulted in crash in absence of fields in the virtual_tmp_table.

Fix:
Disallow single-field subselect whose result type is non-row result and
throw error.

Behavior change:
This also affects ordinary stored-program ROW variables, not only trigger
NEW/OLD. Field_row::sp_prepare_and_store_item() no longer accepts a subselect
with a single field as a row: SET row_var= (SELECT one_col ...) for a ROW
variable with one column now fails with ER_OPERAND_COLUMNS, like any other
scalar value.
Rucha Deodhar
MDEV-41766: Assertion marked_for_read() failed in Field_long::val_int on
row comparison of NEW/OLD in AFTER trigger

Comparing the whole rows, SET @x = (NEW = OLD), in an AFTER UPDATE trigger hit an assertion failure in debug builds. The comparison now works.

Analysis:
Whole-row trigger comparisons (NEW = OLD) evaluate constituent fields
without registering them in the table's read bitmap. This causes a
marked_for_read() assertion crash when reading field values during
trigger execution.

Fix:
Call register_field_in_read_map() on each field to ensure proper read map
marking when fixing fields.
Rucha Deodhar
MDEV-41767: Wrong result for row comparison of trigger NEW/OLD:
NEW = OLD returns 1 after a column change, OLD = (1,2,3) returns 0

Row comparisons with NEW and OLD in a trigger gave wrong results: NEW = OLD returned 1 after a column had changed, and OLD = (1,2,3) returned 0 for a row holding 1,2,3. Both comparisons now give the right result.

Analysis:
Multi-argument row comparisons returned incorrect results because all
column comparators evaluated the exact same column value.
Item_trigger_row::addr(i) returned the address of a single shared member
variable (m_last_item_ptr) making all columns to evaluate against
the final field.

Fix:
Added an m_item_array member to Item_trigger_row to hold unique pointers
for each field. Populated the array during populate_with_trigger_fields().
Updated addr(i) to return pointer for each column index.
Rucha Deodhar
MDEV-34723: Address review comments on trigger NEW/OLD row variables

Using NEW and OLD as whole-row values in triggers (SET NEW = OLD,
NEW = OLD comparisons, passing them to CALL or functions) hit several
review findings: some statements gave wrong results or confusing errors
instead of a clear one, and several cases were missing from the tests.

This commit applies the review comments: it makes these statements
fail with a clear error or give the right result, and extends the
mdev_34723 and sp-row tests to cover them.
Yuchen Pei
MDEV-25848 Do not ask the engine for the key of HA_ERR_BAD_FIELD_VALUE

get_dup_key() called info(HA_STATUS_ERRKEY) for HA_ERR_BAD_FIELD_VALUE,
so print_error() named a key column for engine geometry errors. InnoDB
sets the error key to the clustered index when an UPDATE makes a
geometry column empty, so the error named the first PRIMARY KEY column
("Incorrect int value: '1' for column id"), and a multi-column PRIMARY
KEY failed the usable_key_parts == 1 assertion in print_error().

This closes finding #10.
Rucha Deodhar
MDEV-41831: SET NEW = (SELECT ...) in a BEFORE INSERT trigger fails with
ER_OPERAND_COLUMNS (1241) on a single-column table

In a BEFORE INSERT trigger on a single-column table, SET NEW = (SELECT 5) failed with ER_OPERAND_COLUMNS even though the subquery returns one value. The assignment now works.
bsrikanth-mariadb
MDEV-38303: Do not use HAVING shortcut for COUNT(..) = string constant

The type check in is_having_shortcut_cmp() is required to guard
against the truncation warning for string literals such as ‘a’. So,
HAVING shortcut would not be performed for such cases. Added tests for
the same.
Rucha Deodhar
MDEV-41760: SIGSEGV in Field_iterator_table::set_table on re-prepare of
trigger SET NEW = (subquery) after DDL on referenced table

A trigger that does SET NEW = (SELECT ... FROM t1) crashed the server on the next INSERT after the table it reads was altered, for example with ALTER TABLE t1 FORCE. The server no longer crashes in this case.

Analysis
Item_trigger_row items were not having proper setup and list tracking, so
they were not getting saved or restored during expression re-parsing.
So when table alteration happened the row items lost their correct table
resulting in assertion failure.

Fix
Added setup function and tracking lists for row items to properly handle
and re-bind items.
Rucha Deodhar
MDEV-40124: Assertion `m_sp == m_thd->spcont->m_sp' failed virtual
Item *Item_splocal::this_item(), UBSAN : member call on null pointer of
type 'Sp_rcontext_handler' in sql/item.cc

In a trigger, comparing the whole rows with IF NEW = OLD THEN ... crashed the server (an assertion failure in debug builds). The comparison now runs and gives a result.

Analysis:
Comparing trigger row objects (IF NEW = OLD) calls cmp_row_type(),
which uses element_index(i). Item_trigger_row was missing its own
element_index() override, falling back to Item_splocal's version
and crashing/asserting on local context lookup.

Fix:
Override element_index(i) in Item_trigger_row to return
m_fields.elem(i) directly.
Jan Lindström
Set version to 10.4.34-6442
Rucha Deodhar
MDEV-41814: Assertion `argp[arg_no]->fixed()' failed in
sp_head::execute_function

Passing NEW or OLD from a trigger to a stored function that takes a ROW parameter, DO f(OLD), hit an assertion failure in debug builds. The call now works.

Analysis:
Passing OLD or NEW trigger rows as function arguments caused an assertion
failure (arg->fixed()) because Item_trigger_row::fix_fields() could return
early. This left the trigger row item in an unfixed state without setting
the item_base_t::FIXED flag.

Fix:
Restructured fix_fields() to return result and set the base_flags as needed.
Rucha Deodhar
MDEV-40490: SET NEW = (row subquery) in a trigger silently assigns NULL
to all columns and skips the single-row check

In a BEFORE INSERT trigger, SET NEW = (SELECT a, b FROM ...) silently stored NULL in every column and never checked that the subquery returns a single row. The row now gets the values from the subquery, and a subquery that returns several rows is an error.

Analysis:
Assigning a multi-column subquery in a row trigger was resulting in NULL
values because the Item_cache objects wrapped around the columns weren't
being evaluated yet.

Fix:
Calling bring_value() on the RHS item forces the subquery to run and
populate those caches properly before we try to assign them, fixing the
silent data loss.
Rucha Deodhar
MDEV-41827: SIGSEGV in Item_trigger_row::cleanup on condition pushdown of
row = NEW into derived table in trigger

A trigger query that compares a row with NEW inside a derived table, such as (SELECT DISTINCT a, b FROM t) d WHERE (a,b) = NEW, crashed the server on INSERT. The server no longer crashes.

Analysis:
During query cleanup, Query_arena::free_items() called delete_self() on
Item_trigger_row. Since trigger row items are allocated on a MEM_ROOT,
explicit heap deletion caused memory corruption and a segmentation fault.

Fix:
Override Item_trigger_row::delete_self() to just return to prevent double
deletion.
Mohamed
MDEV-40402 use-of-uninitialized-value in reload_acl_and_cache(THD*, unsigned long long, TABLE_LIST*, int*)

FLUSH MASTER resets the binary log the same way as RESET MASTER, through
reload_acl_and_cache() and reset_master(), which takes the number of the
first new log file from LEX::next_binlog_file_number. Only the RESET
MASTER grammar set that field. So FLUSH MASTER, and COM_REFRESH with
REFRESH_MASTER, used a number left by an earlier RESET MASTER TO on the
same connection, or an uninitialized one in a new LEX, such as the one
of a statement in a stored procedure.

Set next_binlog_file_number to 0 (no number requested) in the FLUSH
MASTER grammar rule, as the RESET MASTER rule does, and for COM_REFRESH,
which does not go through the parser.
Mohamed
MDEV-39593 Server crashes in Item_func::Item_func/Item_xpath_cast_number::Item_xpath_cast_number after EXTRACTVALUE with number() function in xpath

XPath number() accepts zero or one argument, but create_func_number()
always used args[0]. For number() without an argument args[0] was
never set, so Item_xpath_cast_number was built from an uninitialized
pointer and the server crashed.

Without an argument, number() converts the context node, like
number(.). Use xpath->context in that case, as
create_func_string_length() does, and fail with an XPath syntax error
when there is no context node.
Vladislav Vaintroub
CI, Windows ARM64 - increase MTR parallel workers

The low number of workers was used to workaround OOM on CI(likely, some
Windows memory manager bug)

OOM seems to be gone with image update. Increase the MTR parallel workers
to speed up the test.
Rucha Deodhar
MDEV-42700: Column named new/old in a trigger query resolves to whole-row NEW/OLD

In a trigger, a subquery that reads a column named new or old of another table, such as SELECT new FROM t2, could be taken as the whole NEW row, for example when the name was ambiguous. The column is now resolved as in a normal query, and a lookup error such as an ambiguous name is reported instead of falling back to the row.

Analysis:
Item_trigger_row::fix_fields() treated any error from the lookup of a column
named new/old as "no such column", so e.g. an ambiguous column fell back to
the whole row. When the column was found, the replaced Item_trigger_row was
still checked for a scalar, giving ER_OPERAND_COLUMNS.

Fix:
Fall back to the trigger row only on ER_BAD_FIELD_ERROR and return other
errors. Make check_cols() expect one column once the item is replaced by a
column.

Assisted-by: Claude Sonnet 5.5
Rucha Deodhar
MDEV-40127: Server hangs when setting NEW=OLD on a multi-row table

In a BEFORE trigger, SET NEW = OLD on a table with several rows could
make the server hang, because assigning one trigger row to another read
the columns through a stateful iterator that was never reset between
executions.

Analysis:
Item_trigger_row::addr(i) used a shared list iterator
(m_fields_iterator/index) that was never reset when m_fields was rebuilt,
causing stale or looping state on re-execution while m_fields also
retained old entries.

Fix:
Replaced iterator lookup (get_element_at_index_or_next()) in
Item_trigger_row::addr(i) with direct m_fields.elem(i) access, and added
Item_trigger_row::cleanup() to clean up fields and empty m_fields between
executions.

Assisted-by: Claude Sonnet 5.5
Rucha Deodhar
MDEV-42697: SIGSEGV in sortcmp / cmp_item_row::compare on NEW IN (..., OLD)
in trigger when OLD has a NULL string column

NEW IN (..., OLD) in a trigger crashed the server when OLD had a NULL string column. The comparison now works.

Analysis:
IN with a row skips the comparison when the row reports is_null(), which
cmp_item_row::store_value() sets via null_value if some column is NULL.
Item_trigger_row::is_null() ignored null_value and was true only when all
columns were NULL, so a row with a NULL column was compared and sortcmp()
got a NULL string.

Fix:
Make Item_trigger_row::is_null() return true if null_value is set, the same
as Item_row.
Rucha Deodhar
MDEV-42652: ASAN stack-use-after-return in Item_change_list::rollback_item_tree_changes on trigger reading view column named NEW

A trigger that reads a view column named NEW, as in SELECT new FROM v, crashed the server (a memory error that ASAN reports). It now returns the value of the column.

Analysis:
Item_trigger_row::fix_fields() passed the address of a local Item *col to
Item_field::fix_fields(). For a view column that call stores the address in
the item tree change list, which is rolled back after the function returned,
so the rollback wrote to a dead stack slot.

Fix:
Allocate the Item * slot on the THD mem_root, so that it lives as long as the
statement's items and is still valid when the changes are rolled back.
Rucha Deodhar
MDEV-41812: Columns named old/new of other tables are resolved as the
OLD/NEW row inside trigger bodies, giving ER_TRG_NO_SUCH_ROW_IN_TRG and
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION

In a trigger, a query that reads a column named old or new from another table, such as SELECT old FROM t INTO @x, was treated as the OLD row and failed with ER_TRG_NO_SUCH_ROW_IN_TRG or ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION. In the cases covered by the tests the column of the table is now used.

Analysis:
Inside the trigger's BEGIN...END block, impossible fields are not checked
and the mechanism directly falls on checking whether it is new or old
reference.

Fix:
Check whether the fields are impossible and only then resolve the context
of new and old.
Rucha Deodhar
MDEV-41826: Crash in Table_triggers_list::mark_fields_used on INSERT after
trigger re-parse fails with unknown column

After a trigger that compares a column with NEW (DO (SELECT a = NEW FROM t2)) failed and the table it reads was altered, the next INSERT into the trigger's table crashed the server. It now fails with the 'Unknown column' error instead.
Rucha Deodhar
MDEV-42695: SET NEW = ... in trigger on system-versioned table fails with ERROR 1054 Unknown column 'row_start' in 'NEW'

SET NEW = ... in a trigger on a system-versioned table failed with ERROR 1054 Unknown column 'row_start' in 'NEW'. It now works, because NEW and OLD no longer contain the hidden row_start and row_end columns.

Analysis:
The whole row NEW/OLD was built from all columns except the internal ones, so
on a system-versioned table it also contained row_start and row_end. These
can't be looked up by name when assigned, giving ER_BAD_FIELD_ERROR, and
they made the row have more columns than the user sees.

Fix:
Skip the INVISIBLE_SYSTEM columns (row_start/row_end) when building the
columns of the whole row NEW/OLD.

Assisted-by: Claude Sonnet 5.5
Rucha Deodhar
More self review changes.