国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務器之家:專注于服務器技術及軟件下載分享
分類導航

Mysql|Sql Server|Oracle|Redis|MongoDB|PostgreSQL|Sqlite|DB2|mariadb|Access|數據庫技術|

服務器之家 - 數據庫 - Mysql - mysql提示[Warning] Invalid (old?) table or database name問題的解決方法

mysql提示[Warning] Invalid (old?) table or database name問題的解決方法

2019-12-06 15:32king_wangheng Mysql

今天一個朋友的上服務器出現[Warning] Invalid (old?) table or database name問題,通過分析binlog日志發現,在以下sql語句中出現問題,由于涉及敏感內容,用sql語法表示

DROP TABLE IF EXISTS [TEMP_TABLE_NAME]; 
create temporary table [TEMP_TABLE_NAME] select col1,col2,... from [TABLE_NAME]; 
alter table [TEMP_TABLE_NAME] add unique idx_col1(col1); 
經過以上操作中,多次出現該warning問題。通過查詢和跟蹤調試源碼,有以下線索和處理方式: 
mysql的"[Warning] Invalid (old?) table or database name"問題出現位置: 

sql_table.cc:279 
uint explain_filename (THD* thd, const char *from, char *to , uint to_length , enum_explain_filename_mode explain_mode ) 

跟蹤代碼發現,只有在ha_innodb.cc:1946的innobase_convert_identifier 中調用explain_filename函數。 

復制代碼代碼如下:


/*****************************************************************//** 
Convert an SQL identifier to the MySQL system_charset_info (UTF-8) 
and quote it if needed. 
@return pointer to the end of buf */ 
static char* innobase_convert_identifier ( 
/*========================*/ 
char* buf, /*!< out: buffer for converted identifier */ 
ulint buflen, /*!< in: length of buf, in bytes */ 
const char * id, /*!< in: identifier to convert */ 
ulint idlen, /*!< in: length of id, in bytes */ 
void* thd, /*!< in: MySQL connection thread, or NULL */ 
ibool file_id) /*!< in: TRUE=id is a table or database name; 
FALSE=id is an UTF-8 string */ 


順著線索向上查找,發現在有兩個位置調用了innobase_convert_identifier 函數,分兩個線索繼續查找。 

線索一: 
ha_innodb.cc:2034 
調用innodb_convert_identifier函數 

復制代碼代碼如下:


/*****************************************************************//** 
Convert a table or index name to the MySQL system_charset_info (UTF-8) 
and quote it if needed. 
@return pointer to the end of buf */ 
extern "C" UNIV_INTERN char* innobase_convert_name ( 
/*==================*/ 
char* buf, /*!< out: buffer for converted identifier */ 
ulint buflen, /*!< in: length of buf, in bytes */ 
const char * id, /*!< in: identifier to convert */ 
ulint idlen, /*!< in: length of id, in bytes */ 
void* thd, /*!< in: MySQL connection thread, or NULL */ 
ibool table_id) /*!< in: TRUE=id is a table or database name; 
FALSE=id is an index name */ 


從函數定義和函數功能來看,該函數是將mysql的表名或者索引名轉換成utf8,與字符集相關。查看現有數據庫字符集和生成的臨時表字符集均為lanti1,推斷是可能的原因之一。 
處理方式: 
修改數據庫的字符集為utf8,觀察數據庫是否仍然出現該錯誤。 

線索二: 

復制代碼代碼如下:


ha_innodb.cc:6269 
調用innodb_convert_identifier函數 
/*****************************************************************//** 
Creates a table definition to an InnoDB database. */ 
static create_table_def ( 
/*=============*/ 
trx_t* trx, /*!< in: InnoDB transaction handle */ 
TABLE* form, /*!< in: information on table 
columns and indexes */ 
const char * table_name, /*!< in: table name */ 
const char * path_of_temp_table, /*!< in: if this is a table explicitly 
created by the user with the 
TEMPORARY keyword, then this 
parameter is the dir path where the 
table should be placed if we create 
an .ibd file for it (no .ibd extension 
in the path, though); otherwise this 
is NULL */ 
ulint flags) /*!< in: table flags */ 


在create_table_def 函數中,調用row_create_table_for_mysql函數后,當返回值為DB_DUPLICATE_KEY時,調用innodb_convert_identifier,從而觸發該warning。 

復制代碼代碼如下:


row0mysql.c:1820 
UNIV_INTERN int row_create_table_for_mysql( 
/*=======================*/ 
dict_table_t* table, /*!< in, own: table definition 
(will be freed) */ 
trx_t* trx) /*!< in: transaction handle */ 


該函數中調用了更深層次的函數,但從調試代碼來看,暫時沒有發現導致該問題的點。 
處理方式: 
在線索一中的處理方式不能解決問題的情況下,再進行進一步的代碼分析。 
總結: 
經過以上代碼調試和分析,得出兩條線索,但是一直未能重現該問題。因此,目前只能對現有服務器進行線索一的處理。如果按照線索一處理方式處理后,仍然出現該問題,將對第二步進行深入的分析。 

作者 king_wangheng

延伸 · 閱讀

精彩推薦
Weibo Article 1 Weibo Article 2 Weibo Article 3 Weibo Article 4 Weibo Article 5 Weibo Article 6 Weibo Article 7 Weibo Article 8 Weibo Article 9 Weibo Article 10 Weibo Article 11 Weibo Article 12 Weibo Article 13 Weibo Article 14 Weibo Article 15 Weibo Article 16 Weibo Article 17 Weibo Article 18 Weibo Article 19 Weibo Article 20 Weibo Article 21 Weibo Article 22 Weibo Article 23 Weibo Article 24 Weibo Article 25 Weibo Article 26 Weibo Article 27 Weibo Article 28 Weibo Article 29 Weibo Article 30 Weibo Article 31 Weibo Article 32 Weibo Article 33 Weibo Article 34 Weibo Article 35 Weibo Article 36 Weibo Article 37 Weibo Article 38 Weibo Article 39 Weibo Article 40
主站蜘蛛池模板: 日韩精品在线播放 | 特黄特黄的视频 | 日韩在线一区二区三区免费视频 | www.夜夜爽 | 欧美午夜精品久久久久久浪潮 | 日韩免费| 狠狠天天 | 一本大道久久a久久精二百 在线a人片免费观看视频 | 欧美wwwsss9999 | 一区二区三区精品 | 日韩在线视频在线观看 | 犬夜叉在线观看 | 亚洲区视频 | 亚洲一区精品在线 | 日韩中文字幕一区二区三区 | 91资源在线| 精品96久久久久久中文字幕无 | 日韩一区二区不卡 | av中文在线 | av网站有哪些 | 中文字幕国产一区 | yw193com尤物 | 黄色片视频在线播放 | 亚洲精品国产一区 | 美日韩一区 | 欧美在线免费视频 | 午夜精品久久久久久 | 亚洲成av人片在线观看无码 | 午夜视频在线免费观看 | 国产欧美精品一区二区三区四区 | 免费av一区二区三区 | 91精品国产日韩91久久久久久 | 高清日韩av | 国产在线精品一区二区三区 | 亚洲国产成人精品女人久久久 | 精品免费 | 国产精品视频免费看 | av片免费看| 国产成人精品一区二区三区视频 | 91精品国产欧美一区二区成人 | 国产精品永久免费视频 |