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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
966049ef
Commit
966049ef
authored
Jun 27, 2007
by
dkatz@damien-katzs-computer.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge damien-katzs-computer.local:/Users/dkatz/mysql51
into damien-katzs-computer.local:/Users/dkatz/51
parents
1ce7a247
1b235fae
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
147 additions
and
69 deletions
+147
-69
mysql-test/lib/mtr_process.pl
mysql-test/lib/mtr_process.pl
+19
-14
mysql-test/lib/mtr_timer.pl
mysql-test/lib/mtr_timer.pl
+7
-2
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+18
-9
mysql-test/r/rpl_truncate_7ndb.result
mysql-test/r/rpl_truncate_7ndb.result
+20
-20
mysql-test/r/windows_shm.result
mysql-test/r/windows_shm.result
+2
-0
mysql-test/t/windows_shm-master.opt
mysql-test/t/windows_shm-master.opt
+1
-0
mysql-test/t/windows_shm.test
mysql-test/t/windows_shm.test
+9
-0
sql/log.cc
sql/log.cc
+70
-24
sql/mysqld.cc
sql/mysqld.cc
+1
-0
No files found.
mysql-test/lib/mtr_process.pl
View file @
966049ef
...
...
@@ -142,6 +142,7 @@ sub spawn_impl ($$$$$$$) {
if
(
$pid
)
{
select
(
STDOUT
)
if
$::glob_win32_perl
;
return
spawn_parent_impl
(
$pid
,
$mode
,
$path
);
}
else
...
...
@@ -163,9 +164,6 @@ sub spawn_impl ($$$$$$$) {
{
# Don't redirect stdout on ActiveState perl since this is
# just another thread in the same process.
# Should be fixed so that the thread that is created with fork
# executes the exe in another process and wait's for it to return.
# In the meanwhile, we get all the output from mysqld's to screen
}
elsif
(
!
open
(
STDOUT
,
$log_file_open_mode
,
$output
)
)
{
...
...
@@ -175,7 +173,7 @@ sub spawn_impl ($$$$$$$) {
if
(
$error
)
{
if
(
$output
eq
$error
)
if
(
!
$::glob_win32_perl
and
$output
eq
$error
)
{
if
(
!
open
(
STDERR
,"
>&STDOUT
")
)
{
...
...
@@ -184,15 +182,7 @@ sub spawn_impl ($$$$$$$) {
}
else
{
if
(
$::glob_win32_perl
)
{
# Don't redirect stdout on ActiveState perl since this is
# just another thread in the same process.
# Should be fixed so that the thread that is created with fork
# executes the exe in another process and wait's for it to return.
# In the meanwhile, we get all the output from mysqld's to screen
}
elsif
(
!
open
(
STDERR
,
$log_file_open_mode
,
$error
)
)
if
(
!
open
(
STDERR
,
$log_file_open_mode
,
$error
)
)
{
mtr_child_error
("
can't redirect STDERR to
\"
$error
\"
: $!
");
}
...
...
@@ -613,6 +603,11 @@ sub mtr_check_stop_servers ($) {
if
(
$pid
)
{
# Server is still alive, put it in list to be hard killed
if
(
$::glob_win32_perl
)
{
# Kill the real process if it's known
$pid
=
$srv
->
{'
real_pid
'}
if
(
$srv
->
{'
real_pid
'});
}
$kill_pids
{
$pid
}
=
1
;
# Write a message to the process's error log (if it has one)
...
...
@@ -666,6 +661,16 @@ sub mtr_check_stop_servers ($) {
}
}
if
(
$::glob_win32_perl
and
$srv
->
{'
real_pid
'})
{
# Wait for the pseudo pid - if the real_pid was known
# the pseudo pid has not been waited for yet, wai blocking
# since it's "such a simple program"
mtr_verbose
("
Wait for pseudo process
$srv
->{'pid'}
");
my
$ret_pid
=
waitpid
(
$srv
->
{'
pid
'},
0
);
mtr_verbose
("
Pseudo process
$ret_pid
died
");
}
$srv
->
{'
pid
'}
=
0
;
}
}
...
...
@@ -1043,7 +1048,7 @@ sub sleep_until_file_created ($$$) {
{
if
(
-
r
$pidfile
)
{
return
$pid
;
return
1
;
}
# Check if it died after the fork() was successful
...
...
mysql-test/lib/mtr_timer.pl
View file @
966049ef
...
...
@@ -97,9 +97,14 @@ sub mtr_timer_start($$$) {
# clearing the signal handler.
$SIG
{
INT
}
=
'
DEFAULT
';
$SIG
{
TERM
}
=
sub
{
mtr_verbose
("
timer woke up, exiting!
");
exit
(
0
);
};
$0
=
"
mtr_timer(timers,
$name
,
$duration
)
";
mtr_verbose
("
timer child
$name
, sleep
$duration
");
sleep
(
$duration
);
mtr_verbose
("
timer expired after
$duration
seconds
");
exit
(
0
);
}
}
...
...
@@ -118,7 +123,7 @@ sub mtr_timer_stop ($$) {
# FIXME as Cygwin reuses pids fast, maybe check that is
# the expected process somehow?!
kill
(
9
,
$tpid
);
kill
(
15
,
$tpid
);
# As the timers are so simple programs, we trust them to terminate,
# and use blocking wait for it. We wait just to avoid a zombie.
...
...
mysql-test/mysql-test-run.pl
View file @
966049ef
...
...
@@ -2593,10 +2593,19 @@ sub ndbcluster_wait_started($$){
sub
mysqld_wait_started
($){
my
$mysqld
=
shift
;
my
$res
=
sleep_until_file_created
(
$mysqld
->
{'
path_pid
'},
$mysqld
->
{'
start_timeout
'},
$mysqld
->
{'
pid
'});
return
$res
==
0
;
if
(
sleep_until_file_created
(
$mysqld
->
{'
path_pid
'},
$mysqld
->
{'
start_timeout
'},
$mysqld
->
{'
pid
'})
==
0
)
{
# Failed to wait for pid file
return
1
;
}
# Get the "real pid" of the process, it will be used for killing
# the process in ActiveState's perl on windows
$mysqld
->
{'
real_pid
'}
=
mtr_get_pid_from_file
(
$mysqld
->
{'
path_pid
'});
return
0
;
}
...
...
@@ -3759,7 +3768,6 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg
(
$args
,
"
%s--no-defaults
",
$prefix
);
mtr_add_arg
(
$args
,
"
%s--console
",
$prefix
);
mtr_add_arg
(
$args
,
"
%s--basedir=%s
",
$prefix
,
$path_my_basedir
);
mtr_add_arg
(
$args
,
"
%s--character-sets-dir=%s
",
$prefix
,
$path_charsetsdir
);
...
...
@@ -4134,6 +4142,7 @@ sub stop_all_servers () {
push
(
@kill_pids
,{
pid
=>
$mysqld
->
{'
pid
'},
real_pid
=>
$mysqld
->
{'
real_pid
'},
pidfile
=>
$mysqld
->
{'
path_pid
'},
sockfile
=>
$mysqld
->
{'
path_sock
'},
port
=>
$mysqld
->
{'
port
'},
...
...
@@ -4341,6 +4350,7 @@ sub run_testcase_stop_servers($$$) {
push
(
@kill_pids
,{
pid
=>
$mysqld
->
{'
pid
'},
real_pid
=>
$mysqld
->
{'
real_pid
'},
pidfile
=>
$mysqld
->
{'
path_pid
'},
sockfile
=>
$mysqld
->
{'
path_sock
'},
port
=>
$mysqld
->
{'
port
'},
...
...
@@ -4392,6 +4402,7 @@ sub run_testcase_stop_servers($$$) {
push
(
@kill_pids
,{
pid
=>
$mysqld
->
{'
pid
'},
real_pid
=>
$mysqld
->
{'
real_pid
'},
pidfile
=>
$mysqld
->
{'
path_pid
'},
sockfile
=>
$mysqld
->
{'
path_sock
'},
port
=>
$mysqld
->
{'
port
'},
...
...
@@ -4818,12 +4829,10 @@ sub run_mysqltest ($) {
mtr_add_arg
(
$args
,
"
%s
",
$_
)
for
@args_saved
;
}
mtr_add_arg
(
$args
,
"
--test-file
");
mtr_add_arg
(
$args
,
$tinfo
->
{'
path
'});
mtr_add_arg
(
$args
,
"
--test-file=%s
",
$tinfo
->
{'
path
'});
if
(
defined
$tinfo
->
{'
result_file
'}
)
{
mtr_add_arg
(
$args
,
"
--result-file
");
mtr_add_arg
(
$args
,
$tinfo
->
{'
result_file
'});
mtr_add_arg
(
$args
,
"
--result-file=%s
",
$tinfo
->
{'
result_file
'});
}
if
(
$opt_record
)
...
...
mysql-test/r/rpl_truncate_7ndb.result
View file @
966049ef
...
...
@@ -32,11 +32,11 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 223 Query 1 287 BEGIN
master-bin.000001 287 Table_map 1
40
table_id: # (test.t1)
master-bin.000001 327 Table_map 1
98
table_id: # (mysql.ndb_apply_status)
master-bin.000001 385 Write_rows 1
157
table_id: #
master-bin.000001 444 Write_rows 1
195
table_id: #
master-bin.000001 482 Write_rows 1
233
table_id: # flags: STMT_END_F
master-bin.000001 287 Table_map 1
327
table_id: # (test.t1)
master-bin.000001 327 Table_map 1
385
table_id: # (mysql.ndb_apply_status)
master-bin.000001 385 Write_rows 1
444
table_id: #
master-bin.000001 444 Write_rows 1
482
table_id: #
master-bin.000001 482 Write_rows 1
520
table_id: # flags: STMT_END_F
master-bin.000001 520 Query 1 585 COMMIT
master-bin.000001 585 Query 1 665 use `test`; TRUNCATE TABLE t1
master-bin.000001 665 Query 1 741 use `test`; DROP TABLE t1
...
...
@@ -69,27 +69,27 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 223 Query 1 287 BEGIN
master-bin.000001 287 Table_map 1
40
table_id: # (test.t1)
master-bin.000001 327 Table_map 1
98
table_id: # (mysql.ndb_apply_status)
master-bin.000001 385 Write_rows 1
157
table_id: #
master-bin.000001 444 Write_rows 1
195
table_id: #
master-bin.000001 482 Write_rows 1
233
table_id: # flags: STMT_END_F
master-bin.000001 287 Table_map 1
327
table_id: # (test.t1)
master-bin.000001 327 Table_map 1
385
table_id: # (mysql.ndb_apply_status)
master-bin.000001 385 Write_rows 1
444
table_id: #
master-bin.000001 444 Write_rows 1
482
table_id: #
master-bin.000001 482 Write_rows 1
520
table_id: # flags: STMT_END_F
master-bin.000001 520 Query 1 585 COMMIT
master-bin.000001 585 Query 1 665 use `test`; TRUNCATE TABLE t1
master-bin.000001 665 Query 1 741 use `test`; DROP TABLE t1
master-bin.000001 741 Query 1 858 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 858 Query 1 922 BEGIN
master-bin.000001 922 Table_map 1
40
table_id: # (test.t1)
master-bin.000001 962 Table_map 1
98
table_id: # (mysql.ndb_apply_status)
master-bin.000001 1020 Write_rows 1 1
57
table_id: #
master-bin.000001 1079 Write_rows 1 1
95
table_id: #
master-bin.000001 1117 Write_rows 1
233
table_id: # flags: STMT_END_F
master-bin.000001 922 Table_map 1
962
table_id: # (test.t1)
master-bin.000001 962 Table_map 1
1020
table_id: # (mysql.ndb_apply_status)
master-bin.000001 1020 Write_rows 1 1
079
table_id: #
master-bin.000001 1079 Write_rows 1 1
117
table_id: #
master-bin.000001 1117 Write_rows 1
1155
table_id: # flags: STMT_END_F
master-bin.000001 1155 Query 1 1220 COMMIT
master-bin.000001 1220 Query 1 1284 BEGIN
master-bin.000001 1284 Table_map 1
40
table_id: # (test.t1)
master-bin.000001 1324 Table_map 1
98
table_id: # (mysql.ndb_apply_status)
master-bin.000001 1382 Write_rows 1 1
57
table_id: #
master-bin.000001 1441 Delete_rows 1 1
91
table_id: #
master-bin.000001 1475 Delete_rows 1
225
table_id: # flags: STMT_END_F
master-bin.000001 1284 Table_map 1
1324
table_id: # (test.t1)
master-bin.000001 1324 Table_map 1
1382
table_id: # (mysql.ndb_apply_status)
master-bin.000001 1382 Write_rows 1 1
441
table_id: #
master-bin.000001 1441 Delete_rows 1 1
475
table_id: #
master-bin.000001 1475 Delete_rows 1
1509
table_id: # flags: STMT_END_F
master-bin.000001 1509 Query 1 1574 COMMIT
master-bin.000001 1574 Query 1 1650 use `test`; DROP TABLE t1
mysql-test/r/windows_shm.result
0 → 100644
View file @
966049ef
mysqld is alive
End of 5.0 tests.
mysql-test/t/windows_shm-master.opt
0 → 100644
View file @
966049ef
--skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --loose-shared-memory=1
mysql-test/t/windows_shm.test
0 → 100644
View file @
966049ef
# Windows-specific tests
--
source
include
/
windows
.
inc
#
# Bug #24924: shared-memory-base-name that is too long causes buffer overflow
#
--
exec
$MYSQLADMIN
--
no
-
defaults
--
shared
-
memory
-
base
-
name
=
HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ping
--
echo
End
of
5.0
tests
.
sql/log.cc
View file @
966049ef
...
...
@@ -3949,65 +3949,111 @@ int MYSQL_BIN_LOG::write_cache(IO_CACHE *cache, bool lock_log, bool sync_log)
long
val
;
uchar
header
[
LOG_EVENT_HEADER_LEN
];
group
=
my_b_tell
(
&
log_file
);
/*
The events in the buffer have incorrect end_log_pos data
(relative to beginning of group rather than absolute),
so we'll recalculate them in situ so the binlog is always
correct, even in the middle of a group. This is possible
because we now know the start position of the group (the
offset of this cache in the log, if you will); all we need
to do is to find all event-headers, and add the position of
the group to the end_log_pos of each event. This is pretty
straight forward, except that we read the cache in segments,
so an event-header might end up on the cache-border and get
split.
*/
group
=
(
uint
)
my_b_tell
(
&
log_file
);
hdr_offs
=
carry
=
0
;
do
{
if
(
likely
(
carry
>
0
))
/*
if we only got a partial header in the last iteration,
get the other half now and process a full header.
*/
if
(
unlikely
(
carry
>
0
))
{
DBUG_ASSERT
(
carry
<
LOG_EVENT_HEADER_LEN
);
/* assemble both halves */
memcpy
(
&
header
[
carry
],
(
char
*
)
cache
->
read_pos
,
LOG_EVENT_HEADER_LEN
-
carry
);
/* fix end_log_pos */
val
=
uint4korr
(
&
header
[
LOG_POS_OFFSET
])
+
group
;
int4store
(
&
header
[
LOG_POS_OFFSET
],
val
);
/* write the first half of the split header */
if
(
my_b_write
(
&
log_file
,
header
,
carry
))
return
ER_ERROR_ON_WRITE
;
/*
copy fixed second half of header to cache so the correct
version will be written later.
*/
memcpy
((
char
*
)
cache
->
read_pos
,
&
header
[
carry
],
LOG_EVENT_HEADER_LEN
-
carry
);
/* next event header at ... */
hdr_offs
=
LOG_EVENT_HEADER_LEN
-
carry
+
uint4korr
(
&
header
[
EVENT_LEN_OFFSET
]);
carry
=
0
;
}
/* if there is anything to write, process it. */
if
(
likely
(
bytes
>
0
))
{
do
{
DBUG_ASSERT
((
hdr_offs
+
max
(
EVENT_LEN_OFFSET
,
LOG_POS_OFFSET
)
+
4
)
<=
bytes
);
/*
next header beyond current read-buffer? we'll get it later
(though not necessarily in the very next iteration).
*/
val
=
uint4korr
((
char
*
)
cache
->
read_pos
+
hdr_offs
+
LOG_POS_OFFSET
)
+
group
;
int4store
((
char
*
)
cache
->
read_pos
+
hdr_offs
+
LOG_POS_OFFSET
,
val
);
hdr_offs
+=
uint4korr
((
char
*
)
cache
->
read_pos
+
hdr_offs
+
EVENT_LEN_OFFSET
);
if
(
hdr_offs
>=
bytes
)
hdr_offs
-=
bytes
;
else
{
/* header beyond current read-buffer? */
if
(
hdr_offs
>=
bytes
)
{
hdr_offs
-=
bytes
;
break
;
}
/* process all event-headers in this (partial) cache. */
/* split header? */
if
(
hdr_offs
+
LOG_EVENT_HEADER_LEN
>
bytes
)
{
carry
=
bytes
-
hdr_offs
;
do
{
memcpy
(
header
,
(
char
*
)
cache
->
read_pos
+
hdr_offs
,
carry
);
bytes
-=
carry
;
}
/*
partial header only? save what we can get, process once
we get the rest.
*/
if
(
hdr_offs
+
LOG_EVENT_HEADER_LEN
>
bytes
)
{
carry
=
bytes
-
hdr_offs
;
memcpy
(
header
,
(
char
*
)
cache
->
read_pos
+
hdr_offs
,
carry
);
bytes
=
hdr_offs
;
}
else
{
/* we've got a full event-header, and it came in one piece */
uchar
*
log_pos
=
(
uchar
*
)
cache
->
read_pos
+
hdr_offs
+
LOG_POS_OFFSET
;
/* fix end_log_pos */
val
=
uint4korr
(
log_pos
)
+
group
;
int4store
(
log_pos
,
val
);
/* next event header at ... */
log_pos
=
(
uchar
*
)
cache
->
read_pos
+
hdr_offs
+
EVENT_LEN_OFFSET
;
hdr_offs
+=
uint4korr
(
log_pos
);
}
while
(
hdr_offs
<
bytes
);
}
}
while
(
hdr_offs
<
bytes
);
}
}
/* Write data to the binary log file */
if
(
my_b_write
(
&
log_file
,
cache
->
read_pos
,
bytes
))
return
ER_ERROR_ON_WRITE
;
cache
->
read_pos
=
cache
->
read_end
;
}
while
((
bytes
=
my_b_fill
(
cache
)));
cache
->
read_pos
=
cache
->
read_end
;
// Mark buffer used up
}
while
((
bytes
=
my_b_fill
(
cache
)));
if
(
sync_log
)
flush_and_sync
();
...
...
sql/mysqld.cc
View file @
966049ef
...
...
@@ -762,6 +762,7 @@ static void close_connections(void)
DBUG_PRINT
(
"info"
,(
"Waiting for select thread"
));
#ifndef DONT_USE_THR_ALARM
if
(
pthread_kill
(
select_thread
,
thr_client_alarm
))
break
;
// allready dead
#endif
set_timespec
(
abstime
,
2
);
...
...
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