summaryrefslogtreecommitdiff
path: root/sql/parse_file.cc
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@sun.com>2010-01-06 22:42:07 -0700
committerMarc Alff <marc.alff@sun.com>2010-01-06 22:42:07 -0700
commit3d915225611a921fad03934e58bf281b48fc15b0 (patch)
treeea8cbc9d70015a17aad75df30e7d223476eaa4da /sql/parse_file.cc
parent4b559b912f5a3aa02a226fdacddaa3b80a8ade42 (diff)
downloadmariadb-git-3d915225611a921fad03934e58bf281b48fc15b0.tar.gz
WL#2360 Performance schema
Part IV: sql instrumentation
Diffstat (limited to 'sql/parse_file.cc')
-rw-r--r--sql/parse_file.cc31
1 files changed, 17 insertions, 14 deletions
diff --git a/sql/parse_file.cc b/sql/parse_file.cc
index 3d65fa1de31..d94ab3d940d 100644
--- a/sql/parse_file.cc
+++ b/sql/parse_file.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -237,8 +237,9 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
// temporary file name
path[path_end]='~';
path[path_end+1]= '\0';
- if ((handler= my_create(path, CREATE_MODE, O_RDWR | O_TRUNC,
- MYF(MY_WME))) <= 0)
+ if ((handler= mysql_file_create(key_file_fileparser,
+ path, CREATE_MODE, O_RDWR | O_TRUNC,
+ MYF(MY_WME))) <= 0)
{
DBUG_RETURN(TRUE);
}
@@ -267,11 +268,11 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
goto err_w_file;
if (opt_sync_frm) {
- if (my_sync(handler, MYF(MY_WME)))
+ if (mysql_file_sync(handler, MYF(MY_WME)))
goto err_w_file;
}
- if (my_close(handler, MYF(MY_WME)))
+ if (mysql_file_close(handler, MYF(MY_WME)))
{
DBUG_RETURN(TRUE);
}
@@ -283,7 +284,7 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
char path_to[FN_REFLEN];
memcpy(path_to, path, path_end+1);
path[path_end]='~';
- if (my_rename(path, path_to, MYF(MY_WME)))
+ if (mysql_file_rename(key_file_fileparser, path, path_to, MYF(MY_WME)))
{
DBUG_RETURN(TRUE);
}
@@ -292,7 +293,7 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
err_w_cache:
end_io_cache(&file);
err_w_file:
- my_close(handler, MYF(MY_WME));
+ mysql_file_close(handler, MYF(MY_WME));
DBUG_RETURN(TRUE);
}
@@ -321,7 +322,7 @@ my_bool rename_in_schema_file(THD *thd,
build_table_filename(new_path, sizeof(new_path) - 1,
new_db, new_name, reg_ext, 0);
- if (my_rename(old_path, new_path, MYF(MY_WME)))
+ if (mysql_file_rename(key_file_frm, old_path, new_path, MYF(MY_WME)))
return 1;
/* check if arc_dir exists: disabled unused feature (see bug #17823). */
@@ -365,7 +366,8 @@ sql_parse_prepare(const LEX_STRING *file_name, MEM_ROOT *mem_root,
File file;
DBUG_ENTER("sql_parse_prepare");
- if (!my_stat(file_name->str, &stat_info, MYF(MY_WME)))
+ if (!mysql_file_stat(key_file_fileparser,
+ file_name->str, &stat_info, MYF(MY_WME)))
{
DBUG_RETURN(0);
}
@@ -386,20 +388,21 @@ sql_parse_prepare(const LEX_STRING *file_name, MEM_ROOT *mem_root,
DBUG_RETURN(0);
}
- if ((file= my_open(file_name->str, O_RDONLY | O_SHARE, MYF(MY_WME))) < 0)
+ if ((file= mysql_file_open(key_file_fileparser, file_name->str,
+ O_RDONLY | O_SHARE, MYF(MY_WME))) < 0)
{
DBUG_RETURN(0);
}
- if ((len= my_read(file, (uchar *)parser->buff,
- stat_info.st_size, MYF(MY_WME))) ==
+ if ((len= mysql_file_read(file, (uchar *)parser->buff,
+ stat_info.st_size, MYF(MY_WME))) ==
MY_FILE_ERROR)
{
- my_close(file, MYF(MY_WME));
+ mysql_file_close(file, MYF(MY_WME));
DBUG_RETURN(0);
}
- if (my_close(file, MYF(MY_WME)))
+ if (mysql_file_close(file, MYF(MY_WME)))
{
DBUG_RETURN(0);
}