diff options
author | Andrei Elkin <aelkin@mysql.com> | 2009-12-01 21:07:18 +0200 |
---|---|---|
committer | Andrei Elkin <aelkin@mysql.com> | 2009-12-01 21:07:18 +0200 |
commit | e8e85ed2a6fc6b1091ac62590f9084b9eae00d50 (patch) | |
tree | 39a60b9bbefbde5c02b040d381c8fd5d0c0dc0ea /mysys | |
parent | 4b28a6ce84fbcab3e819018a03c116c0939dab5e (diff) | |
parent | 46b67a3b297843c4f6dc3de5f0cc79d5f1f9bf1d (diff) | |
download | mariadb-git-e8e85ed2a6fc6b1091ac62590f9084b9eae00d50.tar.gz |
Manual resolving for the following files
Text conflict in mysql-test/collections/default.experimental
Text conflict in mysql-test/r/show_check.result
Text conflict in mysql-test/r/sp-code.result
Text conflict in mysql-test/suite/binlog/r/binlog_tmp_table.result
Text conflict in mysql-test/suite/rpl/t/disabled.def
Text conflict in mysql-test/t/show_check.test
Text conflict in mysys/my_delete.c
Text conflict in sql/item.h
Text conflict in sql/item_cmpfunc.h
Text conflict in sql/log.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/repl_failsafe.cc
Text conflict in sql/slave.cc
Text conflict in sql/sql_parse.cc
Text conflict in sql/sql_table.cc
Text conflict in sql/sql_yacc.yy
Text conflict in storage/myisam/ha_myisam.cc
Corrected results for
stm_auto_increment_bug33029.reject 2009-12-01
20:01:49.000000000 +0300
<andrei> @@ -42,9 +42,6 @@
<andrei> RETURN i;
<andrei> END//
<andrei> CALL p1();
<andrei> -Warnings:
<andrei> -Note 1592 Statement may not be safe to log in statement
format.
<andrei> -Note 1592 Statement may not be safe to log in statement
format.
There should be indeed no Note present because there is in fact autoincrement
top-level query in sp() that triggers inserting in yet another auto-inc table.
(todo: alert DaoGang to improve the test).
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_delete.c | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/mysys/my_delete.c b/mysys/my_delete.c index 3ab6ba399f9..edee1c4e875 100644 --- a/mysys/my_delete.c +++ b/mysys/my_delete.c @@ -37,7 +37,7 @@ int my_delete(const char *name, myf MyFlags) } /* my_delete */ #if defined(__WIN__) -/* +/** Delete file which is possibly not closed. This function is intended to be used exclusively as a temporal solution @@ -53,6 +53,20 @@ int my_delete(const char *name, myf MyFlags) renamed to <name>.<num>.deleted where <name> - the initial name of the file, <num> - a hexadecimal number chosen to make the temporal name to be unique. + + @param the name of the being deleted file + @param the flags instructing how to react on an error internally in + the function + + @note The per-thread @c my_errno holds additional info for a caller to + decide how critical the error can be. + + @retval + 0 ok + @retval + 1 error + + */ int nt_share_delete(const char *name, myf MyFlags) { @@ -63,6 +77,7 @@ int nt_share_delete(const char *name, myf MyFlags) for (cnt= GetTickCount(); cnt; cnt--) { + errno= 0; sprintf(buf, "%s.%08X.deleted", name, cnt); if (MoveFile(name, buf)) break; @@ -78,15 +93,23 @@ int nt_share_delete(const char *name, myf MyFlags) name, buf, errno)); break; } - - if (DeleteFile(buf)) - DBUG_RETURN(0); - - my_errno= GetLastError(); + + if (errno == ERROR_FILE_NOT_FOUND) + { + my_errno= ENOENT; // marking, that `name' doesn't exist + } + else if (errno == 0) + { + if (DeleteFile(buf)) + DBUG_RETURN(0); + else if ((my_errno= GetLastError()) == 0) + my_errno= ENOENT; // marking, that `buf' doesn't exist + } else + my_errno= errno; + if (MyFlags & (MY_FAE+MY_WME)) - my_error(EE_DELETE, MYF(ME_BELL + ME_WAITTANG + (MyFlags & ME_NOINPUT)), - name, my_errno); - + my_error(EE_DELETE, MYF(ME_BELL + ME_WAITTANG + (MyFlags & ME_NOINPUT)), + name, my_errno); DBUG_RETURN(-1); } #endif |