标签:
http://guduwhuzhe.iteye.com/blog/1887619
create table的调用路径如下(5.1.58): do_command(sql_parse.cc) ->dispatch_command(sql_parse.cc) ->mysql_parse(sql_parse.cc) ->mysql_execute_command(sql_parse.cc) ->mysql_create_table(sql_table.cc) ->mysql_create_table_nolock(sql_table.cc),这里会持有LOCK_open ->rea_create_table(unireg.cc) ->mysql_create_frm(unireg.cc) ->ha_create_table(handler.cc) ->handler::ha_create(handler.cc) ->ha_innodb::create(handler/ha_innodb.cc) ->create_table_def(handler/ha_innodb.cc), ->row_create_table_for_mysql(row/row0mysql.c) ->create_clustered_index_when_no_primary(handler/ha_innodb.cc)..when no primary key is defined.. ->row_create_index_for_mysql(row/row0mysql.c) ->create_index(hanler/ha_innodb.cc) ->row_table_add_foreign_constraints(row/row0mysql.c)
标签:
原文地址:http://www.cnblogs.com/taek/p/5073395.html