mysql 服务器端命令源码(四)--show create table / view
2014-06-06 17:15
1156 查看
bool
mysqld_show_create(THD *thd, TABLE_LIST *table_list)
{
Protocol *protocol= thd->protocol;
char buff[2048];
String buffer(buff, sizeof(buff), system_charset_info);
DBUG_ENTER("mysqld_show_create");
DBUG_PRINT("enter",("db: %s table: %s",table_list->db,
table_list->table_name));
/* We want to preserve the tree for views. */
thd->lex->view_prepare_mode= TRUE;
{
Show_create_error_handler view_error_suppressor(thd, table_list);
thd->push_internal_handler(&view_error_suppressor);
bool error= open_normal_and_derived_tables(thd, table_list, 0);
thd->pop_internal_handler();
if (error && (thd->killed || thd->is_error()))
DBUG_RETURN(TRUE);
}
/* TODO: add environment variables show when it become possible */
if (thd->lex->only_view && !table_list->view)
{
my_error(ER_WRONG_OBJECT, MYF(0),
table_list->db, table_list->table_name, "VIEW");
DBUG_RETURN(TRUE);
}
视图和表展示的区别
mysqld_show_create(THD *thd, TABLE_LIST *table_list)
{
Protocol *protocol= thd->protocol;
char buff[2048];
String buffer(buff, sizeof(buff), system_charset_info);
DBUG_ENTER("mysqld_show_create");
DBUG_PRINT("enter",("db: %s table: %s",table_list->db,
table_list->table_name));
/* We want to preserve the tree for views. */
thd->lex->view_prepare_mode= TRUE;
{
Show_create_error_handler view_error_suppressor(thd, table_list);
thd->push_internal_handler(&view_error_suppressor);
bool error= open_normal_and_derived_tables(thd, table_list, 0);
thd->pop_internal_handler();
if (error && (thd->killed || thd->is_error()))
DBUG_RETURN(TRUE);
}
/* TODO: add environment variables show when it become possible */
if (thd->lex->only_view && !table_list->view)
{
my_error(ER_WRONG_OBJECT, MYF(0),
table_list->db, table_list->table_name, "VIEW");
DBUG_RETURN(TRUE);
}
视图和表展示的区别
相关文章推荐
- mysql 服务器端命令源码(五)--show create database
- MySQL- SHOW TABLE STATUS命令
- MySQL- SHOW TABLE STATUS命令
- Oracle中实现MySQL show index from table命令SQL脚本分享
- oracle中与mysql中的命令 show databases, show tables, desc table类似的命令集
- Oracle如何实现类似MySQL的show create table,show index的功能
- MySQL show create table
- MySQL- SHOW TABLE STATUS命令
- HBase createTable 的服务器端实现源码分析
- MySQL- SHOW TABLE STATUS命令
- mysql复制命令源码分析(一)show slave status
- mysql 服务器端命令源码(二) Show authors
- oracle中与mysql中的命令 show databases, show tables, desc table类似的命令集
- MySQL维护命令集锦--查看表的状态(show table status)
- oracle中与mysql中的命令 show databases, show tables, desc table类似的命令集
- mysql 服务器端命令源码(六)--show privileges
- mysql5.5基础 show create table...\G 查看创建表时候用的SQL语句
- MySQL- SHOW TABLE STATUS命令
- Oracle中实现MySQL show index from table命令SQL脚本分享
- mysql 服务器端命令源码(三)--show contributors