| 2571 | */ |
| 2572 | |
| 2573 | bool ddl_log_write_execute_entry(uint first_entry, |
| 2574 | uint cond_entry, |
| 2575 | DDL_LOG_MEMORY_ENTRY **active_entry) |
| 2576 | { |
| 2577 | uchar *file_entry_buf= global_ddl_log.file_entry_buf; |
| 2578 | bool got_free_entry= 0; |
| 2579 | DBUG_ENTER("ddl_log_write_execute_entry"); |
| 2580 | |
| 2581 | mysql_mutex_assert_owner(&LOCK_gdl); |
| 2582 | /* |
| 2583 | We haven't synched the log entries yet, we sync them now before |
| 2584 | writing the execute entry. |
| 2585 | */ |
| 2586 | (void) ddl_log_sync_no_lock(); |
| 2587 | bzero(file_entry_buf, global_ddl_log.io_size); |
| 2588 | |
| 2589 | file_entry_buf[DDL_LOG_ENTRY_TYPE_POS]= (uchar)DDL_LOG_EXECUTE_CODE; |
| 2590 | int4store(file_entry_buf + DDL_LOG_NEXT_ENTRY_POS, first_entry); |
| 2591 | int8store(file_entry_buf + DDL_LOG_ID_POS, ((ulonglong)cond_entry << DDL_LOG_RETRY_BITS)); |
| 2592 | |
| 2593 | if (!(*active_entry)) |
| 2594 | { |
| 2595 | if (ddl_log_get_free_entry(active_entry)) |
| 2596 | DBUG_RETURN(TRUE); |
| 2597 | got_free_entry= TRUE; |
| 2598 | } |
| 2599 | DBUG_PRINT("ddl_log", |
| 2600 | ("pos: %u=>%u", |
| 2601 | (*active_entry)->entry_pos, first_entry)); |
| 2602 | if (write_ddl_log_file_entry((*active_entry)->entry_pos)) |
| 2603 | { |
| 2604 | sql_print_error("DDL_LOG: Error writing execute entry %u", |
| 2605 | (*active_entry)->entry_pos); |
| 2606 | if (got_free_entry) |
| 2607 | { |
| 2608 | ddl_log_release_memory_entry(*active_entry); |
| 2609 | *active_entry= 0; |
| 2610 | } |
| 2611 | DBUG_RETURN(TRUE); |
| 2612 | } |
| 2613 | (void) ddl_log_sync_no_lock(); |
| 2614 | DBUG_RETURN(FALSE); |
| 2615 | } |
| 2616 | |
| 2617 | |
| 2618 | /** |
no test coverage detected