From 63b7b45ff7f79a08a673e8b759a69f5ee7e67902 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Oct 2000 14:18:03 +0300 Subject: First part of automatic repair of MyISAM tables. Error on full disk on repair. SIGHUP signal handling. Update with keys on timestamp Portability fixes Docs/manual.texi: Added documentation about automatic repair of MyISAM tables client/mysql.cc: Remove usage of tempnam. include/my_sys.h: Added create_temp_file include/myisam.h: Fix for disk full on repair myisam/mi_check.c: Fix for disk full on repair myisam/sort.c: Fix for disk full on repair & removed usage of tempnam() mysys/mf_cache.c: Remove usage of tempnam() mysys/mf_dirname.c: Changed convert_dirname to return end 0 mysys/my_fopen.c: Security fixes mysys/my_tempnam.c: remove blanks readline/bind.c: Portability fixes readline/complete.c: Portability fixes readline/histexpand.c: Portability fixes readline/input.c: Portability fixes readline/search.c: Portability fixes readline/shell.c: Portability fixes readline/terminal.c: Portability fixes readline/tilde.c: Portability fixes readline/undo.c: Portability fixes regex/cname.h: Portability fixes regex/debug.c: Portability fixes regex/main.c: Portability fixes regex/regcomp.c: Portability fixes regex/regerror.c: Portability fixes sql/filesort.cc: Remove dummy code sql/ha_myisam.cc: Automatic repair of MyISAM tables sql/ha_myisam.h: Automatic repair of MyISAM tables sql/handler.cc: Automatic repair of MyISAM tables sql/handler.h: Automatic repair of MyISAM tables sql/key.cc: Fix for UPDATE with key on timestamp column sql/mysql_priv.h: Automatic repair of MyISAM tables sql/mysqld.cc: Automatic repair of MyISAM tables & signal SIGHUP handling sql/sql_base.cc: Automatic repair of MyISAM tables sql/sql_class.cc: Automatic repair of MyISAM tables sql/sql_class.h: Fix for insert with reference to columns sql/sql_insert.cc: Fix for insert with reference to columns sql/table.cc: Automatic repair of MyISAM tables BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- sql/sql_insert.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'sql/sql_insert.cc') diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 13feba9ab9c..26d110ba31c 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -140,6 +140,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List &fields, if (!table) DBUG_RETURN(-1); thd->proc_info="init"; + thd->used_tables=0; save_time_stamp=table->time_stamp; values= its++; if (check_insert_fields(thd,table,fields,*values,1) || @@ -200,7 +201,10 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List &fields, } else { - table->record[0][0]=table->record[2][0]; // Fix delete marker + if (thd->used_tables) // Column used in values() + restore_record(table,2); // Get empty record + else + table->record[0][0]=table->record[2][0]; // Fix delete marker if (fill_record(table->field,*values)) { if (values_list.elements != 1) @@ -1166,12 +1170,7 @@ select_insert::prepare(List &values) if (check_insert_fields(thd,table,*fields,values,1)) DBUG_RETURN(1); - if (fields->elements) - { - restore_record(table,2); // Get empty record - } - else - table->record[0][0]=table->record[2][0]; // Fix delete marker + restore_record(table,2); // Get empty record table->next_number_field=table->found_next_number_field; thd->count_cuted_fields=1; /* calc cuted fields */ thd->cuted_fields=0; -- cgit v1.2.1