1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-12261 build failure without P_S

restore mysql_file_delete_with_symlink() but let it use
new my_handler_delete_with_symlink() mysys helper.
This commit is contained in:
Sergei Golubchik
2017-03-15 11:46:54 +01:00
parent 06f1f1aa6e
commit 2c2bd8c155
8 changed files with 64 additions and 23 deletions

View File

@@ -441,6 +441,20 @@
inline_mysql_file_create_with_symlink(P1, P2, P3, P4, P5)
#endif
/**
@def mysql_file_delete_with_symlink(K, P1, P2, P3)
Instrumented delete with symbolic link.
@c mysql_file_delete_with_symlink is a replacement
for @c my_handler_delete_with_symlink.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
#define mysql_file_delete_with_symlink(K, P1, P2, P3) \
inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2, P3)
#else
#define mysql_file_delete_with_symlink(K, P1, P2, P3) \
inline_mysql_file_delete_with_symlink(P1, P2, P3)
#endif
/**
@def mysql_file_rename_with_symlink(K, P1, P2, P3)
Instrumented rename with symbolic link.
@@ -1294,6 +1308,7 @@ inline_mysql_file_rename(
return result;
}
static inline File
inline_mysql_file_create_with_symlink(
#ifdef HAVE_PSI_FILE_INTERFACE
@@ -1324,6 +1339,35 @@ inline_mysql_file_create_with_symlink(
}
static inline int
inline_mysql_file_delete_with_symlink(
#ifdef HAVE_PSI_FILE_INTERFACE
PSI_file_key key, const char *src_file, uint src_line,
#endif
const char *name, const char *ext, myf flags)
{
int result;
char fullname[FN_REFLEN];
fn_format(fullname, name, "", ext, MY_UNPACK_FILENAME | MY_APPEND_EXT);
#ifdef HAVE_PSI_FILE_INTERFACE
struct PSI_file_locker *locker;
PSI_file_locker_state state;
locker= PSI_FILE_CALL(get_thread_file_name_locker)
(&state, key, PSI_FILE_DELETE, fullname, &locker);
if (likely(locker != NULL))
{
PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line);
result= my_handler_delete_with_symlink(fullname, flags);
PSI_FILE_CALL(end_file_close_wait)(locker, result);
return result;
}
#endif
result= my_handler_delete_with_symlink(fullname, flags);
return result;
}
static inline int
inline_mysql_file_rename_with_symlink(
#ifdef HAVE_PSI_FILE_INTERFACE