MCPcopy Create free account
hub / github.com/MariaDB/server / ddl_log_write_execute_entry

Function ddl_log_write_execute_entry

sql/ddl_log.cc:2573–2615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2571*/
2572
2573bool 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/**

Callers 10

write_log_drop_frmFunction · 0.85
write_log_rename_frmFunction · 0.85
write_log_drop_partitionFunction · 0.85
mysql_write_frmFunction · 0.85
ddl_log_writeFunction · 0.85
ddl_log_store_queryFunction · 0.85

Calls 7

ddl_log_sync_no_lockFunction · 0.85
int4storeFunction · 0.85
int8storeFunction · 0.85
ddl_log_get_free_entryFunction · 0.85
write_ddl_log_file_entryFunction · 0.85
sql_print_errorFunction · 0.70

Tested by

no test coverage detected