select into outfile creates files everytime with 666 permission, regardsless if umask environment variables and umask settings on OS level.
It seems hardcoded.
/***************************************************************************
|
** Export of select to textfile
|
***************************************************************************/
|
[..]
|
static File create_file(THD *thd, char *path, sql_exchange *exchange,
|
IO_CACHE *cache)
|
[...]
|
/* Create the file world readable */
|
if ((file= mysql_file_create(key_select_to_file,
|
path, 0666, O_WRONLY|O_EXCL, MYF(MY_WME))) < 0)
|
return file;
|
#ifdef HAVE_FCHMOD
|
(void) fchmod(file, 0666); // Because of umask()
|
#else
|
(void) chmod(path, 0666);
|
#endif
|
It should use my_umask instead to respect UMASK and UMASK_DIR environment variables.