diff options
author | unknown <bell@sanja.is.com.ua> | 2004-11-13 19:35:51 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-11-13 19:35:51 +0200 |
commit | 8d71bcec217bead7d832d6ea4dca437c5f134577 (patch) | |
tree | a534689811d0f65eba423eed77b056f3bb30bd51 /sql/sql_update.cc | |
parent | 067863e184e9a23034d410919d4c8075ee30bcee (diff) | |
download | mariadb-git-8d71bcec217bead7d832d6ea4dca437c5f134577.tar.gz |
now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
include/mysqld_error.h:
newerror messages
mysql-test/t/key.test:
unknown error replaced with real error
mysys/my_error.c:
my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
new errors converted from unknown error
sql/share/danish/errmsg.txt:
new errors converted from unknown error
sql/share/dutch/errmsg.txt:
new errors converted from unknown error
sql/share/english/errmsg.txt:
new errors converted from unknown error
sql/share/estonian/errmsg.txt:
new errors converted from unknown error
sql/share/french/errmsg.txt:
new errors converted from unknown error
sql/share/german/errmsg.txt:
new errors converted from unknown error
sql/share/greek/errmsg.txt:
new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
new errors converted from unknown error
sql/share/italian/errmsg.txt:
new errors converted from unknown error
sql/share/japanese/errmsg.txt:
new errors converted from unknown error
sql/share/korean/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
new errors converted from unknown error
sql/share/polish/errmsg.txt:
new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
new errors converted from unknown error
sql/share/romanian/errmsg.txt:
new errors converted from unknown error
sql/share/russian/errmsg.txt:
new errors converted from unknown error
sql/share/serbian/errmsg.txt:
new errors converted from unknown error
sql/share/slovak/errmsg.txt:
new errors converted from unknown error
sql/share/spanish/errmsg.txt:
new errors converted from unknown error
sql/share/swedish/errmsg.txt:
new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
new errors converted from unknown error
sql/slave.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
multi-row command fixed
sql/sql_prepare.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
remover send_error ingected from 4.1
sql/sql_rename.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
* format support added to my_vsprint
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index dfc46150847..c5167018701 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -38,15 +38,15 @@ static bool compare_record(TABLE *table, ulong query_id) if (memcmp(table->null_flags, table->null_flags+table->rec_buff_length, table->null_bytes)) - return 1; // Diff in NULL value + return TRUE; // Diff in NULL value /* Compare updated fields */ for (Field **ptr=table->field ; *ptr ; ptr++) { if ((*ptr)->query_id == query_id && (*ptr)->cmp_binary_offset(table->rec_buff_length)) - return 1; + return TRUE; } - return 0; + return FALSE; } @@ -73,8 +73,7 @@ static bool check_fields(THD *thd, List<Item> &items) if (!(field= item->filed_for_view_update())) { /* item has name, because it comes from VIEW SELECT list */ - my_printf_error(ER_NONUPDATEABLE_COLUMN, ER(ER_NONUPDATEABLE_COLUMN), - MYF(0), item->name); + my_error(ER_NONUPDATEABLE_COLUMN, MYF(0), item->name); return TRUE; } /* @@ -134,8 +133,8 @@ bool mysql_update(THD *thd, table_list->grant.want_privilege : table->grant.want_privilege); #endif - if ((error= mysql_prepare_update(thd, table_list, &conds, order_num, order))) - DBUG_RETURN(error); + if (mysql_prepare_update(thd, table_list, &conds, order_num, order)) + DBUG_RETURN(TRUE); old_used_keys= table->used_keys; // Keys used in WHERE /* @@ -165,8 +164,7 @@ bool mysql_update(THD *thd, } if (!table_list->updatable || check_key_in_view(thd, table_list)) { - my_printf_error(ER_NON_UPDATABLE_TABLE, ER(ER_NON_UPDATABLE_TABLE), - MYF(0), table_list->alias, "UPDATE"); + my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias, "UPDATE"); DBUG_RETURN(TRUE); } if (table->timestamp_field) @@ -532,8 +530,7 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list, /* Check that we are not using table that we are updating in a sub select */ if (unique_table(table_list, table_list->next_global)) { - my_printf_error(ER_UPDATE_TABLE_USED, ER(ER_UPDATE_TABLE_USED), MYF(0), - table_list->real_name); + my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->real_name); DBUG_RETURN(TRUE); } select_lex->fix_prepare_information(thd, conds); @@ -591,7 +588,7 @@ bool mysql_multi_update_prepare(THD *thd) /* open tables and create derived ones, but do not lock and fill them */ if (open_tables(thd, table_list, & table_count) || mysql_handle_derived(lex, &mysql_derived_prepare)) - DBUG_RETURN(thd->net.report_error ? -1 : 1); + DBUG_RETURN(TRUE); /* Ensure that we have update privilege for all tables and columns in the SET part @@ -658,9 +655,7 @@ bool mysql_multi_update_prepare(THD *thd) { if (!tl->updatable || check_key_in_view(thd, tl)) { - my_printf_error(ER_NON_UPDATABLE_TABLE, - ER(ER_NON_UPDATABLE_TABLE), MYF(0), - tl->alias, "UPDATE"); + my_error(ER_NON_UPDATABLE_TABLE, MYF(0), tl->alias, "UPDATE"); DBUG_RETURN(TRUE); } @@ -671,8 +666,7 @@ bool mysql_multi_update_prepare(THD *thd) if (lex->select_lex.check_updateable_in_subqueries(tl->db, tl->real_name)) { - my_printf_error(ER_UPDATE_TABLE_USED, - ER(ER_UPDATE_TABLE_USED), MYF(0), tl->real_name); + my_error(ER_UPDATE_TABLE_USED, MYF(0), tl->real_name); DBUG_RETURN(TRUE); } DBUG_PRINT("info",("setting table `%s` for update", tl->alias)); @@ -727,7 +721,7 @@ bool mysql_multi_update_prepare(THD *thd) } if (thd->fill_derived_tables() && mysql_handle_derived(lex, &mysql_derived_filling)) - DBUG_RETURN(thd->net.report_error ? -1 : 1); + DBUG_RETURN(TRUE); DBUG_RETURN (FALSE); } @@ -749,8 +743,8 @@ bool mysql_multi_update(THD *thd, multi_update *result; DBUG_ENTER("mysql_multi_update"); - if ((res= mysql_multi_update_prepare(thd))) - DBUG_RETURN(res); + if (mysql_multi_update_prepare(thd)) + DBUG_RETURN(TRUE); if (!(result= new multi_update(thd, table_list, fields, values, handle_duplicates))) @@ -1021,7 +1015,7 @@ static bool safe_update_on_fly(JOIN_TAB *join_tab, List<Item> *fields) case JT_SYSTEM: case JT_CONST: case JT_EQ_REF: - return 1; // At most one matching row + return TRUE; // At most one matching row case JT_REF: return !check_if_key_used(table, join_tab->ref.key, *fields); case JT_ALL: @@ -1032,11 +1026,11 @@ static bool safe_update_on_fly(JOIN_TAB *join_tab, List<Item> *fields) if ((table->file->table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) && table->primary_key < MAX_KEY) return !check_if_key_used(table, table->primary_key, *fields); - return 1; + return TRUE; default: break; // Avoid compler warning } - return 0; + return FALSE; } @@ -1360,7 +1354,7 @@ bool multi_update::send_eof() /* Safety: If we haven't got an error before (should not happen) */ my_message(ER_UNKNOWN_ERROR, "An error occured in multi-table update", MYF(0)); - return 1; + return TRUE; } @@ -1370,5 +1364,5 @@ bool multi_update::send_eof() (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated; ::send_ok(thd, (ulong) thd->row_count_func, thd->insert_id_used ? thd->insert_id() : 0L,buff); - return 0; + return FALSE; } |