diff --git a/modules/backup/mysql-restore-to-sql.sh b/modules/backup/mysql-restore-to-sql.sh index 329749e..b692158 100755 --- a/modules/backup/mysql-restore-to-sql.sh +++ b/modules/backup/mysql-restore-to-sql.sh @@ -1090,6 +1090,7 @@ check_innodb_errors() { # CRITICAL error patterns that ALWAYS fail (not specific to any database) # These indicate fundamental InnoDB corruption or system issues + # NOTE: Missing tablespaces are NOT included - instance can still work with force recovery local critical_patterns=( "InnoDB: Corrupted" "InnoDB: Database page corruption" @@ -1099,13 +1100,6 @@ check_innodb_errors() { "InnoDB: Plugin initialization aborted" ) - # DATABASE-SPECIFIC error patterns - # These only cause failure if they mention the selected database - local db_patterns=( - "InnoDB: Unable to open" - "InnoDB: Tablespace.*missing" - ) - # If checking recent errors, only look at last 50 lines local log_content if [ "$check_recent" = "yes" ]; then @@ -1115,6 +1109,7 @@ check_innodb_errors() { fi # Check CRITICAL patterns first (always fail if found) + # These are truly blocking issues that prevent any recovery for pattern in "${critical_patterns[@]}"; do if echo "$log_content" | grep -qE "$pattern"; then local error_line=$(echo "$log_content" | grep -E "$pattern" | tail -1) @@ -1123,19 +1118,6 @@ check_innodb_errors() { fi done - # Check DATABASE-SPECIFIC patterns only if they mention the selected database - if [ -n "$selected_db" ]; then - for pattern in "${db_patterns[@]}"; do - # Create pattern that checks both for the error pattern AND the database name - # The error message will contain backticks like: `database_name`.`table_name` - if echo "$log_content" | grep -qE "$pattern.*\`${selected_db}\`"; then - local error_line=$(echo "$log_content" | grep -E "$pattern.*\`${selected_db}\`" | tail -1) - critical_errors+=("$error_line") - errors_found=$((errors_found + 1)) - fi - done - fi - if [ -n "$errors_found" ] && [ "$errors_found" -gt 0 ]; then print_error "InnoDB errors detected in $error_log:" for err in "${critical_errors[@]}"; do