Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
be188b11
Commit
be188b11
authored
May 31, 2001
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql into hundin.mysql.fi:/my/bk/mysql
parents
e66e6a0b
6a387c7c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
220 additions
and
17 deletions
+220
-17
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
Docs/manual.texi
Docs/manual.texi
+7
-7
configure.in
configure.in
+6
-1
include/my_sys.h
include/my_sys.h
+14
-0
include/mysys_err.h
include/mysys_err.h
+4
-1
innobase/include/sync0sync.ic
innobase/include/sync0sync.ic
+2
-1
mysys/Makefile.am
mysys/Makefile.am
+1
-0
mysys/errors.c
mysys/errors.c
+7
-1
mysys/mf_brkhant.c
mysys/mf_brkhant.c
+2
-4
mysys/my_symlink.c
mysys/my_symlink.c
+171
-0
sql/sql_select.h
sql/sql_select.h
+5
-2
No files found.
BitKeeper/etc/logging_ok
View file @
be188b11
jani@janikt.pp.saunalahti.fi
jani@janikt.pp.saunalahti.fi
monty@hundin.mysql.fi
mwagner@evoq.mwagner.org
mwagner@evoq.mwagner.org
Docs/manual.texi
View file @
be188b11
...
@@ -8488,7 +8488,7 @@ The following @code{configure} command should work:
...
@@ -8488,7 +8488,7 @@ The following @code{configure} command should work:
@example
@example
shell> CFLAGS="-D_XOPEN_XPG4" CXX=gcc CXXFLAGS="-D_XOPEN_XPG4" \
shell> CFLAGS="-D_XOPEN_XPG4" CXX=gcc CXXFLAGS="-D_XOPEN_XPG4" \
./configure \
./configure \
--
with-debug --
prefix=/usr/local/mysql \
--prefix=/usr/local/mysql \
--with-named-thread-libs="-lgthreads -lsocket -lgen -lgthreads" \
--with-named-thread-libs="-lgthreads -lsocket -lgen -lgthreads" \
--with-named-curses-libs="-lcurses"
--with-named-curses-libs="-lcurses"
@end example
@end example
...
@@ -9525,19 +9525,19 @@ and are configured with the following compilers and options:
...
@@ -9525,19 +9525,19 @@ and are configured with the following compilers and options:
@code{CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors" ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-assembler}
@code{CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors" ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-assembler}
@item SunOS 5.5.1 sun4u with @code{egcs} 1.0.3a
@item SunOS 5.5.1 sun4u with @code{egcs} 1.0.3a
@code{CC=gcc CFLAGS="-O3
-fomit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fomit-frame-pointer
-felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex}
@code{CC=gcc CFLAGS="-O3
" CXX=gcc CXXFLAGS="-O3
-felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex}
@item SunOS 5.6 sun4u with @code{egcs} 2.90.27
@item SunOS 5.6 sun4u with @code{egcs} 2.90.27
@code{CC=gcc CFLAGS="-O3
-fomit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fomit-frame-pointer
-felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex}
@code{CC=gcc CFLAGS="-O3
" CXX=gcc CXXFLAGS="-O3
-felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex}
@item SunOS 5.6 i86pc with @code{gcc} 2.8.1
@item SunOS 5.6 i86pc with @code{gcc} 2.8.1
@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex}
@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex}
@item Linux 2.0.33 i386 with @code{pgcc} 2.90.29 (@code{egcs} 1.0.3a)
@item Linux 2.0.33 i386 with @code{pgcc} 2.90.29 (@code{egcs} 1.0.3a)
@code{CFLAGS="-O3 -mpentium -mstack-align-double
-fomit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -mpentium -mstack-align-double -fomit-frame-pointer
-felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --with-extra-charsets=complex}
@code{CFLAGS="-O3 -mpentium -mstack-align-double
" CXX=gcc CXXFLAGS="-O3 -mpentium -mstack-align-double
-felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --with-extra-charsets=complex}
@item Linux 2.2.x with x686 with @code{gcc} 2.95.2
@item Linux 2.2.x with x686 with @code{gcc} 2.95.2
@code{CFLAGS="-O3 -mpentiumpro
-fomit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -mpentiumpro -fomit-frame-pointer
-felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --disable-shared --with-extra-charset=complex}
@code{CFLAGS="-O3 -mpentiumpro
" CXX=gcc CXXFLAGS="-O3 -mpentiumpro
-felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --disable-shared --with-extra-charset=complex}
@item SCO 3.2v5.0.4 i386 with @code{gcc} 2.7-95q4
@item SCO 3.2v5.0.4 i386 with @code{gcc} 2.7-95q4
@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex}
@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex}
...
@@ -10740,8 +10740,8 @@ the old @code{ISAM} type. You don't have to convert your old tables to
...
@@ -10740,8 +10740,8 @@ the old @code{ISAM} type. You don't have to convert your old tables to
use these with Version 3.23. By default, all new tables will be created with
use these with Version 3.23. By default, all new tables will be created with
type @code{MyISAM} (unless you start @code{mysqld} with the
type @code{MyISAM} (unless you start @code{mysqld} with the
@code{--default-table-type=isam} option). You can change an @code{ISAM}
@code{--default-table-type=isam} option). You can change an @code{ISAM}
table to a @code{MyISAM} table with @code{ALTER TABLE
} or the Perl script
table to a @code{MyISAM} table with @code{ALTER TABLE
table_name TYPE=MyISAM}
@code{mysql_convert_table_format}.
or the Perl script
@code{mysql_convert_table_format}.
Version 3.22 and 3.21 clients will work without any problems with a Version
Version 3.22 and 3.21 clients will work without any problems with a Version
3.23 server.
3.23 server.
configure.in
View file @
be188b11
...
@@ -755,6 +755,11 @@ case $SYSTEM_TYPE in
...
@@ -755,6 +755,11 @@ case $SYSTEM_TYPE in
echo
"Enabling snprintf workaround for hpux 10.20"
echo
"Enabling snprintf workaround for hpux 10.20"
CFLAGS
=
"
$CFLAGS
-DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ"
CFLAGS
=
"
$CFLAGS
-DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ"
CXXFLAGS
=
"
$CXXFLAGS
-DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ"
CXXFLAGS
=
"
$CXXFLAGS
-DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ"
if
test
"
$with_named_thread
"
=
"no"
then
echo
"Using --with-named-thread=-lpthread"
with_named_thread
=
"-lcma"
fi
;;
;;
*
hpux11.
*
)
*
hpux11.
*
)
echo
"Enabling pread/pwrite workaround for hpux 11"
echo
"Enabling pread/pwrite workaround for hpux 11"
...
@@ -1051,7 +1056,7 @@ fi
...
@@ -1051,7 +1056,7 @@ fi
AC_MSG_CHECKING
(
"named thread libs:"
)
AC_MSG_CHECKING
(
"named thread libs:"
)
if
test
"
$with_named_thread
"
!=
"no"
if
test
"
$with_named_thread
"
!=
"no"
then
then
LIBS
=
"
$LIBS
$with_named_thread
"
LIBS
=
"
$
with_named_thread
$
LIBS
$with_named_thread
"
with_posix_threads
=
"yes"
with_posix_threads
=
"yes"
with_mit_threads
=
"no"
with_mit_threads
=
"no"
AC_MSG_RESULT
(
"
$with_named_thread
"
)
AC_MSG_RESULT
(
"
$with_named_thread
"
)
...
...
include/my_sys.h
View file @
be188b11
...
@@ -62,6 +62,8 @@ extern int NEAR my_errno; /* Last error in mysys */
...
@@ -62,6 +62,8 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_DONT_CHECK_FILESIZE 128
/* Option to init_io_cache() */
#define MY_DONT_CHECK_FILESIZE 128
/* Option to init_io_cache() */
#define MY_LINK_WARNING 32
/* my_redel() gives warning if links */
#define MY_LINK_WARNING 32
/* my_redel() gives warning if links */
#define MY_COPYTIME 64
/* my_redel() copys time */
#define MY_COPYTIME 64
/* my_redel() copys time */
#define MY_DELETE_OLD 256
/* my_create_with_symlink() */
#define MY_RESOLVE_LINK 128
/* my_realpath(); Only resolve links */
#define MY_HOLD_ORIGINAL_MODES 128
/* my_copy() holds to file modes */
#define MY_HOLD_ORIGINAL_MODES 128
/* my_copy() holds to file modes */
#define MY_REDEL_MAKE_BACKUP 256
#define MY_REDEL_MAKE_BACKUP 256
#define MY_SEEK_NOT_DONE 32
/* my_lock may have to do a seek */
#define MY_SEEK_NOT_DONE 32
/* my_lock may have to do a seek */
...
@@ -378,6 +380,12 @@ extern File my_create(const char *FileName,int CreateFlags,
...
@@ -378,6 +380,12 @@ extern File my_create(const char *FileName,int CreateFlags,
int
AccsesFlags
,
myf
MyFlags
);
int
AccsesFlags
,
myf
MyFlags
);
extern
int
my_close
(
File
Filedes
,
myf
MyFlags
);
extern
int
my_close
(
File
Filedes
,
myf
MyFlags
);
extern
int
my_mkdir
(
const
char
*
dir
,
int
Flags
,
myf
MyFlags
);
extern
int
my_mkdir
(
const
char
*
dir
,
int
Flags
,
myf
MyFlags
);
extern
int
my_readlink
(
char
*
to
,
const
char
*
filename
,
myf
MyFlags
);
extern
int
my_realpath
(
char
*
to
,
const
char
*
filename
,
myf
MyFlags
);
extern
File
my_create_with_symlink
(
const
char
*
linkname
,
const
char
*
filename
,
int
createflags
,
int
access_flags
,
myf
MyFlags
);
extern
int
my_symlink
(
const
char
*
content
,
const
char
*
linkname
,
myf
MyFlags
);
extern
uint
my_read
(
File
Filedes
,
byte
*
Buffer
,
uint
Count
,
myf
MyFlags
);
extern
uint
my_read
(
File
Filedes
,
byte
*
Buffer
,
uint
Count
,
myf
MyFlags
);
extern
uint
my_pread
(
File
Filedes
,
byte
*
Buffer
,
uint
Count
,
my_off_t
offset
,
extern
uint
my_pread
(
File
Filedes
,
byte
*
Buffer
,
uint
Count
,
my_off_t
offset
,
myf
MyFlags
);
myf
MyFlags
);
...
@@ -428,8 +436,14 @@ extern int my_redel(const char *from, const char *to, int MyFlags);
...
@@ -428,8 +436,14 @@ extern int my_redel(const char *from, const char *to, int MyFlags);
extern
int
my_copystat
(
const
char
*
from
,
const
char
*
to
,
int
MyFlags
);
extern
int
my_copystat
(
const
char
*
from
,
const
char
*
to
,
int
MyFlags
);
extern
my_string
my_filename
(
File
fd
);
extern
my_string
my_filename
(
File
fd
);
#ifndef THREAD
extern
void
dont_break
(
void
);
extern
void
dont_break
(
void
);
extern
void
allow_break
(
void
);
extern
void
allow_break
(
void
);
#else
#define dont_break()
#define allow_break()
#endif
extern
void
my_remember_signal
(
int
signal_number
,
sig_handler
(
*
func
)(
int
));
extern
void
my_remember_signal
(
int
signal_number
,
sig_handler
(
*
func
)(
int
));
extern
void
caseup
(
my_string
str
,
uint
length
);
extern
void
caseup
(
my_string
str
,
uint
length
);
extern
void
casedn
(
my_string
str
,
uint
length
);
extern
void
casedn
(
my_string
str
,
uint
length
);
...
...
include/mysys_err.h
View file @
be188b11
...
@@ -22,7 +22,7 @@ extern "C" {
...
@@ -22,7 +22,7 @@ extern "C" {
#endif
#endif
#define GLOB 0
/* Error maps */
#define GLOB 0
/* Error maps */
#define GLOBERRS 2
4
/* Max number of error messages in map's */
#define GLOBERRS 2
7
/* Max number of error messages in map's */
#define EE(X) globerrs[ X ]
/* Defines to add error to right map */
#define EE(X) globerrs[ X ]
/* Defines to add error to right map */
extern
const
char
*
NEAR
globerrs
[];
/* my_error_messages is here */
extern
const
char
*
NEAR
globerrs
[];
/* my_error_messages is here */
...
@@ -51,6 +51,9 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
...
@@ -51,6 +51,9 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#define EE_CANT_MKDIR 21
#define EE_CANT_MKDIR 21
#define EE_UNKNOWN_CHARSET 22
#define EE_UNKNOWN_CHARSET 22
#define EE_OUT_OF_FILERESOURCES 23
#define EE_OUT_OF_FILERESOURCES 23
#define EE_CANT_READLINK 24
#define EE_CANT_SYMLINK 25
#define EE_REALPATH 26
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
innobase/include/sync0sync.ic
View file @
be188b11
...
@@ -134,9 +134,10 @@ mutex_reset_lock_word(
...
@@ -134,9 +134,10 @@ mutex_reset_lock_word(
__asm XCHG EDX, DWORD PTR [ECX]
__asm XCHG EDX, DWORD PTR [ECX]
#else
#else
mutex->lock_word = 0;
mutex->lock_word = 0;
#if !(defined(__GNUC__) && defined(UNIV_INTEL_X86))
os_fast_mutex_unlock(&(mutex->os_fast_mutex));
os_fast_mutex_unlock(&(mutex->os_fast_mutex));
#endif
#endif
#endif
}
}
/**********************************************************************
/**********************************************************************
...
...
mysys/Makefile.am
View file @
be188b11
...
@@ -33,6 +33,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c\
...
@@ -33,6 +33,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c\
my_alloc.c safemalloc.c my_fopen.c my_fstream.c
\
my_alloc.c safemalloc.c my_fopen.c my_fstream.c
\
my_error.c errors.c my_div.c my_messnc.c
\
my_error.c errors.c my_div.c my_messnc.c
\
mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c
\
mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c
\
my_symlink.c
\
mf_pack.c mf_pack2.c mf_unixpath.c mf_stripp.c
\
mf_pack.c mf_pack2.c mf_unixpath.c mf_stripp.c
\
mf_casecnv.c mf_soundex.c mf_wcomp.c mf_wfile.c
\
mf_casecnv.c mf_soundex.c mf_wcomp.c mf_wfile.c
\
mf_qsort.c mf_qsort2.c mf_sort.c
\
mf_qsort.c mf_qsort2.c mf_sort.c
\
...
...
mysys/errors.c
View file @
be188b11
...
@@ -46,6 +46,9 @@ const char * NEAR globerrs[GLOBERRS]=
...
@@ -46,6 +46,9 @@ const char * NEAR globerrs[GLOBERRS]=
"Can't create directory '%s' (Errcode: %d)"
,
"Can't create directory '%s' (Errcode: %d)"
,
"Character set '%s' is not a compiled character set and is not specified in the '%s' file"
,
"Character set '%s' is not a compiled character set and is not specified in the '%s' file"
,
"Out of resources when opening file '%s' (Errcode: %d)"
,
"Out of resources when opening file '%s' (Errcode: %d)"
,
"Can't read value for symlink '%s' (Error %d)"
,
"Can't create symlink '%s' pointing at '%s' (Error %d)"
,
"Error on realpath() on '%s' (Error %d)"
,
};
};
void
init_glob_errs
(
void
)
void
init_glob_errs
(
void
)
...
@@ -81,6 +84,9 @@ void init_glob_errs()
...
@@ -81,6 +84,9 @@ void init_glob_errs()
EE
(
EE_DISK_FULL
)
=
"Disk is full writing '%s'. Waiting for someone to free space..."
;
EE
(
EE_DISK_FULL
)
=
"Disk is full writing '%s'. Waiting for someone to free space..."
;
EE
(
EE_CANT_MKDIR
)
=
"Can't create directory '%s' (Errcode: %d)"
;
EE
(
EE_CANT_MKDIR
)
=
"Can't create directory '%s' (Errcode: %d)"
;
EE
(
EE_UNKNOWN_CHARSET
)
=
"Character set is not a compiled character set and is not specified in the %s file"
;
EE
(
EE_UNKNOWN_CHARSET
)
=
"Character set is not a compiled character set and is not specified in the %s file"
;
EE
(
EE_OUT_OF_FILERESOURCES
)
=
"Out of resources when opening file '%s' (Errcode: %d)"
,
EE
(
EE_OUT_OF_FILERESOURCES
)
=
"Out of resources when opening file '%s' (Errcode: %d)"
;
EE
(
EE_CANT_READLINK
)
=
"Can't read value for symlink '%s' (Error %d)"
;
EE
(
EE_CANT_SYMLINK
)
=
"Can't create symlink '%s' pointing at '%s' (Error %d)"
;
EE
(
EE_REALPATH
)
=
"Error on realpath() on '%s' (Error %d)"
;
}
}
#endif
#endif
mysys/mf_brkhant.c
View file @
be188b11
...
@@ -24,17 +24,15 @@
...
@@ -24,17 +24,15 @@
/* Set variable that we can't break */
/* Set variable that we can't break */
#if !defined(THREAD)
void
dont_break
(
void
)
void
dont_break
(
void
)
{
{
#if !defined(THREAD)
my_dont_interrupt
=
1
;
my_dont_interrupt
=
1
;
#endif
return
;
return
;
}
/* dont_break */
}
/* dont_break */
void
allow_break
(
void
)
void
allow_break
(
void
)
{
{
#if !defined(THREAD)
{
{
reg1
int
index
;
reg1
int
index
;
...
@@ -54,8 +52,8 @@ void allow_break(void)
...
@@ -54,8 +52,8 @@ void allow_break(void)
_my_signals
=
0
;
_my_signals
=
0
;
}
}
}
}
#endif
}
/* dont_break */
}
/* dont_break */
#endif
/* Set old status */
/* Set old status */
...
...
mysys/my_symlink.c
0 → 100644
View file @
be188b11
/* 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 "mysys_err.h"
#include <m_string.h>
#ifdef HAVE_REALPATH
#include <sys/param.h>
#include <sys/stat.h>
#endif
/*
Reads the content of a symbolic link
If the file is not a symbolic link, return the original file name in to.
*/
int
my_readlink
(
char
*
to
,
const
char
*
filename
,
myf
MyFlags
)
{
#ifndef HAVE_READLINK
strmov
(
to
,
filename
);
return
0
;
#else
int
result
=
0
;
int
length
;
DBUG_ENTER
(
"my_readlink"
);
if
((
length
=
readlink
(
filename
,
to
,
FN_REFLEN
-
1
))
<
0
)
{
/* Don't give an error if this wasn't a symlink */
if
((
my_errno
=
errno
)
==
EINVAL
)
{
strmov
(
to
,
filename
);
}
else
{
if
(
MyFlags
&
MY_WME
)
my_error
(
EE_CANT_READLINK
,
MYF
(
0
),
filename
,
errno
);
result
=
-
1
;
}
}
else
to
[
length
]
=
0
;
DBUG_RETURN
(
result
);
#endif
/* HAVE_READLINK */
}
/* Create a symbolic link */
int
my_symlink
(
const
char
*
content
,
const
char
*
linkname
,
myf
MyFlags
)
{
#ifndef HAVE_READLINK
return
0
;
#else
int
result
;
DBUG_ENTER
(
"my_symlink"
);
result
=
0
;
if
(
symlink
(
content
,
linkname
))
{
result
=
-
1
;
my_errno
=
errno
;
if
(
MyFlags
&
MY_WME
)
my_error
(
EE_CANT_SYMLINK
,
MYF
(
0
),
linkname
,
content
,
errno
);
}
DBUG_RETURN
(
result
);
#endif
/* HAVE_READLINK */
}
/*
Create a file and a symbolic link that points to this file
If linkname is a null pointer or equal to filename, we don't
create a link.
*/
File
my_create_with_symlink
(
const
char
*
linkname
,
const
char
*
filename
,
int
createflags
,
int
access_flags
,
myf
MyFlags
)
{
File
file
;
int
tmp_errno
;
DBUG_ENTER
(
"my_create_with_symlink"
);
if
((
file
=
my_create
(
filename
,
createflags
,
access_flags
,
MyFlags
))
>=
0
)
{
/* Test if we should create a link */
if
(
linkname
&&
strcmp
(
linkname
,
filename
))
{
/* Delete old link/file */
if
(
MyFlags
&
MY_DELETE_OLD
)
my_delete
(
linkname
,
MYF
(
0
));
/* Create link */
if
(
my_symlink
(
filename
,
linkname
,
MyFlags
))
{
/* Fail, remove everything we have done */
tmp_errno
=
my_errno
;
my_close
(
file
,
MYF
(
0
));
my_delete
(
filename
,
MYF
(
0
));
file
=
-
1
;
my_errno
=
tmp_errno
;
}
}
}
DBUG_RETURN
(
file
);
}
/*
Resolve all symbolic links in path
'to' may be equal to 'filename'
Because purify gives a lot of UMR errors when using realpath(),
this code is disabled when using purify.
If MY_RESOLVE_LINK is given, only do realpath if the file is a link.
*/
#if defined(SCO)
#define BUFF_LEN 4097
#elif defined(MAXPATHLEN)
#define BUFF_LEN MAXPATHLEN
#else
#define BUFF_LEN FN_LEN
#endif
int
my_realpath
(
char
*
to
,
const
char
*
filename
,
myf
MyFlags
)
{
#if defined(HAVE_REALPATH) && !defined(HAVE_purify) && !defined(HAVE_BROKEN_REALPATH)
int
result
=
0
;
char
buff
[
BUFF_LEN
];
struct
stat
stat_buff
;
DBUG_ENTER
(
"my_realpath"
);
if
(
!
(
MyFlags
&
MY_RESOLVE_LINK
)
||
(
!
lstat
(
filename
,
&
stat_buff
)
&&
S_ISLNK
(
stat_buff
.
st_mode
)))
{
char
*
ptr
;
if
((
ptr
=
realpath
(
filename
,
buff
)))
strmake
(
to
,
ptr
,
FN_REFLEN
-
1
);
else
{
/* Realpath didn't work; Use original name */
my_errno
=
errno
;
if
(
MyFlags
&
MY_WME
)
my_error
(
EE_REALPATH
,
MYF
(
0
),
filename
,
my_errno
);
if
(
to
!=
filename
)
strmov
(
to
,
filename
);
result
=
-
1
;
}
}
return
result
;
#else
if
(
to
!=
filename
)
strmov
(
to
,
filename
);
return
0
;
#endif
}
sql/sql_select.h
View file @
be188b11
...
@@ -138,8 +138,11 @@ class TMP_TABLE_PARAM {
...
@@ -138,8 +138,11 @@ class TMP_TABLE_PARAM {
}
}
inline
void
cleanup
(
void
)
inline
void
cleanup
(
void
)
{
{
delete
[]
copy_field
;
if
(
copy_field
)
/* Fix for Intel compiler */
copy_field
=
0
;
{
delete
[]
copy_field
;
copy_field
=
0
;
}
}
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment