mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
errors without code removed
net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed (WL#2133) include/mysqld_error.h: new errors added. mysql-test/r/rpl_charset.result: new error mysql-test/r/rpl_timezone.result: new error mysql-test/r/sp-security.result: more clean error message mysql-test/r/sp.result: now error state intercepted correctly mysql-test/t/connect.test: new error message mysql-test/t/rpl_charset.test: new error message mysql-test/t/rpl_timezone.test: new error mysql-test/t/sp-security.test: more correct error handling mysql-test/t/sp.test: now error state intercepted correctly sql/ha_innodb.cc: -1/1 (sent/unsent) error reporting removed sql/ha_innodb.h: -1/1 (sent/unsent) error reporting removed sql/item.cc: only boolean values should be returned by fix_fields() sql/item_cmpfunc.cc: only boolean values should be returned by fix_fields() sql/item_func.cc: only boolean values should be returned by fix_fields() net_printf/send_error calls replaced by my_error family functions sql/item_row.cc: only boolean values should be returned by fix_fields() sql/item_subselect.cc: only boolean values should be returned by fix_fields() -1/1 (sent/unsent) error reporting removed sql/item_subselect.h: -1/1 (sent/unsent) error reporting removed sql/item_sum.cc: only boolean values should be returned by fix_fields() sql/item_timefunc.cc: only boolean values should be returned by fix_fields() sql/item_uniq.h: only boolean values should be returned by fix_fields() sql/mysql_priv.h: -1/1 (sent/unsent) error reporting removed sql/mysqld.cc: net_printf/send_error calls replaced by my_error family functions changes in my_message_sql to support error handling correctly sql/protocol.cc: net_printf/send_error calls replaced by my_error family functions sql/protocol_cursor.cc: net_printf/send_error calls replaced by my_error family functions sql/repl_failsafe.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/repl_failsafe.h: -1/1 (sent/unsent) error reporting removed sql/set_var.cc: net_printf/send_error calls replaced by my_error family functions sql/share/czech/errmsg.txt: new error messages sql/share/danish/errmsg.txt: new error messages sql/share/dutch/errmsg.txt: new error messages sql/share/english/errmsg.txt: new error messages sql/share/estonian/errmsg.txt: new error messages sql/share/french/errmsg.txt: new error messages sql/share/german/errmsg.txt: new error messages sql/share/greek/errmsg.txt: new error messages sql/share/hungarian/errmsg.txt: new error messages sql/share/italian/errmsg.txt: new error messages sql/share/japanese/errmsg.txt: new error messages sql/share/korean/errmsg.txt: new error messages sql/share/norwegian-ny/errmsg.txt: new error messages sql/share/norwegian/errmsg.txt: new error messages sql/share/polish/errmsg.txt: new error messages sql/share/portuguese/errmsg.txt: new error messages sql/share/romanian/errmsg.txt: new error messages sql/share/russian/errmsg.txt: new error messages sql/share/serbian/errmsg.txt: new error messages sql/share/slovak/errmsg.txt: new error messages sql/share/spanish/errmsg.txt: new error messages sql/share/swedish/errmsg.txt: new error messages sql/share/ukrainian/errmsg.txt: new error messages sql/slave.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/slave.h: -1/1 (sent/unsent) error reporting removed sql/sp.cc: net_printf/send_error calls replaced by my_error family functions sql/sp_head.cc: new eror handling support net_printf/send_error calls replaced by my_error family functions sql/sp_rcontext.cc: net_printf/send_error calls replaced by my_error family functions sql/sql_acl.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_acl.h: -1/1 (sent/unsent) error reporting removed sql/sql_base.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_class.cc: net_printf/send_error calls replaced by my_error family functions sql/sql_class.h: my_messhage_sql now set/reset query_error flag sql/sql_db.cc: -1/1 (sent/unsent) error reporting removed sql/sql_delete.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_do.cc: -1/1 (sent/unsent) error reporting removed sql/sql_error.cc: -1/1 (sent/unsent) error reporting removed sql/sql_handler.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_help.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_insert.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_lex.h: -1/1 (sent/unsent) error reporting removed sql/sql_load.cc: -1/1 (sent/unsent) error reporting removed sql/sql_map.cc: errors without code removed sql/sql_parse.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed from mysql_execute_command sql/sql_prepare.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_repl.cc: error messages fixed net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_repl.h: -1/1 (sent/unsent) error reporting removed sql/sql_select.cc: -1/1 (sent/unsent) error reporting removed sql/sql_select.h: -1/1 (sent/unsent) error reporting removed sql/sql_show.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_table.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_trigger.cc: -1/1 (sent/unsent) error reporting removed sql/sql_udf.cc: net_printf/send_error calls replaced by my_error family functions sql/sql_union.cc: -1/1 (sent/unsent) error reporting removed sql/sql_update.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_view.cc: -1/1 (sent/unsent) error reporting removed sql/sql_view.h: -1/1 (sent/unsent) error reporting removed sql/sql_yacc.yy: net_printf/send_error calls replaced by my_error family functions
This commit is contained in:
@ -276,7 +276,7 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations,
|
||||
(iindex_relations= find_type((char*) primary_key_name,
|
||||
&relations->keynames, 1+2)-1)<0)
|
||||
{
|
||||
send_error(thd,ER_CORRUPT_HELP_DB);
|
||||
my_error(ER_CORRUPT_HELP_DB, 0);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
rtopic_id= find_fields[help_relation_help_topic_id].field;
|
||||
@ -607,12 +607,11 @@ SQL_SELECT *prepare_select_for_name(THD *thd, const char *mask, uint mlen,
|
||||
thd Thread handler
|
||||
|
||||
RETURN VALUES
|
||||
0 Success
|
||||
1 Error and send_error already commited
|
||||
-1 error && send_error should be issued (normal case)
|
||||
FALSE Success
|
||||
TRUE Error and send_error already commited
|
||||
*/
|
||||
|
||||
int mysqld_help(THD *thd, const char *mask)
|
||||
bool mysqld_help(THD *thd, const char *mask)
|
||||
{
|
||||
Protocol *protocol= thd->protocol;
|
||||
SQL_SELECT *select;
|
||||
@ -640,8 +639,8 @@ int mysqld_help(THD *thd, const char *mask)
|
||||
uint mlen= strlen(mask);
|
||||
MEM_ROOT *mem_root= &thd->mem_root;
|
||||
|
||||
if ((res= open_and_lock_tables(thd, tables)))
|
||||
goto end;
|
||||
if (open_and_lock_tables(thd, tables))
|
||||
goto error;
|
||||
/*
|
||||
Init tables and fields to be usable from items
|
||||
|
||||
@ -650,10 +649,7 @@ int mysqld_help(THD *thd, const char *mask)
|
||||
setup_tables(thd, tables, 0);
|
||||
memcpy((char*) used_fields, (char*) init_used_fields, sizeof(used_fields));
|
||||
if (init_fields(thd, tables, used_fields, array_elements(used_fields)))
|
||||
{
|
||||
res= -1;
|
||||
goto end;
|
||||
}
|
||||
goto error;
|
||||
size_t i;
|
||||
for (i=0; i<sizeof(tables)/sizeof(TABLE_LIST); i++)
|
||||
tables[i].table->file->init_table_handle_for_HANDLER();
|
||||
@ -661,12 +657,8 @@ int mysqld_help(THD *thd, const char *mask)
|
||||
if (!(select=
|
||||
prepare_select_for_name(thd,mask,mlen,tables,tables[0].table,
|
||||
used_fields[help_topic_name].field,&error)))
|
||||
{
|
||||
res= -1;
|
||||
goto end;
|
||||
}
|
||||
goto error;
|
||||
|
||||
res= 1;
|
||||
count_topics= search_topics(thd,tables[0].table,used_fields,
|
||||
select,&topics_list,
|
||||
&name, &description, &example);
|
||||
@ -678,10 +670,8 @@ int mysqld_help(THD *thd, const char *mask)
|
||||
if (!(select=
|
||||
prepare_select_for_name(thd,mask,mlen,tables,tables[3].table,
|
||||
used_fields[help_keyword_name].field,&error)))
|
||||
{
|
||||
res= -1;
|
||||
goto end;
|
||||
}
|
||||
goto error;
|
||||
|
||||
count_topics=search_keyword(thd,tables[3].table,used_fields,select,&key_id);
|
||||
delete select;
|
||||
count_topics= (count_topics != 1) ? 0 :
|
||||
@ -697,10 +687,7 @@ int mysqld_help(THD *thd, const char *mask)
|
||||
if (!(select=
|
||||
prepare_select_for_name(thd,mask,mlen,tables,tables[1].table,
|
||||
used_fields[help_category_name].field,&error)))
|
||||
{
|
||||
res= -1;
|
||||
goto end;
|
||||
}
|
||||
goto error;
|
||||
|
||||
count_categories= search_categories(thd, tables[1].table, used_fields,
|
||||
select,
|
||||
@ -709,13 +696,13 @@ int mysqld_help(THD *thd, const char *mask)
|
||||
if (!count_categories)
|
||||
{
|
||||
if (send_header_2(protocol,FALSE))
|
||||
goto end;
|
||||
goto error;
|
||||
}
|
||||
else if (count_categories > 1)
|
||||
{
|
||||
if (send_header_2(protocol,FALSE) ||
|
||||
send_variant_2_list(mem_root,protocol,&categories_list,"Y",0))
|
||||
goto end;
|
||||
goto error;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -728,20 +715,14 @@ int mysqld_help(THD *thd, const char *mask)
|
||||
new Item_int((int32)category_id));
|
||||
if (!(select= prepare_simple_select(thd,cond_topic_by_cat,
|
||||
tables,tables[0].table,&error)))
|
||||
{
|
||||
res= -1;
|
||||
goto end;
|
||||
}
|
||||
goto error;
|
||||
get_all_items_for_category(thd,tables[0].table,
|
||||
used_fields[help_topic_name].field,
|
||||
select,&topics_list);
|
||||
delete select;
|
||||
if (!(select= prepare_simple_select(thd,cond_cat_by_cat,tables,
|
||||
tables[1].table,&error)))
|
||||
{
|
||||
res= -1;
|
||||
goto end;
|
||||
}
|
||||
goto error;
|
||||
get_all_items_for_category(thd,tables[1].table,
|
||||
used_fields[help_category_name].field,
|
||||
select,&subcategories_list);
|
||||
@ -750,39 +731,36 @@ int mysqld_help(THD *thd, const char *mask)
|
||||
if (send_header_2(protocol, true) ||
|
||||
send_variant_2_list(mem_root,protocol,&topics_list, "N",cat) ||
|
||||
send_variant_2_list(mem_root,protocol,&subcategories_list,"Y",cat))
|
||||
goto end;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
else if (count_topics == 1)
|
||||
{
|
||||
if (send_answer_1(protocol,&name,&description,&example))
|
||||
goto end;
|
||||
goto error;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* First send header and functions */
|
||||
if (send_header_2(protocol, FALSE) ||
|
||||
send_variant_2_list(mem_root,protocol, &topics_list, "N", 0))
|
||||
goto end;
|
||||
goto error;
|
||||
if (!(select=
|
||||
prepare_select_for_name(thd,mask,mlen,tables,tables[1].table,
|
||||
used_fields[help_category_name].field,&error)))
|
||||
{
|
||||
res= -1;
|
||||
goto end;
|
||||
}
|
||||
goto error;
|
||||
search_categories(thd, tables[1].table, used_fields,
|
||||
select,&categories_list, 0);
|
||||
delete select;
|
||||
/* Then send categories */
|
||||
if (send_variant_2_list(mem_root,protocol, &categories_list, "Y", 0))
|
||||
goto end;
|
||||
goto error;
|
||||
}
|
||||
res= 0;
|
||||
|
||||
send_eof(thd);
|
||||
|
||||
end:
|
||||
DBUG_RETURN(res);
|
||||
DBUG_RETURN(FALSE);
|
||||
error:
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user