1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-09 11:41:36 +03:00
Files
mariadb/sql
Alexander Barkov a0290cfbed MDEV-36850 SIGSEGV in Item_sp_variable::save_in_field | fill_record
Thanks to Sergei Golubchik for the idea and a working prototype of this patch.

Problem:

Inside these methods:
- Item_splocal_assoc_array_element::append_for_log()
- Item_splocal_assoc_array_element_field::append_for_log()

an expression like this:

  first_names(nick || CONVERT(' ' USING ucs2)

was converted to:

  first_names(nick || CONVERT(CONVERT(' ' USING ucs2) USING latin1)

i.e. an automatic CONVERT(... USING latin1) was added, as expected.

In the end of append_for_log() the destructor of
Item_change_list_savepoint_raii restored the Item changes, so
the automatically added CONVERT(..USING latin1) was removed from
the tree and the tree changed back to:

   first_names(nick || CONVERT(' ' USING ucs2)

But all Item_splocal_assoc_array_element* Items were left in the fixed state.

Later, duing the INSERT, a concatenation of the SP variable `nick`
and the space character in UCS2 evaluated 'Michael\x00\x20' instead
of the expected 'Michael\x20', so the assoc array
element with the given key was not found.

Note:

Item_change_list_savepoint_raii was needed to make this DBUG_ASSERT in
sp_lex_keeper::reset_lex_and_exec_core() happy:
  DBUG_ASSERT(thd->Item_change_list::is_empty());

The fix:

- Removing Item_change_list_savepoint_raii from the implementations of
  Item_splocal_assoc_array_element*::append_for_log()
  Removing the class Item_change_list_savepoint_raii as it's not needed
  any more.

- Relaxing the DBUG_ASSERT() in sp_lex_keeper::reset_lex_and_exec_core() to:
  DBUG_ASSERT(dbug_rqp_are_fixed(instr) || thd->Item_change_list::is_empty());

  where dbug_rqp_are_fixed() is a new debug function to check that
  all Rewritable_query_parameter's in instr::free_list are fixed.
2025-08-01 18:03:20 +02:00
..
2025-03-14 12:08:56 +04:00
2025-06-18 07:50:39 +02:00
2024-08-12 09:32:30 +01:00
2024-11-13 16:38:53 +01:00
2024-11-10 19:22:21 +01:00
2024-11-05 14:00:48 -08:00
2024-11-05 14:00:48 -08:00
2025-06-18 07:50:39 +02:00
2024-12-02 17:51:17 +02:00
2025-03-14 12:08:56 +04:00
2025-03-14 12:08:56 +04:00
2024-12-02 11:35:34 +02:00
2024-12-02 17:51:17 +02:00
2024-12-02 17:51:17 +02:00
2024-10-30 15:11:17 +01:00
2025-02-06 16:46:36 +01:00
2024-12-02 11:35:34 +02:00
2025-05-22 09:22:55 +02:00
2024-11-08 07:17:00 +01:00
2025-06-18 07:50:39 +02:00
2025-06-18 07:50:39 +02:00
2024-11-29 13:43:17 +02:00
2024-12-05 10:11:58 +01:00
2025-05-22 09:22:55 +02:00
2025-04-18 17:11:01 +02:00
2025-04-22 16:26:36 -04:00
2025-05-22 09:22:55 +02:00
2025-04-29 11:18:00 +10:00
2025-04-29 11:18:00 +10:00
2025-05-22 09:22:55 +02:00
2024-11-10 19:22:21 +01:00
2025-05-22 09:22:55 +02:00
2024-07-22 15:14:50 +02:00
2024-12-02 11:35:34 +02:00
2024-12-02 11:35:34 +02:00
2024-12-02 11:35:34 +02:00
2024-12-02 17:51:17 +02:00
2024-07-08 22:40:16 +02:00
2025-04-29 11:18:00 +10:00
2025-04-18 17:11:01 +02:00
2025-05-22 09:22:55 +02:00
2025-05-22 09:22:55 +02:00
2025-03-14 12:08:56 +04:00
2024-10-03 15:59:20 +10:00
2025-03-14 12:08:56 +04:00
2024-11-29 12:37:46 +02:00
2024-05-30 16:04:00 +03:00
2025-04-29 11:18:00 +10:00
2025-04-02 14:07:01 +03:00
2025-04-29 11:18:00 +10:00
2025-06-18 07:50:39 +02:00
2024-10-30 15:11:17 +01:00
2025-05-22 09:22:55 +02:00
2024-06-24 13:09:47 +03:00
2025-05-22 09:22:55 +02:00
2024-12-02 17:51:17 +02:00
2024-12-02 11:35:34 +02:00
2024-12-02 17:51:17 +02:00
2024-07-22 15:14:50 +02:00
2025-04-29 11:18:00 +10:00
2025-03-14 12:08:56 +04:00
2025-05-22 09:22:55 +02:00
2025-05-22 09:22:55 +02:00
2025-05-22 09:22:55 +02:00
2025-03-14 12:08:56 +04:00
2025-03-14 12:08:56 +04:00
2025-01-29 11:17:38 +01:00
2025-05-03 12:06:36 +02:00
2024-12-02 17:51:17 +02:00
2025-04-18 17:11:01 +02:00
2024-12-02 17:51:17 +02:00
2024-12-05 09:20:36 +01:00
2025-05-03 12:06:36 +02:00
2025-06-18 07:50:39 +02:00
2024-06-24 13:09:47 +03:00
2024-12-02 17:51:17 +02:00
2024-12-02 17:51:17 +02:00
2025-06-18 07:50:39 +02:00
2025-05-22 09:22:55 +02:00
2025-05-22 09:22:55 +02:00
2025-04-29 11:18:00 +10:00
2025-03-14 12:08:56 +04:00
2025-03-14 12:08:56 +04:00
2025-03-14 12:08:56 +04:00
2025-03-03 11:07:56 +02:00
2025-05-22 09:22:55 +02:00
2024-06-27 10:26:09 +03:00
2024-12-02 17:51:17 +02:00
2025-05-22 09:22:55 +02:00
2025-04-26 10:47:03 +02:00
2025-04-29 11:18:00 +10:00
2025-03-14 12:08:56 +04:00
2024-07-03 12:45:30 +02:00
2025-01-09 09:41:38 +02:00
2025-06-18 07:50:39 +02:00
2024-12-02 17:51:17 +02:00
2025-04-29 11:18:00 +10:00
2025-06-18 09:27:49 +02:00
2025-03-14 12:08:56 +04:00
2025-06-18 09:27:49 +02:00
2025-04-29 11:18:00 +10:00
2025-03-14 12:08:56 +04:00
2025-03-14 12:08:56 +04:00
2024-12-02 17:51:17 +02:00
2025-06-18 07:50:39 +02:00
2025-05-22 09:22:55 +02:00
2024-12-02 17:51:17 +02:00
2025-06-18 07:50:39 +02:00
2025-04-29 11:18:00 +10:00
2024-06-24 13:09:47 +03:00
2025-06-18 07:50:39 +02:00
2025-03-14 12:08:56 +04:00
2024-12-02 17:51:17 +02:00
2024-12-02 11:35:34 +02:00
2025-03-14 12:08:56 +04:00
2025-03-14 12:08:56 +04:00
2025-03-14 12:08:56 +04:00
2024-06-27 10:26:09 +03:00
2025-06-18 07:50:39 +02:00
2024-05-10 20:02:18 +02:00
2025-06-18 07:43:24 +02:00
2025-06-18 07:50:39 +02:00
2024-10-03 13:24:43 +03:00
2024-09-09 13:50:38 +03:00
2025-04-18 17:11:01 +02:00
2025-02-06 16:46:36 +01:00
2024-11-08 07:17:00 +01:00
2025-03-03 11:07:56 +02:00