Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d697f891
Commit
d697f891
authored
Dec 15, 2006
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.1-maint
into neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint
parents
82db3278
1feb1887
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
119 additions
and
50 deletions
+119
-50
include/config-win.h
include/config-win.h
+0
-1
include/my_global.h
include/my_global.h
+1
-35
include/my_pthread.h
include/my_pthread.h
+69
-2
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+21
-0
mysql-test/t/archive.test
mysql-test/t/archive.test
+1
-0
mysys/my_wincond.c
mysys/my_wincond.c
+22
-6
scripts/mysqld_safe.sh
scripts/mysqld_safe.sh
+1
-0
server-tools/instance-manager/guardian.cc
server-tools/instance-manager/guardian.cc
+2
-3
server-tools/instance-manager/instance.cc
server-tools/instance-manager/instance.cc
+2
-3
No files found.
include/config-win.h
View file @
d697f891
...
@@ -249,7 +249,6 @@ inline double ulonglong2double(ulonglong value)
...
@@ -249,7 +249,6 @@ inline double ulonglong2double(ulonglong value)
#define tell(A) _telli64(A)
#define tell(A) _telli64(A)
#endif
#endif
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time((time_t*)0) + (time_t) (SEC); (ABSTIME).tv_nsec=0; }
#define STACK_DIRECTION -1
#define STACK_DIRECTION -1
...
...
include/my_global.h
View file @
d697f891
...
@@ -1106,41 +1106,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
...
@@ -1106,41 +1106,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define MY_HOW_OFTEN_TO_ALARM 2
/* How often we want info on screen */
#define MY_HOW_OFTEN_TO_ALARM 2
/* How often we want info on screen */
#define MY_HOW_OFTEN_TO_WRITE 1000
/* How often we want info on screen */
#define MY_HOW_OFTEN_TO_WRITE 1000
/* How often we want info on screen */
#ifdef HAVE_TIMESPEC_TS_SEC
#ifndef set_timespec
#define set_timespec(ABSTIME,SEC) \
{ \
(ABSTIME).ts_sec=time(0) + (time_t) (SEC); \
(ABSTIME).ts_nsec=0; \
}
#endif
/* !set_timespec */
#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC) \
{ \
ulonglong now= my_getsystime() + (NSEC/100); \
(ABSTIME).ts_sec= (now / ULL(10000000)); \
(ABSTIME).ts_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif
/* !set_timespec_nsec */
#else
#ifndef set_timespec
#define set_timespec(ABSTIME,SEC) \
{\
struct timeval tv;\
gettimeofday(&tv,0);\
(ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\
(ABSTIME).tv_nsec=tv.tv_usec*1000;\
}
#endif
/* !set_timespec */
#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC) \
{\
ulonglong now= my_getsystime() + (NSEC/100); \
(ABSTIME).tv_sec= (time_t) (now / ULL(10000000)); \
(ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif
/* !set_timespec_nsec */
#endif
/* HAVE_TIMESPEC_TS_SEC */
/*
/*
Define-funktions for reading and storing in machine independent format
Define-funktions for reading and storing in machine independent format
...
...
include/my_pthread.h
View file @
d697f891
...
@@ -66,6 +66,34 @@ typedef int pthread_mutexattr_t;
...
@@ -66,6 +66,34 @@ typedef int pthread_mutexattr_t;
#define pthread_handler_t EXTERNC void * __cdecl
#define pthread_handler_t EXTERNC void * __cdecl
typedef
void
*
(
__cdecl
*
pthread_handler
)(
void
*
);
typedef
void
*
(
__cdecl
*
pthread_handler
)(
void
*
);
/*
Struct and macros to be used in combination with the
windows implementation of pthread_cond_timedwait
*/
/*
Declare a union to make sure FILETIME is properly aligned
so it can be used directly as a 64 bit value. The value
stored is in 100ns units.
*/
union
ft64
{
FILETIME
ft
;
__int64
i64
;
};
struct
timespec
{
union
ft64
start
;
/* The max timeout value in millisecond for pthread_cond_timedwait */
long
timeout_msec
;
};
#define set_timespec(ABSTIME,SEC) { \
GetSystemTimeAsFileTime(&((ABSTIME).start.ft)); \
(ABSTIME).timeout_msec= (long)((SEC)*1000); \
}
#define set_timespec_nsec(ABSTIME,NSEC) { \
GetSystemTimeAsFileTime(&((ABSTIME).start.ft)); \
(ABSTIME).timeout_msec= (long)((NSEC)/1000000); \
}
void
win_pthread_init
(
void
);
void
win_pthread_init
(
void
);
int
win_pthread_setspecific
(
void
*
A
,
void
*
B
,
uint
length
);
int
win_pthread_setspecific
(
void
*
A
,
void
*
B
,
uint
length
);
int
pthread_create
(
pthread_t
*
,
pthread_attr_t
*
,
pthread_handler
,
void
*
);
int
pthread_create
(
pthread_t
*
,
pthread_attr_t
*
,
pthread_handler
,
void
*
);
...
@@ -141,8 +169,6 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
...
@@ -141,8 +169,6 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define pthread_condattr_init(A)
#define pthread_condattr_init(A)
#define pthread_condattr_destroy(A)
#define pthread_condattr_destroy(A)
/*Irena: compiler does not like this: */
/*#define my_pthread_getprio(pthread_t thread_id) pthread_dummy(0) */
#define my_pthread_getprio(thread_id) pthread_dummy(0)
#define my_pthread_getprio(thread_id) pthread_dummy(0)
#else
/* Normal threads */
#else
/* Normal threads */
...
@@ -367,6 +393,47 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
...
@@ -367,6 +393,47 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
int
my_pthread_mutex_trylock
(
pthread_mutex_t
*
mutex
);
int
my_pthread_mutex_trylock
(
pthread_mutex_t
*
mutex
);
#endif
#endif
/*
The defines set_timespec and set_timespec_nsec should be used
for calculating an absolute time at which
pthread_cond_timedwait should timeout
*/
#ifdef HAVE_TIMESPEC_TS_SEC
#ifndef set_timespec
#define set_timespec(ABSTIME,SEC) \
{ \
(ABSTIME).ts_sec=time(0) + (time_t) (SEC); \
(ABSTIME).ts_nsec=0; \
}
#endif
/* !set_timespec */
#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC) \
{ \
ulonglong now= my_getsystime() + (NSEC/100); \
(ABSTIME).ts_sec= (now / ULL(10000000)); \
(ABSTIME).ts_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif
/* !set_timespec_nsec */
#else
#ifndef set_timespec
#define set_timespec(ABSTIME,SEC) \
{\
struct timeval tv;\
gettimeofday(&tv,0);\
(ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\
(ABSTIME).tv_nsec=tv.tv_usec*1000;\
}
#endif
/* !set_timespec */
#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC) \
{\
ulonglong now= my_getsystime() + (NSEC/100); \
(ABSTIME).tv_sec= (time_t) (now / ULL(10000000)); \
(ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif
/* !set_timespec_nsec */
#endif
/* HAVE_TIMESPEC_TS_SEC */
/* safe_mutex adds checking to mutex for easier debugging */
/* safe_mutex adds checking to mutex for easier debugging */
#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY)
#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY)
...
...
mysql-test/r/myisam.result
View file @
d697f891
...
@@ -922,6 +922,27 @@ SET @@myisam_repair_threads=1;
...
@@ -922,6 +922,27 @@ 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
show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
`a` int(11) default NULL
)
ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TEST_DIR/var/log/'
show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
`a` int(11) default NULL
)
ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TEST_DIR/var/log/'
create table t1 (a int) engine=myisam select 42 a;
select * from t1;
a
9
select * from t1;
a
99
select * from t1;
a
42
drop table t1;
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 ---
...
...
mysql-test/t/archive.test
View file @
d697f891
...
@@ -1346,6 +1346,7 @@ SELECT * FROM t2;
...
@@ -1346,6 +1346,7 @@ SELECT * FROM t2;
CHECK
TABLE
t2
;
CHECK
TABLE
t2
;
SELECT
*
FROM
t2
;
SELECT
*
FROM
t2
;
# Test INSERT DELAYED and wait until the table has one more record
# Test INSERT DELAYED and wait until the table has one more record
SELECT
COUNT
(
auto
)
FROM
t2
;
SELECT
COUNT
(
auto
)
FROM
t2
;
INSERT
DELAYED
INTO
t2
VALUES
(
4
,
011403
,
37
,
'intercepted'
,
'audiology'
,
'tinily'
,
''
);
INSERT
DELAYED
INTO
t2
VALUES
(
4
,
011403
,
37
,
'intercepted'
,
'audiology'
,
'tinily'
,
''
);
...
...
mysys/my_wincond.c
View file @
d697f891
...
@@ -54,14 +54,30 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
...
@@ -54,14 +54,30 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
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
)
{
{
struct
_timeb
curtime
;
int
result
;
int
result
;
long
timeout
;
long
timeout
;
_ftime
(
&
curtime
);
union
ft64
now
;
timeout
=
((
long
)
(
abstime
->
tv_sec
-
curtime
.
time
)
*
1000L
+
(
long
)((
abstime
->
tv_nsec
/
1000
)
-
curtime
.
millitm
)
/
1000L
);
GetSystemTimeAsFileTime
(
&
now
.
ft
);
if
(
timeout
<
0
)
/* Some safety */
/*
- subtract start time from current time(values are in 100ns units
- 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
);
/* Don't allow the timeout to be negative */
if
(
timeout
<
0
)
timeout
=
0L
;
timeout
=
0L
;
/*
Make sure the calucated time does not exceed original timeout
value which could cause "wait for ever" if system time changes
*/
if
(
timeout
>
abstime
->
timeout_msec
)
timeout
=
abstime
->
timeout_msec
;
InterlockedIncrement
(
&
cond
->
waiting
);
InterlockedIncrement
(
&
cond
->
waiting
);
LeaveCriticalSection
(
mutex
);
LeaveCriticalSection
(
mutex
);
result
=
WaitForSingleObject
(
cond
->
semaphore
,
timeout
);
result
=
WaitForSingleObject
(
cond
->
semaphore
,
timeout
);
...
...
scripts/mysqld_safe.sh
View file @
d697f891
...
@@ -217,6 +217,7 @@ if [ ! -d $mysql_unix_port_dir ]
...
@@ -217,6 +217,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
# If the user doesn't specify a binary, we assume name "mysqld"
# If the user doesn't specify a binary, we assume name "mysqld"
...
...
server-tools/instance-manager/guardian.cc
View file @
d697f891
...
@@ -254,8 +254,7 @@ void Guardian::run()
...
@@ -254,8 +254,7 @@ void Guardian::run()
node
=
node
->
next
;
node
=
node
->
next
;
}
}
timeout
.
tv_sec
=
time
(
NULL
)
+
monitoring_interval
;
set_timespec
(
timeout
,
monitoring_interval
);
timeout
.
tv_nsec
=
0
;
/* check the loop predicate before sleeping */
/* check the loop predicate before sleeping */
if
(
!
(
shutdown_requested
&&
(
!
(
guarded_instances
))))
if
(
!
(
shutdown_requested
&&
(
!
(
guarded_instances
))))
...
...
server-tools/instance-manager/instance.cc
View file @
d697f891
...
@@ -636,10 +636,9 @@ int Instance::stop()
...
@@ -636,10 +636,9 @@ int Instance::stop()
waitchild
=
options
.
get_shutdown_delay
();
waitchild
=
options
.
get_shutdown_delay
();
kill_mysqld
(
SIGTERM
);
kill_mysqld
(
SIGTERM
);
/* sleep on condition to wait for SIGCHLD */
timeout
.
tv_sec
=
time
(
NULL
)
+
waitchild
;
/* sleep on condition to wait for SIGCHLD */
timeout
.
tv_nsec
=
0
;
set_timespec
(
timeout
,
waitchild
)
;
if
(
pthread_mutex_lock
(
&
LOCK_instance
))
if
(
pthread_mutex_lock
(
&
LOCK_instance
))
return
ER_STOP_INSTANCE
;
return
ER_STOP_INSTANCE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment