mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Cleanup of new code pushed into 5.0 since last pull
Merged the different find_xxxx_table_in_list functions to one + some inline functions mysql-test/r/view.result: Fix result (remove not used view from show tables) sql/item_subselect.cc: Remove not used functions sql/item_subselect.h: Remove not used functions sql/mysql_priv.h: Merged the different find_xxxx_table_in_list functions to one + some inline functions sql/sql_acl.cc: More debugging + simple cleanups sql/sql_base.cc: Merged the different find_xxxx_table_in_list functions to one + some inline functions Indentation cleanups & more comments sql/sql_delete.cc: Namechange sql/sql_insert.cc: Simple optimizations & Style cleanups Merged common code (in mysql_prepare_insert_check_table) sql/sql_lex.cc: function name changes More comments sql/sql_parse.cc: Function name changes Made check_one_table_access returning bool More debugging in 'check_access' Added function 'check_some_access', which is used when creating a view sql/sql_prepare.cc: Resetting flag directly after test makes code easier to read sql/sql_select.cc: Code simplifications sql/sql_show.cc: Indentation cleanups. Fixed typo in name sql/sql_update.cc: Function name change sql/sql_view.cc: Simple optimizations. Style fixes. Remove view_field_names[] Simplified 'check_key_in_view()' sql/table.cc: Simplified new code in openfrm() variable name change i -> item Indentation changes sql/table.h: Fixed typo in variable name Method name change in field iterator: end() -> end_of_fields() tests/client_test.c: Changed number to macro
This commit is contained in:
@ -225,25 +225,18 @@ int handle_select(THD *thd, LEX *lex, select_result *result)
|
||||
thd->net.report_error));
|
||||
if (thd->net.report_error)
|
||||
res= 1;
|
||||
if (res > 0)
|
||||
if (unlikely(res))
|
||||
{
|
||||
if (result)
|
||||
{
|
||||
result->send_error(0, NullS);
|
||||
if (res > 0)
|
||||
result->send_error(0, NullS);
|
||||
result->abort();
|
||||
}
|
||||
else
|
||||
else if (res > 0)
|
||||
send_error(thd, 0, NullS);
|
||||
res= 1; // Error sent to client
|
||||
}
|
||||
if (res < 0)
|
||||
{
|
||||
if (result)
|
||||
{
|
||||
result->abort();
|
||||
}
|
||||
res= 1;
|
||||
}
|
||||
if (result != lex->result)
|
||||
delete result;
|
||||
DBUG_RETURN(res);
|
||||
@ -348,9 +341,7 @@ JOIN::prepare(Item ***rref_pointer_array,
|
||||
if ((subselect= select_lex->master_unit()->item))
|
||||
{
|
||||
Item_subselect::trans_res res;
|
||||
if ((res= ((!thd->lex->view_prepare_mode) ?
|
||||
subselect->select_transformer(this) :
|
||||
subselect->no_select_transform())) !=
|
||||
if ((res= subselect->select_transformer(this)) !=
|
||||
Item_subselect::RES_OK)
|
||||
{
|
||||
select_lex->fix_prepare_information(thd, &conds);
|
||||
@ -11192,7 +11183,7 @@ int mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
|
||||
SYNOPSIS
|
||||
print_join()
|
||||
thd thread handler
|
||||
str string where table should bbe printed
|
||||
str string where table should be printed
|
||||
tables list of tables in join
|
||||
*/
|
||||
|
||||
@ -11248,30 +11239,31 @@ void st_table_list::print(THD *thd, String *str)
|
||||
print_join(thd, str, &nested_join->join_list);
|
||||
str->append(')');
|
||||
}
|
||||
else if (view_name.str)
|
||||
{
|
||||
str->append(view_db.str, view_db.length);
|
||||
str->append('.');
|
||||
str->append(view_name.str, view_name.length);
|
||||
if (my_strcasecmp(table_alias_charset, view_name.str, alias))
|
||||
{
|
||||
str->append(' ');
|
||||
str->append(alias);
|
||||
}
|
||||
}
|
||||
else if (derived)
|
||||
{
|
||||
str->append('(');
|
||||
derived->print(str);
|
||||
str->append(") ", 2);
|
||||
str->append(alias);
|
||||
}
|
||||
else
|
||||
{
|
||||
str->append(db);
|
||||
str->append('.');
|
||||
str->append(real_name);
|
||||
if (my_strcasecmp(table_alias_charset, real_name, alias))
|
||||
const char *cmp_name; // Name to compare with alias
|
||||
if (view_name.str)
|
||||
{
|
||||
str->append(view_db.str, view_db.length);
|
||||
str->append('.');
|
||||
str->append(view_name.str, view_name.length);
|
||||
cmp_name= view_name.str;
|
||||
}
|
||||
else if (derived)
|
||||
{
|
||||
str->append('(');
|
||||
derived->print(str);
|
||||
str->append(')');
|
||||
cmp_name= ""; // Force printing of alias
|
||||
}
|
||||
else
|
||||
{
|
||||
str->append(db);
|
||||
str->append('.');
|
||||
str->append(real_name);
|
||||
cmp_name= real_name;
|
||||
}
|
||||
if (my_strcasecmp(table_alias_charset, cmp_name, alias))
|
||||
{
|
||||
str->append(' ');
|
||||
str->append(alias);
|
||||
@ -11279,6 +11271,7 @@ void st_table_list::print(THD *thd, String *str)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void st_select_lex::print(THD *thd, String *str)
|
||||
{
|
||||
if (!thd)
|
||||
|
Reference in New Issue
Block a user