1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00
Files
mariadb/sql
Alexander Barkov 13cd4cf436 MDEV-17278 CURSOR FOR LOOP - ERROR: unexpected end of stream, read 0 bytes (SERVER CRASH)
sp_instr_cursor_copy_struct::exec_core() created TYPELIBs on a wrong mem_root,
the one which is initialized in sp_head::execute(), this code:

  /* init per-instruction memroot */
  init_sql_alloc(&execute_mem_root, "per_instruction_memroot",
                 MEM_ROOT_BLOCK_SIZE, 0, MYF(0));

This memory root cleans up after every sp_instr_xxx executed, so later
sp_instr_cfetch::execute() tried to use already freed and trashed memory.

Changing sp_instr_cursor_copy_struct::exec_core() to call tmp.export_structure()
inside this block (not outside of it):
  thd->set_n_backup_active_arena(thd->spcont->callers_arena, &current_arena);
  ...
  thd->restore_active_arena(thd->spcont->callers_arena, &current_arena);

So now TYPELIBs created by sp_instr_cursor_copy_struct::exec_core() are
still available and valid when sp_instr_cfetch::execute() is called.
They are freed at the end of dispatch_command() corresponding to
the "CALL p1" statement.
2018-11-14 14:23:43 +04:00
..
2017-11-22 14:39:21 +04:00
2018-11-06 09:40:39 +02:00
2018-11-06 09:40:39 +02:00
2018-09-10 16:47:44 +04:00
2017-08-24 01:05:48 +02:00
2018-11-06 09:40:39 +02:00
2018-04-20 18:29:18 +04:00
2017-08-31 15:44:17 +04:00
2018-11-06 09:40:39 +02:00
2018-09-28 16:37:06 +02:00
2018-09-06 22:35:45 +03:00
2018-01-04 09:22:59 +02:00
2017-08-24 01:05:48 +02:00
2018-09-28 16:37:06 +02:00
2018-11-06 09:40:39 +02:00
2017-09-01 11:33:45 +03:00
2018-09-28 16:37:06 +02:00
2018-09-28 16:37:06 +02:00
2018-10-09 09:11:30 +03:00
2018-09-28 16:37:06 +02:00
2018-05-17 08:42:53 +03:00
2018-10-17 19:37:05 +03:00
2018-08-28 12:22:56 +03:00
2018-11-06 09:40:39 +02:00
2018-11-06 09:40:39 +02:00
2018-11-06 09:40:39 +02:00
2018-09-28 16:37:06 +02:00
2018-04-23 09:49:58 +03:00
2018-03-26 17:53:17 +03:00
2018-05-01 16:52:19 +03:00
2018-05-29 17:34:49 +03:00
2018-08-28 12:22:56 +03:00
2017-12-12 09:57:17 +02:00
2018-11-06 09:40:39 +02:00
2018-09-28 16:37:06 +02:00
2018-08-03 15:57:23 +03:00
2018-08-28 12:22:56 +03:00
2018-11-06 09:40:39 +02:00
2018-08-28 12:22:56 +03:00
2018-09-17 18:50:21 -07:00
2018-08-03 15:57:23 +03:00
2017-08-24 01:05:48 +02:00
2018-04-10 13:12:36 +02:00
2018-04-24 20:59:57 +03:00
2018-04-24 12:48:27 +03:00
2018-08-28 12:22:56 +03:00
2018-11-06 09:40:39 +02:00
2018-11-06 08:41:48 +02:00
2018-10-11 08:22:08 +03:00
2018-11-06 08:41:48 +02:00
2018-11-06 08:41:48 +02:00
2018-10-17 19:37:05 +03:00
2018-06-30 16:39:20 +02:00
2018-06-30 16:39:20 +02:00
2018-11-08 09:39:37 +02:00
2018-01-04 09:22:59 +02:00
2018-04-10 13:12:36 +02:00
2018-04-10 13:12:36 +02:00
2018-11-06 09:40:39 +02:00
2018-11-06 09:40:39 +02:00
2018-05-01 16:52:19 +03:00
2018-11-06 09:40:39 +02:00
2018-11-06 09:40:39 +02:00
2018-09-28 16:37:06 +02:00
2018-04-29 17:53:21 +03:00
2018-11-06 09:40:39 +02:00
2018-05-11 13:15:10 +02:00
2017-08-24 01:05:48 +02:00
2018-11-08 09:39:37 +02:00
2018-09-28 16:37:06 +02:00
2018-05-12 10:16:45 +02:00
2018-09-28 16:37:06 +02:00
2018-09-28 16:37:06 +02:00
2018-08-03 14:37:55 +02:00
2018-02-15 10:22:03 +02:00
2018-11-06 09:40:39 +02:00
2018-06-30 16:39:20 +02:00
2018-11-06 09:40:39 +02:00
2018-04-29 17:53:21 +03:00
2018-02-15 10:22:03 +02:00
2018-08-21 15:20:34 +03:00
2017-10-04 08:24:06 +03:00
2018-11-06 09:40:39 +02:00
2018-11-06 09:40:39 +02:00
2018-09-28 16:37:06 +02:00
2018-11-06 09:40:39 +02:00
2018-09-28 16:37:06 +02:00
2018-05-29 17:34:49 +03:00
2018-06-30 16:39:20 +02:00
2017-11-21 19:47:46 +01:00
2018-09-28 16:37:06 +02:00
2018-04-10 13:12:36 +02:00
2018-09-28 16:37:06 +02:00
2018-10-09 09:11:30 +03:00
2018-10-09 09:11:30 +03:00
2018-10-30 15:10:01 +01:00
2018-01-09 14:16:47 +03:00
2018-08-28 12:22:56 +03:00
2018-02-23 15:33:24 +01:00
2018-11-06 09:40:39 +02:00
2018-09-28 16:37:06 +02:00
2018-11-06 09:40:39 +02:00
2018-11-06 09:40:39 +02:00
2018-11-06 09:40:39 +02:00
2018-06-30 16:39:20 +02:00
2018-09-28 16:37:06 +02:00
2018-11-06 13:36:50 +01:00
2018-11-06 09:40:39 +02:00
2018-08-03 15:57:23 +03:00
2017-11-27 15:07:32 +03:00
2018-04-24 12:48:27 +03:00
2018-04-10 13:12:36 +02:00
2018-05-12 10:16:45 +02:00
2018-04-10 13:12:36 +02:00
2017-11-05 22:23:32 +02:00
2018-08-03 15:57:23 +03:00
2018-09-28 16:37:06 +02:00
2018-09-28 16:37:06 +02:00
2018-11-06 09:40:39 +02:00
2018-09-28 16:37:06 +02:00
2018-06-21 23:47:39 +02:00
2018-09-28 16:37:06 +02:00
2018-09-14 08:47:22 +02:00
2018-09-06 22:35:45 +03:00
2017-08-31 09:30:40 +03:00
2018-09-28 16:37:06 +02:00
2018-03-21 10:36:49 +02:00
2018-08-03 15:57:23 +03:00