my_boolinit_tmpdir(MY_TMPDIR*tmpdir,constchar*pathlist){char*end,*copy;charbuff[FN_REFLEN];DBUG_ENTER("init_tmpdir");DBUG_PRINT("enter",("pathlist: %s",pathlist?pathlist:"NULL"));pthread_mutex_init(&tmpdir->mutex,MY_MUTEX_INIT_FAST);if(my_init_dynamic_array(&tmpdir->full_list,sizeof(char*),1,5))gotoerr;if(!pathlist||!pathlist[0]){/* Get default temporary directory */pathlist=getenv("TMPDIR");/* Use this if possible */#if defined( __WIN__) || defined(__NETWARE__)if(!pathlist)pathlist=getenv("TEMP");if(!pathlist)pathlist=getenv("TMP");#endifif(!pathlist||!pathlist[0])pathlist=(char*)P_tmpdir;}...
MySQL server 和 客户端工具都使用这个临时目录查找策略,怪不得使用 mysqlbinlog tmp directory 作为关键词没有搜到需要的结果,而使用 mysql tmp directory 作为关键词,第一条搜索结果就是 Where MySQL Stores Temporary Files,选择正确的关键词很重要啊。