mirror of
https://github.com/MariaDB/server.git
synced 2026-05-08 08:04:29 +02:00
merge
sql/sql_insert.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_update.cc: Auto merged sql/share/czech/errmsg.txt: Auto merged sql/share/danish/errmsg.txt: Auto merged sql/share/dutch/errmsg.txt: Auto merged sql/share/english/errmsg.txt: Auto merged sql/share/estonian/errmsg.txt: Auto merged sql/share/french/errmsg.txt: Auto merged sql/share/german/errmsg.txt: Auto merged sql/share/greek/errmsg.txt: Auto merged sql/share/hungarian/errmsg.txt: Auto merged sql/share/italian/errmsg.txt: Auto merged sql/share/japanese/errmsg.txt: Auto merged sql/share/korean/errmsg.txt: Auto merged sql/share/norwegian-ny/errmsg.txt: Auto merged sql/share/norwegian/errmsg.txt: Auto merged sql/share/polish/errmsg.txt: Auto merged sql/share/portuguese/errmsg.txt: Auto merged sql/share/romanian/errmsg.txt: Auto merged sql/share/russian/errmsg.txt: Auto merged sql/share/serbian/errmsg.txt: Auto merged sql/share/slovak/errmsg.txt: Auto merged sql/share/spanish/errmsg.txt: Auto merged sql/share/swedish/errmsg.txt: Auto merged sql/share/ukrainian/errmsg.txt: Auto merged sql/table.h: Auto merged
This commit is contained in:
commit
c05fbd4c0b
33 changed files with 330 additions and 29 deletions
|
|
@ -317,7 +317,6 @@ static const int required_view_parameters= 7;
|
|||
Note that one should NOT change the order for this, as it's used by
|
||||
parse()
|
||||
*/
|
||||
|
||||
static File_option view_parameters[]=
|
||||
{{{(char*) "query", 5}, offsetof(TABLE_LIST, query),
|
||||
FILE_OPTIONS_STRING},
|
||||
|
|
@ -327,6 +326,8 @@ static File_option view_parameters[]=
|
|||
FILE_OPTIONS_ULONGLONG},
|
||||
{{(char*) "algorithm", 9}, offsetof(TABLE_LIST, algorithm),
|
||||
FILE_OPTIONS_ULONGLONG},
|
||||
{{"with_check_option", 17}, offsetof(TABLE_LIST, with_check),
|
||||
FILE_OPTIONS_ULONGLONG},
|
||||
{{(char*) "revision", 8}, offsetof(TABLE_LIST, revision),
|
||||
FILE_OPTIONS_REV},
|
||||
{{(char*) "timestamp", 9}, offsetof(TABLE_LIST, timestamp),
|
||||
|
|
@ -407,7 +408,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
|
|||
if (mode == VIEW_CREATE_NEW)
|
||||
{
|
||||
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), view->alias);
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
if (!(parser= sql_parse_prepare(&path, &thd->mem_root, 0)))
|
||||
|
|
@ -418,7 +419,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
|
|||
{
|
||||
my_error(ER_WRONG_OBJECT, MYF(0), (view->db ? view->db : thd->db),
|
||||
view->real_name, "VIEW");
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -430,7 +431,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
|
|||
if (parser->parse((gptr)view, &thd->mem_root,
|
||||
view_parameters + revision_number_position, 1))
|
||||
{
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(thd->net.report_error? -1 : 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -438,7 +439,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
|
|||
if (mode == VIEW_ALTER)
|
||||
{
|
||||
my_error(ER_NO_SUCH_TABLE, MYF(0), view->db, view->alias);
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -460,6 +461,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
|
|||
thd->lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED;
|
||||
}
|
||||
view->algorithm= thd->lex->create_view_algorithm;
|
||||
view->with_check= thd->lex->create_view_check;
|
||||
if ((view->updatable_view= (can_be_merged &&
|
||||
view->algorithm != VIEW_ALGORITHM_TMPTABLE)))
|
||||
{
|
||||
|
|
@ -475,10 +477,18 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (view->with_check != VIEW_CHECK_NONE &&
|
||||
!view->updatable_view)
|
||||
{
|
||||
my_error(ER_VIEW_NONUPD_CHECK, MYF(0));
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
if (sql_create_definition_file(&dir, &file, view_file_type,
|
||||
(gptr)view, view_parameters, 3))
|
||||
{
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(thd->net.report_error? -1 : 1);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
|
@ -707,6 +717,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
|
|||
DBUG_PRINT("info", ("algorithm: TEMPORARY TABLE"));
|
||||
lex->select_lex.linkage= DERIVED_TABLE_TYPE;
|
||||
table->updatable= 0;
|
||||
table->with_check= VIEW_CHECK_NONE;
|
||||
|
||||
/* SELECT tree link */
|
||||
lex->unit.include_down(table->select_lex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue