summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-10-31 03:22:31 +0200
committerunknown <monty@hundin.mysql.fi>2001-10-31 03:22:31 +0200
commit4765ab612ca4f5ee35c413437f7da04889bd0a14 (patch)
treea7cd1bf6f7f295d11ffce88081f69bc1963bfd06 /mysys
parentbacf546eaaa2666a1634ea224af2c53cb17dcfb9 (diff)
downloadmariadb-git-4765ab612ca4f5ee35c413437f7da04889bd0a14.tar.gz
Update for OS2 (patch from Yuri Dario).
Use LONG_TIMEOUT (one year) instead of ~0 for long timeouts Fixed error messages. Fixed problem with const propagation when comparing columns of different types BitKeeper/deleted/.del-.cvsignore~a91d63182f0b2366: Delete: sql/share/norwegian/.cvsignore BitKeeper/deleted/.del-.cvsignore~469064b5190d703d: Delete: sql/share/norwegian-ny/.cvsignore Docs/manual.texi: Changelog client/client_priv.h: Update for OS2 client/mysqldump.c: Update for OS2 include/mysqld_error.h: Updated error texts isam/create.c: Removed warning myisam/myisamchk.c: Fix for OS2 myisam/myisampack.c: Fix for OS2 mysys/mf_cache.c: Fix for OS2 mysys/mf_tempfile.c: Fix for OS2 mysys/my_os2file64.c: Fix for OS2 mysys/my_tempnam.c: Fix for OS2 os2/ChangeLog.os2: Fix for OS2 os2/MySQL-Client.icc: Fix for OS2 os2/MySQL-Opt.icc: Fix for OS2 os2/MySQL-Source.icc: Fix for OS2 os2/MySQL-Sql.icc: Fix for OS2 os2/MySQL-Util.icc: Fix for OS2 sql/mysqld.cc: Use LONG_TIMEOUT (one year) instead of ~0 for long timeouts. This avoids some problems when users spefices wrong arguments to mysqld. sql/nt_servc.cc: C sql/share/czech/errmsg.txt: Updated error texts sql/share/danish/errmsg.txt: Updated error texts sql/share/dutch/errmsg.txt: Updated error texts sql/share/english/errmsg.txt: Updated error texts sql/share/estonian/errmsg.txt: Updated error texts sql/share/french/errmsg.txt: Updated error texts sql/share/german/errmsg.txt: Updated error texts sql/share/greek/errmsg.txt: Updated error texts sql/share/hungarian/errmsg.txt: Updated error texts sql/share/italian/errmsg.txt: Updated error texts sql/share/japanese/errmsg.txt: Updated error texts sql/share/korean/errmsg.txt: Updated error texts sql/share/norwegian-ny/errmsg.txt: Updated error texts sql/share/norwegian/errmsg.txt: Updated error texts sql/share/polish/errmsg.txt: Updated error texts sql/share/portuguese/errmsg.txt: Updated error texts sql/share/romanian/errmsg.txt: Updated error texts sql/share/russian/errmsg.txt: Updated error texts sql/share/slovak/errmsg.txt: Updated error texts sql/share/spanish/errmsg.txt: Updated error texts sql/share/swedish/errmsg.txt: Updated error texts sql/share/ukrainian/errmsg.txt: Updated error texts sql/sql_select.cc: Fixed problem with const propagation when comparing columns of different types. Fixed bug when HEAP table is converted to MyISAM tables in GROUP BY on long strings.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_cache.c4
-rw-r--r--mysys/mf_tempfile.c3
-rw-r--r--mysys/my_os2file64.c58
-rw-r--r--mysys/my_tempnam.c3
4 files changed, 58 insertions, 10 deletions
diff --git a/mysys/mf_cache.c b/mysys/mf_cache.c
index ff29926ac50..8d6eda8305a 100644
--- a/mysys/mf_cache.c
+++ b/mysys/mf_cache.c
@@ -37,11 +37,11 @@ static my_bool cache_remove_open_tmp(IO_CACHE *cache, const char *name)
#else
int length;
if (!(cache->file_name=
- (char*) my_malloc((length=strlen(name)+1),MYF(MY_WME)))
+ (char*) my_malloc((length=strlen(name)+1),MYF(MY_WME))))
{
my_close(cache->file,MYF(0));
cache->file = -1;
- errno=my_error=ENOMEM;
+ errno=my_errno=ENOMEM;
return 1;
}
memcpy(cache->file_name,name,length);
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c
index 2cdd720edbd..465311088c1 100644
--- a/mysys/mf_tempfile.c
+++ b/mysys/mf_tempfile.c
@@ -126,6 +126,9 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
// changing environ variable doesn't work with VACPP
char buffer[256];
sprintf( buffer, "TMP=%s", dir);
+ // remove ending backslash
+ if (buffer[strlen(buffer)-1] == '\\')
+ buffer[strlen(buffer)-1] = '\0';
putenv( buffer);
#else
old_env= (char**) environ;
diff --git a/mysys/my_os2file64.c b/mysys/my_os2file64.c
index 8964e562ea1..b7ee40d292e 100644
--- a/mysys/my_os2file64.c
+++ b/mysys/my_os2file64.c
@@ -22,7 +22,6 @@ void _OS2errno( APIRET rc);
longlong _lseek64( int fd, longlong offset, int seektype);
int _lock64( int fd, int locktype, my_off_t start,
my_off_t length, myf MyFlags);
-int _sopen64( const char *name, int oflag, int shflag, int mask);
//
// this class is used to define a global c++ variable, that
@@ -255,7 +254,7 @@ int _lock64( int fd, int locktype, my_off_t start,
return(-1);
}
-int _sopen64( const char *name, int oflag, int shflag, int mask)
+int _sopen( const char *name, int oflag, int shflag, int mask)
{
int fail_errno;
APIRET rc = 0;
@@ -325,17 +324,60 @@ int _sopen64( const char *name, int oflag, int shflag, int mask)
return hf;
}
-inline int open( const char *name, int oflag)
+int read( int fd, void *buffer, unsigned int count)
{
- return _sopen64( name, oflag, OPEN_SHARE_DENYNONE, S_IREAD | S_IWRITE);
+ APIRET rc;
+ ULONG actual;
+
+ rc = DosRead( fd, (PVOID) buffer, count, &actual);
+
+ if (!rc)
+ return( actual);/* NO_ERROR */
+
+ // set errno
+ _OS2errno( rc);
+ // write failed
+ return(-1);
}
-inline int open( const char *name, int oflag, int mask)
+int write( int fd, const void *buffer, unsigned int count)
{
- return _sopen64( name, oflag, OPEN_SHARE_DENYNONE, mask);
+ APIRET rc;
+ ULONG actual;
+
+ rc = DosWrite( fd, (PVOID) buffer, count, &actual);
+
+ if (!rc)
+ return( actual);/* NO_ERROR */
+
+ // set errno
+ _OS2errno( rc);
+ // write failed
+ return(-1);
+}
+
+int close( int fd)
+{
+ APIRET rc;
+ ULONG actual;
+
+ rc = DosClose( fd);
+
+ if (!rc)
+ return( 0);/* NO_ERROR */
+
+ // set errno
+ _OS2errno( rc);
+ // write failed
+ return(-1);
}
-inline int sopen( const char *name, int oflag, int shflag, int mask)
+inline int open( const char *name, int oflag)
+{
+ return sopen( name, oflag, OPEN_SHARE_DENYNONE, S_IREAD | S_IWRITE);
+}
+
+inline int open( const char *name, int oflag, int mask)
{
- return _sopen64( name, oflag, shflag, mask);
+ return sopen( name, oflag, OPEN_SHARE_DENYNONE, mask);
}
diff --git a/mysys/my_tempnam.c b/mysys/my_tempnam.c
index 7da037e8d49..6b7ac099581 100644
--- a/mysys/my_tempnam.c
+++ b/mysys/my_tempnam.c
@@ -95,6 +95,9 @@ my_string my_tempnam(const char *dir, const char *pfx,
// changing environ variable doesn't work with VACPP
char buffer[256];
sprintf( buffer, "TMP=%s", dir);
+ // remove ending backslash
+ if (buffer[strlen(buffer)-1] == '\\')
+ buffer[strlen(buffer)-1] = '\0';
putenv( buffer);
#else
old_env=(char**)environ;