本篇内容介绍了“怎么解决MySQL中InnoDB: Failing assertion: format != 0错误”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

1、MySQL版本5.7.19,OS是MAC OSX在删除表空间时,出现如下错误

[root@localhost][(none)]>droptablespacets1;ERROR2013(HY000):LostconnectiontoMySQLserverduringquery

2、查看error.log日志,看样子有点像是BUG

2018-04-0916:00:210x700007f04000InnoDB:Assertionfailureinthread123145435496448infileha_innodb.ccline20927InnoDB:Failingassertion:format!=0InnoDB:Weintentionallygenerateamemorytrap.InnoDB:Submitadetailedbugreporttohttp://bugs.mysql.com.InnoDB:Ifyougetrepeatedassertionfailuresorcrashes,evenInnoDB:immediatelyafterthemysqldstartup,theremaybeInnoDB:corruptionintheInnoDBtablespace.PleaserefertoInnoDB:http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.htmlInnoDB:aboutforcingrecovery.08:00:21UTC-mysqldgotsignal6;Thiscouldbebecauseyouhitabug.Itisalsopossiblethatthisbinaryoroneofthelibrariesitwaslinkedagainstiscorrupt,improperlybuilt,ormisconfigured.Thiserrorcanalsobecausedbymalfunctioninghardware.Attemptingtocollectsomeinformationthatcouldhelpdiagnosetheproblem.Asthisisacrashandsomethingisdefinitelywrong,theinformationcollectionprocessmightfail.key_buffer_size=8388608read_buffer_size=16777216max_used_connections=1max_threads=512thread_count=2connection_count=1Itispossiblethatmysqldcoulduseuptokey_buffer_size+(read_buffer_size+sort_buffer_size)*max_threads=25180932KbytesofmemoryHopethat'sok;ifnot,decreasesomevariablesintheequation.Threadpointer:0x7f86b59eda00Attemptingbacktrace.Youcanusethefollowinginformationtofindoutwheremysqlddied.Ifyouseenomessagesafterthis,somethingwentterriblywrong...stack_bottom=700007f03e90thread_stack0x400000mysqld0x000000010385b12amy_print_stacktrace+581mysqld0x00000001037b7e30handle_fatal_signal+6882libsystem_platform.dylib0x00007fff7ab81f5a_sigtramp+263mysqld0x0000000104175c4b_ZZN10binary_log4Uuid9to_stringEPKhPcE11byte_to_hex+788114libsystem_c.dylib0x00007fff7a9ac312abort+1275mysqld0x0000000103ab1471_Z23ut_dbg_assertion_failedPKcS0_m+1616mysqld0x0000000103970147_Z11ib_senderrfP3THD14ib_log_level_tjz+3597mysqld0x0000000103982b27_Z7ib_errfP3THD14ib_log_level_tjPKcz+1998mysqld0x0000000103984f9c_ZL25innobase_alter_tablespaceP10handlertonP3THDP19st_alter_tablespace+12609mysqld0x00000001037353e4_Z22mysql_alter_tablespaceP3THDP19st_alter_tablespace+22810mysqld0x00000001036c6920_Z21mysql_execute_commandP3THDb+1281611mysqld0x00000001036c2d28_Z11mysql_parseP3THDP12Parser_state+87212mysqld0x00000001036c1b98_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+472813mysqld0x00000001036c2789_Z10do_commandP3THD+50514mysqld0x000000010379ba44handle_connection+43615mysqld0x0000000103b11756pfs_spawn_thread+31016libsystem_pthread.dylib0x00007fff7ab8b6c1_pthread_body+34017libsystem_pthread.dylib0x00007fff7ab8b56d_pthread_body+018libsystem_pthread.dylib0x00007fff7ab8ac5dthread_start+13Tryingtogetsomevariables.Somepointersmaybeinvalidandcausethedumptoabort.Query(7f86b589dc30):droptablespacets1ConnectionID(threadID):4Status:NOT_KILLEDThemanualpageathttp://dev.mysql.com/doc/mysql/en/crashing.htmlcontainsinformationthatshouldhelpyoufindoutwhatiscausingthecrash.

3、查看ha_innodb.cc源码的20927行

/******************************************************************//**Usethiswhentheargsarepassedtotheformatstringfromerrmsg-utf8.txtdirectlyasis.Pushawarningmessagetotheclient,itisawrapperaround:voidpush_warning_printf(THD*thd,Sql_condition::enum_condition_levellevel,uintcode,constchar*format,...);*/voidib_senderrf(/*========*/THD*thd,/*!<in/out:session*/ib_log_level_tlevel,/*!<in:warninglevel*/ib_uint32_tcode,/*!<MySQLerrorcode*/...)/*!<Args*/{va_listargs;char*str=NULL;constchar*format=innobase_get_err_msg(code);/*Ifthecallerwantstopushamessagetotheclientthenthecallermustpassavalidsessionhandle.*/ut_a(thd!=0);/*Theerrorcodemustexistintheerrmsg-utf8.txtfile.*/ut_a(format!=0);va_start(args,code);#ifdef_WIN32intsize=_vscprintf(format,args)+1;if(size>0){str=static_cast<char*>(malloc(size));}if(str==NULL){va_end(args);return;/*WatchforOut-Of-Memory*/}str[size-1]=0x0;vsnprintf(str,size,format,args);#elifHAVE_VASPRINTFintret;ret=vasprintf(&str,format,args);if(ret<0){va_end(args);return;/*WatchforOut-Of-Memory*/}#else/*Useafixedlengthstring.*/str=static_cast<char*>(malloc(BUFSIZ));if(str==NULL){va_end(args);return;/*WatchforOut-Of-Memory*/}my_vsnprintf(str,BUFSIZ,format,args);#endif/*_WIN32*/Sql_condition::enum_severity_levell;l=Sql_condition::SL_NOTE;switch(level){caseIB_LOG_LEVEL_INFO:break;caseIB_LOG_LEVEL_WARN:l=Sql_condition::SL_WARNING;break;caseIB_LOG_LEVEL_ERROR:/*Wecan'tusepush_warning_printf(),itisaharderror.*/my_printf_error(code,"%s",MYF(0),str);break;caseIB_LOG_LEVEL_FATAL:l=Sql_condition::SEVERITY_END;break;}if(level!=IB_LOG_LEVEL_ERROR){push_warning_printf(thd,l,code,"InnoDB:%s",str);}va_end(args);free(str);if(level==IB_LOG_LEVEL_FATAL){ut_error;}}

“怎么解决MySQL中InnoDB: Failing assertion: format != 0错误”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!