|
1 | 1 | /*
|
2 | 2 | Copyright (c) 2000, 2019, Oracle and/or its affiliates.
|
3 |
| - Copyright (c) 2009, 2019, MariaDB |
| 3 | + Copyright (c) 2009, 2020, MariaDB |
4 | 4 |
|
5 | 5 | This program is free software; you can redistribute it and/or modify
|
6 | 6 | it under the terms of the GNU General Public License as published by
|
@@ -3184,7 +3184,7 @@ void Rows_log_event::change_to_flashback_event(PRINT_EVENT_INFO *print_event_inf
|
3184 | 3184 | Table_map_log_event *map;
|
3185 | 3185 | table_def *td;
|
3186 | 3186 | DYNAMIC_ARRAY rows_arr;
|
3187 |
| - uchar *swap_buff1, *swap_buff2; |
| 3187 | + uchar *swap_buff1; |
3188 | 3188 | uchar *rows_pos= rows_buff + m_rows_before_size;
|
3189 | 3189 |
|
3190 | 3190 | if (!(map= print_event_info->m_table_map.get_table(m_table_id)) ||
|
@@ -3233,29 +3233,22 @@ void Rows_log_event::change_to_flashback_event(PRINT_EVENT_INFO *print_event_inf
|
3233 | 3233 | }
|
3234 | 3234 | value+= length2;
|
3235 | 3235 |
|
3236 |
| - swap_buff2= (uchar *) my_malloc(length2, MYF(0)); |
| 3236 | + void *swap_buff2= my_malloc(length2, MYF(0)); |
3237 | 3237 | if (!swap_buff2)
|
3238 | 3238 | {
|
3239 | 3239 | fprintf(stderr, "\nError: Out of memory. "
|
3240 | 3240 | "Could not exchange to flashback event.\n");
|
3241 | 3241 | exit(1);
|
3242 | 3242 | }
|
3243 | 3243 | memcpy(swap_buff2, start_pos + length1, length2); // WHERE part
|
3244 |
| - } |
3245 | 3244 |
|
3246 |
| - if (ev_type == UPDATE_ROWS_EVENT || |
3247 |
| - ev_type == UPDATE_ROWS_EVENT_V1) |
3248 |
| - { |
3249 | 3245 | /* Swap SET and WHERE part */
|
3250 | 3246 | memcpy(start_pos, swap_buff2, length2);
|
3251 | 3247 | memcpy(start_pos + length2, swap_buff1, length1);
|
| 3248 | + my_free(swap_buff2); |
3252 | 3249 | }
|
3253 | 3250 |
|
3254 |
| - /* Free tmp buffers */ |
3255 | 3251 | my_free(swap_buff1);
|
3256 |
| - if (ev_type == UPDATE_ROWS_EVENT || |
3257 |
| - ev_type == UPDATE_ROWS_EVENT_V1) |
3258 |
| - my_free(swap_buff2); |
3259 | 3252 |
|
3260 | 3253 | /* Copying one row into a buff, and pushing into the array */
|
3261 | 3254 | LEX_STRING one_row;
|
|
0 commit comments