Lines with zero coverage (811/14984): ===File client/mysqlbinlog-engine.cc: 169 : + int read_error_corruption(const char *msg) 171 : + return read_error_corruption(s.file_no, s.page_no, msg); 342 : + res= -1; 343 : + my_errno= EIO; 346 : + else if (read == (size_t)-1) 347 : + res= -1; 349 : + res= 0; 372 : +chunk_reader_mysqlbinlog::read_error_corruption(uint64_t file_no, uint64_t page_no, 375 : + error("Corrupt InnoDB binlog found on page %" PRIu64 " in binlog number " 377 : + return -1; 389 : + return sofar; 395 : + return 0; 397 : + return -1; 419 : + return sofar; 424 : + DBUG_ASSERT(s.in_page_offset >= binlog_page_size - BINLOG_PAGE_DATA_END || 426 : + goto go_next_page; 451 : + return read_error_corruption(s.file_no, s.page_no, "Binlog record " 452 : + "starts with continuation chunk"); 471 : + return read_error_corruption(s.file_no, s.page_no, "Binlog record missing " 472 : + "end chunk"); 477 : + return read_error_corruption(s.file_no, s.page_no, "Binlog record missing " 478 : + "end chunk"); 616 : + DBUG_ASSERT(0 /* Should not call when no more oob data to read. */); 617 : + return 0; 630 : + return -1; 632 : + return chunk_rd->read_error_corruption("Wrong chunk type"); 634 : + return chunk_rd->read_error_corruption("Unexpected EOF, expected " 635 : + "oob chunk"); 641 : + return chunk_rd->read_error_corruption("Short chunk"); 648 : + return chunk_rd->read_error_corruption("Short chunk"); 653 : + return chunk_rd->read_error_corruption("Short chunk"); 659 : + return chunk_rd->read_error_corruption("Short chunk"); 664 : + return chunk_rd->read_error_corruption("Short chunk"); 719 : + return -1; 731 : + default: 732 : + DBUG_ASSERT(0); 733 : + return -1; 777 : +binlog_reader_innodb::data_available() 779 : + DBUG_ASSERT(0 /* Should not be used in mysqlbinlog. */); 780 : + return true; 785 : +binlog_reader_innodb::wait_available(THD *thd, const struct timespec *abstime) 787 : + DBUG_ASSERT(0 /* Should not be used in mysqlbinlog. */); 788 : + return true; 793 : +binlog_reader_innodb::init_gtid_pos(THD *thd, slave_connection_state *pos, 796 : + DBUG_ASSERT(0 /* Should not be used in mysqlbinlog. */); 797 : + return 1; 802 : +binlog_reader_innodb::init_legacy_pos(THD *thd, const char *filename, 805 : + DBUG_ASSERT(0 /* Should not be used in mysqlbinlog. */); 806 : + return 1; 811 : +binlog_reader_innodb::enable_single_file() 813 : + DBUG_ASSERT(0 /* Should not be used in mysqlbinlog. */); 814 : +} 830 : + return true; 875 : + return res; 892 : + return chunk_rd.read_error_corruption("Short chunk"); 902 : + return chunk_rd.read_error_corruption("Short chunk"); 906 : + return chunk_rd.read_error_corruption("Short chunk"); 911 : + return chunk_rd.read_error_corruption("Short chunk"); 916 : + return chunk_rd.read_error_corruption("Short chunk"); 923 : + return chunk_rd.read_error_corruption("Short chunk"); 932 : + return chunk_rd.read_error_corruption("Short chunk"); 936 : + return chunk_rd.read_error_corruption("Short chunk"); 941 : + return chunk_rd.read_error_corruption("Short chunk"); 946 : + return chunk_rd.read_error_corruption("Short chunk"); 971 : + return -1; 1000 : + goto again; 1008 : + return -1; 1029 : + DBUG_ASSERT(0 /* Should have had oob_traversal_done() last time then. */); 1030 : + if (sofar == 0) 1031 : + goto again; 1035 : + default: 1036 : + DBUG_ASSERT(0); 1037 : + return -1; 1048 : + error("Cannot read first page of InnoDB binlog file"); 1049 : + return -1; 1055 : + error("Invalid checksum on first page, cannot read binlog file"); 1056 : + return -1; 1061 : + error("Unsupported version of InnoDB binlog file, cannot read"); 1062 : + return -1; 1087 : + cur_file_handle= (File)-1; 1088 : + cur_file_length= ~(uint64_t)0; 1095 : + return errno == ENOENT ? CHUNK_READER_EOF : CHUNK_READER_ERROR; 1098 : + error("Cannot stat() file '%s', errno: %d", filename, errno); 1099 : + my_close(cur_file_handle, MYF(0)); 1100 : + cur_file_handle= (File)-1; 1101 : + cur_file_length= ~(uint64_t)0; 1102 : + return CHUNK_READER_ERROR; 1110 : + goto_next_file: 1111 : + if (cur_file_handle >= (File)0) 1113 : + my_close(cur_file_handle, MYF(0)); 1114 : + cur_file_handle= (File)-1; 1115 : + cur_file_length= ~(uint64_t)0; 1117 : + ++s.file_no; 1118 : + s.page_no= 1; /* Skip the header page. */ 1119 : + continue; 1122 : + } 1126 : + return CHUNK_READER_ERROR; 1128 : + goto goto_next_file; 1168 : + error("Out of memory allocating page buffer"); 1169 : + return true; ===File client/mysqlbinlog.cc: 3012 : + error("Out of memory setting up reader for InnoDB-implemented binlog."); 3013 : + return ERROR_STOP; 3240 : + goto err; 3260 : + ev= nullptr; 3261 : + read_error= -1; 3271 : + error("Error reading event: %s", errmsg); 3272 : + read_error= -1; ===File extra/mariabackup/backup_copy.cc: 1874 : + goto cleanup; ===File extra/mariabackup/backup_mysql.cc: 555 : + my_free(const_cast(opt_binlog_directory)); ===File extra/mariabackup/common_engine.cc: 356 : + goto exit; 367 : + goto exit; ===File extra/mariabackup/xtrabackup.cc: 2629 : + my_free(const_cast(opt_binlog_directory)); 5435 : + msg("Error on copy InnoDB binlog files"); 5436 : + return false; 5439 : + msg("InnoDB binlog file backup process is finished with error"); 5440 : + return false; 5470 : + return false; ===File sql/handler.cc: 2072 : + (void)tc_log->unlog(thd, cookie, xid); 2755 : + sql_print_error("Too many transactional engines during binlog recovery " 2758 : + return true; 2793 : + info->error= true; 2801 : + info->error= true; 2818 : + info->error= true; 2849 : + sql_print_error(ER(ER_OUTOFMEMORY), 2850 : + static_cast(info.len*sizeof(XID))); 2851 : + DBUG_RETURN(1); 2860 : + DBUG_RETURN(1); 2892 : + handlerton *hton= info.htons[j]; 2893 : + (*hton->rollback_by_xid)(&rec->xid); 3183 : + sql_print_error("The --tc-heuristic-recover option is not needed with, " 3185 : + DBUG_RETURN(1); ===File sql/log.cc: 2133 : + DBUG_RETURN(1); 2146 : + DBUG_RETURN(1); 2388 : + return 1; 2493 : + sp_ptr= &sp->next; 2494 : + } 2545 : + return 1; 2554 : + return 1; 2558 : + return 1; 2843 : + mysql_bin_log.unlog(thd, 2844 : + BINLOG_COOKIE_MAKE(cache_mngr->binlog_id, 3003 : + error= binlog_engine_xa_rollback(thd, cache_mngr); 3225 : + DBUG_RETURN(error); 3264 : + DBUG_ASSERT("Should be removed by ha_release_savepoint()" == nullptr); 3265 : + *next_ptr= sp->next; 5288 : + DBUG_ASSERT(FALSE); 5289 : + return false; 5296 : + mysql_cond_wait(&COND_binlog_use, &LOCK_binlog_use); 5298 : + killed_err= true; 5317 : + DBUG_ASSERT(FALSE); 5318 : + return; 5325 : + DBUG_ASSERT(FALSE); 5385 : + my_error(ER_NOT_AVAILABLE_WITH_ENGINE_BINLOG, MYF(0), 5387 : + error= true; 5685 : + rpl_global_gtid_binlog_state.load(init_state, init_state_len); 6471 : + return; 6479 : + purge_info.limit_file_no= 0; 6480 : + purge_info.nonpurge_reason= "less than " 6610 : + my_printf_error(ER_BINLOG_PURGE_PROHIBITED, 6620 : + sql_print_information("Binary log purge is prevented because %s", 7382 : + part_len= max_len; 7383 : + next_stmt_start_ptr= nullptr; 7384 : + next_savepoint_ptr= nullptr; 7385 : + next_sp= sp; 7397 : + return res; 7437 : + return res; 7461 : + return NULL; 7489 : + my_free(cache_mngr); 7490 : + return NULL; 8299 : + DBUG_RETURN(true); 8471 : + return true; 8482 : + return true; 8690 : + DBUG_RETURN(1); 8710 : + if (mdl_request.ticket) 8711 : + thd->mdl_context.release_lock(mdl_request.ticket); 8712 : + thd->backup_commit_lock= 0; 8713 : + DBUG_RETURN(res); 8756 : + Annotate_rows_log_event anno(thd, using_trans, events_direct); 8842 : + goto engine_fail; 8849 : + goto engine_fail; 8854 : + if (mdl_request.ticket) 8855 : + thd->mdl_context.release_lock(mdl_request.ticket); 8856 : + thd->backup_commit_lock= 0; 8857 : + goto engine_fail; 8866 : + goto engine_fail; 8890 : + mysql_mutex_unlock(&LOCK_commit_ordered); 8891 : + goto engine_fail; 8900 : + goto engine_fail; 8904 : + engine_fail: 8905 : + error= 1; 8933 : + sql_print_error("Failed to run 'after_flush' hooks"); 8934 : + error= 1; 8947 : + check_purge= false; 8967 : + error=1; 9388 : + my_error(ER_OUT_OF_RESOURCES, MYF(0)); 9389 : + rc= -1; 9390 : + goto err; 9502 : + my_error(ER_ENGINE_BINLOG_NO_DELETE_DOMAIN, MYF(0)); 9503 : + return -1; 9509 : + my_error(ER_BINLOG_CANNOT_READ_STATE, MYF(0)); 9510 : + return -1; 9564 : + error= 1; 9820 : + DBUG_RETURN(0); 10478 : + binlog_cache_data *cache_data= cache_mngr->engine_cache_data(); 10479 : + IO_CACHE *file= &cache_data->cache_log; 10480 : + handler_binlog_event_group_info *engine_context= 10482 : + binlog_setup_engine_commit_data(engine_context, cache_mngr); 10483 : + if (likely(!entry->error)) 10485 : + entry->error= (*opt_binlog_engine_hton->binlog_write_direct_ordered) 10486 : + (file, engine_context, entry->thd->get_last_commit_gtid()); 10487 : + if (likely(!entry->error)) 10489 : + cache_mngr->last_commit_pos_file.engine_file_no= 10490 : + engine_context->out_file_no; 10491 : + cache_mngr->last_commit_pos_offset= engine_context->out_file_no; 10494 : + cache_mngr->need_write_direct= TRUE; 10792 : + (*opt_binlog_engine_hton->get_filename) 10793 : + (buf, current->cache_mngr->last_commit_pos_file.engine_file_no); 10802 : + current->error= ER_ERROR_ON_WRITE; 10803 : + current->commit_errno= -1; 10804 : + current->error_cache= NULL; 10805 : + any_error= true; 10810 : + sql_print_error("Failed to run 'after_flush' hooks"); 11158 : + DBUG_RETURN(ER_ERROR_ON_WRITE); 11171 : + DBUG_RETURN(ER_ERROR_ON_WRITE); 12847 : + my_hash_free(&recover_hash); 12848 : + DBUG_RETURN(1); 12854 : + DBUG_RETURN(1); 14604 : + sql_print_information("Value of binlog_checksum forced to NONE since " 14607 : + value= 0; ===File sql/log.h: 122 : + int unlog(THD *thd, ulong cookie, my_xid xid) override { return 0; } 123 : + int log_xa_prepare(THD *thd, bool all) override 125 : + return 0; ===File sql/log_event.cc: 1301 : + return LOG_READ_MEM; 1335 : + res= LOG_READ_BOGUS; 1336 : + goto err; 1340 : + res= LOG_READ_TOO_LARGE; 1341 : + goto err; ===File sql/log_event_server.cc: 2463 : + return true; 2519 : + return true; ===File sql/mysqld.cc: 4980 : + buf[len-1]= '\0'; 4981 : + len= dirname_length(buf); 4988 : + strmake(buf, dir, len); 4989 : + if (create_dir_path_if_needed(buf)) 4990 : + return 1; 4993 : + return 1; 5197 : + sql_print_error("Path '%s' is a directory name, please specify " 5200 : + unireg_abort(1); 5212 : + sql_print_error("The combination of --binlog-directory path '%s' with " 5215 : + unireg_abort(1); 5219 : + sql_print_error("Failed to create the directory '%s' specified in " 5221 : + opt_binlog_directory, my_errno); 5222 : + unireg_abort(1); 5285 : + sql_print_error("Galera cannot be used with the " 5287 : + unireg_abort(1); 5645 : + sql_print_error("Cannot specify a directory path for the binlog in " 5647 : + unireg_abort(1); 5658 : + if (!opt_binlog_engine_plugin) 5659 : + sql_print_error("Unknown/unsupported storage engine: %s", 5662 : + sql_print_error("Engine %s is not available for " 5665 : + unireg_abort(1); 5670 : + sql_print_error("Engine %s does not support --binlog-storage-engine", 5672 : + unireg_abort(1); 5677 : + sql_print_error("Binlog name can not be set with --log-bin=NAME when " 5682 : + unireg_abort(1); 5687 : + sql_print_error("Semi-synchronous replication is not yet supported " 5689 : + unireg_abort(1); 5693 : + sql_print_error("The --init-rpl-role option is not available with " 5695 : + unireg_abort(1); 5699 : + sql_print_error("Binlog encryption is not available with " 5702 : + unireg_abort(1); ===File sql/rpl_gtid.cc: 1679 : + return true; 2040 : + return true; 2200 : + return true; ===File sql/slave.cc: 2273 : + if (check_io_slave_killed(mi, NULL)) 2274 : + goto slave_killed_err; 2276 : + err_code= mysql_errno(mysql); 2277 : + if (is_network_error(err_code)) 2279 : + mi->report(ERROR_LEVEL, err_code, NULL, 2282 : + goto network_err; 2284 : + else if (err_code == ER_UNKNOWN_SYSTEM_VARIABLE) 2290 : + DBUG_PRINT("info", ("Old master, no --binlog-storage-engine")); 2291 : + mi->binlog_storage_engine= false; 2296 : + errmsg= "The slave I/O thread stops because a fatal error is " 2299 : + sprintf(err_buff, "%s Error: %s", errmsg, mysql_error(mysql)); 2300 : + goto err; ===File sql/sql_binlog.cc: 313 : + my_error(ER_OUT_OF_RESOURCES, MYF(0)); 314 : + goto end; ===File sql/sql_parse.cc: 4071 : + my_error(thd->killed_errno(), MYF(0)); 4072 : + goto error; ===File sql/sql_repl.cc: 328 : + info->error= ER_UNKNOWN_ERROR; 329 : + *errmsg= "Failed due to out-of-memory writing Format_description event"; 330 : + return -1; 337 : + info->error= ER_UNKNOWN_ERROR; 338 : + return err; 350 : + info->error= ER_UNKNOWN_ERROR; 351 : + return err; 808 : + return TRUE; 889 : + purge_info.limit_file_no= 0; 890 : + purge_info.nonpurge_reason= "less than " 904 : + give_purge_note(purge_info.nonpurge_reason, 1650 : + DBUG_ASSERT(0); 1805 : + return "Error while looking up GTID position in engine binlog"; 1807 : + return gtid_too_old_errmsg; 2594 : + LEX_CSTRING *engine_name= hton_name(opt_binlog_engine_hton); 2595 : + my_error(ER_CANNOT_INIT_ENGINE_BINLOG_READER, MYF(0), engine_name->str); 2596 : + info->errmsg= "Error while initializing engine binlog reader"; 2597 : + info->error= ER_CANNOT_INIT_ENGINE_BINLOG_READER; 2598 : + return 1; 2627 : + my_error(ER_ENGINE_BINLOG_REQUIRES_GTID, MYF(0)); 2628 : + info->errmsg= 2630 : + info->error= ER_ENGINE_BINLOG_REQUIRES_GTID; 2631 : + return 1; 2700 : + info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG; 2701 : + return 1; 3207 : + info->error= ER_UNKNOWN_ERROR; 3208 : + return true; 3219 : + info->error= ER_UNKNOWN_ERROR; 3220 : + return true; 3319 : + return 1; 3356 : + return 1; 3362 : + set_read_error(info, error); 3363 : + return 1; 3459 : + return 1; 3476 : + return 1; 3479 : + return 1; 3567 : + info->errmsg= "Binlog dump terminated by user kill"; 3568 : + info->error= ER_CONNECTION_KILLED; 3569 : + goto err; 3614 : + info->errmsg= "Out of memory initializing format_description event"; 3615 : + info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG; 3616 : + goto err; 3622 : + info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG; 3623 : + goto err; 3663 : + info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG; 3664 : + goto err; 3669 : + info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG; 3670 : + goto err; 4917 : + return 1; 4948 : + my_error(ER_OUT_OF_RESOURCES, MYF(0)); 4949 : + return true; 4994 : + my_error(ER_ERROR_WHEN_EXECUTING_COMMAND, MYF(0), 4996 : + err= true; 5009 : + my_error(ER_ERROR_WHEN_EXECUTING_COMMAND, MYF(0), 5011 : + err= true; 5012 : + break; 5018 : + my_error(ER_ERROR_WHEN_EXECUTING_COMMAND, MYF(0), 5020 : + err= true; 5021 : + break; ===File sql/transaction.cc: 785 : + res= TRUE; 794 : + DBUG_ASSERT(0 /* Should not get here, would imply that the list of savepoints 797 : + thd->transaction->savepoints= NULL;; ===File storage/innobase/fsp/fsp_binlog.cc: 133 : + size_t new_allocated_entries= 2*pl->allocated_entries; 134 : + size_t new_size= new_allocated_entries * sizeof(*pl->entries); 136 : + (fsp_binlog_page_entry **)ut_realloc(pl->entries, new_size); 137 : + if (!new_entries) 138 : + return nullptr; 140 : + if (pl->first_entry + pl->used_entries > pl->allocated_entries) 142 : + size_t wrapped_entries= 143 : + pl->first_entry + pl->used_entries - pl->allocated_entries; 144 : + ut_ad(new_allocated_entries >= pl->allocated_entries + wrapped_entries); 145 : + memcpy(new_entries + pl->allocated_entries, new_entries, 148 : + pl->entries= new_entries; 149 : + pl->allocated_entries= new_allocated_entries; 165 : + return nullptr; 310 : + sql_print_error("InnoDB: Internal inconsistency with mini-transaction " 325 : + return false; 327 : + return false; 370 : + return; 436 : + return; 486 : + break; 521 : + break; 524 : + break; 594 : + ut_a(pl->used_entries == 0); 595 : + if (UNIV_UNLIKELY(pl->fh != (File)-1)) 597 : + ut_ad(false /* Should have been done as part of tablespace close. */); 598 : + my_close(pl->fh, MYF(0)); 600 : + first_file_no= file_no - 1; 719 : + byte *q= (byte *)*(uintptr_t *)to_free_list; 720 : + ut_free(to_free_list); 721 : + to_free_list= q; 742 : + my_cond_wait(&m_cond, &m_mutex.m_mutex); 763 : + return; 858 : + if (MyFlags & MY_WME) 859 : + my_error(ER_READING_BINLOG_FILE, MYF(0), page_no, my_errno); 860 : + res= -1; 879 : + return -1; 881 : + return 0; 889 : + my_errno= EIO; 890 : + if (MyFlags & MY_WME) 891 : + sql_print_error("InnoDB: Page corruption in binlog tablespace file " 894 : + return -1; 986 : + return ~(uint64_t)0; 1001 : + return ~(uint64_t)0; 1072 : + return false; 1143 : + my_error(ER_OUTOFMEMORY, MYF(0), ibb_page_size); 1144 : + return true; 1151 : + my_error(ER_ERROR_ON_READ, MYF(0), filename, my_errno); 1152 : + ut_free(page_buf); 1153 : + return true; 1159 : + ut_free(page_buf); 1160 : + my_error(ER_ERROR_ON_READ, MYF(0), filename, my_errno); 1161 : + return true; 1168 : + my_error(ER_FILE_CORRUPT, MYF(0), filename); 1169 : + return true; 1174 : + return true; 1212 : + return false; 1231 : + my_error(ER_OUT_OF_RESOURCES, MYF(0)); 1232 : + return true; 1243 : + ut_ad(res < 0 /* Should not get unique violation, never insert twice */); 1244 : + sql_print_error("InnoDB: Could not initialize in-memory structure for " 1247 : + err= true; 1297 : + out_header_data->is_invalid= true; 1368 : + sql_print_error("InnoDB: Could not allocate memory for the page fifo, " 1370 : + return DB_OUT_OF_MEMORY; 1449 : + if (!os_file_set_size(file_name, fh, binlog_size, false)) { 1450 : + sql_print_warning("Failed to change the size of InnoDB binlog file '%s' " 1452 : + file_size, (size_t)binlog_size, errno); 1454 : + file_size= (size_t)binlog_size; 1459 : + sql_print_warning("InnoDB binlog file number %" PRIu64 " is too short " 1462 : + os_file_close(fh); 1463 : + return true; 1489 : + return DB_ERROR; 1502 : + os_file_close(fh); 1503 : + return DB_ERROR; 1661 : + binlog_full_state.get_gtid_list_nolock(&singleton_gtid, 1); 1662 : + if (singleton_gtid.seq_no == 1) 1663 : + binlog_state= &binlog_diff_state; // Conveniently empty 1750 : + binlog_page_fifo->release_page_mtr(block, mtr); 1751 : + block= nullptr; 1799 : + binlog_page_fifo->unlock(); 1800 : + mysql_mutex_unlock(&purge_binlog_mutex); 1801 : + return true; 1807 : + binlog_page_fifo->unlock(); 1808 : + mysql_mutex_unlock(&purge_binlog_mutex); 1809 : + return true; 1826 : + page_offset < ibb_page_size - BINLOG_PAGE_DATA_END) 1846 : + ut_ad(0); 1896 : +binlog_chunk_reader::read_error_corruption(uint64_t file_no, uint64_t page_no, 1899 : + sql_print_error("InnoDB: Corrupt binlog found on page %" PRIu64 1901 : + return -1; 2003 : + my_error(ER_CANT_GET_STAT, MYF(0), filename, errno); 2004 : + my_close(cur_file_handle, MYF(0)); 2005 : + cur_file_handle= (File)-1; 2006 : + cur_file_length= ~(uint64_t)0; 2007 : + return CHUNK_READER_ERROR; 2020 : + return CHUNK_READER_EOF; 2061 : + return read_error_corruption(s.file_no, s.page_no, "binlog tablespace " 2062 : + "truncated in the middle of record"); 2094 : + ut_ad(s.in_page_offset >= ibb_page_size - BINLOG_PAGE_DATA_END || 2096 : + goto go_next_page; 2102 : + ut_ad(0 /* Should have detected end-of-file on cur_end_offset. */); 2103 : + return 0; 2124 : + return read_error_corruption(s.file_no, s.page_no, "Binlog record " 2125 : + "starts with continuation chunk"); 2144 : + return read_error_corruption(s.file_no, s.page_no, "Binlog record missing " 2145 : + "end chunk"); 2150 : + return read_error_corruption(s.file_no, s.page_no, "Binlog record missing " 2151 : + "end chunk"); 2244 : + return 0; 2287 : + return res == CHUNK_READER_EOF ? 0 : -1; 2290 : + return -1; 2354 : + return true; 2357 : + return false; 2368 : + active= active2; 2369 : + } 2386 : + return false; ===File storage/innobase/handler/ha_innodb.cc: 3787 : + sql_print_error("InnoDB: innodb_binlog_state_interval must be " 3790 : + DBUG_RETURN(HA_ERR_INITIALIZATION); 4045 : + return nullptr; 4052 : + return nullptr; 4058 : + return nullptr; ===File storage/innobase/handler/innodb_binlog.cc: 367 : + p= compr_int_write(p, 0); 537 : + return {0, true}; 812 : + return -1; 814 : + return 0; 826 : + return 0; 856 : + my_error(ER_OUTOFMEMORY, MYF(MY_WME), ibb_page_size); 857 : + return true; 872 : + return true; 936 : + page_no == 0 && offset == 0) 937 : + ++start_file_no; 946 : + sql_print_error("InnoDB: I/O error reading binlog file number %" PRIu64, 948 : + return true; 952 : + sql_print_error("InnoDB: I/O error reading binlog file number %" PRIu64, 954 : + return true; 967 : + --num_binlogs; 970 : + --num_binlogs; 973 : + if (srv_force_recovery) 981 : + sql_print_warning("InnoDB: Binlog tablespace file recovery is not " 984 : + init_recovery_skip_all(); 985 : + return false; 987 : + sql_print_error("InnoDB: Last 3 binlog tablespace files are all empty. " 989 : + return true; 1000 : + page_no == 0 && offset == 0) 1001 : + return init_recovery_from(file_no2, lsn1, page_no, offset, 1002 : + start_lsn, buf, size); 1010 : + return init_recovery_from(file_no2, lsn2, 1011 : + page_no, offset, start_lsn, buf, size); 1093 : +binlog_recovery::init_recovery_skip_all() noexcept 1095 : + skip_recovery= true; 1096 : +} 1127 : + sql_print_warning("InnoDB: Could not delete empty file '%s' (" 1128 : + "error: %d)", full_path, my_errno); 1140 : + my_close(cur_file_fh, MYF(0)); 1141 : + cur_file_fh= (File)-1; 1153 : + my_close(cur_file_fh, MYF(0)); 1164 : + if (my_errno != ENOENT || 1165 : + cur_page_no != 0 || 1166 : + (cur_file_fh= my_open(full_path, O_RDWR | O_CREAT | O_TRUNC | 1169 : + my_error(EE_FILENOTFOUND, MYF(MY_WME), full_path, my_errno); 1170 : + return true; 1183 : + return true; 1187 : + return true; 1198 : + return; 1204 : + sql_print_warning("InnoDB: Could not read last binlog file during recovery"); 1205 : + return; 1212 : + sql_print_warning("InnoDB: Invalid header page in last binlog file " 1214 : + return; 1218 : + sql_print_warning("InnoDB: Empty binlog file header found during recovery"); 1219 : + ut_ad(0); 1220 : + return; 1226 : + sql_print_warning("InnoDB: Could not change the size of last binlog file " 1227 : + "during recovery (error: %d)", my_errno); 1233 : + break; 1242 : + sql_print_warning("InnoDB: Error writing to last binlog file during " 1243 : + "recovery (error code: %d)", my_errno); 1244 : + break; 1256 : + return true; 1269 : + return true; 1271 : + return true; 1282 : + return true; 1316 : + return false; 1340 : + ut_a(!skipping_early_lsn /* Was handled in condition above */); 1341 : + if (!srv_force_recovery) 1343 : + sql_print_error("InnoDB: Unexpected LSN " LSN_PF " during recovery, " 1345 : + return true; 1347 : + sql_print_warning("InnoDB: Ignoring unexpected LSN " LSN_PF " during " 1349 : + return false; 1361 : + !srv_force_recovery) 1363 : + sql_print_error("InnoDB: Missing recovery record at end of file_no=%" 1365 : + return true; 1371 : + sql_print_error("InnoDB: Missing recovery record at start of file_no=%" 1372 : + PRIu64 ", LSN " LSN_PF, cur_file_no+1, start_lsn); 1373 : + return true; 1377 : + return true; 1384 : + !srv_force_recovery) 1386 : + sql_print_error("InnoDB: Missing recovery record in file_no=%" 1389 : + return true; 1393 : + !srv_force_recovery) 1395 : + sql_print_error("InnoDB: Missing recovery record in file_no=%" 1397 : + cur_file_no, cur_page_no + 1, start_lsn); 1398 : + return true; 1402 : + return true; 1406 : + offset > BINLOG_PAGE_DATA && 1407 : + !srv_force_recovery) 1409 : + sql_print_error("InnoDB: Missing recovery record in file_no=%" 1412 : + return true; 1416 : + return !srv_force_recovery; 1445 : + sql_print_error("InnoDB: Corrupt or invalid file header found during " 1447 : + return !srv_force_recovery; 1451 : + sql_print_error("InnoDB: Empty file header found during " 1453 : + return !srv_force_recovery; 1457 : + sql_print_error("InnoDB: Inconsistency in file header during recovery. " 1460 : + return !srv_force_recovery; 1485 : + return false; 1494 : + return false; 1506 : + return err; 1513 : + sql_print_error("InnoDB: Could not allocate memory for the internal " 1515 : + return DB_OUT_OF_MEMORY; 1599 : + pages= UINT32_MAX; 1600 : + sql_print_warning("Requested max_binlog_size is larger than the maximum " 1634 : + sql_print_error("Specified binlog directory path '%s' is too long", 1636 : + return true; 1646 : + return true; 1652 : + return true; 1680 : + return true; 1684 : + sql_print_error("InnoDB: Out of memory while recovering pending XID"); 1685 : + return true; 1745 : + if (my_errno != ENOENT || error_if_missing) 1746 : + sql_print_error("Could not read the binlog directory '%s', error code %d", 1747 : + binlog_dir, my_errno); 1748 : + return (my_errno == ENOENT ? 0 : -1); 1808 : + sql_print_warning("InnoDB: Unable to open file '%s'", file_name); 1809 : + return -1; 1814 : + os_file_close(fh); 1815 : + return -1; 1820 : + sql_print_error("InnoDB: Invalid or corrupt file header in file " 1822 : + return -1; 1833 : + sql_print_error("InnoDB: Inconsistent file header in file '%s', " 1836 : + return -1; 1853 : + os_file_close(fh); 1854 : + return -1; 1872 : + os_file_close(fh); 1873 : + return -1; 1881 : + p= page_end; 1882 : + break; 1887 : + sql_print_error("InnoDB: Invalid record in file_no=%" PRIu64 1890 : + return -1; 1950 : + if (res == 0) 1951 : + ibb_pending_lsn_fifo.init(0); 1952 : + return res; 1964 : + return -1; 1974 : + file_no= binlog_files.last_file_no; 1975 : + if (ibb_record_in_file_hash(file_no, ~(uint64_t)0, ~(uint64_t)0)) 1976 : + return -1; 1977 : + binlog_discover_init(file_no, innodb_binlog_state_interval); 1978 : + sql_print_warning("Binlog number " UINT64PF " could no be opened. " 1981 : + return 0; 1989 : + return -1; 2003 : + return -1; 2012 : + file_no= binlog_files.last_file_no; 2013 : + if (ibb_record_in_file_hash(file_no, ~(uint64_t)0, ~(uint64_t)0)) 2014 : + return -1; 2015 : + binlog_discover_init(file_no, innodb_binlog_state_interval); 2016 : + binlog_cur_page_no= page_no; 2017 : + binlog_cur_page_offset= pos_in_page; 2018 : + sql_print_warning("Binlog number " UINT64PF " could not be opened, " 2021 : + return 1; 2026 : + return -1; 2038 : + file_no= binlog_files.last_file_no; 2039 : + if (ibb_record_in_file_hash(file_no, ~(uint64_t)0, ~(uint64_t)0)) 2040 : + return -1; 2041 : + binlog_discover_init(file_no, innodb_binlog_state_interval); 2042 : + binlog_cur_page_no= page_no; 2043 : + binlog_cur_page_offset= pos_in_page; 2044 : + sql_print_information("InnoDB: Continuing binlog number %" PRIu64 " from " 2046 : + return binlog_files.num_found; 2200 : + return true; 2299 : + return true; 2304 : + ut_ad(0 /* Shouldn't happen, as we allocated maximum needed size. */); 2305 : + ut_free(alloced_buf); 2306 : + return true; 2335 : + return true; 2359 : + if (block) 2360 : + binlog_page_fifo->release_page_mtr(block, mtr); 2361 : + block= nullptr; 2362 : + block_page_no= ~(uint32_t)0; 2363 : + page_offset= BINLOG_PAGE_DATA; 2364 : + ++page_no; 2371 : + block= binlog_page_fifo->create_page(file_no, page_no); 2372 : + if (UNIV_UNLIKELY(!block)) 2373 : + return true; 2399 : + return -1; 2409 : + return -1; 2418 : + return -1; 2433 : + return -1; 2440 : + return -1; 2443 : + return -1; 2447 : + return -1; 2450 : + return -1; 2454 : + return -1; 2459 : + return -1; 2461 : + return -1; 2495 : + return true; 2502 : + ut_free(page_buf); 2503 : + return true; 2507 : + sql_print_warning("Invalid differential binlog state interval " UINT64PF 2551 : + sql_print_error("InnoDB: Out of memory while scanning file_no=%" PRIu64, 2553 : + delete info; 2554 : + return true; 2574 : + sql_print_error("InnoDB: Corrupt prepare record found in file_no=%" PRIu64 2577 : + return true; 2599 : + sql_print_error("InnoDB: Corrupt prepare record found in file_no=%" PRIu64 2601 : + data_len, (uint)(p - rec_data)); 2602 : + return true; 2608 : + sql_print_error("InnoDB: Out of memory while scanning file_no=%" PRIu64, 2610 : + return true; 2621 : + return true; 2642 : + sql_print_error("InnoDB: Corrupt %s record found in file_no=%" PRIu64 2646 : + return true; 2652 : + sql_print_error("InnoDB: Corrupt prepare record found in file_no=%" PRIu64 2654 : + data_len, (uint)(p - rec_data)); 2655 : + return true; 2663 : + sql_print_error("InnoDB: Out of memory while scanning file_no=%" PRIu64, 2665 : + return true; 2670 : + return true; 2680 : + return false; // No active XID, no scan needed. 2686 : + return true; 2713 : + return true; 2719 : + return true; 2755 : + sql_print_error("InnoDB: Could not process file number %" PRIu64 2758 : + return true; 2768 : + fprintf(stderr, "InnoDB: Out of memory while recovering pending " 2770 : + return true; 2789 : + my_error(ER_OUT_OF_RESOURCES, MYF(0)); 2790 : + ut_free(c); 2791 : + return nullptr; 2803 : + my_error(ER_OUTOFMEMORY, MYF(0), needed); 2889 : + return nullptr; 2968 : + return true; 2971 : + my_error(ER_XAER_RMFAIL, MYF(0), "IDLE"); 2972 : + return true; 2978 : + return true; 2981 : + return false; 2987 : + return true; 2990 : + return false; 3006 : + return true; 3014 : + return true; 3021 : + return true; 3047 : + return true; 3162 : + my_error(ER_OUTOFMEMORY, MYF(0), size); 3163 : + return true; 3181 : + my_error(ER_OUTOFMEMORY, MYF(0), size); 3182 : + return nullptr; 3206 : + break; 3322 : + ut_ad(0 /* Should not call when no more oob data to read. */); 3323 : + return 0; 3336 : + return -1; 3338 : + return chunk_rd->read_error_corruption("Wrong chunk type"); 3340 : + return chunk_rd->read_error_corruption("Unexpected EOF, expected " 3341 : + "oob chunk"); 3347 : + return chunk_rd->read_error_corruption("Short chunk"); 3354 : + return chunk_rd->read_error_corruption("Short chunk"); 3359 : + return chunk_rd->read_error_corruption("Short chunk"); 3365 : + return chunk_rd->read_error_corruption("Short chunk"); 3370 : + return chunk_rd->read_error_corruption("Short chunk"); 3425 : + return -1; 3437 : + default: 3438 : + ut_ad(0); 3439 : + return -1; 3512 : + return res; 3529 : + return chunk_rd.read_error_corruption("Short chunk"); 3539 : + return chunk_rd.read_error_corruption("Short chunk"); 3543 : + return chunk_rd.read_error_corruption("Short chunk"); 3548 : + return chunk_rd.read_error_corruption("Short chunk"); 3553 : + return chunk_rd.read_error_corruption("Short chunk"); 3560 : + return chunk_rd.read_error_corruption("Short chunk"); 3569 : + return chunk_rd.read_error_corruption("Short chunk"); 3573 : + return chunk_rd.read_error_corruption("Short chunk"); 3578 : + return chunk_rd.read_error_corruption("Short chunk"); 3583 : + return chunk_rd.read_error_corruption("Short chunk"); 3608 : + return -1; 3637 : + goto again; 3645 : + return -1; 3666 : + ut_ad(0 /* Should have had oob_traversal_done() last time then. */); 3667 : + if (sofar == 0) 3668 : + goto again; 3672 : + default: 3673 : + ut_ad(0); 3674 : + return -1; 3683 : + return true; 3814 : + my_close(cur_open_file, MYF(0)); 3847 : + my_error(ER_OUTOFMEMORY, MYF(0), ibb_page_size); 3848 : + return -1; 3864 : + return -1; 3866 : + goto not_found_in_file; 3872 : + return -1; 3875 : + not_found_in_file: 3876 : + if (file_no == 0) 3879 : + out_state->reset_nolock(); 3880 : + *out_file_no= file_no; 3881 : + *out_offset= ibb_page_size; 3882 : + return 1; 3890 : + return 0; 3921 : + return -1; 3929 : + page1= page1 - (uint32_t)diff_state_page_interval; 3930 : + continue; 3974 : + return -1; 3978 : + return -1; 4016 : + my_error(ER_BINLOG_POS_INVALID, MYF(0), offset); 4017 : + return -1; 4297 : + my_error(ER_OUTOFMEMORY, MYF(0), (int)sizeof(xid_elem)); 4298 : + return true; 4310 : + mysql_mutex_unlock(&xid_mutex); 4311 : + my_free(e); 4312 : + return true; 4337 : + err= true; 4387 : + return nullptr; 4519 : + err= true; 4594 : + *engine_data= c= alloc_oob_context(); 4620 : + ut_ad(0 /* Impossible, we wait at startup for binlog to be created. */); 4621 : + return true; 4650 : + my_error(ER_OUTOFMEMORY, MYF(0), ibb_page_size); 4651 : + return true; 4660 : + err= true; 4706 : + sql_print_error("Could not read the binlog directory '%s', error code %d", 4707 : + innodb_binlog_directory, my_errno); 4708 : + err= true; 4722 : + err= true; 4771 : + return true; 4839 : + if (my_errno == ENOENT) 4840 : + sql_print_information("InnoDB: File already gone when purging binlog " 4843 : + sql_print_warning("InnoDB: Failed to stat() when trying to purge " 4844 : + "binlog file '%s' (errno: %d)", filename, my_errno); 4845 : + continue; 4867 : + ut_ad(0); 4887 : + if (my_errno == ENOENT) 4896 : + sql_print_warning("InnoDB: Delete failed while trying to purge binlog " 4897 : + "file '%s' (errno: %d)", filename, my_errno); 4898 : + continue; 4933 : + return; 4939 : + purge_info.limit_file_no= first_open_file_no; 4951 : + sql_print_information("InnoDB: Binlog file %s could not be purged " 4958 : + else if (purge_info.limit_file_no == file_no) 4959 : + sql_print_information("InnoDB: Binlog file %s could not be purged " 4962 : + sql_print_information("InnoDB: Binlog file %s could not be purged " 4987 : + return 0; 5008 : + lf_hash_put_pins(lf_pins); 5009 : + return LOG_INFO_IO; ===File storage/innobase/include/fsp_binlog.h: 450 : + int read_error_corruption(const char *msg) 452 : + return read_error_corruption(s.file_no, s.page_no, msg); ===File storage/innobase/log/log0recv.cc: 2574 : + return true; 2578 : + return true; 2581 : + return true; 3098 : + goto record_corrupted; 3117 : + goto record_corrupted; 3122 : + goto record_corrupted; 3125 : + goto record_corrupted; 3199 : + goto record_corrupted; ===File storage/innobase/srv/srv0start.cc: 1975 : + sql_print_error("InnoDB: Could not initialize the binlog in InnoDB, " 1977 : + return(srv_init_abort(DB_ERROR));