Skip to content

Commit

Permalink
sql_print_information corrected
Browse files Browse the repository at this point in the history
as checksum/swap don't always occur
  • Loading branch information
grooverdan committed Apr 13, 2015
1 parent 622891c commit 76c18f7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions sql/sql_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,8 @@ int mariadb_fix_view(THD *thd, TABLE_LIST *view, bool wrong_checksum,
else
view->algorithm= VIEW_ALGORITHM_MERGE;
}
else
swap_alg= 0;
if (wrong_checksum)
{
if (view->md5.length != 32)
Expand All @@ -875,10 +877,14 @@ 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': algorithm swapped to '%s'",
view->db, view->table_name,
(view->algorithm == VIEW_ALGORITHM_MERGE)?
"MERGE":"TEMPTABLE");
sql_print_information("View '%-.192s'.'%-.192s': versioned to %llu%s%s",
view->db, view->table_name, view->mariadb_version,
(wrong_checksum ? ", and checksum corrected" : ""),
(swap_alg ?
((view->algorithm == VIEW_ALGORITHM_MERGE) ?
", and algorithm swapped to 'MERGE'"
: ", and algorithm swapped to 'TEMPTABLE'")
: ""));


DBUG_RETURN(HA_ADMIN_OK);
Expand Down

0 comments on commit 76c18f7

Please sign in to comment.