diff options
author | Marc Alff <marc.alff@oracle.com> | 2018-08-17 14:20:25 +0200 |
---|---|---|
committer | Marc Alff <marc.alff@oracle.com> | 2018-08-20 13:32:37 +0200 |
commit | bac287c315b1792e7ae33f91add6a60292f9bae8 (patch) | |
tree | 1243221ee89cf0c83b697c12b8d3266f8673a13f /mysys | |
parent | a653fca99be15b6c3bd6483041578f0bfe5bf5b0 (diff) | |
download | mariadb-git-bac287c315b1792e7ae33f91add6a60292f9bae8.tar.gz |
Bug#27788907 SOME FILE OPERATIONS IN MF_IOCACHE2.C ARE NOT INSTRUMENTEDmysql-5.5.62
MySQL bug number 90264
Contribution by Yura Sorokin.
Problem:
File mysys/mf_iocache2.c contains non instrumented file io operations.
This causes inaccurate statistics in PERFORMANCE_SCHEMA.
Solution:
Use the instrumentation apis (mysql_file_tell instead of my_tell, etc).
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/mf_iocache2.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c index 1b0375cb88e..8d7cb53041c 100644 --- a/mysys/mf_iocache2.c +++ b/mysys/mf_iocache2.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. 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 @@ -102,14 +102,14 @@ my_off_t my_b_append_tell(IO_CACHE* info) */ { volatile my_off_t save_pos; - save_pos = my_tell(info->file,MYF(0)); - my_seek(info->file,(my_off_t)0,MY_SEEK_END,MYF(0)); + save_pos = mysql_file_tell(info->file,MYF(0)); + mysql_file_seek(info->file,(my_off_t)0,MY_SEEK_END,MYF(0)); /* Save the value of my_tell in res so we can see it when studying coredump */ DBUG_ASSERT(info->end_of_file - (info->append_read_pos-info->write_buffer) - == (res=my_tell(info->file,MYF(0)))); - my_seek(info->file,save_pos,MY_SEEK_SET,MYF(0)); + == (res=mysql_file_tell(info->file,MYF(0)))); + mysql_file_seek(info->file,save_pos,MY_SEEK_SET,MYF(0)); } #endif res = info->end_of_file + (info->write_pos-info->append_read_pos); @@ -203,7 +203,7 @@ size_t my_b_fill(IO_CACHE *info) if (info->seek_not_done) { /* File touched, do seek */ - if (my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) == + if (mysql_file_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) == MY_FILEPOS_ERROR) { info->error= 0; @@ -223,7 +223,7 @@ size_t my_b_fill(IO_CACHE *info) } DBUG_EXECUTE_IF ("simulate_my_b_fill_error", {DBUG_SET("+d,simulate_file_read_error");}); - if ((length= my_read(info->file,info->buffer,max_length, + if ((length= mysql_file_read(info->file,info->buffer,max_length, info->myflags)) == (size_t) -1) { info->error= -1; @@ -287,7 +287,7 @@ my_off_t my_b_filelength(IO_CACHE *info) return my_b_tell(info); info->seek_not_done= 1; - return my_seek(info->file, 0L, MY_SEEK_END, MYF(0)); + return mysql_file_seek(info->file, 0L, MY_SEEK_END, MYF(0)); } |