Commit 3cdb85a0 authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

ufter review fix

parent f1bbfdf4
...@@ -330,7 +330,7 @@ err: ...@@ -330,7 +330,7 @@ err:
/* index of revision number in following table */ /* index of revision number in following table */
static const int revision_number_position= 5; static const int revision_number_position= 5;
/* index of last required parameter for making view */ /* index of last required parameter for making view */
static const int last_parameter= 8; static const int required_view_parameters= 7;
static char *view_field_names[]= static char *view_field_names[]=
{ {
...@@ -338,7 +338,6 @@ static char *view_field_names[]= ...@@ -338,7 +338,6 @@ static char *view_field_names[]=
(char*)"md5", (char*)"md5",
(char*)"updatable", (char*)"updatable",
(char*)"algorithm", (char*)"algorithm",
(char*)"syscharset",
(char*)"revision", (char*)"revision",
(char*)"timestamp", (char*)"timestamp",
(char*)"create-version", (char*)"create-version",
...@@ -355,15 +354,13 @@ static File_option view_parameters[]= ...@@ -355,15 +354,13 @@ static File_option view_parameters[]=
FILE_OPTIONS_ULONGLONG}, FILE_OPTIONS_ULONGLONG},
{{view_field_names[3], 9}, offsetof(TABLE_LIST, algorithm), {{view_field_names[3], 9}, offsetof(TABLE_LIST, algorithm),
FILE_OPTIONS_ULONGLONG}, FILE_OPTIONS_ULONGLONG},
{{view_field_names[4], 10}, offsetof(TABLE_LIST, syscharset), {{view_field_names[4], 8}, offsetof(TABLE_LIST, revision),
FILE_OPTIONS_STRING},
{{view_field_names[5], 8}, offsetof(TABLE_LIST, revision),
FILE_OPTIONS_REV}, FILE_OPTIONS_REV},
{{view_field_names[6], 9}, offsetof(TABLE_LIST, timestamp), {{view_field_names[5], 9}, offsetof(TABLE_LIST, timestamp),
FILE_OPTIONS_TIMESTAMP}, FILE_OPTIONS_TIMESTAMP},
{{view_field_names[7], 14}, offsetof(TABLE_LIST, file_version), {{view_field_names[6], 14}, offsetof(TABLE_LIST, file_version),
FILE_OPTIONS_ULONGLONG}, FILE_OPTIONS_ULONGLONG},
{{view_field_names[8], 6}, offsetof(TABLE_LIST, source), {{view_field_names[7], 6}, offsetof(TABLE_LIST, source),
FILE_OPTIONS_ESTRING}, FILE_OPTIONS_ESTRING},
{{NULL, 0}, 0, {{NULL, 0}, 0,
FILE_OPTIONS_STRING} FILE_OPTIONS_STRING}
...@@ -482,8 +479,6 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, ...@@ -482,8 +479,6 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
view->query.length= str.length()-1; // we do not need last \0 view->query.length= str.length()-1; // we do not need last \0
view->source.str= thd->query; view->source.str= thd->query;
view->source.length= thd->query_length; view->source.length= thd->query_length;
view->syscharset.str= (char *)system_charset_info->csname;
view->syscharset.length= strlen(view->syscharset.str);
view->file_version= 1; view->file_version= 1;
view->calc_md5(md5); view->calc_md5(md5);
view->md5.str= md5; view->md5.str= md5;
...@@ -569,7 +564,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) ...@@ -569,7 +564,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
be used here be used here
*/ */
if (parser->parse((gptr)table, &thd->mem_root, view_parameters, if (parser->parse((gptr)table, &thd->mem_root, view_parameters,
last_parameter)) required_view_parameters))
goto err; goto err;
/* /*
...@@ -622,18 +617,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) ...@@ -622,18 +617,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
thd->options&= ~(MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | thd->options&= ~(MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES); MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES);
CHARSET_INFO *save_cs= thd->variables.character_set_client; CHARSET_INFO *save_cs= thd->variables.character_set_client;
if (!table->syscharset.length) thd->variables.character_set_client= system_charset_info;
thd->variables.character_set_client= system_charset_info;
else
{
if (!(thd->variables.character_set_client=
get_charset_by_csname(table->syscharset.str,
MY_CS_PRIMARY, MYF(MY_WME))))
{
thd->variables.character_set_client= save_cs;
goto err;
}
}
res= yyparse((void *)thd); res= yyparse((void *)thd);
thd->variables.character_set_client= save_cs; thd->variables.character_set_client= save_cs;
thd->options= options; thd->options= options;
......
...@@ -224,9 +224,8 @@ typedef struct st_table_list ...@@ -224,9 +224,8 @@ typedef struct st_table_list
LEX_STRING view_db; /* save view database */ LEX_STRING view_db; /* save view database */
LEX_STRING view_name; /* save view name */ LEX_STRING view_name; /* save view name */
LEX_STRING timestamp; /* GMT time stamp of last operation */ LEX_STRING timestamp; /* GMT time stamp of last operation */
LEX_STRING syscharset; /* charset of VIEW query text*/
ulonglong file_version; /* version of file's field set */ ulonglong file_version; /* version of file's field set */
ulonglong updatable_view; /* VIEW can be updated */ ulonglong updatable_view; /* VIEW can be updated */
ulonglong revision; /* revision control number */ ulonglong revision; /* revision control number */
ulonglong algorithm; /* 0 any, 1 tmp tables , 2 merging */ ulonglong algorithm; /* 0 any, 1 tmp tables , 2 merging */
uint effective_algorithm; /* which algorithm was really used */ uint effective_algorithm; /* which algorithm was really used */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment