diff options
author | unknown <monty@hundin.mysql.fi> | 2002-01-29 18:32:16 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-01-29 18:32:16 +0200 |
commit | d6a4362687434767d835713f174cd9bdd2656967 (patch) | |
tree | dc6d00358536a5dca27f806f929ab5e25a000c92 /sql/sql_update.cc | |
parent | 741b75b1c7810a1f6425c81738499fe12bdbc309 (diff) | |
download | mariadb-git-d6a4362687434767d835713f174cd9bdd2656967.tar.gz |
New error messages
Test of unsigned BIGINT values
Fixes for queries-per-hour
Cleanup of replication code (comments and portability fixes)
Make most of the binary log code 4G clean
Changed syntax for GRANT ... QUERIES PER HOUR
Docs/manual.texi:
Fixed Changelog, upgrading to 4.0 and 4.1 TODO sections.
Docs/mysqld_error.txt:
Added error message.
configure.in:
Fix for autoconf 2.52
include/my_getopt.h:
Portability fix.
include/my_global.h:
Portablity fix.
include/mysqld_error.h:
New error messages
mysql-test/r/bigint.result:
Test of unsigned BIGINT values.
mysql-test/r/func_op.result:
Test of unsigned BIGINT values.
mysql-test/r/varbinary.result:
Test of unsigned BIGINT values.
mysql-test/t/bigint.test:
Test of unsigned BIGINT values.
sql/item_func.h:
Optimized Item_int_func() usage.
sql/lock.cc:
Cleanup comments
sql/log.cc:
Cleanup
sql/log_event.cc:
Cleanup and portability fixes.
sql/log_event.h:
Cleanup and portability fixes.
sql/mini_client.cc:
Cleanup and portability fixes.
sql/mysqld.cc:
Fix for queries-per-hour
sql/repl_failsafe.cc:
Prepare for making binary log 2G clean.
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/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:
Cleanup
sql/slave.h:
Cleanup
sql/sql_acl.cc:
Cleanup and removal of possible reserved words
sql/sql_base.cc:
More DBUG
sql/sql_cache.cc:
Cleanup & portability fixes
sql/sql_class.h:
Make binary log 4G clean
sql/sql_delete.cc:
More DBUG
sql/sql_handler.cc:
Cleanup & portability fixes
sql/sql_parse.cc:
Cleanup of queries-per-hours code
sql/sql_rename.cc:
Add missing DBUG_RETURN
sql/sql_repl.cc:
Cleanup & portability fixes
sql/sql_select.cc:
Cleanup & portability fixes
sql/sql_show.cc:
Cleanup & portability fixes
sql/sql_update.cc:
Small cleanup of multi-update-code (need second pass)
sql/sql_yacc.yy:
Changed syntax for GRANT ... QUERIES PER HOUR
strings/str2int.c:
Cleanup & portability fixes
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 5776cba7e96..6c868b542d1 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -613,10 +613,12 @@ bool multi_update::send_data(List<Item> &values) } else { -// Here I insert into each temporary table - values_by_table.push_front(new Item_string(table->file->ref,table->file->ref_length)); + // Here we insert into each temporary table + values_by_table.push_front(new Item_string((char*) table->file->ref, + table->file->ref_length)); fill_record(tmp_tables[secure_counter]->field,values_by_table); - error= write_record(tmp_tables[secure_counter],&(infos[secure_counter])); + error= write_record(tmp_tables[secure_counter], + &(infos[secure_counter])); if (error) { error=-1; @@ -661,7 +663,8 @@ int multi_update::do_updates (bool from_send_error) { int error = 0, counter = 0; - if (num_updated == 1) return 0; + if (num_updated == 1) + return 0; if (from_send_error) { /* Found out table number for 'table_being_updated' */ @@ -690,7 +693,7 @@ int multi_update::do_updates (bool from_send_error) } List<Item> list; Field **ptr=tmp_table->field,*field; -// This is supposed to be something like insert_fields + // This is supposed to be something like insert_fields thd->used_tables|=tmp_table->map; while ((field = *ptr++)) { @@ -709,12 +712,14 @@ int multi_update::do_updates (bool from_send_error) (!thd->killed || from_send_error || not_trans_safe)) { found++; - error= table->file->rnd_pos(table->record[0], (*(tmp_table->field))->ptr); + error= table->file->rnd_pos(table->record[0], + (byte*) (*(tmp_table->field))->ptr); if (error) return error; table->status|= STATUS_UPDATED; store_record(table,1); - error= fill_record(*fields_by_tables[counter + 1],list) /*|| compare_record(table, query_id)*/ || + error= fill_record(*fields_by_tables[counter + 1],list) || + /* compare_record(table, query_id) || */ table->file->update_row(table->record[1],table->record[0]); if (error) { @@ -731,40 +736,47 @@ int multi_update::do_updates (bool from_send_error) } +/* out: 1 if error, 0 if success */ + bool multi_update::send_eof() { - thd->proc_info="updating the reference tables"; /* out: 1 if error, 0 if success */ + thd->proc_info="updating the reference tables"; /* Does updates for the last n - 1 tables, returns 0 if ok */ int error = do_updates(false); /* do_updates returns 0 if success */ /* reset used flags */ -// update_tables->table->no_keyread=0; - if (error == -1) error = 0; +#ifndef NOT_USED + update_tables->table->no_keyread=0; +#endif + if (error == -1) + error = 0; thd->proc_info="end"; if (error) send_error(error,"An error occured in multi-table update"); - /* Write the SQL statement to the binlog if we updated - rows and we succeeded, or also in an error case when there - was a non-transaction-safe table involved, since - modifications in it cannot be rolled back. */ + /* + Write the SQL statement to the binlog if we updated + rows and we succeeded, or also in an error case when there + was a non-transaction-safe table involved, since + modifications in it cannot be rolled back. + */ if (updated || not_trans_safe) { mysql_update_log.write(thd,thd->query,thd->query_length); Query_log_event qinfo(thd, thd->query); - /* mysql_bin_log is not open if binlogging or replication - is not used */ + /* + mysql_bin_log is not open if binlogging or replication + is not used + */ if (mysql_bin_log.is_open() && mysql_bin_log.write(&qinfo) && !not_trans_safe) - error=1; /* Log write failed: roll back - the SQL statement */ + error=1; /* Log write failed: roll back the SQL statement */ /* Commit or rollback the current SQL statement */ - VOID(ha_autocommit_or_rollback(thd,error > 0)); } else @@ -777,8 +789,8 @@ bool multi_update::send_eof() if (updated) query_cache.invalidate(update_tables); ::send_ok(&thd->net, - (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated, - thd->insert_id_used ? thd->insert_id() : 0L,buff); + (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated, + thd->insert_id_used ? thd->insert_id() : 0L,buff); } thd->count_cuted_fields=0; return 0; |