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
032ef1fa
Commit
032ef1fa
authored
Mar 22, 2009
by
Michael Widenius
Browse files
Options
Browse Files
Download
Plain Diff
Merge with trunk
parents
46db8aac
90151609
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
192 additions
and
108 deletions
+192
-108
mysql-test/lib/My/Test.pm
mysql-test/lib/My/Test.pm
+10
-65
mysql-test/lib/mtr_cases.pm
mysql-test/lib/mtr_cases.pm
+0
-9
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+172
-33
mysql-test/t/multi_update2.test
mysql-test/t/multi_update2.test
+3
-0
storage/maria/ma_loghandler.c
storage/maria/ma_loghandler.c
+7
-1
No files found.
mysql-test/lib/My/Test.pm
View file @
032ef1fa
...
@@ -9,6 +9,7 @@ package My::Test;
...
@@ -9,6 +9,7 @@ package My::Test;
use
strict
;
use
strict
;
use
warnings
;
use
warnings
;
use
Carp
;
use
Carp
;
use
Storable
();
sub
new
{
sub
new
{
...
@@ -30,18 +31,6 @@ sub key {
...
@@ -30,18 +31,6 @@ sub key {
}
}
sub
_encode
{
my
(
$value
)
=
@_
;
$value
=~
s/([|\\\x{0a}\x{0d}])/sprintf('\%02X', ord($1))/
eg
;
return
$value
;
}
sub
_decode
{
my
(
$value
)
=
@_
;
$value
=~
s/\\([0-9a-fA-F]{2})/chr(hex($1))/g
e
;
return
$value
;
}
sub
is_failed
{
sub
is_failed
{
my
(
$self
)
=
@_
;
my
(
$self
)
=
@_
;
my
$result
=
$self
->
{
result
};
my
$result
=
$self
->
{
result
};
...
@@ -58,66 +47,22 @@ sub write_test {
...
@@ -58,66 +47,22 @@ sub write_test {
# Give the test a unique key before serializing it
# Give the test a unique key before serializing it
$test
->
{
key
}
=
"
$test
"
unless
defined
$test
->
{
key
};
$test
->
{
key
}
=
"
$test
"
unless
defined
$test
->
{
key
};
print
$sock
$header
,
"
\n
";
my
$serialized
=
Storable::
freeze
(
$test
);
while
((
my
(
$key
,
$value
))
=
each
(
%
$test
))
{
$serialized
=~
s/([\x0d\x0a\\])/sprintf("\\%02x", ord($1))/
eg
;
print
$sock
$key
,
"
=
";
print
$sock
$header
,
"
\n
",
$serialized
,
"
\n
";
if
(
ref
$value
eq
"
ARRAY
")
{
print
$sock
"
[
",
_encode
(
join
("
,
",
@$value
)),
"
]
";
}
else
{
print
$sock
_encode
(
$value
);
}
print
$sock
"
\n
";
}
print
$sock
"
\n
";
}
}
sub
read_test
{
sub
read_test
{
my
(
$sock
)
=
@_
;
my
(
$sock
)
=
@_
;
my
$test
=
My::
Test
->
new
();
my
$serialized
=
<
$sock
>
;
# Read the : separated key value pairs until a
chomp
(
$serialized
);
# single newline on it's own line
$serialized
=~
s/\\([0-9a-fA-F]{2})/chr(hex($1))/
eg
;
my
$line
;
my
$test
=
Storable::
thaw
(
$serialized
);
while
(
defined
(
$line
=
<
$sock
>
))
{
die
"
wrong class (hack attempt?)
"
# List is terminated by newline on it's own
unless
ref
(
$test
)
eq
'
My::Test
';
if
(
$line
eq
"
\n
")
{
# Correctly terminated reply
# print "Got newline\n";
last
;
}
chomp
(
$line
);
# Split key/value on the first "="
my
(
$key
,
$value
)
=
split
("
=
",
$line
,
2
);
if
(
$value
=~
/^\[(.*)\]/
){
my
@values
=
split
("
,
",
_decode
(
$1
));
push
(
@
{
$test
->
{
$key
}},
@values
);
}
else
{
$test
->
{
$key
}
=
_decode
(
$value
);
}
}
return
$test
;
return
$test
;
}
}
sub
print_test
{
my
(
$self
)
=
@_
;
print
"
[
",
$self
->
{
name
},
"
]
",
"
\n
";
while
((
my
(
$key
,
$value
))
=
each
(
%
$self
))
{
print
"
",
$key
,
"
=
";
if
(
ref
$value
eq
"
ARRAY
")
{
print
"
[
",
join
("
,
",
@$value
),
"
]
";
}
else
{
print
$value
;
}
print
"
\n
";
}
print
"
\n
";
}
1
;
1
;
mysql-test/lib/mtr_cases.pm
View file @
032ef1fa
...
@@ -799,15 +799,6 @@ sub collect_one_test_case {
...
@@ -799,15 +799,6 @@ sub collect_one_test_case {
push
(
@
{
$tinfo
->
{'
master_opt
'}},
@$suite_opts
);
push
(
@
{
$tinfo
->
{'
master_opt
'}},
@$suite_opts
);
push
(
@
{
$tinfo
->
{'
slave_opt
'}},
@$suite_opts
);
push
(
@
{
$tinfo
->
{'
slave_opt
'}},
@$suite_opts
);
#-----------------------------------------------------------------------
# Check for test specific config file
#-----------------------------------------------------------------------
my
$test_cnf_file
=
"
$testdir
/
$tname
.cnf
";
if
(
-
f
$test_cnf_file
)
{
# Specifies the configuration file to use for this test
$tinfo
->
{'
template_path
'}
=
$test_cnf_file
;
}
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Check for test specific config file
# Check for test specific config file
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
...
...
mysql-test/mysql-test-run.pl
View file @
032ef1fa
This diff is collapsed.
Click to expand it.
mysql-test/t/multi_update2.test
View file @
032ef1fa
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
# Test of update statement that uses many tables.
# Test of update statement that uses many tables.
#
#
# This is a big test.
--
source
include
/
big_test
.
inc
--
disable_warnings
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
,
t2
;
DROP
TABLE
IF
EXISTS
t1
,
t2
;
--
enable_warnings
--
enable_warnings
...
...
storage/maria/ma_loghandler.c
View file @
032ef1fa
...
@@ -333,6 +333,8 @@ struct st_translog_descriptor
...
@@ -333,6 +333,8 @@ struct st_translog_descriptor
my_bool
is_everything_flushed
;
my_bool
is_everything_flushed
;
/* True when flush pass is in progress */
/* True when flush pass is in progress */
my_bool
flush_in_progress
;
my_bool
flush_in_progress
;
/* The flush number (used to distinguish two flushes goes one by one) */
volatile
int
flush_no
;
/* Next flush pass variables */
/* Next flush pass variables */
TRANSLOG_ADDRESS
next_pass_max_lsn
;
TRANSLOG_ADDRESS
next_pass_max_lsn
;
pthread_t
max_lsn_requester
;
pthread_t
max_lsn_requester
;
...
@@ -3484,6 +3486,8 @@ my_bool translog_init_with_table(const char *directory,
...
@@ -3484,6 +3486,8 @@ my_bool translog_init_with_table(const char *directory,
id_to_share
=
NULL
;
id_to_share
=
NULL
;
log_descriptor
.
directory_fd
=
-
1
;
log_descriptor
.
directory_fd
=
-
1
;
log_descriptor
.
is_everything_flushed
=
1
;
log_descriptor
.
is_everything_flushed
=
1
;
log_descriptor
.
flush_in_progress
=
0
;
log_descriptor
.
flush_no
=
0
;
log_descriptor
.
next_pass_max_lsn
=
LSN_IMPOSSIBLE
;
log_descriptor
.
next_pass_max_lsn
=
LSN_IMPOSSIBLE
;
(
*
init_table_func
)();
(
*
init_table_func
)();
...
@@ -7548,6 +7552,7 @@ void translog_flush_wait_for_end(LSN lsn)
...
@@ -7548,6 +7552,7 @@ void translog_flush_wait_for_end(LSN lsn)
void
translog_flush_set_new_goal_and_wait
(
TRANSLOG_ADDRESS
lsn
)
void
translog_flush_set_new_goal_and_wait
(
TRANSLOG_ADDRESS
lsn
)
{
{
int
flush_no
=
log_descriptor
.
flush_no
;
DBUG_ENTER
(
"translog_flush_set_new_goal_and_wait"
);
DBUG_ENTER
(
"translog_flush_set_new_goal_and_wait"
);
DBUG_PRINT
(
"enter"
,
(
"LSN: (%lu,0x%lx)"
,
LSN_IN_PARTS
(
lsn
)));
DBUG_PRINT
(
"enter"
,
(
"LSN: (%lu,0x%lx)"
,
LSN_IN_PARTS
(
lsn
)));
safe_mutex_assert_owner
(
&
log_descriptor
.
log_flush_lock
);
safe_mutex_assert_owner
(
&
log_descriptor
.
log_flush_lock
);
...
@@ -7556,7 +7561,7 @@ void translog_flush_set_new_goal_and_wait(TRANSLOG_ADDRESS lsn)
...
@@ -7556,7 +7561,7 @@ void translog_flush_set_new_goal_and_wait(TRANSLOG_ADDRESS lsn)
log_descriptor
.
next_pass_max_lsn
=
lsn
;
log_descriptor
.
next_pass_max_lsn
=
lsn
;
log_descriptor
.
max_lsn_requester
=
pthread_self
();
log_descriptor
.
max_lsn_requester
=
pthread_self
();
}
}
while
(
log_descriptor
.
flush_in_progress
)
while
(
flush_no
==
log_descriptor
.
flush_no
)
{
{
pthread_cond_wait
(
&
log_descriptor
.
log_flush_cond
,
pthread_cond_wait
(
&
log_descriptor
.
log_flush_cond
,
&
log_descriptor
.
log_flush_lock
);
&
log_descriptor
.
log_flush_lock
);
...
@@ -7735,6 +7740,7 @@ out:
...
@@ -7735,6 +7740,7 @@ out:
if
(
sent_to_disk
!=
LSN_IMPOSSIBLE
)
if
(
sent_to_disk
!=
LSN_IMPOSSIBLE
)
log_descriptor
.
flushed
=
sent_to_disk
;
log_descriptor
.
flushed
=
sent_to_disk
;
log_descriptor
.
flush_in_progress
=
0
;
log_descriptor
.
flush_in_progress
=
0
;
log_descriptor
.
flush_no
++
;
DBUG_PRINT
(
"info"
,
(
"flush_in_progress is dropped"
));
DBUG_PRINT
(
"info"
,
(
"flush_in_progress is dropped"
));
pthread_mutex_unlock
(
&
log_descriptor
.
log_flush_lock
);
\
pthread_mutex_unlock
(
&
log_descriptor
.
log_flush_lock
);
\
pthread_cond_broadcast
(
&
log_descriptor
.
log_flush_cond
);
pthread_cond_broadcast
(
&
log_descriptor
.
log_flush_cond
);
...
...
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