MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / inline_mysql_file_fopen

Function inline_mysql_file_fopen

include/mysql/psi/mysql_file.h:813–853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

811}
812
813static inline MYSQL_FILE*
814inline_mysql_file_fopen(
815#ifdef HAVE_PSI_FILE_INTERFACE
816 PSI_file_key key, const char *src_file, uint src_line,
817#endif
818 const char *filename, int flags, myf myFlags)
819{
820 MYSQL_FILE *that;
821 that= (MYSQL_FILE*) my_malloc(sizeof(MYSQL_FILE), MYF(MY_WME));
822 if (likely(that != NULL))
823 {
824#ifdef HAVE_PSI_FILE_INTERFACE
825 struct PSI_file_locker *locker;
826 PSI_file_locker_state state;
827 locker= PSI_FILE_CALL(get_thread_file_name_locker)
828 (&state, key, PSI_FILE_STREAM_OPEN, filename, that);
829 if (likely(locker != NULL))
830 {
831 PSI_FILE_CALL(start_file_open_wait)
832 (locker, src_file, src_line);
833 that->m_file= my_fopen(filename, flags, myFlags);
834 that->m_psi= PSI_FILE_CALL(end_file_open_wait)(locker, that->m_file);
835 if (unlikely(that->m_file == NULL))
836 {
837 my_free(that);
838 return NULL;
839 }
840 return that;
841 }
842#endif
843
844 that->m_psi= NULL;
845 that->m_file= my_fopen(filename, flags, myFlags);
846 if (unlikely(that->m_file == NULL))
847 {
848 my_free(that);
849 return NULL;
850 }
851 }
852 return that;
853}
854
855static inline int
856inline_mysql_file_fclose(

Callers

nothing calls this directly

Calls 3

my_mallocFunction · 0.85
my_fopenFunction · 0.85
my_freeFunction · 0.85

Tested by

no test coverage detected