1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-11 15:22:09 +03:00

Merge serg.mylan:/usr/home/serg/Abk/mysql-5.0

into serg.mylan:/usr/home/serg/Abk/mysql-5.1


VC++Files/libmysqld/libmysqld.dsp:
  Auto merged
VC++Files/sql/mysqld.dsp:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/repl_failsafe.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
storage/myisam/ft_nlq_search.c:
  Auto merged
storage/myisam/myisamdef.h:
  Auto merged
storage/myisam/sort.c:
  Auto merged
storage/ndb/src/mgmsrv/Services.cpp:
  Auto merged
storage/ndb/src/ndbapi/ndb_cluster_connection.cpp:
  Auto merged
This commit is contained in:
unknown
2005-10-09 19:10:19 +02:00
42 changed files with 361 additions and 408 deletions

View File

@ -396,10 +396,6 @@ SOURCE=..\sql\protocol.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\sql\protocol_cursor.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\records.cpp SOURCE=..\sql\records.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@ -1279,10 +1279,6 @@ SOURCE=.\protocol.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\protocol_cursor.cpp
# End Source File
# Begin Source File
SOURCE=.\records.cpp SOURCE=.\records.cpp
!IF "$(CFG)" == "mysqld - Win32 Release" !IF "$(CFG)" == "mysqld - Win32 Release"

View File

@ -33,7 +33,7 @@ typedef CRITICAL_SECTION pthread_mutex_t;
#define pthread_mutex_lock(A) (EnterCriticalSection(A),0) #define pthread_mutex_lock(A) (EnterCriticalSection(A),0)
#define pthread_mutex_unlock(A) LeaveCriticalSection(A) #define pthread_mutex_unlock(A) LeaveCriticalSection(A)
#define pthread_mutex_destroy(A) DeleteCriticalSection(A) #define pthread_mutex_destroy(A) DeleteCriticalSection(A)
#define pthread_handler_decl(A,B) unsigned __cdecl A(void *B) #define pthread_handler_t unsigned __cdecl *
typedef unsigned (__cdecl *pthread_handler)(void *); typedef unsigned (__cdecl *pthread_handler)(void *);
#define pthread_self() GetCurrentThread() #define pthread_self() GetCurrentThread()
@ -155,7 +155,7 @@ int _my_errno(void)
** The test program ** The test program
*****************************************************************************/ *****************************************************************************/
pthread_handler_decl(test_thread,arg) pthread_handler_t test_thread(void *arg)
{ {
MYSQL mysql; MYSQL mysql;
MYSQL_RES *res; MYSQL_RES *res;

View File

@ -44,7 +44,7 @@ typedef CRITICAL_SECTION pthread_mutex_t;
#define pthread_mutex_lock(A) (EnterCriticalSection(A),0) #define pthread_mutex_lock(A) (EnterCriticalSection(A),0)
#define pthread_mutex_unlock(A) LeaveCriticalSection(A) #define pthread_mutex_unlock(A) LeaveCriticalSection(A)
#define pthread_mutex_destroy(A) DeleteCriticalSection(A) #define pthread_mutex_destroy(A) DeleteCriticalSection(A)
#define pthread_handler_decl(A,B) unsigned __cdecl A(void *B) #define pthread_handler_t unsigned __cdecl *
typedef unsigned (__cdecl *pthread_handler)(void *); typedef unsigned (__cdecl *pthread_handler)(void *);
#define pthread_self() GetCurrentThread() #define pthread_self() GetCurrentThread()
@ -174,7 +174,7 @@ int _my_errno(void)
** The test program ** The test program
*****************************************************************************/ *****************************************************************************/
pthread_handler_decl(test_thread,arg) pthread_handler_t test_thread(void *arg)
{ {
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
thread_count--; thread_count--;

View File

@ -1014,7 +1014,6 @@ static int read_and_execute(bool interactive)
unsigned long clen; unsigned long clen;
do do
{ {
line= my_cgets((char*)tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen);
buffer.append(line, clen); buffer.append(line, clen);
/* /*
if we got buffer fully filled than there is a chance that if we got buffer fully filled than there is a chance that

View File

@ -25,7 +25,10 @@
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
#define EXTERN_C extern "C"
extern "C" { extern "C" {
#else
#define EXTERN_C
#endif /* __cplusplus */ #endif /* __cplusplus */
#if defined(__WIN__) || defined(OS2) #if defined(__WIN__) || defined(OS2)
@ -77,10 +80,10 @@ struct timespec { /* For pthread_cond_timedwait() */
typedef int pthread_mutexattr_t; typedef int pthread_mutexattr_t;
#define win_pthread_self my_thread_var->pthread_self #define win_pthread_self my_thread_var->pthread_self
#ifdef OS2 #ifdef OS2
#define pthread_handler_decl(A,B) void * _Optlink A(void *B) #define pthread_handler_t EXTERN_C void * _Optlink
typedef void * (_Optlink *pthread_handler)(void *); typedef void * (_Optlink *pthread_handler)(void *);
#else #else
#define pthread_handler_decl(A,B) void * __cdecl A(void *B) #define pthread_handler_t EXTERN_C void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *); typedef void * (__cdecl *pthread_handler)(void *);
#endif #endif
@ -184,7 +187,7 @@ typedef int pthread_attr_t; /* Needed by Unixware 7.0.0 */
#define pthread_key_create(A,B) thr_keycreate((A),(B)) #define pthread_key_create(A,B) thr_keycreate((A),(B))
#define pthread_key_delete(A) thr_keydelete(A) #define pthread_key_delete(A) thr_keydelete(A)
#define pthread_handler_decl(A,B) void *A(void *B) #define pthread_handler_t EXTERN_C void *
#define pthread_key(T,V) pthread_key_t V #define pthread_key(T,V) pthread_key_t V
void * my_pthread_getspecific_imp(pthread_key_t key); void * my_pthread_getspecific_imp(pthread_key_t key);
@ -262,7 +265,7 @@ extern int my_pthread_getprio(pthread_t thread_id);
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V)) #define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V)) #define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
#define pthread_detach_this_thread() #define pthread_detach_this_thread()
#define pthread_handler_decl(A,B) void *A(void *B) #define pthread_handler_t EXTERN_C void *
typedef void *(* pthread_handler)(void *); typedef void *(* pthread_handler)(void *);
/* Test first for RTS or FSU threads */ /* Test first for RTS or FSU threads */

View File

@ -203,3 +203,60 @@ oid fk_bbk_niederlassung fk_wochentag uhrzeit_von uhrzeit_bis geloescht version
21 7 1 08:00:00 13:00:00 0 1 21 7 1 08:00:00 13:00:00 0 1
drop view v1; drop view v1;
drop table t1; drop table t1;
CREATE TABLE t1(
t_cpac varchar(2) NOT NULL,
t_vers varchar(4) NOT NULL,
t_rele varchar(2) NOT NULL,
t_cust varchar(4) NOT NULL,
filler1 char(250) default NULL,
filler2 char(250) default NULL,
PRIMARY KEY (t_cpac,t_vers,t_rele,t_cust),
UNIQUE KEY IX_4 (t_cust,t_cpac,t_vers,t_rele),
KEY IX_5 (t_vers,t_rele,t_cust)
) ENGINE=InnoDB;
insert into t1 values
('tm','2.5 ','a ',' ','',''), ('tm','2.5U','a ','stnd','',''),
('da','3.3 ','b ',' ','',''), ('da','3.3U','b ','stnd','',''),
('tl','7.6 ','a ',' ','',''), ('tt','7.6 ','a ',' ','',''),
('bc','B61 ','a ',' ','',''), ('bp','B61 ','a ',' ','',''),
('ca','B61 ','a ',' ','',''), ('ci','B61 ','a ',' ','',''),
('cp','B61 ','a ',' ','',''), ('dm','B61 ','a ',' ','',''),
('ec','B61 ','a ',' ','',''), ('ed','B61 ','a ',' ','',''),
('fm','B61 ','a ',' ','',''), ('nt','B61 ','a ',' ','',''),
('qm','B61 ','a ',' ','',''), ('tc','B61 ','a ',' ','',''),
('td','B61 ','a ',' ','',''), ('tf','B61 ','a ',' ','',''),
('tg','B61 ','a ',' ','',''), ('ti','B61 ','a ',' ','',''),
('tp','B61 ','a ',' ','',''), ('ts','B61 ','a ',' ','',''),
('wh','B61 ','a ',' ','',''), ('bc','B61U','a ','stnd','',''),
('bp','B61U','a ','stnd','',''), ('ca','B61U','a ','stnd','',''),
('ci','B61U','a ','stnd','',''), ('cp','B61U','a ','stnd','',''),
('dm','B61U','a ','stnd','',''), ('ec','B61U','a ','stnd','',''),
('fm','B61U','a ','stnd','',''), ('nt','B61U','a ','stnd','',''),
('qm','B61U','a ','stnd','',''), ('tc','B61U','a ','stnd','',''),
('td','B61U','a ','stnd','',''), ('tf','B61U','a ','stnd','',''),
('tg','B61U','a ','stnd','',''), ('ti','B61U','a ','stnd','',''),
('tp','B61U','a ','stnd','',''), ('ts','B61U','a ','stnd','',''),
('wh','B61U','a ','stnd','','');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`t_cpac` varchar(2) NOT NULL,
`t_vers` varchar(4) NOT NULL,
`t_rele` varchar(2) NOT NULL,
`t_cust` varchar(4) NOT NULL,
`filler1` char(250) default NULL,
`filler2` char(250) default NULL,
PRIMARY KEY (`t_cpac`,`t_vers`,`t_rele`,`t_cust`),
UNIQUE KEY `IX_4` (`t_cust`,`t_cpac`,`t_vers`,`t_rele`),
KEY `IX_5` (`t_vers`,`t_rele`,`t_cust`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
select t_vers,t_rele,t_cust,filler1 from t1 where t_vers = '7.6';
t_vers t_rele t_cust filler1
7.6 a
7.6 a
select t_vers,t_rele,t_cust,filler1 from t1 where t_vers = '7.6'
and t_rele='a' and t_cust = ' ';
t_vers t_rele t_cust filler1
7.6 a
7.6 a
drop table t1;

View File

@ -178,9 +178,9 @@ insert into t1 values ('','empt',2,2),
('dddd','d--d',2,2); ('dddd','d--d',2,2);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3; select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
pk1 pk2 key1 key2 pk1 pk2 key1 key2
empt 2 2
a a--a 2 2 a a--a 2 2
bb b--b 2 2 bb b--b 2 2
ccc c--c 2 2 ccc c--c 2 2
dddd d--d 2 2 dddd d--d 2 2
empt 2 2
drop table t1; drop table t1;

View File

@ -38,3 +38,9 @@ master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 # Query 1 # use `test`; flush tables master-bin.000001 # Query 1 # use `test`; flush tables
select * from t3; select * from t3;
a a
stop slave;
drop table t1;
flush tables with read lock;
start slave;
stop slave;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction

View File

@ -204,3 +204,47 @@ and (zeit1.geloescht = 0);
select * from v1 where oid = 21; select * from v1 where oid = 21;
drop view v1; drop view v1;
drop table t1; drop table t1;
##
CREATE TABLE t1(
t_cpac varchar(2) NOT NULL,
t_vers varchar(4) NOT NULL,
t_rele varchar(2) NOT NULL,
t_cust varchar(4) NOT NULL,
filler1 char(250) default NULL,
filler2 char(250) default NULL,
PRIMARY KEY (t_cpac,t_vers,t_rele,t_cust),
UNIQUE KEY IX_4 (t_cust,t_cpac,t_vers,t_rele),
KEY IX_5 (t_vers,t_rele,t_cust)
) ENGINE=InnoDB;
insert into t1 values
('tm','2.5 ','a ',' ','',''), ('tm','2.5U','a ','stnd','',''),
('da','3.3 ','b ',' ','',''), ('da','3.3U','b ','stnd','',''),
('tl','7.6 ','a ',' ','',''), ('tt','7.6 ','a ',' ','',''),
('bc','B61 ','a ',' ','',''), ('bp','B61 ','a ',' ','',''),
('ca','B61 ','a ',' ','',''), ('ci','B61 ','a ',' ','',''),
('cp','B61 ','a ',' ','',''), ('dm','B61 ','a ',' ','',''),
('ec','B61 ','a ',' ','',''), ('ed','B61 ','a ',' ','',''),
('fm','B61 ','a ',' ','',''), ('nt','B61 ','a ',' ','',''),
('qm','B61 ','a ',' ','',''), ('tc','B61 ','a ',' ','',''),
('td','B61 ','a ',' ','',''), ('tf','B61 ','a ',' ','',''),
('tg','B61 ','a ',' ','',''), ('ti','B61 ','a ',' ','',''),
('tp','B61 ','a ',' ','',''), ('ts','B61 ','a ',' ','',''),
('wh','B61 ','a ',' ','',''), ('bc','B61U','a ','stnd','',''),
('bp','B61U','a ','stnd','',''), ('ca','B61U','a ','stnd','',''),
('ci','B61U','a ','stnd','',''), ('cp','B61U','a ','stnd','',''),
('dm','B61U','a ','stnd','',''), ('ec','B61U','a ','stnd','',''),
('fm','B61U','a ','stnd','',''), ('nt','B61U','a ','stnd','',''),
('qm','B61U','a ','stnd','',''), ('tc','B61U','a ','stnd','',''),
('td','B61U','a ','stnd','',''), ('tf','B61U','a ','stnd','',''),
('tg','B61U','a ','stnd','',''), ('ti','B61U','a ','stnd','',''),
('tp','B61U','a ','stnd','',''), ('ts','B61U','a ','stnd','',''),
('wh','B61U','a ','stnd','','');
show create table t1;
select t_vers,t_rele,t_cust,filler1 from t1 where t_vers = '7.6';
select t_vers,t_rele,t_cust,filler1 from t1 where t_vers = '7.6'
and t_rele='a' and t_cust = ' ';
drop table t1;

View File

@ -65,3 +65,21 @@ EXPLAIN
DROP TABLE t1; DROP TABLE t1;
# End of 4.1 tests # End of 4.1 tests
#
# Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails
#
disable_query_log;
eval SELECT * INTO OUTFILE "$MYSQL_TEST_DIR/var/tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM information_schema.schemata LIMIT 0, 5;
# enable_query_log;
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.4
use information_schema;
# disable_query_log;
eval SELECT * INTO OUTFILE "$MYSQL_TEST_DIR/var/tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM schemata LIMIT 0, 5;
enable_query_log;
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.4

View File

@ -39,5 +39,15 @@ select * from t3;
# Note that all this confusion may cause warnings 'table xx is open on rename' # Note that all this confusion may cause warnings 'table xx is open on rename'
# in the .err files; these are not fatal and are not reported by mysql-test-run. # in the .err files; these are not fatal and are not reported by mysql-test-run.
stop slave;
connection master;
drop table t1;
connection slave;
flush tables with read lock;
start slave;
sleep 1;
--error 1192
stop slave;
# End of 4.1 tests # End of 4.1 tests
# Adding comment for force manual merge 5.0 -> wl1012. Delete me if needed. # Adding comment for force manual merge 5.0 -> wl1012. Delete me if needed.

View File

@ -358,7 +358,8 @@ invalid value '%s'\n",
continue; continue;
} }
get_one_option(optp->id, optp, get_one_option(optp->id, optp,
value ? (char*) "1" : disabled_my_option); *((my_bool*) value) ?
(char*) "1" : disabled_my_option);
continue; continue;
} }
argument= optend; argument= optend;
@ -599,16 +600,27 @@ static int setval(const struct my_option *opts, gptr *value, char *argument,
return 0; return 0;
} }
/* /*
function: findopt Find option
Arguments: opt_pattern, length of opt_pattern, opt_struct, first found SYNOPSIS
name (ffname) findopt()
optpat Prefix of option to find (with - or _)
length Length of optpat
opt_res Options
ffname Place for pointer to first found name
IMPLEMENTATION
Go through all options in the my_option struct. Return number Go through all options in the my_option struct. Return number
of options found that match the pattern and in the argument of options found that match the pattern and in the argument
list the option found, if any. In case of ambiguous option, store list the option found, if any. In case of ambiguous option, store
the name in ffname argument the name in ffname argument
RETURN
0 No matching options
# Number of matching options
ffname points to first matching option
*/ */
static int findopt(char *optpat, uint length, static int findopt(char *optpat, uint length,
@ -623,14 +635,23 @@ static int findopt(char *optpat, uint length,
if (!getopt_compare_strings(opt->name, optpat, length)) /* match found */ if (!getopt_compare_strings(opt->name, optpat, length)) /* match found */
{ {
(*opt_res)= opt; (*opt_res)= opt;
if (!count)
*ffname= (char *) opt->name; /* We only need to know one prev */
if (!opt->name[length]) /* Exact match */ if (!opt->name[length]) /* Exact match */
return 1; return 1;
if (!count || strcmp(*ffname, opt->name)) /* Don't count synonyms */ if (!count)
{
count= 1;
*ffname= (char *) opt->name; /* We only need to know one prev */
}
else if (strcmp(*ffname, opt->name))
{
/*
The above test is to not count same option twice
(see mysql.cc, option "help")
*/
count++; count++;
} }
} }
}
return count; return count;
} }

View File

@ -51,7 +51,7 @@ void win_pthread_init(void)
** in the new thread. ** in the new thread.
*/ */
static pthread_handler_decl(pthread_start,param) pthread_handler_t pthread_start(void *param)
{ {
DBUG_ENTER("pthread_start"); DBUG_ENTER("pthread_start");
pthread_handler func=((struct pthread_map *) param)->func; pthread_handler func=((struct pthread_map *) param)->func;

View File

@ -51,7 +51,7 @@ void win_pthread_init(void)
** in the new thread. ** in the new thread.
*/ */
static pthread_handler_decl(pthread_start,param) pthread_handler_t pthread_start(void *param)
{ {
pthread_handler func=((struct pthread_map *) param)->func; pthread_handler func=((struct pthread_map *) param)->func;
void *func_param=((struct pthread_map *) param)->param; void *func_param=((struct pthread_map *) param)->param;

View File

@ -1,13 +1,15 @@
#!/bin/sh #!/bin/sh
# The default path should be /usr/local
# Get some info from configure # This is a script to create a TAR or ZIP binary distribution out of a
# chmod +x ./scripts/setsomevars # built source tree. The output file will be put at the top level of
# the source tree, as "mysql-<vsn>....{tar.gz,zip}"
#
# The temporary directory path given to "--tmp=<path>" has to be
# absolute and with no spaces.
machine=@MACHINE_TYPE@ machine=@MACHINE_TYPE@
system=@SYSTEM_TYPE@ system=@SYSTEM_TYPE@
version=@VERSION@ version=@VERSION@
export machine system version
SOURCE=`pwd` SOURCE=`pwd`
CP="cp -p" CP="cp -p"
MV="mv" MV="mv"
@ -15,19 +17,20 @@ MV="mv"
STRIP=1 STRIP=1
DEBUG=0 DEBUG=0
SILENT=0 SILENT=0
MACHINE= MACHINE=""
PLATFORM=""
TMP=/tmp TMP=/tmp
SUFFIX="" SUFFIX=""
NDBCLUSTER= NDBCLUSTER=""
parse_arguments() { for arg do
for arg do
case "$arg" in case "$arg" in
--debug) DEBUG=1;; --debug) DEBUG=1;;
--tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;;
--suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
--no-strip) STRIP=0 ;; --no-strip) STRIP=0 ;;
--machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;; --machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;;
--platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;;
--silent) SILENT=1 ;; --silent) SILENT=1 ;;
--with-ndbcluster) NDBCLUSTER=1 ;; --with-ndbcluster) NDBCLUSTER=1 ;;
*) *)
@ -35,22 +38,41 @@ parse_arguments() {
exit 1 exit 1
;; ;;
esac esac
done done
}
parse_arguments "$@" # Remove vendor from $system
system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'`
# Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2)
system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'`
system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'`
system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'`
system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'`
system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'`
system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'`
system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'`
system=`echo $system | sed -e 's/osf5.1b/tru64/g'`
system=`echo $system | sed -e 's/linux-gnu/linux/g'`
system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'`
system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'`
if [ x"$MACHINE" != x"" ] ; then
machine=$MACHINE
fi
#make if [ x"$PLATFORM" != x"" ] ; then
platform="$PLATFORM"
else
platform="$system-$machine"
fi
# This should really be integrated with automake and not duplicate the # FIXME This should really be integrated with automake and not duplicate the
# installation list. # installation list.
BASE=$TMP/my_dist$SUFFIX BASE=$TMP/my_dist$SUFFIX
if [ -d $BASE ] ; then if [ -d $BASE ] ; then
rm -r -f $BASE rm -rf $BASE
fi fi
BS="" BS=""
@ -79,25 +101,29 @@ if [ $BASE_SYSTEM != "netware" ] ; then
chmod o-rwx $BASE/data $BASE/data/* chmod o-rwx $BASE/data $BASE/data/*
fi fi
for i in ChangeLog \ # Copy files if they exists, warn for those that don't
Docs/mysql.info copyfileto()
do {
if [ -f $i ] destdir=$1
then shift
$CP $i $BASE/docs for i
do
if [ -f $i ] ; then
$CP $i $destdir
elif [ -d $i ] ; then
echo "Warning: Will not copy directory \"$i\""
else
echo "Warning: Listed file not found \"$i\""
fi fi
done done
}
for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \ copyfileto $BASE/docs ChangeLog Docs/mysql.info
copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \
EXCEPTIONS-CLIENT MySQLEULA.txt LICENSE.doc README.NW EXCEPTIONS-CLIENT MySQLEULA.txt LICENSE.doc README.NW
do
if [ -f $i ]
then
$CP $i $BASE
fi
done
# Non platform-specific bin files: # Non platform-specific bin dir files:
BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
extra/resolveip$BS extra/my_print_defaults$BS \ extra/resolveip$BS extra/my_print_defaults$BS \
extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \
@ -114,7 +140,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
libmysqld/examples/mysqltest_embedded$BS \ libmysqld/examples/mysqltest_embedded$BS \
"; ";
# Platform-specific bin files: # Platform-specific bin dir files:
if [ $BASE_SYSTEM = "netware" ] ; then if [ $BASE_SYSTEM = "netware" ] ; then
BIN_FILES="$BIN_FILES \ BIN_FILES="$BIN_FILES \
netware/mysqld_safe$BS netware/mysql_install_db$BS \ netware/mysqld_safe$BS netware/mysql_install_db$BS \
@ -137,33 +163,21 @@ else
"; ";
fi fi
for i in $BIN_FILES copyfileto $BASE/bin $BIN_FILES
do
if [ -f $i ]
then
$CP $i $BASE/bin
fi
done
if [ x$STRIP = x1 ] ; then if [ x$STRIP = x1 ] ; then
strip $BASE/bin/* strip $BASE/bin/*
fi fi
# Copy not binary files # Copy not binary files
for i in sql/mysqld.sym.gz copyfileto $BASE/bin sql/mysqld.sym.gz
do
if [ -f $i ]
then
$CP $i $BASE/bin
fi
done
if [ $BASE_SYSTEM = "netware" ] ; then if [ $BASE_SYSTEM = "netware" ] ; then
$CP -r netware/*.pl $BASE/scripts $CP netware/*.pl $BASE/scripts
$CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl $CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl
fi fi
for i in \ copyfileto $BASE/lib \
libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* \ libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* \
libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a \ libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a \
libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \ libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \
@ -171,12 +185,6 @@ for i in \
libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \ libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \
libmysqld/libmysqld.a netware/libmysql.imp \ libmysqld/libmysqld.a netware/libmysql.imp \
zlib/.libs/libz.a zlib/.libs/libz.a
do
if [ -f $i ]
then
$CP $i $BASE/lib
fi
done
# convert the .a to .lib for NetWare # convert the .a to .lib for NetWare
if [ $BASE_SYSTEM = "netware" ] ; then if [ $BASE_SYSTEM = "netware" ] ; then
@ -187,7 +195,8 @@ if [ $BASE_SYSTEM = "netware" ] ; then
done done
fi fi
$CP config.h include/* $BASE/include copyfileto $BASE/include config.h include/*
rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h
if [ $BASE_SYSTEM != "netware" ] ; then if [ $BASE_SYSTEM != "netware" ] ; then
rm -f $BASE/include/config-netware.h rm -f $BASE/include/config-netware.h
@ -202,22 +211,18 @@ if [ $BASE_SYSTEM != "netware" ] ; then
fi fi
fi fi
$CP support-files/* $BASE/support-files copyfileto $BASE/support-files support-files/*
$CP scripts/*.sql $BASE/share
copyfileto $BASE/share scripts/*.sql
$CP -r sql/share/* $MYSQL_SHARE $CP -r sql/share/* $MYSQL_SHARE
rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD
for i in mysql-test/mysql-test-run mysql-test/install_test_db \ copyfileto $BASE/mysql-test \
mysql-test/mysql-test-run mysql-test/install_test_db \
mysql-test/mysql-test-run.pl mysql-test/README \ mysql-test/mysql-test-run.pl mysql-test/README \
mysql-test/valgrind.supp \ mysql-test/valgrind.supp \
netware/mysql_test_run.nlm netware/install_test_db.ncf netware/mysql_test_run.nlm netware/install_test_db.ncf
do
if [ -f $i ]
then
$CP $i $BASE/mysql-test
fi
done
$CP mysql-test/lib/*.pl $BASE/mysql-test/lib $CP mysql-test/lib/*.pl $BASE/mysql-test/lib
$CP mysql-test/lib/*.sql $BASE/mysql-test/lib $CP mysql-test/lib/*.sql $BASE/mysql-test/lib
@ -234,19 +239,29 @@ $CP mysql-test/r/*.result mysql-test/r/*.require \
if [ $BASE_SYSTEM != "netware" ] ; then if [ $BASE_SYSTEM != "netware" ] ; then
chmod a+x $BASE/bin/* chmod a+x $BASE/bin/*
$CP scripts/* $BASE/bin copyfileto $BASE/bin scripts/*
$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \
$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@sbindir\@ ./bin \@libexecdir\@ ./bin \@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \
@HOSTNAME@ \@pkgdatadir\@ ./support-files \
< scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db
$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \
\@sbindir\@ ./bin \@libexecdir\@ ./bin \
\@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \
\@HOSTNAME\@ @HOSTNAME@ \
< support-files/mysql.server.sh > $BASE/support-files/mysql.server
$BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe
mv $BASE/support-files/binary-configure $BASE/configure mv $BASE/support-files/binary-configure $BASE/configure
chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* \
$BASE/support-files/mysql.server $BASE/configure
$CP -r sql-bench/* $BASE/sql-bench $CP -r sql-bench/* $BASE/sql-bench
rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la
rm -f $BASE/bin/*.sql rm -f $BASE/bin/*.sql
fi fi
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \
$BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \
$BASE/bin/setsomevars $BASE/support-files/Makefile* \
$BASE/support-files/*.sh
# #
# Copy system dependent files # Copy system dependent files
@ -281,8 +296,8 @@ fi
# Clean up if we did this from a bk tree # Clean up if we did this from a bk tree
if [ -d $BASE/sql-bench/SCCS ] ; then if [ -d $BASE/sql-bench/SCCS ] ; then
find $BASE/share -name SCCS -print | xargs rm -r -f find $BASE/share -name SCCS -print | xargs rm -rf
find $BASE/sql-bench -name SCCS -print | xargs rm -r -f find $BASE/sql-bench -name SCCS -print | xargs rm -rf
fi fi
# NDB Cluster # NDB Cluster
@ -297,52 +312,27 @@ if [ x$NDBCLUSTER = x1 ]; then
rm -rf $BASE/ndb-stage rm -rf $BASE/ndb-stage
fi fi
# Remove vendor from $system
system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'`
# Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2)
system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'`
system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'`
system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'`
system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'`
system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'`
system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'`
system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'`
system=`echo $system | sed -e 's/osf5.1b/tru64/g'`
system=`echo $system | sed -e 's/linux-gnu/linux/g'`
system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'`
system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'`
# Use the override --machine if present
if [ -n "$MACHINE" ] ; then
machine=$MACHINE
fi
# Change the distribution to a long descriptive name # Change the distribution to a long descriptive name
NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$system-$machine$SUFFIX NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$platform$SUFFIX
# Print the platform name for build logs # Print the platform name for build logs
echo "PLATFORM NAME: $system-$machine" echo "PLATFORM NAME: $platform"
BASE2=$TMP/$NEW_NAME BASE2=$TMP/$NEW_NAME
rm -r -f $BASE2 rm -rf $BASE2
mv $BASE $BASE2 mv $BASE $BASE2
BASE=$BASE2 BASE=$BASE2
# #
# If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a # If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a
# #
if test "@GXX@" = "yes" if [ x"@GXX@" = x"yes" ] ; then
then
cd $BASE/lib
gcclib=`@CC@ --print-libgcc-file` gcclib=`@CC@ --print-libgcc-file`
if test $? -ne 0 if [ $? -ne 0 ] ; then
then
print "Warning: Couldn't find libgcc.a!" print "Warning: Couldn't find libgcc.a!"
else else
$CP $gcclib libmygcc.a $CP $gcclib $BASE/lib/libmygcc.a
fi fi
cd $SOURCE
fi fi
#if we are debugging, do not do tar/gz #if we are debugging, do not do tar/gz
@ -353,7 +343,9 @@ fi
# This is needed to prefere gnu tar instead of tar because tar can't # This is needed to prefere gnu tar instead of tar because tar can't
# always handle long filenames # always handle long filenames
PATH_DIRS=`echo $PATH | sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' ` PATH_DIRS=`echo $PATH | \
sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' `
which_1 () which_1 ()
{ {
for cmd for cmd
@ -362,8 +354,7 @@ which_1 ()
do do
for file in $d/$cmd for file in $d/$cmd
do do
if test -x $file -a ! -d $file if [ -x $file -a ! -d $file ] ; then
then
echo $file echo $file
exit 0 exit 0
fi fi
@ -380,36 +371,33 @@ if [ $BASE_SYSTEM != "netware" ] ; then
# #
tar=`which_1 gnutar gtar` tar=`which_1 gnutar gtar`
if test "$?" = "1" -o "$tar" = "" if [ "$?" = "1" -o x"$tar" = x"" ] ; then
then
tar=tar tar=tar
fi fi
echo "Using $tar to create archive" echo "Using $tar to create archive"
cd $TMP
OPT=cvf OPT=cvf
if [ x$SILENT = x1 ] ; then if [ x$SILENT = x1 ] ; then
OPT=cf OPT=cf
fi fi
$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME echo "Creating and compressing archive"
cd $SOURCE
echo "Compressing archive"
rm -f $NEW_NAME.tar.gz rm -f $NEW_NAME.tar.gz
gzip -9 $NEW_NAME.tar (cd $TMP ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz
echo "$NEW_NAME.tar.gz created" echo "$NEW_NAME.tar.gz created"
else else
# #
# Create a zip file for NetWare users # Create a zip file for NetWare users
# #
cd $TMP rm -f $NEW_NAME.zip
if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi (cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME)
zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME
echo "$NEW_NAME.zip created" echo "$NEW_NAME.zip created"
fi fi
echo "Removing temporary directory" echo "Removing temporary directory"
rm -r -f $BASE rm -rf $BASE

View File

@ -33,18 +33,13 @@
C_MODE_START pthread_handler_t guardian(void *arg)
pthread_handler_decl(guardian, arg)
{ {
Guardian_thread *guardian_thread= (Guardian_thread *) arg; Guardian_thread *guardian_thread= (Guardian_thread *) arg;
guardian_thread->run(); guardian_thread->run();
return 0; return 0;
} }
C_MODE_END
Guardian_thread::Guardian_thread(Thread_registry &thread_registry_arg, Guardian_thread::Guardian_thread(Thread_registry &thread_registry_arg,
Instance_map *instance_map_arg, Instance_map *instance_map_arg,
uint monitoring_interval_arg) : uint monitoring_interval_arg) :

View File

@ -31,11 +31,7 @@ class Instance_map;
class Thread_registry; class Thread_registry;
struct GUARD_NODE; struct GUARD_NODE;
C_MODE_START pthread_handler_t guardian(void *arg);
pthread_handler_decl(guardian, arg);
C_MODE_END
struct Guardian_thread_args struct Guardian_thread_args
{ {

View File

@ -43,8 +43,6 @@ typedef pid_t My_process_info;
typedef PROCESS_INFORMATION My_process_info; typedef PROCESS_INFORMATION My_process_info;
#endif #endif
C_MODE_START
/* /*
Proxy thread is a simple way to avoid all pitfalls of the threads Proxy thread is a simple way to avoid all pitfalls of the threads
implementation in the OS (e.g. LinuxThreads). With such a thread we implementation in the OS (e.g. LinuxThreads). With such a thread we
@ -52,7 +50,7 @@ C_MODE_START
to do it in a portable way. to do it in a portable way.
*/ */
pthread_handler_decl(proxy, arg) pthread_handler_t proxy(void *arg)
{ {
Instance *instance= (Instance *) arg; Instance *instance= (Instance *) arg;
start_and_monitor_instance(&instance->options, start_and_monitor_instance(&instance->options,
@ -60,9 +58,6 @@ pthread_handler_decl(proxy, arg)
return 0; return 0;
} }
C_MODE_END
/* /*
Wait for an instance Wait for an instance

View File

@ -372,10 +372,7 @@ void Listener_thread::handle_new_mysql_connection(Vio *vio)
} }
C_MODE_START pthread_handler_t listener(void *arg)
pthread_handler_decl(listener, arg)
{ {
Listener_thread_args *args= (Listener_thread_args *) arg; Listener_thread_args *args= (Listener_thread_args *) arg;
Listener_thread listener(*args); Listener_thread listener(*args);
@ -387,6 +384,3 @@ pthread_handler_decl(listener, arg)
return 0; return 0;
} }
C_MODE_END

View File

@ -24,11 +24,7 @@
#include <my_pthread.h> #include <my_pthread.h>
C_MODE_START pthread_handler_t listener(void *arg);
pthread_handler_decl(listener, arg);
C_MODE_END
class Thread_registry; class Thread_registry;
struct Options; struct Options;

View File

@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
#pragma interface #pragma implementation
#endif #endif
#include "mysql_connection.h" #include "mysql_connection.h"
@ -364,9 +364,7 @@ int Mysql_connection_thread::dispatch_command(enum enum_server_command command,
} }
C_MODE_START pthread_handler_t mysql_connection(void *arg)
pthread_handler_decl(mysql_connection, arg)
{ {
Mysql_connection_thread_args *args= (Mysql_connection_thread_args *) arg; Mysql_connection_thread_args *args= (Mysql_connection_thread_args *) arg;
Mysql_connection_thread mysql_connection_thread(*args); Mysql_connection_thread mysql_connection_thread(*args);
@ -381,9 +379,6 @@ pthread_handler_decl(mysql_connection, arg)
return 0; return 0;
} }
C_MODE_END
/* /*
vim: fdm=marker vim: fdm=marker
*/ */

View File

@ -24,12 +24,7 @@
#include <my_pthread.h> #include <my_pthread.h>
C_MODE_START pthread_handler_t mysql_connection(void *arg);
pthread_handler_decl(mysql_connection, arg);
C_MODE_END
class Thread_registry; class Thread_registry;
class User_map; class User_map;

View File

@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION)
#pragma interface #pragma implementation
#endif #endif
#include "user_map.h" #include "user_map.h"

View File

@ -7044,7 +7044,7 @@ ha_innobase::cmp_ref(
(const char*)ref1, len1, (const char*)ref1, len1,
(const char*)ref2, len2); (const char*)ref2, len2);
} else { } else {
result = field->cmp((const char*)ref1, result = field->key_cmp((const char*)ref1,
(const char*)ref2); (const char*)ref2);
} }

