Commit 2884b87f authored by peter@mysql.com's avatar peter@mysql.com

Merge mysql.com:/home/pz/mysql/mysql-4.0-root

into mysql.com:/home/pz/mysql/mysql-4.0
parents 7a515381 0d4770c7
This diff is collapsed.
...@@ -215,7 +215,14 @@ if ($opt_stage <= 1) ...@@ -215,7 +215,14 @@ if ($opt_stage <= 1)
# Only enable InnoDB when requested (required to be able to # Only enable InnoDB when requested (required to be able to
# build the "Classic" packages that do not include InnoDB) # build the "Classic" packages that do not include InnoDB)
$opt_config_options.= " --without-innodb" if (!$opt_innodb); if ($opt_innodb)
{
$opt_config_options.= " --with-innodb";
}
else
{
$opt_config_options.= " --without-innodb";
}
if ($opt_with_other_libc) if ($opt_with_other_libc)
{ {
...@@ -314,7 +321,7 @@ if (!$opt_no_test) ...@@ -314,7 +321,7 @@ if (!$opt_no_test)
} }
if ($opt_innodb) if ($opt_innodb)
{ {
$extra.=" --innodb_data_file_path=ibdata1:100M"; $extra.=" --innodb_data_file_path=ibdata1:100M:autoextend";
} }
safe_system("./bin/mysqld --no-defaults --basedir . --datadir ./data --skip-locking $extra >> $log 2>&1 &"); safe_system("./bin/mysqld --no-defaults --basedir . --datadir ./data --skip-locking $extra >> $log 2>&1 &");
sleep(2); sleep(2);
......
...@@ -51680,6 +51680,8 @@ not yet 100% confident in this code. ...@@ -51680,6 +51680,8 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.54 @appendixsubsec Changes in release 3.23.54
@itemize @itemize
@item @item
Fixed a problem with BDB and @code{ALTER TABLE}.
@item
Fixed reference to freed memory when doing complicated @code{GROUP BY Fixed reference to freed memory when doing complicated @code{GROUP BY
... ORDER BY} queries. Symptom was that @code{mysqld} died in function ... ORDER BY} queries. Symptom was that @code{mysqld} died in function
@code{send_fields}. @code{send_fields}.
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
#undef SPRINTF_RETURNS_INT #undef SPRINTF_RETURNS_INT
#undef SPRINTF_RETURNS_GARBAGE #undef SPRINTF_RETURNS_GARBAGE
/* Needed to get large file supportat HPUX 10.20 */ /* Needed to get large file support on HPUX 10.20 */
#undef __STDC_EXT__ #undef __STDC_EXT__
#undef STACK_DIRECTION #undef STACK_DIRECTION
......
...@@ -914,8 +914,8 @@ case $SYSTEM_TYPE in ...@@ -914,8 +914,8 @@ case $SYSTEM_TYPE in
;; ;;
*hpux10.20*) *hpux10.20*)
echo "Enabling workarounds for hpux 10.20" echo "Enabling workarounds for hpux 10.20"
CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX" CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX10 -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX"
CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX" CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX10 -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX"
if test "$with_named_thread" = "no" if test "$with_named_thread" = "no"
then then
echo "Using --with-named-thread=-lpthread" echo "Using --with-named-thread=-lpthread"
...@@ -924,8 +924,8 @@ case $SYSTEM_TYPE in ...@@ -924,8 +924,8 @@ case $SYSTEM_TYPE in
;; ;;
*hpux11.*) *hpux11.*)
echo "Enabling workarounds for hpux 11" echo "Enabling workarounds for hpux 11"
CFLAGS="$CFLAGS -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" CFLAGS="$CFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" CXXFLAGS="$CXXFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
if test "$with_named_thread" = "no" if test "$with_named_thread" = "no"
then then
echo "Using --with-named-thread=-lpthread" echo "Using --with-named-thread=-lpthread"
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
#ifdef DONT_USE_FINITE /* HPUX 11.x has is_finite() */ #ifdef DONT_USE_FINITE /* HPUX 11.x has is_finite() */
#undef HAVE_FINITE #undef HAVE_FINITE
#endif #endif
#if defined(HPUX) && defined(_LARGEFILE64_SOURCE) && defined(THREAD) #if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD)
/* Fix bug in setrlimit */ /* Fix bug in setrlimit */
#undef setrlimit #undef setrlimit
#define setrlimit cma_setrlimit64 #define setrlimit cma_setrlimit64
......
...@@ -71,7 +71,7 @@ void my_inet_ntoa(struct in_addr in, char *buf); ...@@ -71,7 +71,7 @@ void my_inet_ntoa(struct in_addr in, char *buf);
Handling of gethostbyname_r() Handling of gethostbyname_r()
*/ */
#if !defined(HPUX) #if !defined(HPUX10)
struct hostent; struct hostent;
#endif /* HPUX */ #endif /* HPUX */
#if !defined(HAVE_GETHOSTBYNAME_R) #if !defined(HAVE_GETHOSTBYNAME_R)
...@@ -84,7 +84,7 @@ struct hostent *my_gethostbyname_r(const char *name, ...@@ -84,7 +84,7 @@ struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer, struct hostent *result, char *buffer,
int buflen, int *h_errnop); int buflen, int *h_errnop);
#define my_gethostbyname_r_free() #define my_gethostbyname_r_free()
#if !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) && !defined(HPUX) #if !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) && !defined(HPUX10)
#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data) #define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
#endif /* !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */ #endif /* !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */
......
...@@ -428,7 +428,7 @@ struct tm *localtime_r(const time_t *clock, struct tm *res); ...@@ -428,7 +428,7 @@ struct tm *localtime_r(const time_t *clock, struct tm *res);
#endif /* defined(__WIN__) */ #endif /* defined(__WIN__) */
#if defined(HPUX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS) #if defined(HPUX10) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
#undef pthread_cond_timedwait #undef pthread_cond_timedwait
#define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c)) #define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c))
int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
*/ */
#include "univ.i"
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
...@@ -607,13 +609,18 @@ How to make the InnoDB parser and lexer C files: ...@@ -607,13 +609,18 @@ How to make the InnoDB parser and lexer C files:
6. Remove the #include of unistd.h from about line 2500 of lexyy.c 6. Remove the #include of unistd.h from about line 2500 of lexyy.c
7. Move #include <math.h> in pars0grm.c after #include "univ.i" to remove
a large file compilation error on AIX.
8. Move #include "univ.i" in lexyy.c to the file start to remove a large
file compilation error on AIX.
These instructions seem to work at least with bison-1.28 and flex-2.5.4 on These instructions seem to work at least with bison-1.28 and flex-2.5.4 on
Linux. Linux.
*******************************************************/ *******************************************************/
#line 36 "pars0lex.l" #line 36 "pars0lex.l"
#define YYSTYPE que_node_t* #define YYSTYPE que_node_t*
#include "univ.i"
#include "pars0pars.h" #include "pars0pars.h"
#include "pars0grm.h" #include "pars0grm.h"
#include "pars0sym.h" #include "pars0sym.h"
......
...@@ -102,6 +102,8 @@ que_node_t */ ...@@ -102,6 +102,8 @@ que_node_t */
#include "que0que.h" #include "que0que.h"
#include "row0sel.h" #include "row0sel.h"
#include <math.h>
#define YYSTYPE que_node_t* #define YYSTYPE que_node_t*
/* #define __STDC__ */ /* #define __STDC__ */
......
...@@ -221,7 +221,7 @@ int my_connect(my_socket s, const struct sockaddr *name, uint namelen, ...@@ -221,7 +221,7 @@ int my_connect(my_socket s, const struct sockaddr *name, uint namelen,
{ {
tv.tv_sec = (long) timeout; tv.tv_sec = (long) timeout;
tv.tv_usec = 0; tv.tv_usec = 0;
#if defined(HPUX) && defined(THREAD) #if defined(HPUX10) && defined(THREAD)
if ((res = select(s+1, NULL, (int*) &sfds, NULL, &tv)) >= 0) if ((res = select(s+1, NULL, (int*) &sfds, NULL, &tv)) >= 0)
break; break;
#else #else
......
...@@ -371,7 +371,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, ...@@ -371,7 +371,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
length+=key_length; length+=key_length;
keydef->block_length= MI_BLOCK_SIZE(length,pointer,MI_MAX_KEYPTR_SIZE); keydef->block_length= MI_BLOCK_SIZE(length,pointer,MI_MAX_KEYPTR_SIZE);
if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH || if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH ||
length > MI_MAX_KEY_LENGTH) length >= MI_MAX_KEY_BUFF)
{ {
my_errno=HA_WRONG_CREATE_OPTION; my_errno=HA_WRONG_CREATE_OPTION;
goto err; goto err;
......
...@@ -15,7 +15,7 @@ ...@@ -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 */
/* Remove all rows from a MyISAM table */ /* Remove all rows from a MyISAM table */
/* This only clears the status information and truncates the data file */ /* This clears the status information and truncates files */
#include "myisamdef.h" #include "myisamdef.h"
...@@ -49,14 +49,15 @@ int mi_delete_all_rows(MI_INFO *info) ...@@ -49,14 +49,15 @@ int mi_delete_all_rows(MI_INFO *info)
state->key_root[i]= HA_OFFSET_ERROR; state->key_root[i]= HA_OFFSET_ERROR;
myisam_log_command(MI_LOG_DELETE_ALL,info,(byte*) 0,0,0); myisam_log_command(MI_LOG_DELETE_ALL,info,(byte*) 0,0,0);
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
if (my_chsize(info->dfile, 0, 0, MYF(MY_WME)))
goto err;
/* /*
If we are using delayed keys or if the user has done changes to the tables If we are using delayed keys or if the user has done changes to the tables
since it was locked then there may be key blocks in the key cache since it was locked then there may be key blocks in the key cache
*/ */
flush_key_blocks(share->kfile, FLUSH_IGNORE_CHANGED); flush_key_blocks(share->kfile, FLUSH_IGNORE_CHANGED);
if (my_chsize(info->dfile, 0, 0, MYF(MY_WME)) ||
my_chsize(share->kfile, share->base.keystart, 0, MYF(MY_WME)) )
goto err;
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
allow_break(); /* Allow SIGHUP & SIGINT */ allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(0); DBUG_RETURN(0);
......
-- source include/have_bdb.inc -- source include/have_bdb.inc
# test for bug reported by Mark Steele # test for bug reported by Mark Steele
drop table if exists t1; drop table if exists t1;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <sys/utime.h> #include <sys/utime.h>
#elif defined(HAVE_UTIME_H) #elif defined(HAVE_UTIME_H)
#include <utime.h> #include <utime.h>
#elif !defined(HPUX) #elif !defined(HPUX10)
struct utimbuf { struct utimbuf {
time_t actime; time_t actime;
time_t modtime; time_t modtime;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <sys/utime.h> #include <sys/utime.h>
#elif defined(HAVE_UTIME_H) #elif defined(HAVE_UTIME_H)
#include <utime.h> #include <utime.h>
#elif !defined(HPUX) #elif !defined(HPUX10)
#include <time.h> #include <time.h>
struct utimbuf { struct utimbuf {
time_t actime; time_t actime;
......
...@@ -245,7 +245,7 @@ static void my_win_init(void) ...@@ -245,7 +245,7 @@ static void my_win_init(void)
/* Inserisce i dati come variabili d'ambiente */ /* Inserisce i dati come variabili d'ambiente */
my_env=strdup(EnvString); /* variable for putenv must be allocated ! */ my_env=strdup(EnvString); /* variable for putenv must be allocated ! */
putenv(EnvString) ; putenv(my_env) ;
dimNameValueBuffer = dimName ; dimNameValueBuffer = dimName ;
dimDataValueBuffer = dimData ; dimDataValueBuffer = dimData ;
......
...@@ -435,7 +435,7 @@ int my_pthread_cond_init(pthread_cond_t *mp, const pthread_condattr_t *attr) ...@@ -435,7 +435,7 @@ int my_pthread_cond_init(pthread_cond_t *mp, const pthread_condattr_t *attr)
this has to be added here. this has to be added here.
****************************************************************************/ ****************************************************************************/
#if defined(HPUX) || defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT) #if defined(HPUX10) || defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT)
int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime) struct timespec *abstime)
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <sys/utime.h> #include <sys/utime.h>
#elif defined(HAVE_UTIME_H) #elif defined(HAVE_UTIME_H)
#include <utime.h> #include <utime.h>
#elif !defined(HPUX) #elif !defined(HPUX10)
struct utimbuf { struct utimbuf {
time_t actime; time_t actime;
time_t modtime; time_t modtime;
......
...@@ -730,11 +730,11 @@ static pthread_cond_t COND_thread_count; ...@@ -730,11 +730,11 @@ static pthread_cond_t COND_thread_count;
static pthread_mutex_t LOCK_thread_count; static pthread_mutex_t LOCK_thread_count;
static uint thread_count; static uint thread_count;
#ifdef HPUX #ifdef HPUX10
typedef int * fd_set_ptr; typedef int * fd_set_ptr;
#else #else
typedef fd_set * fd_set_ptr; typedef fd_set * fd_set_ptr;
#endif /* HPUX */ #endif /* HPUX10 */
static void *test_thread(void *arg) static void *test_thread(void *arg)
{ {
......
...@@ -64,7 +64,7 @@ foreach $table (@ARGV) ...@@ -64,7 +64,7 @@ foreach $table (@ARGV)
{ {
if (uc($row->[1]) eq uc($opt_type)) if (uc($row->[1]) eq uc($opt_type))
{ {
print "$table is alread of type $opt_type; Ignored\n"; print "$table is already of type $opt_type; Ignored\n";
next; next;
} }
} }
......
...@@ -559,15 +559,15 @@ sub copy_files { ...@@ -559,15 +559,15 @@ sub copy_files {
my @cp = ($method); my @cp = ($method);
# add option to preserve mod time etc of copied files # add option to preserve mod time etc of copied files
# not critical, but nice to have # not critical, but nice to have
push @cp, "-p" if $^O =~ m/^(solaris|linux|freebsd)$/; push @cp, "-p" if $^O =~ m/^(solaris|linux|freebsd|darwin)$/;
# add recursive option for scp # add recursive option for scp
push @cp, "-r" if $^O =~ /m^(solaris|linux|freebsd)$/ && $method =~ /^scp\b/; push @cp, "-r" if $^O =~ /m^(solaris|linux|freebsd|darwin)$/ && $method =~ /^scp\b/;
my @non_raid = map { "'$_'" } grep { ! m:/\d{2}/[^/]+$: } @$files; my @non_raid = map { "'$_'" } grep { ! m:/\d{2}/[^/]+$: } @$files;
# add files to copy and the destination directory # add files to copy and the destination directory
+ safe_system( @cp, @non_raid, "'$target'" ); safe_system( @cp, @non_raid, "'$target'" );
foreach my $rd ( @$raid_dirs ) { foreach my $rd ( @$raid_dirs ) {
my @raid = map { "'$_'" } grep { m:$rd/: } @$files; my @raid = map { "'$_'" } grep { m:$rd/: } @$files;
......
...@@ -709,7 +709,7 @@ double Item_func_rand::val() ...@@ -709,7 +709,7 @@ double Item_func_rand::val()
#endif #endif
arg_count=0; arg_count=0;
} }
else if (0)//!thd->rand_used) else if (!thd->rand_used)
{ {
// no need to send a Rand log event if seed was given eg: RAND(seed), // no need to send a Rand log event if seed was given eg: RAND(seed),
// as it will be replicated in the query as such. // as it will be replicated in the query as such.
......
...@@ -294,11 +294,11 @@ static int mc_sock_connect(my_socket s, const struct sockaddr *name, ...@@ -294,11 +294,11 @@ static int mc_sock_connect(my_socket s, const struct sockaddr *name,
FD_SET(s, &sfds); FD_SET(s, &sfds);
tv.tv_sec = (long) to; tv.tv_sec = (long) to;
tv.tv_usec = 0; tv.tv_usec = 0;
#ifdef HPUX #ifdef HPUX10
res = select(s+1, NULL, (int*) &sfds, NULL, &tv); res = select(s+1, NULL, (int*) &sfds, NULL, &tv);
#else #else
res = select(s+1, NULL, &sfds, NULL, &tv); res = select(s+1, NULL, &sfds, NULL, &tv);
#endif #endif /* HPUX10 */
if (res <= 0) /* Never became writable */ if (res <= 0) /* Never became writable */
return(-1); return(-1);
......
...@@ -2531,7 +2531,7 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) ...@@ -2531,7 +2531,7 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused)))
while (!abort_loop) while (!abort_loop)
{ {
readFDs=clientFDs; readFDs=clientFDs;
#ifdef HPUX #ifdef HPUX10
if (select(max_used_connection,(int*) &readFDs,0,0,0) < 0) if (select(max_used_connection,(int*) &readFDs,0,0,0) < 0)
continue; continue;
#else #else
...@@ -2545,7 +2545,7 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) ...@@ -2545,7 +2545,7 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused)))
MAYBE_BROKEN_SYSCALL MAYBE_BROKEN_SYSCALL
continue; continue;
} }
#endif /* HPUX */ #endif /* HPUX10 */
if (abort_loop) if (abort_loop)
{ {
MAYBE_BROKEN_SYSCALL; MAYBE_BROKEN_SYSCALL;
......
...@@ -426,7 +426,17 @@ BOOL NTService::SeekStatus(LPCSTR szInternName, int OperationType) ...@@ -426,7 +426,17 @@ BOOL NTService::SeekStatus(LPCSTR szInternName, int OperationType)
// open a connection to the SCM // open a connection to the SCM
if (!(scm = OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE))) if (!(scm = OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE)))
printf("There is a problem with the Service Control Manager!\n"); {
DWORD ret_error=GetLastError();
if (ret_error == ERROR_ACCESS_DENIED)
{
printf("Install/Remove of the Service Denied!\n");
if(!is_super_user())
printf("That operation should be made by an user with Administrator privileges!\n");
}
else
printf("There is a problem for to open the Service Control Manager!\n");
}
else else
{ {
if (OperationType == 1) if (OperationType == 1)
...@@ -507,3 +517,82 @@ BOOL NTService::got_service_option(char **argv, char *service_option) ...@@ -507,3 +517,82 @@ BOOL NTService::got_service_option(char **argv, char *service_option)
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
/* ------------------------------------------------------------------------
-------------------------------------------------------------------------- */
BOOL NTService::is_super_user()
{
HANDLE hAccessToken;
UCHAR InfoBuffer[1024];
PTOKEN_GROUPS ptgGroups=(PTOKEN_GROUPS)InfoBuffer;
DWORD dwInfoBufferSize;
PSID psidAdministrators;
SID_IDENTIFIER_AUTHORITY siaNtAuthority = SECURITY_NT_AUTHORITY;
UINT x;
BOOL ret_value=FALSE;
if(!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE,&hAccessToken ))
{
if(GetLastError() != ERROR_NO_TOKEN)
return FALSE;
if(!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hAccessToken))
return FALSE;
}
ret_value= GetTokenInformation(hAccessToken,TokenGroups,InfoBuffer,
1024, &dwInfoBufferSize);
CloseHandle(hAccessToken);
if(!ret_value )
return FALSE;
if(!AllocateAndInitializeSid(&siaNtAuthority, 2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&psidAdministrators))
return FALSE;
ret_value = FALSE;
for(x=0;x<ptgGroups->GroupCount;x++)
{
if( EqualSid(psidAdministrators, ptgGroups->Groups[x].Sid) )
{
ret_value = TRUE;
break;
}
}
FreeSid(psidAdministrators);
return ret_value;
}
/* ------------------------------------------------------------------------
-------------------------------------------------------------------------- */
BOOL NTService::IsService(LPCSTR ServiceName)
{
BOOL ret_value=FALSE;
SC_HANDLE service, scm;
if (scm = OpenSCManager(0, 0,SC_MANAGER_ENUMERATE_SERVICE))
{
if ((service = OpenService(scm,ServiceName, SERVICE_ALL_ACCESS )))
{
ret_value=TRUE;
CloseServiceHandle(service);
}
CloseServiceHandle(scm);
}
return ret_value;
}
/* ------------------------------------------------------------------------
-------------------------------------------------------------------------- */
BOOL NTService::got_service_option(char **argv, char *service_option)
{
char *option;
for (option= argv[1]; *option; option++)
if (!strcmp(option, service_option))
return TRUE;
return FALSE;
}
...@@ -54,7 +54,7 @@ class NTService ...@@ -54,7 +54,7 @@ class NTService
BOOL Remove(LPCSTR szInternName); BOOL Remove(LPCSTR szInternName);
BOOL IsService(LPCSTR ServiceName); BOOL IsService(LPCSTR ServiceName);
BOOL got_service_option(char **argv, char *service_option); BOOL got_service_option(char **argv, char *service_option);
BOOL is_super_user();
void Stop(void); //to be called from app. to stop service void Stop(void); //to be called from app. to stop service
protected: protected:
......
...@@ -1529,6 +1529,7 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db, ...@@ -1529,6 +1529,7 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
ha_open_options, ha_open_options,
tmp_table)) tmp_table))
{ {
my_free((char*) tmp_table,MYF(0));
DBUG_RETURN(0); DBUG_RETURN(0);
} }
......
...@@ -1910,16 +1910,24 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -1910,16 +1910,24 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
#ifdef HAVE_BERKELEY_DB #ifdef HAVE_BERKELEY_DB
if (old_db_type == DB_TYPE_BERKELEY_DB) if (old_db_type == DB_TYPE_BERKELEY_DB)
{ {
(void) berkeley_flush_logs();
/* /*
For the alter table to be properly flushed to the logs, we For the alter table to be properly flushed to the logs, we
have to open the new table. If not, we get a problem on server have to open the new table. If not, we get a problem on server
shutdown. shutdown.
*/ */
if (!open_tables(thd, table_list)) // Should always succeed char path[FN_REFLEN];
(void) sprintf(path,"%s/%s/%s",mysql_data_home,new_db,table_name);
fn_format(path,path,"","",4);
table=open_temporary_table(thd, path, new_db, tmp_name,0);
if (table)
{ {
close_thread_table(thd, &table_list->table); intern_close_table(table);
my_free((char*) table, MYF(0));
} }
else
sql_print_error("Warning: Could not open BDB table %s.%s after rename\n",
new_db,table_name);
(void) berkeley_flush_logs();
} }
#endif #endif
table_list->table=0; // For query cache table_list->table=0; // For query cache
......
...@@ -1276,7 +1276,24 @@ opt_to: ...@@ -1276,7 +1276,24 @@ opt_to:
| EQ {} | EQ {}
| AS {}; | AS {};
/*
* The first two deprecate the last two--delete the last two for 4.1 release
*/
slave: slave:
START_SYM SLAVE slave_thread_opts
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_SLAVE_START;
lex->type = 0;
}
|
STOP_SYM SLAVE slave_thread_opts
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_SLAVE_STOP;
lex->type = 0;
}
|
SLAVE START_SYM slave_thread_opts SLAVE START_SYM slave_thread_opts
{ {
LEX *lex=Lex; LEX *lex=Lex;
......
...@@ -145,7 +145,7 @@ void init_case_convert() ...@@ -145,7 +145,7 @@ void init_case_convert()
higher_pos= (uchar * ) "\217\216\231\232\220"; /* Extra chars to konv. */ higher_pos= (uchar * ) "\217\216\231\232\220"; /* Extra chars to konv. */
lower_pos= (uchar * ) "\206\204\224\201\202"; lower_pos= (uchar * ) "\206\204\224\201\202";
#else #else
#if defined(HPUX) && ASCII_BITS_USED == 8 #if defined(HPUX10) && ASCII_BITS_USED == 8
higher_pos= (uchar * ) "\xd0\xd8\xda\xdb\xdc\xd3"; higher_pos= (uchar * ) "\xd0\xd8\xda\xdb\xdc\xd3";
lower_pos= (uchar * ) "\xd4\xcc\xce\xdf\xc9\xd7"; lower_pos= (uchar * ) "\xd4\xcc\xce\xdf\xc9\xd7";
#else #else
...@@ -160,7 +160,7 @@ void init_case_convert() ...@@ -160,7 +160,7 @@ void init_case_convert()
lower_pos= (uchar * ) "{}|`~"; lower_pos= (uchar * ) "{}|`~";
#endif #endif
#endif /* USE_INTERNAL_CTYPE */ #endif /* USE_INTERNAL_CTYPE */
#endif /* HPUX */ #endif /* HPUX10 */
#endif /* MSDOS */ #endif /* MSDOS */
while (*higher_pos) while (*higher_pos)
...@@ -176,7 +176,7 @@ void init_case_convert() ...@@ -176,7 +176,7 @@ void init_case_convert()
higher_pos= (uchar *) "\217\216\231\232\220"; higher_pos= (uchar *) "\217\216\231\232\220";
lower_pos= (uchar *) "\216\217\231YE"; lower_pos= (uchar *) "\216\217\231YE";
#else #else
#if defined(HPUX) && ASCII_BITS_USED == 8 #if defined(HPUX10) && ASCII_BITS_USED == 8
higher_pos= lower_pos= (uchar *) ""; /* Tecknen i r{tt ordning */ higher_pos= lower_pos= (uchar *) ""; /* Tecknen i r{tt ordning */
#else #else
#ifdef USE_ISO_8859_1 /* As in USG5 ICL-386 */ #ifdef USE_ISO_8859_1 /* As in USG5 ICL-386 */
...@@ -186,7 +186,7 @@ void init_case_convert() ...@@ -186,7 +186,7 @@ void init_case_convert()
higher_pos= (uchar *) "][\\~`"; /* R{tt ordning p} tecknen */ higher_pos= (uchar *) "][\\~`"; /* R{tt ordning p} tecknen */
lower_pos= (uchar *) "[\\]YE"; /* Ordning enligt ascii */ lower_pos= (uchar *) "[\\]YE"; /* Ordning enligt ascii */
#endif /* USE_ISO_8859_1 */ #endif /* USE_ISO_8859_1 */
#endif /* HPUX */ #endif /* HPUX10 */
#endif /* MSDOS */ #endif /* MSDOS */
while (*higher_pos) while (*higher_pos)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment