Commit d7777d14 authored by kaa@polly.local's avatar kaa@polly.local

Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint

into  polly.local:/home/kaa/src/maint/mysql-5.0-maint
parents feb0e3a0 e5710dee
...@@ -122,7 +122,7 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type) ...@@ -122,7 +122,7 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
EVP_BytesToKey(info.name, "MD5", info.iv, (byte*)password, EVP_BytesToKey(info.name, "MD5", info.iv, (byte*)password,
passwordSz, 1, key, iv); passwordSz, 1, key, iv);
STL::auto_ptr<BulkCipher> cipher; mySTL::auto_ptr<BulkCipher> cipher;
if (strncmp(info.name, "DES-CBC", 7) == 0) if (strncmp(info.name, "DES-CBC", 7) == 0)
cipher.reset(NEW_YS DES); cipher.reset(NEW_YS DES);
else if (strncmp(info.name, "DES-EDE3-CBC", 13) == 0) else if (strncmp(info.name, "DES-EDE3-CBC", 13) == 0)
...@@ -138,7 +138,7 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type) ...@@ -138,7 +138,7 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
return SSL_BAD_FILE; return SSL_BAD_FILE;
} }
cipher->set_decryptKey(key, info.iv); cipher->set_decryptKey(key, info.iv);
STL::auto_ptr<x509> newx(NEW_YS x509(x->get_length())); mySTL::auto_ptr<x509> newx(NEW_YS x509(x->get_length()));
cipher->decrypt(newx->use_buffer(), x->get_buffer(), cipher->decrypt(newx->use_buffer(), x->get_buffer(),
x->get_length()); x->get_length());
ysDelete(x); ysDelete(x);
......
...@@ -94,17 +94,19 @@ typedef void * (__cdecl *pthread_handler)(void *); ...@@ -94,17 +94,19 @@ typedef void * (__cdecl *pthread_handler)(void *);
__int64 i64; __int64 i64;
}; };
struct timespec { struct timespec {
union ft64 start; union ft64 tv;
/* The max timeout value in millisecond for pthread_cond_timedwait */ /* The max timeout value in millisecond for pthread_cond_timedwait */
long timeout_msec; long max_timeout_msec;
}; };
#define set_timespec(ABSTIME,SEC) { \ #define set_timespec(ABSTIME,SEC) { \
GetSystemTimeAsFileTime(&((ABSTIME).start.ft)); \ GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \
(ABSTIME).timeout_msec= (long)((SEC)*1000); \ (ABSTIME).tv.i64+= (__int64)(SEC)*10000000; \
(ABSTIME).max_timeout_msec= (long)((SEC)*1000); \
} }
#define set_timespec_nsec(ABSTIME,NSEC) { \ #define set_timespec_nsec(ABSTIME,NSEC) { \
GetSystemTimeAsFileTime(&((ABSTIME).start.ft)); \ GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \
(ABSTIME).timeout_msec= (long)((NSEC)/1000000); \ (ABSTIME).tv.i64+= (__int64)(NSEC)/100; \
(ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \
} }
void win_pthread_init(void); void win_pthread_init(void);
......
...@@ -922,6 +922,7 @@ SET @@myisam_repair_threads=1; ...@@ -922,6 +922,7 @@ SET @@myisam_repair_threads=1;
SHOW VARIABLES LIKE 'myisam_repair%'; SHOW VARIABLES LIKE 'myisam_repair%';
Variable_name Value Variable_name Value
myisam_repair_threads 1 myisam_repair_threads 1
End of 4.1 tests
set storage_engine=MyISAM; set storage_engine=MyISAM;
drop table if exists t1,t2,t3; drop table if exists t1,t2,t3;
--- Testing varchar --- --- Testing varchar ---
...@@ -1608,3 +1609,4 @@ create table t3 (c1 int) engine=myisam pack_keys=default; ...@@ -1608,3 +1609,4 @@ create table t3 (c1 int) engine=myisam pack_keys=default;
create table t4 (c1 int) engine=myisam pack_keys=2; create table t4 (c1 int) engine=myisam pack_keys=2;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2' at line 1
drop table t1, t2, t3; drop table t1, t2, t3;
End of 5.0 tests
...@@ -115,12 +115,12 @@ show create table t1; ...@@ -115,12 +115,12 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TEMPORARY TABLE `t1` ( t1 CREATE TEMPORARY TABLE `t1` (
`a` int(11) default NULL `a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TEST_DIR/var/log/' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TEMPORARY TABLE `t1` ( t1 CREATE TEMPORARY TABLE `t1` (
`a` int(11) default NULL `a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TEST_DIR/var/log/' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/'
create table t1 (a int) engine=myisam select 42 a; create table t1 (a int) engine=myisam select 42 a;
select * from t1; select * from t1;
a a
...@@ -132,3 +132,5 @@ select * from t1; ...@@ -132,3 +132,5 @@ select * from t1;
a a
42 42
drop table t1; drop table t1;
End of 4.1 tests
End of 5.0 tests
...@@ -846,6 +846,10 @@ DROP TABLE t1; ...@@ -846,6 +846,10 @@ DROP TABLE t1;
# #
SET @@myisam_repair_threads=1; SET @@myisam_repair_threads=1;
SHOW VARIABLES LIKE 'myisam_repair%'; SHOW VARIABLES LIKE 'myisam_repair%';
--echo End of 4.1 tests
# Test varchar # Test varchar
# #
...@@ -970,4 +974,4 @@ create table t3 (c1 int) engine=myisam pack_keys=default; ...@@ -970,4 +974,4 @@ create table t3 (c1 int) engine=myisam pack_keys=default;
create table t4 (c1 int) engine=myisam pack_keys=2; create table t4 (c1 int) engine=myisam pack_keys=2;
drop table t1, t2, t3; drop table t1, t2, t3;
# End of 4.1 tests --echo End of 5.0 tests
# TODO: THIS TEST DOES NOT WORK ON WINDOWS
# This should be fixed.
--source include/not_windows.inc
source include/have_openssl.inc; source include/have_openssl.inc;
source include/master-slave.inc; source include/master-slave.inc;
......
...@@ -147,20 +147,20 @@ connect (session2,localhost,root,,); ...@@ -147,20 +147,20 @@ connect (session2,localhost,root,,);
connection session1; connection session1;
disable_query_log; disable_query_log;
eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 9 a; eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/log" select 9 a;
enable_query_log; enable_query_log;
# If running test suite with a non standard tmp dir, the "show create table" # If running test suite with a non standard tmp dir, the "show create table"
# will print "DATA_DIRECTORY=". Use replace_result to mask it out # will print "DATA_DIRECTORY=". Use replace_result to mask it out
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1; show create table t1;
connection session2; connection session2;
disable_query_log; disable_query_log;
eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 99 a; eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/log" select 99 a;
enable_query_log; enable_query_log;
# If running test suite with a non standard tmp dir, the "show create table" # If running test suite with a non standard tmp dir, the "show create table"
# will print "DATA_DIRECTORY=". Use replace_result to mask it out # will print "DATA_DIRECTORY=". Use replace_result to mask it out
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1; show create table t1;
connection default; connection default;
...@@ -176,4 +176,6 @@ connection default; ...@@ -176,4 +176,6 @@ connection default;
select * from t1; select * from t1;
drop table t1; drop table t1;
# End of 4.1 tests --echo End of 4.1 tests
--echo End of 5.0 tests
...@@ -979,10 +979,11 @@ static uint my_get_system_windows_directory(char *buffer, uint size) ...@@ -979,10 +979,11 @@ static uint my_get_system_windows_directory(char *buffer, uint size)
Everywhere else, this is: Everywhere else, this is:
1. /etc/ 1. /etc/
2. getenv(DEFAULT_HOME_ENV) 2. /etc/mysql/
3. "" 3. getenv(DEFAULT_HOME_ENV)
4. "~/" 4. ""
5. --sysconfdir=<path> 5. "~/"
6. --sysconfdir=<path>
*/ */
...@@ -1008,6 +1009,7 @@ static void init_default_directories() ...@@ -1008,6 +1009,7 @@ static void init_default_directories()
*ptr++= env; *ptr++= env;
#endif #endif
*ptr++= "/etc/"; *ptr++= "/etc/";
*ptr++= "/etc/mysql/";
#endif #endif
if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV)))) if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV))))
*ptr++= env; *ptr++= env;
......
...@@ -37,7 +37,7 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) ...@@ -37,7 +37,7 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
int pthread_cond_destroy(pthread_cond_t *cond) int pthread_cond_destroy(pthread_cond_t *cond)
{ {
return CloseHandle(cond->semaphore) ? 0 : EINVAL; return CloseHandle(cond->semaphore) ? 0 : EINVAL;
} }
...@@ -51,6 +51,7 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) ...@@ -51,6 +51,7 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
return 0 ; return 0 ;
} }
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime) struct timespec *abstime)
{ {
...@@ -61,26 +62,26 @@ int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, ...@@ -61,26 +62,26 @@ int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
GetSystemTimeAsFileTime(&now.ft); GetSystemTimeAsFileTime(&now.ft);
/* /*
- subtract start time from current time(values are in 100ns units Calculate time left to abstime
- subtract start time from current time(values are in 100ns units)
- convert to millisec by dividing with 10000 - convert to millisec by dividing with 10000
- subtract time since start from max timeout
*/ */
timeout= abstime->timeout_msec - (long)((now.i64 - abstime->start.i64) / 10000); timeout= (long)((abstime->tv.i64 - now.i64) / 10000);
/* Don't allow the timeout to be negative */ /* Don't allow the timeout to be negative */
if (timeout < 0) if (timeout < 0)
timeout = 0L; timeout= 0L;
/* /*
Make sure the calucated time does not exceed original timeout Make sure the calucated timeout does not exceed original timeout
value which could cause "wait for ever" if system time changes value which could cause "wait for ever" if system time changes
*/ */
if (timeout > abstime->timeout_msec) if (timeout > abstime->max_timeout_msec)
timeout= abstime->timeout_msec; timeout= abstime->max_timeout_msec;
InterlockedIncrement(&cond->waiting); InterlockedIncrement(&cond->waiting);
LeaveCriticalSection(mutex); LeaveCriticalSection(mutex);
result=WaitForSingleObject(cond->semaphore,timeout); result= WaitForSingleObject(cond->semaphore,timeout);
InterlockedDecrement(&cond->waiting); InterlockedDecrement(&cond->waiting);
EnterCriticalSection(mutex); EnterCriticalSection(mutex);
......
...@@ -132,7 +132,13 @@ if test -z "$VISUAL" ...@@ -132,7 +132,13 @@ if test -z "$VISUAL"
then then
if test -z "$EDITOR" if test -z "$EDITOR"
then then
EDIT=emacs # Honor debian sensible-editor
if test -x "/usr/bin/sensible-editor"
then
EDIT=/usr/bin/sensible-editor
else
EDIT=emacs
fi
else else
EDIT="$EDITOR" EDIT="$EDITOR"
fi fi
......
...@@ -472,6 +472,14 @@ sub find_groups ...@@ -472,6 +472,14 @@ sub find_groups
{ {
$data[$i] = $line; $data[$i] = $line;
} }
if (-f "/etc/mysql/my.cnf" && -r "/etc/mysql/my.cnf")
{
open(MY_CNF, "</etc/mysql/my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF);
}
for (; ($line = shift @tmp); $i++)
{
$data[$i] = $line;
}
if (defined($ENV{MYSQL_HOME}) && -f "$ENV{MYSQL_HOME}/my.cnf" && if (defined($ENV{MYSQL_HOME}) && -f "$ENV{MYSQL_HOME}/my.cnf" &&
-r "$ENV{MYSQL_HOME}/my.cnf") -r "$ENV{MYSQL_HOME}/my.cnf")
{ {
...@@ -482,6 +490,14 @@ sub find_groups ...@@ -482,6 +490,14 @@ sub find_groups
{ {
$data[$i] = $line; $data[$i] = $line;
} }
if (-f "/etc/mysql/my.cnf" && -r "/etc/mysql/my.cnf")
{
open(MY_CNF, "</etc/mysql/my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF);
}
for (; ($line = shift @tmp); $i++)
{
$data[$i] = $line;
}
if (-f "$homedir/.my.cnf" && -r "$homedir/.my.cnf") if (-f "$homedir/.my.cnf" && -r "$homedir/.my.cnf")
{ {
open(MY_CNF, "<$homedir/.my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF); open(MY_CNF, "<$homedir/.my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF);
...@@ -491,7 +507,7 @@ sub find_groups ...@@ -491,7 +507,7 @@ sub find_groups
$data[$i] = $line; $data[$i] = $line;
} }
} }
chop @data; chomp @data;
# Make a list of the wanted group ids # Make a list of the wanted group ids
if (defined($raw_gids)) if (defined($raw_gids))
{ {
......
...@@ -211,6 +211,7 @@ if [ ! -d $mysql_unix_port_dir ] ...@@ -211,6 +211,7 @@ if [ ! -d $mysql_unix_port_dir ]
then then
mkdir $mysql_unix_port_dir mkdir $mysql_unix_port_dir
chown $user $mysql_unix_port_dir chown $user $mysql_unix_port_dir
chmod 755 $mysql_unix_port_dir
fi fi
# Use the mysqld-max binary by default if the user doesn't specify a binary # Use the mysqld-max binary by default if the user doesn't specify a binary
......
...@@ -597,7 +597,10 @@ net_real_write(NET *net,const char *packet,ulong len) ...@@ -597,7 +597,10 @@ net_real_write(NET *net,const char *packet,ulong len)
} }
#endif /* HAVE_COMPRESS */ #endif /* HAVE_COMPRESS */
/* DBUG_DUMP("net",packet,len); */ #ifdef DEBUG_DATA_PACKETS
DBUG_DUMP("data",packet,len);
#endif
#ifndef NO_ALARM #ifndef NO_ALARM
thr_alarm_init(&alarmed); thr_alarm_init(&alarmed);
if (net_blocking) if (net_blocking)
......
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