mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-owner2-5.0 sql/sql_acl.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.h: Auto merged mysql-test/r/func_in.result: merge mysql-test/r/lowercase_view.result: merge mysql-test/r/mysqldump.result: merge mysql-test/r/sql_mode.result: merge mysql-test/r/temp_table.result: merge mysql-test/r/view.result: merge mysql-test/t/view.test: merge
This commit is contained in:
@ -42,7 +42,7 @@ static TYPELIB grant_types = { sizeof(grant_names)/sizeof(char **),
|
||||
static int
|
||||
store_create_info(THD *thd, TABLE_LIST *table_list, String *packet);
|
||||
static int
|
||||
view_store_create_info(THD *thd, TABLE_LIST *table, String *packet);
|
||||
view_store_create_info(THD *thd, TABLE_LIST *table, String *buff);
|
||||
static bool schema_table_store_record(THD *thd, TABLE *table);
|
||||
|
||||
|
||||
@ -1035,6 +1035,34 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet)
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
void
|
||||
view_store_options(THD *thd, TABLE_LIST *table, String *buff)
|
||||
{
|
||||
buff->append("ALGORITHM=", 10);
|
||||
switch ((int8)table->algorithm) {
|
||||
case VIEW_ALGORITHM_UNDEFINED:
|
||||
buff->append("UNDEFINED ", 10);
|
||||
break;
|
||||
case VIEW_ALGORITHM_TMPTABLE:
|
||||
buff->append("TEMPTABLE ", 10);
|
||||
break;
|
||||
case VIEW_ALGORITHM_MERGE:
|
||||
buff->append("MERGE ", 6);
|
||||
break;
|
||||
default:
|
||||
DBUG_ASSERT(0); // never should happen
|
||||
}
|
||||
buff->append("DEFINER=", 8);
|
||||
append_identifier(thd, buff,
|
||||
table->definer.user.str, table->definer.user.length);
|
||||
buff->append('@');
|
||||
append_identifier(thd, buff,
|
||||
table->definer.host.str, table->definer.host.length);
|
||||
if (table->view_suid)
|
||||
buff->append(" SQL SECURITY DEFINER ", 22);
|
||||
else
|
||||
buff->append(" SQL SECURITY INVOKER ", 22);
|
||||
}
|
||||
|
||||
static int
|
||||
view_store_create_info(THD *thd, TABLE_LIST *table, String *buff)
|
||||
@ -1071,21 +1099,7 @@ view_store_create_info(THD *thd, TABLE_LIST *table, String *buff)
|
||||
buff->append("CREATE ", 7);
|
||||
if (!foreign_db_mode)
|
||||
{
|
||||
buff->append("ALGORITHM=", 10);
|
||||
switch((int8)table->algorithm)
|
||||
{
|
||||
case VIEW_ALGORITHM_UNDEFINED:
|
||||
buff->append("UNDEFINED ", 10);
|
||||
break;
|
||||
case VIEW_ALGORITHM_TMPTABLE:
|
||||
buff->append("TEMPTABLE ", 10);
|
||||
break;
|
||||
case VIEW_ALGORITHM_MERGE:
|
||||
buff->append("MERGE ", 6);
|
||||
break;
|
||||
default:
|
||||
DBUG_ASSERT(0); // never should happen
|
||||
}
|
||||
view_store_options(thd, table, buff);
|
||||
}
|
||||
buff->append("VIEW ", 5);
|
||||
if (!table->compact_view_format)
|
||||
|
Reference in New Issue
Block a user