diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-04-28 21:24:32 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-04-29 12:40:52 +0200 |
commit | 6f17e233bf7f4de20dda8fb31f63aa52452c4e0a (patch) | |
tree | 0163788e8e192b2eb76e8abe807c02687afd02a0 /sql | |
parent | f9c02d7c29e7ddc9fa274e7fe23e5800653660f4 (diff) | |
download | mariadb-git-6f17e233bf7f4de20dda8fb31f63aa52452c4e0a.tar.gz |
post-merge fixes
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_admin.cc | 11 | ||||
-rw-r--r-- | sql/sql_view.cc | 46 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 14 |
3 files changed, 25 insertions, 46 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 65292a526fa..44057b6220e 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -869,7 +869,16 @@ send_result_message: size_t length; protocol->store(STRING_WITH_LEN("error"), system_charset_info); - if (table->table->file->ha_table_flags() & HA_CAN_REPAIR) +#if MYSQL_VERSION_ID > 100104 +#error fix the error message to take TABLE or VIEW as an argument +#else + if (table->view) + length= my_snprintf(buf, sizeof(buf), + "Upgrade required. Please do \"REPAIR VIEW %`s\" or dump/reload to fix it!", + table->table_name); + else +#endif + if (table->table->file->ha_table_flags() & HA_CAN_REPAIR || table->view) length= my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE), table->table_name); else diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 24f01aeaa76..47b238715ac 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -828,25 +828,6 @@ int mariadb_fix_view(THD *thd, TABLE_LIST *view, bool wrong_checksum, if (!view->timestamp.str) view->timestamp.str= view->timestamp_buffer; - /* check old .frm */ - { - char path_buff[FN_REFLEN]; - LEX_STRING path; - File_parser *parser; - - path.str= path_buff; - fn_format(path_buff, file.str, dir.str, "", MY_UNPACK_FILENAME); - path.length= strlen(path_buff); - if (access(path.str, F_OK)) - DBUG_RETURN(HA_ADMIN_INVALID); - - if (!(parser= sql_parse_prepare(&path, thd->mem_root, 0))) - DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR); - - if (!parser->ok() || !is_equal(&view_type, parser->type())) - DBUG_RETURN(HA_ADMIN_INVALID); - } - if (swap_alg && view->algorithm != VIEW_ALGORITHM_UNDEFINED) { DBUG_ASSERT(view->algorithm == VIEW_ALGORITHM_MERGE || @@ -877,13 +858,13 @@ int mariadb_fix_view(THD *thd, TABLE_LIST *view, bool wrong_checksum, view->db, view->table_name); DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR); } - sql_print_information("View '%-.192s'.'%-.192s': versioned to %llu%s%s", + sql_print_information("View %`s.%`s: the version is set to %llu%s%s", view->db, view->table_name, view->mariadb_version, - (wrong_checksum ? ", and checksum corrected" : ""), + (wrong_checksum ? ", checksum corrected" : ""), (swap_alg ? ((view->algorithm == VIEW_ALGORITHM_MERGE) ? - ", and algorithm swapped to 'MERGE'" - : ", and algorithm swapped to 'TEMPTABLE'") + ", algorithm restored to be MERGE" + : ", algorithm restored to be TEMPTABLE") : "")); @@ -2046,20 +2027,15 @@ int view_checksum(THD *thd, TABLE_LIST *view) */ int view_check(THD *thd, TABLE_LIST *view, HA_CHECK_OPT *check_opt) { - int res; DBUG_ENTER("view_check"); - if ((res= view_checksum(thd, view)) != HA_ADMIN_OK) + + int res= view_checksum(thd, view); + if (res != HA_ADMIN_OK) DBUG_RETURN(res); - if (((check_opt->sql_flags & TT_FOR_UPGRADE) && - !view->mariadb_version)) - { - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, - ER_TABLE_NEEDS_UPGRADE, - ER(ER_TABLE_NEEDS_UPGRADE), - view->db, - view->table_name); + + if (((check_opt->sql_flags & TT_FOR_UPGRADE) && !view->mariadb_version)) DBUG_RETURN(HA_ADMIN_NEEDS_UPGRADE); - } + DBUG_RETURN(HA_ADMIN_OK); } @@ -2080,7 +2056,7 @@ int view_repair(THD *thd, TABLE_LIST *view, HA_CHECK_OPT *check_opt) { DBUG_ENTER("view_repair"); bool swap_alg= (check_opt->sql_flags & TT_FROM_MYSQL); - bool wrong_checksum= view_checksum(thd, view); + bool wrong_checksum= view_checksum(thd, view) != HA_ADMIN_OK; int ret; if (wrong_checksum || swap_alg || (!view->mariadb_version)) { diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 8f135e63113..cc16101c38b 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -13806,19 +13806,13 @@ lock: ; table_or_tables: - TABLE_SYM - { Lex->only_view= FALSE; } - | TABLES - { Lex->only_view= FALSE; } + TABLE_SYM { Lex->only_view= FALSE; } + | TABLES { Lex->only_view= FALSE; } ; table_or_view: - TABLE_SYM - { Lex->only_view= FALSE; } - | TABLES - { Lex->only_view= FALSE; } - | VIEW_SYM - { Lex->only_view= TRUE; } + table_or_tables + | VIEW_SYM { Lex->only_view= TRUE; } ; table_lock_list: |