mariadb/mysys/mf_tempfile.c

196 lines
5.2 KiB
C
Raw Normal View History

/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
#include "mysys_priv.h"
#include <m_string.h>
#include "my_static.h"
#include "mysys_err.h"
#include <errno.h>
#ifdef HAVE_PATHS_H
#include <paths.h>
#endif
#ifdef HAVE_TEMPNAM
Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. Docs/manual.texi: Updated credits client/mysql.cc: Fixes for OS2 client/mysqladmin.c: Fixes for OS2 client/mysqldump.c: Fixes for OS2 client/mysqlimport.c: Fixes for OS2 client/mysqltest.c: Fixes for OS2 dbug/dbug.c: Fixes for OS2. Use new C calling convention. dbug/factorial.c: Fixes for OS2. Use new C calling convention. include/errmsg.h: Fix for OS2 include/global.h: Fixes for OS2. include/my_pthread.h: Fixes for OS2. include/my_sys.h: Fixes for OS2. include/mysql_com.h: Move defines to global.h include/thr_alarm.h: Fixes for OS2. isam/isamchk.c: Fixes for OS2. Add arguments to function declarations. isam/isamlog.c: Fixes for OS2. Fix bug in logfile handling. isam/test1.c: Add arguments to function decl isam/test2.c: Add arguments to function declarations. isam/test_all.res: Update result libmysql/get_password.c: Fixes for OS2. libmysql/libmysql.c: Fixes for OS2. libmysql/net.c: Fixes for OS2. libmysql/violite.c: Add arguments to function declarations. merge/_locking.c: Add argument types to function declarations. merge/close.c: Add argument types to function declarations. merge/create.c: Add argument types to function declarations. merge/extra.c: Add argument types to function declarations. merge/open.c: Add argument types to function declarations. merge/panic.c: Add argument types to function declarations. merge/rsame.c: Add argument types to function declarations. merge/update.c: Add argument types to function declarations. myisam/ft_eval.c: Portability fix myisam/ft_search.c: Portability fix myisam/ft_test1.c: Portability fix myisam/ftdefs.h: Portability fix myisam/mi_check.c: Portability fix myisam/mi_test1.c: Portability fix myisam/mi_test2.c: Portability fix myisam/mi_test_all.sh: Update to test for MACH variable myisam/myisamlog.c: Cleanup myisam/myisampack.c: Don't use variable 'new' myisam/sort.c: Portability fix myisammrg/myrg_delete.c: Add argument types to function declarations. myisammrg/myrg_locking.c: Add argument types to function declarations. myisammrg/myrg_open.c: Add argument types to function declarations. myisammrg/myrg_panic.c: Add argument types to function declarations. mysql-test/t/backup.test: Fix for OS2 mysql-test/t/show_check.test: Fix for OS2 mysys/charset.c: Dont use variable 'new' mysys/default.c: Fixes for OS2. mysys/getopt.c: Fixes for OS2. mysys/getopt1.c: Fixes for OS2. mysys/list.c: Don't use variable 'new' mysys/mf_dirname.c: Fixes for OS2. mysys/mf_format.c: Fixes for OS2. mysys/mf_path.c: Fixes for OS2. mysys/mf_qsort.c: Portability fix mysys/mf_tempfile.c: Fixes for OS2. mysys/my_clock.c: Fixes for OS2. mysys/my_copy.c: Fixes for OS2. mysys/my_create.c: Fixes for OS2. mysys/my_getwd.c: Fixes for OS2. mysys/my_init.c: Fixes for OS2. mysys/my_lib.c: Fixes for OS2. mysys/my_lock.c: Fixes for OS2. mysys/my_malloc.c: Portability fix mysys/my_mkdir.c: Fixes for OS2. mysys/my_open.c: Fixes for OS2. mysys/my_pthread.c: Fixes for OS2. mysys/my_realloc.c: Fixes for OS2. mysys/my_redel.c: Fixes for OS2. mysys/my_static.c: Fixes for OS2. mysys/my_tempnam.c: Fixes for OS2. mysys/my_thr_init.c: Fixes for OS2. mysys/my_write.c: Fixes for OS2. mysys/test_charset.c: Fixes for OS2. mysys/thr_alarm.c: Fixes for OS2. mysys/tree.c: Fixes for OS2. sql/field.cc: Fixes for OS2. sql/field.h: Fixes for OS2. sql/gen_lex_hash.cc: Fixes for OS2. sql/hostname.cc: Fixes for OS2. sql/item_func.cc: Fixes for OS2. sql/item_strfunc.cc: Fixes for OS2. sql/log_event.cc: Fixes for OS2. sql/md5.c: Fixes for OS2. sql/mini_client.cc: Fixes for OS2. sql/mysql_priv.h: Fixes for OS2. sql/mysqld.cc: Fixes for OS2. sql/net_serv.cc: Fixes for OS2. sql/slave.cc: Fixes for OS2. sql/sql_base.cc: Fixes for OS2. sql/sql_db.cc: Portability fix sql/sql_insert.cc: Fixes for OS2. sql/sql_load.cc: Fixes for OS2. sql/sql_parse.cc: Fixes for OS2. sql/sql_table.cc: Fixes for OS2. sql/sql_udf.cc: Fixes for OS2. sql/violite.c: Fixes for OS2. strings/ctype-big5.c: Fixes for OS2. strings/ctype-gbk.c: Fixes for OS2. strings/ctype-sjis.c: Fixes for OS2. strings/ctype-tis620.c: Fixes for OS2. strings/ctype.c: Fixes for OS2. strings/strnlen.c: Fixes for OS2.
2001-08-22 01:45:07 +03:00
#if !defined( MSDOS) && !defined(OS2)
extern char **environ;
#endif
#endif
/*
Create a temporary file in a given directory
This function should be used instead of my_tempnam() !
*/
File create_temp_file(char *to, const char *dir, const char *prefix,
int mode __attribute__((unused)),
myf MyFlags __attribute__((unused)))
{
File file= -1;
DBUG_ENTER("create_temp_file");
#if defined(_MSC_VER)
{
Fix of LEFT JOIN optimizer bug, problem with key cache on Windows and a lot of portability issues. Docs/manual.texi: Changed FOREIGN KEY to FOREIGN KEY constraint client/mysqladmin.c: Don't flush MASTER or SLAVE on refresh configure.in: Fix for hpux 11.0 extra/perror.c: New error message include/my_pthread.h: Portability fix for windows myisam/mi_locking.c: Ensure that locking doesn't interfere with pread/pwrite on windows myisam/sort.c: checked with purecover mysys/mf_tempfile.c: Fix for windows mysys/my_lock.c: Ensure that locking doesn't interfere with pread/pwrite on windows mysys/my_winthread.c: Portability fix sql-bench/Results/ATIS-mysql-NT_4.0: New benchmark runs sql-bench/Results/RUN-mysql-NT_4.0: New benchmark runs sql-bench/Results/alter-table-mysql-NT_4.0: New benchmark runs sql-bench/Results/big-tables-mysql-NT_4.0: New benchmark runs sql-bench/Results/connect-mysql-NT_4.0: New benchmark runs sql-bench/Results/create-mysql-NT_4.0: New benchmark runs sql-bench/Results/insert-mysql-NT_4.0: New benchmark runs sql-bench/Results/select-mysql-NT_4.0: New benchmark runs sql-bench/Results/wisconsin-mysql-NT_4.0: New benchmark runs sql-bench/crash-me.sh: Fixed things for PostgreSQL sql-bench/limits/mysql-3.23.cfg: Update for new crash-me sql-bench/limits/mysql.cfg: Update for new crash-me sql-bench/print-limit-table: Fixed position for alter table rename sql-bench/test-insert.sh: Fix for PostgreSQL sql/field.cc: Fix for default values in CREATE ... SELECT sql/field.h: Fix for default values in CREATE ... SELECT sql/log.cc: Fixed typo sql/log_event.cc: Portability fix sql/mysqlbinlog.cc: Portability fix sql/mysqld.cc: Don't turn of concurrent insert with --skip-new or --safe sql/sql_base.cc: Portability fix sql/sql_class.cc: Portability fix sql/sql_class.h: Portability fix sql/sql_parse.cc: Fix for --log-slow-queries sql/sql_repl.cc: Portability fixes sql/sql_select.cc: Fixed optimizer bug for LEFT JOIN sql/sql_select.h: Fixed optimizer bug for LEFT JOIN sql/sql_table.cc: Fix for default values in CREATE ... SELECT sql/sql_yacc.yy: Added optional AS to: CREATE TABLE foo [ AS ] SELECT ...
2000-10-14 03:16:35 +03:00
char temp[FN_REFLEN],*end,*res,**old_env,*temp_env[1];
old_env=environ;
if (dir)
{
end=strend(dir)-1;
if (!dir[0])
{ /* Change empty string to current dir */
to[0]= FN_CURLIB;
to[1]= 0;
dir=to;
}
else if (*end == FN_DEVCHAR)
{ /* Get current dir for drive */
_fullpath(temp,dir,FN_REFLEN);
dir=to;
}
else if (*end == FN_LIBCHAR && dir < end && end[-1] != FN_DEVCHAR)
{
strmake(to,dir,(uint) (end-dir)); /* Copy and remove last '\' */
dir=to;
}
environ=temp_env; /* Force use of dir (dir not checked) */
temp_env[0]=0;
}
if ((res=tempnam((char*) dir,(char *) prefix)))
{
strmake(to,res,FN_REFLEN-1);
(*free)(res);
file=my_create(to,0, mode, MyFlags);
}
environ=old_env;
}
#elif defined(_ZTC__)
if (!dir)
dir=getenv("TMPDIR");
if ((res=tempnam((char*) dir,(char *) prefix)))
{
strmake(to,res,FN_REFLEN-1);
(*free)(res);
file=my_create(to, 0, mode, MyFlags);
}
#elif defined(HAVE_MKSTEMP)
{
char prefix_buff[30];
uint pfx_len;
Lots of new benchmark runs Remember filename for temporary files created with mkstemp Fixed wrongly allocated BDB share structure Cleanups for SunPRO BitKeeper/deleted/.del-ATIS-mysql-SunOS_5.6_sun4m~62028e0375b3b8b: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql-SunOS_5.6_sun4m~eafc8188345e262b: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql-SunOS_5.6_sun4m~8a1bd6589a189890: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql-SunOS_5.6_sun4m~f351a7f3e1e2257e: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql-SunOS_5.6_sun4m~a10e3ddfa26a3e7f: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql-SunOS_5.6_sun4m~9233114ae6f8c5f: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql-SunOS_5.6_sun4m~3402d060ae20e19: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql-SunOS_5.6_sun4m~4da215905bce988d: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql-SunOS_5.6_sun4m~ec61b14072715dc8: ***MISSING WEAVE*** BitKeeper/deleted/.del-ATIS-mysql-Linux_2.2.12_20smp_i686~28211fb9f0e6ab0e: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql-Linux_2.2.12_20smp_i686~da28ced3e0aac09c: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql-Linux_2.2.12_20smp_i686~67ae4e91b5f4eabd: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql-Linux_2.2.12_20smp_i686~a2dcb74a3c73ac18: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql-Linux_2.2.12_20smp_i686~beedcd769a903c19: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql-Linux_2.2.12_20smp_i686~fe23ee50aea195f4: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql-Linux_2.2.12_20smp_i686~f120b0ead3836c81: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql-Linux_2.2.12_20smp_i686~3b64aff0dfddfff4: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql-Linux_2.2.12_20smp_i686~d49db545341a732f: ***MISSING WEAVE*** BitKeeper/deleted/.del-ATIS-mysql-Linux_2.2.13_SMP_alpha~136bdd9fd1a2cd14: ***MISSING WEAVE*** BitKeeper/deleted/.del-ATIS-mysql_fast-Linux_2.2.13_SMP_alpha~defb62af5958fcac: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql-Linux_2.2.13_SMP_alpha~f6fa9f46d4a6152: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql_fast-Linux_2.2.13_SMP_alpha~16694c5927b7600c: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql-Linux_2.2.13_SMP_alpha~c85eb85ba45dd748: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql_fast-Linux_2.2.13_SMP_alpha~b062db76cf6df5d2: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql-Linux_2.2.13_SMP_alpha~b5f4f4c35225f0f: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql_fast-Linux_2.2.13_SMP_alpha~a9eedd951eab7e8b: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql-Linux_2.2.13_SMP_alpha~74ec2bf5f55b81f: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql_fast-Linux_2.2.13_SMP_alpha~f6d7665c418d62c6: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql-Linux_2.2.13_SMP_alpha~771b40d3280fe8ad: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql_fast-Linux_2.2.13_SMP_alpha~c46d6c283c0e34ae: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql-Linux_2.2.13_SMP_alpha~17f262f12d2244bc: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql_fast-Linux_2.2.13_SMP_alpha~3245ba5633a18e8: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql-Linux_2.2.13_SMP_alpha~9fd9c6e036f988d7: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql_fast-Linux_2.2.13_SMP_alpha~744633c6e13a897f: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql-Linux_2.2.13_SMP_alpha~ad7babd436f26841: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql_fast-Linux_2.2.13_SMP_alpha~6ad065fe4c6b4fa9: ***MISSING WEAVE*** BUILD/compile-pentium: Added command line arguments Docs/manual.texi: Update for 3.23.30 configure.in: Removed duplicated symbol include/my_sys.h: cleanup of my_open/my_create/my_tempfile mysys/mf_tempfile.c: Remember filename for temporary files created with mkstemp mysys/my_create.c: cleanup of my_open/my_create/my_tempfile mysys/my_open.c: cleanup of my_open/my_create/my_tempfile scripts/mysqld_multi.sh: Use paths from configure scripts/safe_mysqld.sh: Cleanup sql-bench/Results/ATIS-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/RUN-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/alter-table-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/big-tables-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/connect-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/create-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/insert-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/select-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/wisconsin-mysql-SunOS_5.7_sun4m: New benchmark results sql/ha_berkeley.cc: Fixed wrongly allocated share structure sql/item_cmpfunc.cc: Cleanup sql/item_cmpfunc.h: Cleanup sql/log_event.h: Cleanup sql/mysqld.cc: Changed default number of BDB locks to 10000 sql/sql_class.h: cleanup sql/sql_show.cc: cleanup support-files/mysql.spec.sh: Added mysqld_multi sql-bench/Results-linux/ATIS-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/ATIS-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/RUN-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/RUN-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/alter-table-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/alter-table-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/big-tables-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/big-tables-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/connect-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/connect-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/create-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/create-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/insert-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/insert-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/select-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/select-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/wisconsin-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/wisconsin-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE***
2000-12-18 16:09:19 +02:00
File org_file;
2001-10-04 02:44:18 +03:00
pfx_len= (uint) (strmov(strnmov(prefix_buff,
prefix ? prefix : "tmp.",
sizeof(prefix_buff)-7),"XXXXXX") -
prefix_buff);
if (!dir && ! (dir =getenv("TMPDIR")))
dir=P_tmpdir;
if (strlen(dir)+ pfx_len > FN_REFLEN-2)
{
errno=my_errno= ENAMETOOLONG;
return 1;
}
Updated manual about embedded version. Speed up column-completion in 'mysql' Don't use ISAM if HAVE_ISAM is not defined A lot of fixes for the embedded version. All libraries are now included in libmysqld.a Changed arguments to convert_dirname() to make it more general. Renamed files in the 'merge' directory to all use a common prefix. Don't compile both assembler and C functions on x86 BitKeeper/deleted/.del-mf_pack2.c~f07795bbcf57be7: Delete: mysys/mf_pack2.c Docs/manual.texi: Updated chapter about embedded version acinclude.m4: Fix for using BDB and InnoDB with embedded client/completion_hash.cc: Speed up memory allocation client/completion_hash.h: Speed up memory allocation client/mysql.cc: Speed up memory allocation client/mysqldump.c: Fix to use now convert_dirname client/mysqltest.c: Fixed memory allocation bugs. Added --basedir=#, --compress=#, --server-arg, --server-file. Fixes for embedded version Changed silent mode to -s instead of -q include/my_global.h: Update to use HAVE_ISAM include/my_sys.h: Cleanup of fn_format() include/mysql.h: Prepare FIELD struct for 4.1 include/mysql_embed.h: Don't use ISAM in embedded version innobase/include/srv0srv.h: Make InnoDB startup/shutdown silent in embedded version innobase/log/log0log.c: Make InnoDB startup/shutdown silent in embedded version innobase/srv/srv0srv.c: Make InnoDB startup/shutdown silent in embedded version innobase/srv/srv0start.c: Make InnoDB startup/shutdown silent in embedded version isam/isamlog.c: new convert_dirname libmysql/libmysql.c: Prepare for 4.1 libmysqld/Makefile.am: Changed to create one libmysqld.a file that includes all other libraries. libmysqld/examples/Makefile.am: Changed to use new libmysqld.a libmysqld/examples/test-run: Lot's of fixes to get new mysqltest with embedded MySQL to work. libmysqld/lib_sql.cc: Changed type of arguments for mysql_server_init() to make code more portable. libmysqld/libmysqld.c: Cleanup merge/Makefile.am: Rename to use common prefix. merge/mrg_close.c: Rename to use common prefix. merge/mrg_create.c: Rename to use common prefix. merge/mrg_def.h: Rename to use common prefix. merge/mrg_delete.c: Rename to use common prefix. merge/mrg_extra.c: Rename to use common prefix. merge/mrg_info.c: Rename to use common prefix. merge/mrg_locking.c: Rename to use common prefix. merge/mrg_open.c: Rename to use common prefix. merge/mrg_panic.c: Rename to use common prefix. merge/mrg_rrnd.c: Rename to use common prefix. merge/mrg_rsame.c: Rename to use common prefix. merge/mrg_static.c: Rename to use common prefix. merge/mrg_update.c: Rename to use common prefix. myisam/myisamlog.c: Use new convert_dirname myisammrg/Makefile.am: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_close.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_create.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_def.h: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_delete.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_extra.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_info.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_locking.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_open.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_panic.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_queue.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_rfirst.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_rkey.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_rlast.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_rnext.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_rprev.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_rrnd.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_rsame.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_static.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_update.c: Renamed mymrgdef.h -> myrg_def.h myisammrg/myrg_write.c: Renamed mymrgdef.h -> myrg_def.h mysql-test/include/master-slave.inc: Use short filenames for sockets (portability problem on Mac OS X) mysql-test/mysql-test-run.sh: cleanup mysql-test/r/auto_increment.result: Cleanup of tests for embedded version mysql-test/r/func_system.result: Cleanup of tests for embedded version mysql-test/r/isam.result: Cleanup of tests for embedded version mysql-test/r/lock.result: Cleanup of tests for embedded version mysql-test/r/show_check.result: Cleanup of tests for embedded version mysql-test/t/auto_increment.test: Cleanup of tests for embedded version mysql-test/t/backup.test: Cleanup of tests for embedded version mysql-test/t/count_distinct2-master.opt: Cleanup of tests for embedded version mysql-test/t/count_distinct2.test: Cleanup of tests for embedded version mysql-test/t/create.test: Cleanup of tests for embedded version mysql-test/t/flush.test: Cleanup of tests for embedded version mysql-test/t/func_system.test: Cleanup of tests for embedded version mysql-test/t/isam.test: Cleanup of tests for embedded version mysql-test/t/kill.test: Cleanup of tests for embedded version mysql-test/t/lock.test: Cleanup of tests for embedded version mysql-test/t/order_fill_sortbuf-master.opt: Cleanup of tests for embedded version mysql-test/t/rpl000015.test: Use short filenames for sockets (portability problem on Mac OS X) mysql-test/t/rpl000016.test: Use short filenames for sockets (portability problem on Mac OS X) mysql-test/t/rpl000017.test: Use short filenames for sockets (portability problem on Mac OS X) mysql-test/t/rpl000018.test: Use short filenames for sockets (portability problem on Mac OS X) mysql-test/t/show_check.test: Move ISAM specific tests to isam.test mysql-test/t/status.test: Cleanup of tests for embedded version mysql-test/t/tablelock.test: Cleanup mysys/Makefile.am: Removed not used mf_pack2.c mysys/charset.c: new convert_dirname mysys/default.c: new convert_dirname mysys/mf_dirname.c: Changed convert_dirname() to be more general mysys/mf_format.c: Changed bit flags to fn_format() to defines. Added handling of relative filenames BitKeeper/etc/ignore: Added libmysqld/examples/test-gdbinit scripts/mysql_explain_log to the ignore list mysys/mf_pack.c: new convert_dirname mysys/mf_tempfile.c: new convert_dirname scripts/Makefile.am: Adde mysql_explain_log scripts/mysql_config.sh: Added support of --libmysqld-libs sql/Makefile.am: Fix to use 'innodb_system_libs' sql/ha_innobase.cc: Make InnoDB startup/shutdown silent in embedded version sql/ha_isam.cc: Added handling of HAVE_ISAM sql/ha_isammrg.cc: Added handling of HAVE_ISAM sql/ha_myisam.cc: Handle relative paths; Needed to support BACKUP TABLE in embedded version sql/ha_myisammrg.cc: Rename of filenames sql/handler.cc: Added handling of HAVE_ISAM sql/item_func.cc: Fix for ecc (Intel Compiler) sql/mysql_priv.h: Added global variable 'mysql_embedded' sql/mysqld.cc: Use HAVE_ISAM sql/sql_parse.cc: Use new convert_dirname sql/sql_select.cc: Fix for ecc (Intel Compiler) sql/sql_table.cc: Added handling of relative filenames strings/Makefile.am: Don't compile both assembler and C functions on x86 strings/bchange.c: cleanup
2001-10-08 04:58:07 +03:00
strmov(convert_dirname(to,dir,NullS),prefix_buff);
Lots of new benchmark runs Remember filename for temporary files created with mkstemp Fixed wrongly allocated BDB share structure Cleanups for SunPRO BitKeeper/deleted/.del-ATIS-mysql-SunOS_5.6_sun4m~62028e0375b3b8b: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql-SunOS_5.6_sun4m~eafc8188345e262b: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql-SunOS_5.6_sun4m~8a1bd6589a189890: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql-SunOS_5.6_sun4m~f351a7f3e1e2257e: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql-SunOS_5.6_sun4m~a10e3ddfa26a3e7f: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql-SunOS_5.6_sun4m~9233114ae6f8c5f: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql-SunOS_5.6_sun4m~3402d060ae20e19: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql-SunOS_5.6_sun4m~4da215905bce988d: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql-SunOS_5.6_sun4m~ec61b14072715dc8: ***MISSING WEAVE*** BitKeeper/deleted/.del-ATIS-mysql-Linux_2.2.12_20smp_i686~28211fb9f0e6ab0e: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql-Linux_2.2.12_20smp_i686~da28ced3e0aac09c: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql-Linux_2.2.12_20smp_i686~67ae4e91b5f4eabd: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql-Linux_2.2.12_20smp_i686~a2dcb74a3c73ac18: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql-Linux_2.2.12_20smp_i686~beedcd769a903c19: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql-Linux_2.2.12_20smp_i686~fe23ee50aea195f4: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql-Linux_2.2.12_20smp_i686~f120b0ead3836c81: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql-Linux_2.2.12_20smp_i686~3b64aff0dfddfff4: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql-Linux_2.2.12_20smp_i686~d49db545341a732f: ***MISSING WEAVE*** BitKeeper/deleted/.del-ATIS-mysql-Linux_2.2.13_SMP_alpha~136bdd9fd1a2cd14: ***MISSING WEAVE*** BitKeeper/deleted/.del-ATIS-mysql_fast-Linux_2.2.13_SMP_alpha~defb62af5958fcac: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql-Linux_2.2.13_SMP_alpha~f6fa9f46d4a6152: ***MISSING WEAVE*** BitKeeper/deleted/.del-RUN-mysql_fast-Linux_2.2.13_SMP_alpha~16694c5927b7600c: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql-Linux_2.2.13_SMP_alpha~c85eb85ba45dd748: ***MISSING WEAVE*** BitKeeper/deleted/.del-alter-table-mysql_fast-Linux_2.2.13_SMP_alpha~b062db76cf6df5d2: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql-Linux_2.2.13_SMP_alpha~b5f4f4c35225f0f: ***MISSING WEAVE*** BitKeeper/deleted/.del-big-tables-mysql_fast-Linux_2.2.13_SMP_alpha~a9eedd951eab7e8b: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql-Linux_2.2.13_SMP_alpha~74ec2bf5f55b81f: ***MISSING WEAVE*** BitKeeper/deleted/.del-connect-mysql_fast-Linux_2.2.13_SMP_alpha~f6d7665c418d62c6: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql-Linux_2.2.13_SMP_alpha~771b40d3280fe8ad: ***MISSING WEAVE*** BitKeeper/deleted/.del-create-mysql_fast-Linux_2.2.13_SMP_alpha~c46d6c283c0e34ae: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql-Linux_2.2.13_SMP_alpha~17f262f12d2244bc: ***MISSING WEAVE*** BitKeeper/deleted/.del-insert-mysql_fast-Linux_2.2.13_SMP_alpha~3245ba5633a18e8: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql-Linux_2.2.13_SMP_alpha~9fd9c6e036f988d7: ***MISSING WEAVE*** BitKeeper/deleted/.del-select-mysql_fast-Linux_2.2.13_SMP_alpha~744633c6e13a897f: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql-Linux_2.2.13_SMP_alpha~ad7babd436f26841: ***MISSING WEAVE*** BitKeeper/deleted/.del-wisconsin-mysql_fast-Linux_2.2.13_SMP_alpha~6ad065fe4c6b4fa9: ***MISSING WEAVE*** BUILD/compile-pentium: Added command line arguments Docs/manual.texi: Update for 3.23.30 configure.in: Removed duplicated symbol include/my_sys.h: cleanup of my_open/my_create/my_tempfile mysys/mf_tempfile.c: Remember filename for temporary files created with mkstemp mysys/my_create.c: cleanup of my_open/my_create/my_tempfile mysys/my_open.c: cleanup of my_open/my_create/my_tempfile scripts/mysqld_multi.sh: Use paths from configure scripts/safe_mysqld.sh: Cleanup sql-bench/Results/ATIS-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/RUN-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/alter-table-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/big-tables-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/connect-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/create-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/insert-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/select-mysql-SunOS_5.7_sun4m: New benchmark results sql-bench/Results/wisconsin-mysql-SunOS_5.7_sun4m: New benchmark results sql/ha_berkeley.cc: Fixed wrongly allocated share structure sql/item_cmpfunc.cc: Cleanup sql/item_cmpfunc.h: Cleanup sql/log_event.h: Cleanup sql/mysqld.cc: Changed default number of BDB locks to 10000 sql/sql_class.h: cleanup sql/sql_show.cc: cleanup support-files/mysql.spec.sh: Added mysqld_multi sql-bench/Results-linux/ATIS-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/ATIS-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/RUN-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/RUN-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/alter-table-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/alter-table-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/big-tables-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/big-tables-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/connect-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/connect-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/create-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/create-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/insert-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/insert-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/select-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/select-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/wisconsin-mysql_dbug-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE*** sql-bench/Results-linux/wisconsin-mysql_dbug_full-Linux_2.2.14_my_SMP_i686: ***MISSING WEAVE***
2000-12-18 16:09:19 +02:00
org_file=mkstemp(to);
file=my_register_filename(org_file, to, FILE_BY_MKSTEMP,
EE_CANTCREATEFILE, MyFlags);
/* If we didn't manage to register the name, remove the temp file */
if (org_file >= 0 && file < 0)
{
int tmp=my_errno;
(void) my_delete(to, MYF(MY_WME | ME_NOINPUT));
my_errno=tmp;
}
}
#elif defined(HAVE_TEMPNAM)
{
char *res,**old_env,*temp_env[1];
if (dir && !dir[0])
{ /* Change empty string to current dir */
to[0]= FN_CURLIB;
to[1]= 0;
dir=to;
}
Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. Docs/manual.texi: Updated credits client/mysql.cc: Fixes for OS2 client/mysqladmin.c: Fixes for OS2 client/mysqldump.c: Fixes for OS2 client/mysqlimport.c: Fixes for OS2 client/mysqltest.c: Fixes for OS2 dbug/dbug.c: Fixes for OS2. Use new C calling convention. dbug/factorial.c: Fixes for OS2. Use new C calling convention. include/errmsg.h: Fix for OS2 include/global.h: Fixes for OS2. include/my_pthread.h: Fixes for OS2. include/my_sys.h: Fixes for OS2. include/mysql_com.h: Move defines to global.h include/thr_alarm.h: Fixes for OS2. isam/isamchk.c: Fixes for OS2. Add arguments to function declarations. isam/isamlog.c: Fixes for OS2. Fix bug in logfile handling. isam/test1.c: Add arguments to function decl isam/test2.c: Add arguments to function declarations. isam/test_all.res: Update result libmysql/get_password.c: Fixes for OS2. libmysql/libmysql.c: Fixes for OS2. libmysql/net.c: Fixes for OS2. libmysql/violite.c: Add arguments to function declarations. merge/_locking.c: Add argument types to function declarations. merge/close.c: Add argument types to function declarations. merge/create.c: Add argument types to function declarations. merge/extra.c: Add argument types to function declarations. merge/open.c: Add argument types to function declarations. merge/panic.c: Add argument types to function declarations. merge/rsame.c: Add argument types to function declarations. merge/update.c: Add argument types to function declarations. myisam/ft_eval.c: Portability fix myisam/ft_search.c: Portability fix myisam/ft_test1.c: Portability fix myisam/ftdefs.h: Portability fix myisam/mi_check.c: Portability fix myisam/mi_test1.c: Portability fix myisam/mi_test2.c: Portability fix myisam/mi_test_all.sh: Update to test for MACH variable myisam/myisamlog.c: Cleanup myisam/myisampack.c: Don't use variable 'new' myisam/sort.c: Portability fix myisammrg/myrg_delete.c: Add argument types to function declarations. myisammrg/myrg_locking.c: Add argument types to function declarations. myisammrg/myrg_open.c: Add argument types to function declarations. myisammrg/myrg_panic.c: Add argument types to function declarations. mysql-test/t/backup.test: Fix for OS2 mysql-test/t/show_check.test: Fix for OS2 mysys/charset.c: Dont use variable 'new' mysys/default.c: Fixes for OS2. mysys/getopt.c: Fixes for OS2. mysys/getopt1.c: Fixes for OS2. mysys/list.c: Don't use variable 'new' mysys/mf_dirname.c: Fixes for OS2. mysys/mf_format.c: Fixes for OS2. mysys/mf_path.c: Fixes for OS2. mysys/mf_qsort.c: Portability fix mysys/mf_tempfile.c: Fixes for OS2. mysys/my_clock.c: Fixes for OS2. mysys/my_copy.c: Fixes for OS2. mysys/my_create.c: Fixes for OS2. mysys/my_getwd.c: Fixes for OS2. mysys/my_init.c: Fixes for OS2. mysys/my_lib.c: Fixes for OS2. mysys/my_lock.c: Fixes for OS2. mysys/my_malloc.c: Portability fix mysys/my_mkdir.c: Fixes for OS2. mysys/my_open.c: Fixes for OS2. mysys/my_pthread.c: Fixes for OS2. mysys/my_realloc.c: Fixes for OS2. mysys/my_redel.c: Fixes for OS2. mysys/my_static.c: Fixes for OS2. mysys/my_tempnam.c: Fixes for OS2. mysys/my_thr_init.c: Fixes for OS2. mysys/my_write.c: Fixes for OS2. mysys/test_charset.c: Fixes for OS2. mysys/thr_alarm.c: Fixes for OS2. mysys/tree.c: Fixes for OS2. sql/field.cc: Fixes for OS2. sql/field.h: Fixes for OS2. sql/gen_lex_hash.cc: Fixes for OS2. sql/hostname.cc: Fixes for OS2. sql/item_func.cc: Fixes for OS2. sql/item_strfunc.cc: Fixes for OS2. sql/log_event.cc: Fixes for OS2. sql/md5.c: Fixes for OS2. sql/mini_client.cc: Fixes for OS2. sql/mysql_priv.h: Fixes for OS2. sql/mysqld.cc: Fixes for OS2. sql/net_serv.cc: Fixes for OS2. sql/slave.cc: Fixes for OS2. sql/sql_base.cc: Fixes for OS2. sql/sql_db.cc: Portability fix sql/sql_insert.cc: Fixes for OS2. sql/sql_load.cc: Fixes for OS2. sql/sql_parse.cc: Fixes for OS2. sql/sql_table.cc: Fixes for OS2. sql/sql_udf.cc: Fixes for OS2. sql/violite.c: Fixes for OS2. strings/ctype-big5.c: Fixes for OS2. strings/ctype-gbk.c: Fixes for OS2. strings/ctype-sjis.c: Fixes for OS2. strings/ctype-tis620.c: Fixes for OS2. strings/ctype.c: Fixes for OS2. strings/strnlen.c: Fixes for OS2.
2001-08-22 01:45:07 +03:00
#ifdef OS2
// changing environ variable doesn't work with VACPP
char buffer[256];
sprintf( buffer, "TMP=%s", dir);
putenv( buffer);
#else
old_env= (char**) environ;
if (dir)
{ /* Don't use TMPDIR if dir is given */
Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. Docs/manual.texi: Updated credits client/mysql.cc: Fixes for OS2 client/mysqladmin.c: Fixes for OS2 client/mysqldump.c: Fixes for OS2 client/mysqlimport.c: Fixes for OS2 client/mysqltest.c: Fixes for OS2 dbug/dbug.c: Fixes for OS2. Use new C calling convention. dbug/factorial.c: Fixes for OS2. Use new C calling convention. include/errmsg.h: Fix for OS2 include/global.h: Fixes for OS2. include/my_pthread.h: Fixes for OS2. include/my_sys.h: Fixes for OS2. include/mysql_com.h: Move defines to global.h include/thr_alarm.h: Fixes for OS2. isam/isamchk.c: Fixes for OS2. Add arguments to function declarations. isam/isamlog.c: Fixes for OS2. Fix bug in logfile handling. isam/test1.c: Add arguments to function decl isam/test2.c: Add arguments to function declarations. isam/test_all.res: Update result libmysql/get_password.c: Fixes for OS2. libmysql/libmysql.c: Fixes for OS2. libmysql/net.c: Fixes for OS2. libmysql/violite.c: Add arguments to function declarations. merge/_locking.c: Add argument types to function declarations. merge/close.c: Add argument types to function declarations. merge/create.c: Add argument types to function declarations. merge/extra.c: Add argument types to function declarations. merge/open.c: Add argument types to function declarations. merge/panic.c: Add argument types to function declarations. merge/rsame.c: Add argument types to function declarations. merge/update.c: Add argument types to function declarations. myisam/ft_eval.c: Portability fix myisam/ft_search.c: Portability fix myisam/ft_test1.c: Portability fix myisam/ftdefs.h: Portability fix myisam/mi_check.c: Portability fix myisam/mi_test1.c: Portability fix myisam/mi_test2.c: Portability fix myisam/mi_test_all.sh: Update to test for MACH variable myisam/myisamlog.c: Cleanup myisam/myisampack.c: Don't use variable 'new' myisam/sort.c: Portability fix myisammrg/myrg_delete.c: Add argument types to function declarations. myisammrg/myrg_locking.c: Add argument types to function declarations. myisammrg/myrg_open.c: Add argument types to function declarations. myisammrg/myrg_panic.c: Add argument types to function declarations. mysql-test/t/backup.test: Fix for OS2 mysql-test/t/show_check.test: Fix for OS2 mysys/charset.c: Dont use variable 'new' mysys/default.c: Fixes for OS2. mysys/getopt.c: Fixes for OS2. mysys/getopt1.c: Fixes for OS2. mysys/list.c: Don't use variable 'new' mysys/mf_dirname.c: Fixes for OS2. mysys/mf_format.c: Fixes for OS2. mysys/mf_path.c: Fixes for OS2. mysys/mf_qsort.c: Portability fix mysys/mf_tempfile.c: Fixes for OS2. mysys/my_clock.c: Fixes for OS2. mysys/my_copy.c: Fixes for OS2. mysys/my_create.c: Fixes for OS2. mysys/my_getwd.c: Fixes for OS2. mysys/my_init.c: Fixes for OS2. mysys/my_lib.c: Fixes for OS2. mysys/my_lock.c: Fixes for OS2. mysys/my_malloc.c: Portability fix mysys/my_mkdir.c: Fixes for OS2. mysys/my_open.c: Fixes for OS2. mysys/my_pthread.c: Fixes for OS2. mysys/my_realloc.c: Fixes for OS2. mysys/my_redel.c: Fixes for OS2. mysys/my_static.c: Fixes for OS2. mysys/my_tempnam.c: Fixes for OS2. mysys/my_thr_init.c: Fixes for OS2. mysys/my_write.c: Fixes for OS2. mysys/test_charset.c: Fixes for OS2. mysys/thr_alarm.c: Fixes for OS2. mysys/tree.c: Fixes for OS2. sql/field.cc: Fixes for OS2. sql/field.h: Fixes for OS2. sql/gen_lex_hash.cc: Fixes for OS2. sql/hostname.cc: Fixes for OS2. sql/item_func.cc: Fixes for OS2. sql/item_strfunc.cc: Fixes for OS2. sql/log_event.cc: Fixes for OS2. sql/md5.c: Fixes for OS2. sql/mini_client.cc: Fixes for OS2. sql/mysql_priv.h: Fixes for OS2. sql/mysqld.cc: Fixes for OS2. sql/net_serv.cc: Fixes for OS2. sql/slave.cc: Fixes for OS2. sql/sql_base.cc: Fixes for OS2. sql/sql_db.cc: Portability fix sql/sql_insert.cc: Fixes for OS2. sql/sql_load.cc: Fixes for OS2. sql/sql_parse.cc: Fixes for OS2. sql/sql_table.cc: Fixes for OS2. sql/sql_udf.cc: Fixes for OS2. sql/violite.c: Fixes for OS2. strings/ctype-big5.c: Fixes for OS2. strings/ctype-gbk.c: Fixes for OS2. strings/ctype-sjis.c: Fixes for OS2. strings/ctype-tis620.c: Fixes for OS2. strings/ctype.c: Fixes for OS2. strings/strnlen.c: Fixes for OS2.
2001-08-22 01:45:07 +03:00
environ=(const char**) temp_env;
temp_env[0]=0;
}
Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. Docs/manual.texi: Updated credits client/mysql.cc: Fixes for OS2 client/mysqladmin.c: Fixes for OS2 client/mysqldump.c: Fixes for OS2 client/mysqlimport.c: Fixes for OS2 client/mysqltest.c: Fixes for OS2 dbug/dbug.c: Fixes for OS2. Use new C calling convention. dbug/factorial.c: Fixes for OS2. Use new C calling convention. include/errmsg.h: Fix for OS2 include/global.h: Fixes for OS2. include/my_pthread.h: Fixes for OS2. include/my_sys.h: Fixes for OS2. include/mysql_com.h: Move defines to global.h include/thr_alarm.h: Fixes for OS2. isam/isamchk.c: Fixes for OS2. Add arguments to function declarations. isam/isamlog.c: Fixes for OS2. Fix bug in logfile handling. isam/test1.c: Add arguments to function decl isam/test2.c: Add arguments to function declarations. isam/test_all.res: Update result libmysql/get_password.c: Fixes for OS2. libmysql/libmysql.c: Fixes for OS2. libmysql/net.c: Fixes for OS2. libmysql/violite.c: Add arguments to function declarations. merge/_locking.c: Add argument types to function declarations. merge/close.c: Add argument types to function declarations. merge/create.c: Add argument types to function declarations. merge/extra.c: Add argument types to function declarations. merge/open.c: Add argument types to function declarations. merge/panic.c: Add argument types to function declarations. merge/rsame.c: Add argument types to function declarations. merge/update.c: Add argument types to function declarations. myisam/ft_eval.c: Portability fix myisam/ft_search.c: Portability fix myisam/ft_test1.c: Portability fix myisam/ftdefs.h: Portability fix myisam/mi_check.c: Portability fix myisam/mi_test1.c: Portability fix myisam/mi_test2.c: Portability fix myisam/mi_test_all.sh: Update to test for MACH variable myisam/myisamlog.c: Cleanup myisam/myisampack.c: Don't use variable 'new' myisam/sort.c: Portability fix myisammrg/myrg_delete.c: Add argument types to function declarations. myisammrg/myrg_locking.c: Add argument types to function declarations. myisammrg/myrg_open.c: Add argument types to function declarations. myisammrg/myrg_panic.c: Add argument types to function declarations. mysql-test/t/backup.test: Fix for OS2 mysql-test/t/show_check.test: Fix for OS2 mysys/charset.c: Dont use variable 'new' mysys/default.c: Fixes for OS2. mysys/getopt.c: Fixes for OS2. mysys/getopt1.c: Fixes for OS2. mysys/list.c: Don't use variable 'new' mysys/mf_dirname.c: Fixes for OS2. mysys/mf_format.c: Fixes for OS2. mysys/mf_path.c: Fixes for OS2. mysys/mf_qsort.c: Portability fix mysys/mf_tempfile.c: Fixes for OS2. mysys/my_clock.c: Fixes for OS2. mysys/my_copy.c: Fixes for OS2. mysys/my_create.c: Fixes for OS2. mysys/my_getwd.c: Fixes for OS2. mysys/my_init.c: Fixes for OS2. mysys/my_lib.c: Fixes for OS2. mysys/my_lock.c: Fixes for OS2. mysys/my_malloc.c: Portability fix mysys/my_mkdir.c: Fixes for OS2. mysys/my_open.c: Fixes for OS2. mysys/my_pthread.c: Fixes for OS2. mysys/my_realloc.c: Fixes for OS2. mysys/my_redel.c: Fixes for OS2. mysys/my_static.c: Fixes for OS2. mysys/my_tempnam.c: Fixes for OS2. mysys/my_thr_init.c: Fixes for OS2. mysys/my_write.c: Fixes for OS2. mysys/test_charset.c: Fixes for OS2. mysys/thr_alarm.c: Fixes for OS2. mysys/tree.c: Fixes for OS2. sql/field.cc: Fixes for OS2. sql/field.h: Fixes for OS2. sql/gen_lex_hash.cc: Fixes for OS2. sql/hostname.cc: Fixes for OS2. sql/item_func.cc: Fixes for OS2. sql/item_strfunc.cc: Fixes for OS2. sql/log_event.cc: Fixes for OS2. sql/md5.c: Fixes for OS2. sql/mini_client.cc: Fixes for OS2. sql/mysql_priv.h: Fixes for OS2. sql/mysqld.cc: Fixes for OS2. sql/net_serv.cc: Fixes for OS2. sql/slave.cc: Fixes for OS2. sql/sql_base.cc: Fixes for OS2. sql/sql_db.cc: Portability fix sql/sql_insert.cc: Fixes for OS2. sql/sql_load.cc: Fixes for OS2. sql/sql_parse.cc: Fixes for OS2. sql/sql_table.cc: Fixes for OS2. sql/sql_udf.cc: Fixes for OS2. sql/violite.c: Fixes for OS2. strings/ctype-big5.c: Fixes for OS2. strings/ctype-gbk.c: Fixes for OS2. strings/ctype-sjis.c: Fixes for OS2. strings/ctype-tis620.c: Fixes for OS2. strings/ctype.c: Fixes for OS2. strings/strnlen.c: Fixes for OS2.
2001-08-22 01:45:07 +03:00
#endif
if ((res=tempnam((char*) dir, (char*) prefix)))
{
strmake(to,res,FN_REFLEN-1);
(*free)(res);
file=my_create(to,0,
(int) (O_RDWR | O_BINARY | O_TRUNC |
O_TEMPORARY | O_SHORT_LIVED),
MYF(MY_WME));
}
else
{
DBUG_PRINT("error",("Got error: %d from tempnam",errno));
}
Fixes for OS2. Fix bug in isamlog Add argument types to function declarations. Docs/manual.texi: Updated credits client/mysql.cc: Fixes for OS2 client/mysqladmin.c: Fixes for OS2 client/mysqldump.c: Fixes for OS2 client/mysqlimport.c: Fixes for OS2 client/mysqltest.c: Fixes for OS2 dbug/dbug.c: Fixes for OS2. Use new C calling convention. dbug/factorial.c: Fixes for OS2. Use new C calling convention. include/errmsg.h: Fix for OS2 include/global.h: Fixes for OS2. include/my_pthread.h: Fixes for OS2. include/my_sys.h: Fixes for OS2. include/mysql_com.h: Move defines to global.h include/thr_alarm.h: Fixes for OS2. isam/isamchk.c: Fixes for OS2. Add arguments to function declarations. isam/isamlog.c: Fixes for OS2. Fix bug in logfile handling. isam/test1.c: Add arguments to function decl isam/test2.c: Add arguments to function declarations. isam/test_all.res: Update result libmysql/get_password.c: Fixes for OS2. libmysql/libmysql.c: Fixes for OS2. libmysql/net.c: Fixes for OS2. libmysql/violite.c: Add arguments to function declarations. merge/_locking.c: Add argument types to function declarations. merge/close.c: Add argument types to function declarations. merge/create.c: Add argument types to function declarations. merge/extra.c: Add argument types to function declarations. merge/open.c: Add argument types to function declarations. merge/panic.c: Add argument types to function declarations. merge/rsame.c: Add argument types to function declarations. merge/update.c: Add argument types to function declarations. myisam/ft_eval.c: Portability fix myisam/ft_search.c: Portability fix myisam/ft_test1.c: Portability fix myisam/ftdefs.h: Portability fix myisam/mi_check.c: Portability fix myisam/mi_test1.c: Portability fix myisam/mi_test2.c: Portability fix myisam/mi_test_all.sh: Update to test for MACH variable myisam/myisamlog.c: Cleanup myisam/myisampack.c: Don't use variable 'new' myisam/sort.c: Portability fix myisammrg/myrg_delete.c: Add argument types to function declarations. myisammrg/myrg_locking.c: Add argument types to function declarations. myisammrg/myrg_open.c: Add argument types to function declarations. myisammrg/myrg_panic.c: Add argument types to function declarations. mysql-test/t/backup.test: Fix for OS2 mysql-test/t/show_check.test: Fix for OS2 mysys/charset.c: Dont use variable 'new' mysys/default.c: Fixes for OS2. mysys/getopt.c: Fixes for OS2. mysys/getopt1.c: Fixes for OS2. mysys/list.c: Don't use variable 'new' mysys/mf_dirname.c: Fixes for OS2. mysys/mf_format.c: Fixes for OS2. mysys/mf_path.c: Fixes for OS2. mysys/mf_qsort.c: Portability fix mysys/mf_tempfile.c: Fixes for OS2. mysys/my_clock.c: Fixes for OS2. mysys/my_copy.c: Fixes for OS2. mysys/my_create.c: Fixes for OS2. mysys/my_getwd.c: Fixes for OS2. mysys/my_init.c: Fixes for OS2. mysys/my_lib.c: Fixes for OS2. mysys/my_lock.c: Fixes for OS2. mysys/my_malloc.c: Portability fix mysys/my_mkdir.c: Fixes for OS2. mysys/my_open.c: Fixes for OS2. mysys/my_pthread.c: Fixes for OS2. mysys/my_realloc.c: Fixes for OS2. mysys/my_redel.c: Fixes for OS2. mysys/my_static.c: Fixes for OS2. mysys/my_tempnam.c: Fixes for OS2. mysys/my_thr_init.c: Fixes for OS2. mysys/my_write.c: Fixes for OS2. mysys/test_charset.c: Fixes for OS2. mysys/thr_alarm.c: Fixes for OS2. mysys/tree.c: Fixes for OS2. sql/field.cc: Fixes for OS2. sql/field.h: Fixes for OS2. sql/gen_lex_hash.cc: Fixes for OS2. sql/hostname.cc: Fixes for OS2. sql/item_func.cc: Fixes for OS2. sql/item_strfunc.cc: Fixes for OS2. sql/log_event.cc: Fixes for OS2. sql/md5.c: Fixes for OS2. sql/mini_client.cc: Fixes for OS2. sql/mysql_priv.h: Fixes for OS2. sql/mysqld.cc: Fixes for OS2. sql/net_serv.cc: Fixes for OS2. sql/slave.cc: Fixes for OS2. sql/sql_base.cc: Fixes for OS2. sql/sql_db.cc: Portability fix sql/sql_insert.cc: Fixes for OS2. sql/sql_load.cc: Fixes for OS2. sql/sql_parse.cc: Fixes for OS2. sql/sql_table.cc: Fixes for OS2. sql/sql_udf.cc: Fixes for OS2. sql/violite.c: Fixes for OS2. strings/ctype-big5.c: Fixes for OS2. strings/ctype-gbk.c: Fixes for OS2. strings/ctype-sjis.c: Fixes for OS2. strings/ctype-tis620.c: Fixes for OS2. strings/ctype.c: Fixes for OS2. strings/strnlen.c: Fixes for OS2.
2001-08-22 01:45:07 +03:00
#ifndef OS2
environ=(const char**) old_env;
#endif
}
#else
{
register long uniq;
register int length;
my_string pos,end_pos;
/* Make an unique number */
pthread_mutex_lock(&THR_LOCK_open);
uniq= ((long) getpid() << 20) + (long) _my_tempnam_used++ ;
pthread_mutex_unlock(&THR_LOCK_open);
if (!dir && !(dir=getenv("TMPDIR"))) /* Use this if possibly */
dir=P_tmpdir; /* Use system default */
length=strlen(dir)+strlen(pfx)+1;
DBUG_PRINT("test",("mallocing %d byte",length+8+sizeof(TMP_EXT)+1));
if (length+8+sizeof(TMP_EXT)+1 > FN_REFLENGTH)
errno=my_errno= ENAMETOOLONG;
else
{
end_pos=strmov(to,dir);
if (end_pos != to && end_pos[-1] != FN_LIBCHAR)
*end_pos++=FN_LIBCHAR;
end_pos=strmov(end_pos,pfx);
for (length=0 ; length < 8 && uniq ; length++)
{
*end_pos++= _dig_vec[(int) (uniq & 31)];
uniq >>= 5;
}
(void) strmov(end_pos,TMP_EXT);
file=my_create(to,0,
(int) (O_RDWR | O_BINARY | O_TRUNC |
O_TEMPORARY | O_SHORT_LIVED),
MYF(MY_WME));
}
}
#endif
if (file >= 0)
thread_safe_increment(my_tmp_file_created,&THR_LOCK_open);
DBUG_RETURN(file);
}