summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-10-20 04:04:37 +0300
committerunknown <bell@sanja.is.com.ua>2004-10-20 04:04:37 +0300
commit066c90563a9fd6151461a5d54d879079acffe279 (patch)
tree55e6ec4a0a572c0be2ba69da166ea204bf96502e /sql/item.cc
parent65ed693681b17414fc001099ee734f36de847f13 (diff)
downloadmariadb-git-066c90563a9fd6151461a5d54d879079acffe279.tar.gz
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
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc66
1 files changed, 33 insertions, 33 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 267560b0709..813eaf41b45 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1279,7 +1279,7 @@ bool Item::fix_fields(THD *thd,
// We do not check fields which are fixed during construction
DBUG_ASSERT(fixed == 0 || basic_const_item());
fixed= 1;
- return 0;
+ return FALSE;
}
double Item_ref_null_helper::val()
@@ -1447,9 +1447,9 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
}
}
if (!tmp)
- return -1;
+ return TRUE;
if (!refer)
- return 1;
+ return TRUE;
if (tmp == not_found_field && refer == (Item **)not_found_item)
{
if (upward_lookup)
@@ -1463,7 +1463,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
// Call to report error
find_field_in_tables(thd, this, tables, ref, 1, 1);
}
- return -1;
+ return TRUE;
}
else if (refer != (Item **)not_found_item)
{
@@ -1471,7 +1471,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
my_error(ER_ILLEGAL_REFERENCE, MYF(0), name,
"forward reference in item list");
- return -1;
+ return TRUE;
}
Item_ref *rf;
@@ -1481,16 +1481,16 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
(char *)field_name);
register_item_tree_changing(ref);
if (!rf)
- return 1;
+ return TRUE;
/*
rf is Item_ref => never substitute other items (in this case)
during fix_fields() => we can use rf after fix_fields()
*/
if (rf->fix_fields(thd, tables, ref) || rf->check_cols(1))
- return 1;
+ return TRUE;
mark_as_dependent(thd, last, cursel, rf);
- return 0;
+ return FALSE;
}
else
{
@@ -1503,7 +1503,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
(char *)cached_table->alias,
(char *)field_name);
if (!rf)
- return 1;
+ return TRUE;
/*
rf is Item_ref => never substitute other items (in this case)
during fix_fields() => we can use rf after fix_fields()
@@ -1513,7 +1513,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
}
}
else if (!tmp)
- return -1;
+ return TRUE;
/*
if it is not expression from merged VIEW we will set this field.
@@ -1564,12 +1564,12 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
thd->host_or_ip,
field_name,
tab);
- return 1;
+ return TRUE;
}
}
#endif
fixed= 1;
- return 0;
+ return FALSE;
}
void Item_field::cleanup()
@@ -2209,9 +2209,9 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
}
if (!ref)
- return 1;
+ return TRUE;
else if (!tmp)
- return -1;
+ return TRUE;
else if (ref == (Item **)not_found_item && tmp == not_found_field)
{
if (upward_lookup)
@@ -2229,7 +2229,7 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
REPORT_ALL_ERRORS);
}
ref= 0;
- return 1;
+ return TRUE;
}
else if (tmp != not_found_field)
{
@@ -2238,10 +2238,10 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
{
Item_field* fld;
if (!((*reference)= fld= new Item_field(tmp)))
- return 1;
+ return TRUE;
mark_as_dependent(thd, last, thd->lex->current_select, fld);
register_item_tree_changing(reference);
- return 0;
+ return FALSE;
}
/*
We can leave expression substituted from view for next PS/SP
@@ -2261,7 +2261,7 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
{
my_error(ER_ILLEGAL_REFERENCE, MYF(0), name,
"forward reference in item list");
- return -1;
+ return TRUE;
}
mark_as_dependent(thd, last, thd->lex->current_select,
this);
@@ -2269,14 +2269,14 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
}
}
else if (!ref)
- return 1;
+ return TRUE;
else
{
if (!(*ref)->fixed)
{
my_error(ER_ILLEGAL_REFERENCE, MYF(0), name,
"forward reference in item list");
- return -1;
+ return TRUE;
}
ref= thd->lex->current_select->ref_pointer_array + counter;
}
@@ -2299,7 +2299,7 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
((*ref)->with_sum_func?
"reference on group function":
"forward reference in item list"));
- return 1;
+ return TRUE;
}
max_length= (*ref)->max_length;
maybe_null= (*ref)->maybe_null;
@@ -2309,8 +2309,8 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
fixed= 1;
if (ref && (*ref)->check_cols(1))
- return 1;
- return 0;
+ return TRUE;
+ return FALSE;
}
@@ -2416,17 +2416,17 @@ bool Item_default_value::fix_fields(THD *thd,
if (!arg)
{
fixed= 1;
- return 0;
+ return FALSE;
}
if (arg->fix_fields(thd, table_list, &arg))
- return 1;
+ return TRUE;
if (arg->type() == REF_ITEM)
{
Item_ref *ref= (Item_ref *)arg;
if (ref->ref[0]->type() != FIELD_ITEM)
{
- return 1;
+ return TRUE;
}
arg= ref->ref[0];
}
@@ -2435,16 +2435,16 @@ bool Item_default_value::fix_fields(THD *thd,
{
my_printf_error(ER_NO_DEFAULT_FOR_FIELD, ER(ER_NO_DEFAULT_FOR_FIELD),
MYF(0), field_arg->field->field_name);
- return 1;
+ return TRUE;
}
if (!(def_field= (Field*) sql_alloc(field_arg->field->size_of())))
- return 1;
+ return TRUE;
memcpy(def_field, field_arg->field, field_arg->field->size_of());
def_field->move_field(def_field->table->default_values -
def_field->table->record[0]);
set_field(def_field);
fixed= 1;
- return 0;
+ return FALSE;
}
void Item_default_value::print(String *str)
@@ -2472,14 +2472,14 @@ bool Item_insert_value::fix_fields(THD *thd,
{
DBUG_ASSERT(fixed == 0);
if (arg->fix_fields(thd, table_list, &arg))
- return 1;
+ return TRUE;
if (arg->type() == REF_ITEM)
{
Item_ref *ref= (Item_ref *)arg;
if (ref->ref[0]->type() != FIELD_ITEM)
{
- return 1;
+ return TRUE;
}
arg= ref->ref[0];
}
@@ -2488,7 +2488,7 @@ bool Item_insert_value::fix_fields(THD *thd,
{
Field *def_field= (Field*) sql_alloc(field_arg->field->size_of());
if (!def_field)
- return 1;
+ return TRUE;
memcpy(def_field, field_arg->field, field_arg->field->size_of());
def_field->move_field(def_field->table->insert_values -
def_field->table->record[0]);
@@ -2502,7 +2502,7 @@ bool Item_insert_value::fix_fields(THD *thd,
tmp_field->table, &my_charset_bin));
}
fixed= 1;
- return 0;
+ return FALSE;
}
void Item_insert_value::print(String *str)