View File

@ -132,7 +132,7 @@ static int ndb_get_table_statistics(Ndb*, const char *,
static pthread_t ndb_util_thread; static pthread_t ndb_util_thread;
pthread_mutex_t LOCK_ndb_util_thread; pthread_mutex_t LOCK_ndb_util_thread;
pthread_cond_t COND_ndb_util_thread; pthread_cond_t COND_ndb_util_thread;
extern "C" pthread_handler_decl(ndb_util_thread_func, arg); pthread_handler_t ndb_util_thread_func(void *arg);
ulong ndb_cache_check_time; ulong ndb_cache_check_time;
/* /*
@ -6004,8 +6004,7 @@ ha_ndbcluster::update_table_comment(
// Utility thread main loop // Utility thread main loop
extern "C" pthread_handler_decl(ndb_util_thread_func, pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
arg __attribute__((unused)))
{ {
THD *thd; /* needs to be first for thread_stack */ THD *thd; /* needs to be first for thread_stack */
Ndb* ndb; Ndb* ndb;

View File

@ -617,8 +617,8 @@ bool multi_delete_set_locks_and_link_aux_tables(LEX *lex);
void init_max_user_conn(void); void init_max_user_conn(void);
void init_update_queries(void); void init_update_queries(void);
void free_max_user_conn(void); void free_max_user_conn(void);
extern "C" pthread_handler_decl(handle_one_connection,arg); pthread_handler_t handle_one_connection(void *arg);
extern "C" pthread_handler_decl(handle_bootstrap,arg); pthread_handler_t handle_bootstrap(void *arg);
void end_thread(THD *thd,bool put_in_cache); void end_thread(THD *thd,bool put_in_cache);
void flush_thread_cache(); void flush_thread_cache();
bool mysql_execute_command(THD *thd); bool mysql_execute_command(THD *thd);
@ -1062,7 +1062,7 @@ int write_record(THD *thd, TABLE *table, COPY_INFO *info);
extern ulong volatile manager_status; extern ulong volatile manager_status;
extern bool volatile manager_thread_in_use, mqh_used; extern bool volatile manager_thread_in_use, mqh_used;
extern pthread_t manager_thread; extern pthread_t manager_thread;
extern "C" pthread_handler_decl(handle_manager, arg); pthread_handler_t handle_manager(void *arg);
/* sql_test.cc */ /* sql_test.cc */
#ifndef DBUG_OFF #ifndef DBUG_OFF

View File

@ -593,25 +593,25 @@ struct st_VioSSLAcceptorFd *ssl_acceptor_fd;
/* Function declarations */ /* Function declarations */
static void start_signal_handler(void); static void start_signal_handler(void);
static pthread_handler_decl(signal_hand, arg); pthread_handler_t signal_hand(void *arg);
static void mysql_init_variables(void); static void mysql_init_variables(void);
static void get_options(int argc,char **argv); static void get_options(int argc,char **argv);
static void set_server_version(void); static void set_server_version(void);
static int init_thread_environment(); static int init_thread_environment();
static char *get_relative_path(const char *path); static char *get_relative_path(const char *path);
static void fix_paths(void); static void fix_paths(void);
extern "C" pthread_handler_decl(handle_connections_sockets,arg); pthread_handler_t handle_connections_sockets(void *arg);
extern "C" pthread_handler_decl(kill_server_thread,arg); pthread_handler_t kill_server_thread(void *arg);
static void bootstrap(FILE *file); static void bootstrap(FILE *file);
static void close_server_sock(); static void close_server_sock();
static bool read_init_file(char *file_name); static bool read_init_file(char *file_name);
#ifdef __NT__ #ifdef __NT__
extern "C" pthread_handler_decl(handle_connections_namedpipes,arg); pthread_handler_t handle_connections_namedpipes(void *arg);
#endif #endif
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
static pthread_handler_decl(handle_connections_shared_memory,arg); pthread_handler_t handle_connections_shared_memory(void *arg);
#endif #endif
extern "C" pthread_handler_decl(handle_slave,arg); pthread_handler_t handle_slave(void *arg);
static ulong find_bit_type(const char *x, TYPELIB *bit_lib); static ulong find_bit_type(const char *x, TYPELIB *bit_lib);
static void clean_up(bool print_message); static void clean_up(bool print_message);
static void clean_up_mutexes(void); static void clean_up_mutexes(void);
@ -960,7 +960,7 @@ static void __cdecl kill_server(int sig_ptr)
#if defined(USE_ONE_SIGNAL_HAND) || (defined(__NETWARE__) && defined(SIGNALS_DONT_BREAK_READ)) #if defined(USE_ONE_SIGNAL_HAND) || (defined(__NETWARE__) && defined(SIGNALS_DONT_BREAK_READ))
extern "C" pthread_handler_decl(kill_server_thread,arg __attribute__((unused))) pthread_handler_t kill_server_thread(void *arg __attribute__((unused)))
{ {
my_thread_init(); // Initialize new thread my_thread_init(); // Initialize new thread
kill_server(0); kill_server(0);
@ -2170,7 +2170,7 @@ static void start_signal_handler(void)
/* This threads handles all signals and alarms */ /* This threads handles all signals and alarms */
/* ARGSUSED */ /* ARGSUSED */
static void *signal_hand(void *arg __attribute__((unused))) pthread_handler_t signal_hand(void *arg __attribute__((unused)))
{ {
sigset_t set; sigset_t set;
int sig; int sig;
@ -2391,7 +2391,7 @@ int uname(struct utsname *a)
} }
extern "C" pthread_handler_decl(handle_shutdown,arg) pthread_handler_t handle_shutdown(void *arg)
{ {
MSG msg; MSG msg;
my_thread_init(); my_thread_init();
@ -2420,7 +2420,7 @@ int STDCALL handle_kill(ulong ctrl_type)
#ifdef OS2 #ifdef OS2
extern "C" pthread_handler_decl(handle_shutdown,arg) pthread_handler_t handle_shutdown(void *arg)
{ {
my_thread_init(); my_thread_init();
@ -3742,8 +3742,7 @@ inline void kill_broken_server()
/* Handle new connections and spawn new process to handle them */ /* Handle new connections and spawn new process to handle them */
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
extern "C" pthread_handler_decl(handle_connections_sockets, pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
arg __attribute__((unused)))
{ {
my_socket sock,new_sock; my_socket sock,new_sock;
uint error_count=0; uint error_count=0;
@ -3957,7 +3956,7 @@ extern "C" pthread_handler_decl(handle_connections_sockets,
#ifdef __NT__ #ifdef __NT__
extern "C" pthread_handler_decl(handle_connections_namedpipes,arg) pthread_handler_t handle_connections_namedpipes(void *arg)
{ {
HANDLE hConnectedPipe; HANDLE hConnectedPipe;
BOOL fConnected; BOOL fConnected;
@ -4043,13 +4042,12 @@ extern "C" pthread_handler_decl(handle_connections_namedpipes,arg)
Thread of shared memory's service Thread of shared memory's service
SYNOPSIS SYNOPSIS
pthread_handler_decl() handle_connections_shared_memory()
handle_connections_shared_memory Thread handle
arg Arguments of thread arg Arguments of thread
*/ */
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
pthread_handler_decl(handle_connections_shared_memory,arg) pthread_handler_t handle_connections_shared_memory(void *arg)
{ {
/* file-mapping object, use for create shared memory */ /* file-mapping object, use for create shared memory */
HANDLE handle_connect_file_map= 0; HANDLE handle_connect_file_map= 0;

View File

@ -1,148 +0,0 @@
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
Low level functions for storing data to be send to the MySQL client
The actual communction is handled by the net_xxx functions in net_serv.cc
*/
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
#include "mysql_priv.h"
#include <mysql.h>
bool Protocol_cursor::send_fields(List<Item> *list, uint flags)
{
List_iterator_fast<Item> it(*list);
Item *item;
MYSQL_FIELD *client_field;
DBUG_ENTER("Protocol_cursor::send_fields");
if (prepare_for_send(list))
return FALSE;
fields= (MYSQL_FIELD *)alloc_root(alloc, sizeof(MYSQL_FIELD) * field_count);
if (!fields)
goto err;
for (client_field= fields; (item= it++) ; client_field++)
{
Send_field server_field;
item->make_field(&server_field);
client_field->db= strdup_root(alloc, server_field.db_name);
client_field->table= strdup_root(alloc, server_field.table_name);
client_field->name= strdup_root(alloc, server_field.col_name);
client_field->org_table= strdup_root(alloc, server_field.org_table_name);
client_field->org_name= strdup_root(alloc, server_field.org_col_name);
client_field->catalog= strdup_root(alloc, "");
client_field->length= server_field.length;
client_field->type= server_field.type;
client_field->flags= server_field.flags;
client_field->decimals= server_field.decimals;
client_field->db_length= strlen(client_field->db);
client_field->table_length= strlen(client_field->table);
client_field->name_length= strlen(client_field->name);
client_field->org_name_length= strlen(client_field->org_name);
client_field->org_table_length= strlen(client_field->org_table);
client_field->catalog_length= 0;
client_field->charsetnr= server_field.charsetnr;
if (INTERNAL_NUM_FIELD(client_field))
client_field->flags|= NUM_FLAG;
if (flags & (uint) Protocol::SEND_DEFAULTS)
{
char buff[80];
String tmp(buff, sizeof(buff), default_charset_info), *res;
if (!(res=item->val_str(&tmp)))
client_field->def= (char*) "";
else
client_field->def= strmake_root(alloc, res->ptr(), res->length());
}
else
client_field->def=0;
client_field->max_length= 0;
}
DBUG_RETURN(FALSE);
err:
my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES),
MYF(0)); /* purecov: inspected */
DBUG_RETURN(TRUE); /* purecov: inspected */
}
/* Get the length of next field. Change parameter to point at fieldstart */
bool Protocol_cursor::write()
{
byte *cp= (byte *)packet->ptr();
byte *end_pos= (byte *)packet->ptr() + packet->length();
ulong len;
MYSQL_FIELD *cur_field= fields;
MYSQL_FIELD *fields_end= fields + field_count;
MYSQL_ROWS *new_record;
byte **data_tmp;
byte *to;
new_record= (MYSQL_ROWS *)alloc_root(alloc,
sizeof(MYSQL_ROWS) + (field_count + 2)*sizeof(char *) + packet->length());
if (!new_record)
goto err;
data_tmp= (byte **)(new_record + 1);
new_record->data= (char **)data_tmp;
to= (byte *)data_tmp + (field_count + 2)*sizeof(char *);
for (; cur_field < fields_end; cur_field++, data_tmp++)
{
if ((len= net_field_length((uchar **)&cp)) == NULL_LENGTH)
{
*data_tmp= 0;
}
else
{
if ((long)len > (end_pos - cp))
{
// TODO error signal send_error(thd, CR_MALFORMED_PACKET);
return TRUE;
}
*data_tmp= to;
memcpy(to,(char*) cp,len);
to[len]=0;
to+=len+1;
cp+=len;
if (cur_field->max_length < len)
cur_field->max_length=len;
}
}
data_tmp[0]= to; // Pointer to last used byte
data_tmp[1]= 0;
*prev_record= new_record;
prev_record= &new_record->next;
new_record->next= NULL;
row_count++;
return FALSE;
err:
// TODO error signal send_error(thd, ER_OUT_OF_RESOURCES);
return TRUE;
}

View File

@ -579,7 +579,7 @@ int find_recovery_captain(THD* thd, MYSQL* mysql)
} }
pthread_handler_decl(handle_failsafe_rpl,arg) pthread_handler_t handle_failsafe_rpl(void *arg)
{ {
DBUG_ENTER("handle_failsafe_rpl"); DBUG_ENTER("handle_failsafe_rpl");
THD *thd = new THD; THD *thd = new THD;

View File

@ -31,7 +31,7 @@ extern pthread_cond_t COND_rpl_status;
extern TYPELIB rpl_role_typelib, rpl_status_typelib; extern TYPELIB rpl_role_typelib, rpl_status_typelib;
extern const char* rpl_role_type[], *rpl_status_type[]; extern const char* rpl_role_type[], *rpl_status_type[];
pthread_handler_decl(handle_failsafe_rpl,arg); pthread_handler_t handle_failsafe_rpl(void *arg);
void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status); void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status);
int find_recovery_captain(THD* thd, MYSQL* mysql); int find_recovery_captain(THD* thd, MYSQL* mysql);
int update_slave_list(MYSQL* mysql, MASTER_INFO* mi); int update_slave_list(MYSQL* mysql, MASTER_INFO* mi);

View File

@ -2949,7 +2949,7 @@ on this slave.\
/* Slave I/O Thread entry point */ /* Slave I/O Thread entry point */
extern "C" pthread_handler_decl(handle_slave_io,arg) pthread_handler_t handle_slave_io(void *arg)
{ {
THD *thd; // needs to be first for thread_stack THD *thd; // needs to be first for thread_stack
MYSQL *mysql; MYSQL *mysql;
@ -3267,7 +3267,7 @@ err:
/* Slave SQL Thread entry point */ /* Slave SQL Thread entry point */
extern "C" pthread_handler_decl(handle_slave_sql,arg) pthread_handler_t handle_slave_sql(void *arg)
{ {
THD *thd; /* needs to be first for thread_stack */ THD *thd; /* needs to be first for thread_stack */
char llbuff[22],llbuff1[22]; char llbuff[22],llbuff1[22];

View File

@ -547,8 +547,8 @@ void set_slave_thread_options(THD* thd);
void set_slave_thread_default_charset(THD* thd, RELAY_LOG_INFO *rli); void set_slave_thread_default_charset(THD* thd, RELAY_LOG_INFO *rli);
void rotate_relay_log(MASTER_INFO* mi); void rotate_relay_log(MASTER_INFO* mi);
extern "C" pthread_handler_decl(handle_slave_io,arg); pthread_handler_t handle_slave_io(void *arg);
extern "C" pthread_handler_decl(handle_slave_sql,arg); pthread_handler_t handle_slave_sql(void *arg);
extern bool volatile abort_loop; extern bool volatile abort_loop;
extern MASTER_INFO main_mi, *active_mi; /* active_mi for multi-master */ extern MASTER_INFO main_mi, *active_mi; /* active_mi for multi-master */
extern LIST master_list; extern LIST master_list;

View File

@ -1158,8 +1158,8 @@ public:
thread is (and must remain, for now) the only responsible for freeing these thread is (and must remain, for now) the only responsible for freeing these
3 members. If you add members here, and you add code to set them in 3 members. If you add members here, and you add code to set them in
replication, don't forget to free_them_and_set_them_to_0 in replication replication, don't forget to free_them_and_set_them_to_0 in replication
properly. For details see the 'err:' label of the pthread_handler_decl of properly. For details see the 'err:' label of the handle_slave_sql()
the slave SQL thread, in sql/slave.cc. in sql/slave.cc.
*/ */
char *db, *catalog; char *db, *catalog;
Security_context main_security_ctx; Security_context main_security_ctx;

View File

@ -28,7 +28,7 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list);
static int write_delayed(THD *thd,TABLE *table, enum_duplicates dup, bool ignore, static int write_delayed(THD *thd,TABLE *table, enum_duplicates dup, bool ignore,
char *query, uint query_length, bool log_on); char *query, uint query_length, bool log_on);
static void end_delayed_insert(THD *thd); static void end_delayed_insert(THD *thd);
extern "C" pthread_handler_decl(handle_delayed_insert,arg); pthread_handler_t handle_delayed_insert(void *arg);
static void unlink_blobs(register TABLE *table); static void unlink_blobs(register TABLE *table);
#endif #endif
static bool check_view_insertability(THD *thd, TABLE_LIST *view); static bool check_view_insertability(THD *thd, TABLE_LIST *view);
@ -1704,7 +1704,7 @@ void kill_delayed_threads(void)
* Create a new delayed insert thread * Create a new delayed insert thread
*/ */
extern "C" pthread_handler_decl(handle_delayed_insert,arg) pthread_handler_t handle_delayed_insert(void *arg)
{ {
delayed_insert *di=(delayed_insert*) arg; delayed_insert *di=(delayed_insert*) arg;
THD *thd= &di->thd; THD *thd= &di->thd;

View File

@ -32,7 +32,7 @@ pthread_t manager_thread;
pthread_mutex_t LOCK_manager; pthread_mutex_t LOCK_manager;
pthread_cond_t COND_manager; pthread_cond_t COND_manager;
extern "C" pthread_handler_decl(handle_manager,arg __attribute__((unused))) pthread_handler_t handle_manager(void *arg __attribute__((unused)))
{ {
int error = 0; int error = 0;
ulong status; ulong status;

View File

@ -1048,7 +1048,7 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var,
} }
pthread_handler_decl(handle_one_connection,arg) pthread_handler_t handle_one_connection(void *arg)
{ {
THD *thd=(THD*) arg; THD *thd=(THD*) arg;
uint launch_time = uint launch_time =
@ -1184,7 +1184,7 @@ end_thread:
Used when creating the initial grant tables Used when creating the initial grant tables
*/ */
extern "C" pthread_handler_decl(handle_bootstrap,arg) pthread_handler_t handle_bootstrap(void *arg)
{ {
THD *thd=(THD*) arg; THD *thd=(THD*) arg;
FILE *file=bootstrap_file; FILE *file=bootstrap_file;
@ -2946,7 +2946,7 @@ end_with_restore_list:
To prevent that, refuse SLAVE STOP if the To prevent that, refuse SLAVE STOP if the
client thread has locked tables client thread has locked tables
*/ */
if (thd->locked_tables || thd->active_transaction()) if (thd->locked_tables || thd->active_transaction() || thd->global_read_lock)
{ {
my_message(ER_LOCK_OR_ACTIVE_TRANSACTION, my_message(ER_LOCK_OR_ACTIVE_TRANSACTION,
ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0)); ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0));
@ -5004,7 +5004,7 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
for (; tables; tables= tables->next_global) for (; tables; tables= tables->next_global)
{ {
if (tables->schema_table && if (tables->schema_table &&
(want_access & ~(SELECT_ACL | EXTRA_ACL))) (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
{ {
if (!no_errors) if (!no_errors)
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),

View File

@ -266,7 +266,8 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, byte *query,
so if ndocs == 0, FT_INFO.doc[] must not be accessed. so if ndocs == 0, FT_INFO.doc[] must not be accessed.
*/ */
dlist=(FT_INFO *)my_malloc(sizeof(FT_INFO)+ dlist=(FT_INFO *)my_malloc(sizeof(FT_INFO)+
sizeof(FT_DOC)*(aio.dtree.elements_in_tree-1), sizeof(FT_DOC)*
(int)(aio.dtree.elements_in_tree-1),
MYF(0)); MYF(0));
if (!dlist) if (!dlist)
goto err; goto err;

View File

@ -728,7 +728,7 @@ int flush_pending_blocks(MI_SORT_PARAM *param);
int sort_ft_buf_flush(MI_SORT_PARAM *sort_param); int sort_ft_buf_flush(MI_SORT_PARAM *sort_param);
int thr_write_keys(MI_SORT_PARAM *sort_param); int thr_write_keys(MI_SORT_PARAM *sort_param);
#ifdef THREAD #ifdef THREAD
pthread_handler_decl(thr_find_all_keys,arg); pthread_handler_t thr_find_all_keys(void *arg);
#endif #endif
int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file); int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file);

View File

@ -307,7 +307,7 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys,
#ifdef THREAD #ifdef THREAD
/* Search after all keys and place them in a temp. file */ /* Search after all keys and place them in a temp. file */
pthread_handler_decl(thr_find_all_keys,arg) pthread_handler_t thr_find_all_keys(void *arg)
{ {
MI_SORT_PARAM *info= (MI_SORT_PARAM*) arg; MI_SORT_PARAM *info= (MI_SORT_PARAM*) arg;
int error; int error;

View File

@ -85,7 +85,7 @@ const char *Ndb_cluster_connection::get_connectstring(char *buf,
return 0; return 0;
} }
extern "C" pthread_handler_decl(run_ndb_cluster_connection_connect_thread, me) pthread_handler_t run_ndb_cluster_connection_connect_thread(void *me)
{ {
g_run_connect_thread= 1; g_run_connect_thread= 1;
((Ndb_cluster_connection_impl*) me)->connect_thread(); ((Ndb_cluster_connection_impl*) me)->connect_thread();

View File

@ -332,8 +332,8 @@ static int client_msg_raw(NET* net,int err_code,int pre,const char* fmt,
static int authenticate(struct manager_thd* thd); static int authenticate(struct manager_thd* thd);
/* returns pointer to end of line */ /* returns pointer to end of line */
static char* read_line(struct manager_thd* thd); static char* read_line(struct manager_thd* thd);
static pthread_handler_decl(process_connection, arg); pthread_handler_t process_connection(void *arg);
static pthread_handler_decl(process_launcher_messages, arg); pthread_handler_t process_launcher_messages(void *arg);
static int exec_line(struct manager_thd* thd,char* buf,char* buf_end); static int exec_line(struct manager_thd* thd,char* buf,char* buf_end);
#ifdef DO_STACKTRACE #ifdef DO_STACKTRACE
@ -1089,8 +1089,7 @@ static void log_msg(const char* fmt, int msg_type, va_list args)
pthread_mutex_unlock(&lock_log); pthread_mutex_unlock(&lock_log);
} }
static pthread_handler_decl(process_launcher_messages, pthread_handler_t process_launcher_messages(void *arg __attribute__((unused)))
args __attribute__((unused)))
{ {
my_thread_init(); my_thread_init();
for (;!in_shutdown;) for (;!in_shutdown;)
@ -1146,7 +1145,7 @@ static pthread_handler_decl(process_launcher_messages,
return 0; return 0;
} }
static pthread_handler_decl(process_connection,arg) pthread_handler_t process_connection(void *arg)
{ {
struct manager_thd* thd = (struct manager_thd*)arg; struct manager_thd* thd = (struct manager_thd*)arg;
my_thread_init(); my_thread_init();