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
a50f1641
Commit
a50f1641
authored
Dec 28, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-maria
into janus.mylan:/usr/home/serg/Abk/mysql-maria
parents
4140f76f
77cc781d
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
460 additions
and
21 deletions
+460
-21
storage/maria/ma_loghandler.c
storage/maria/ma_loghandler.c
+13
-8
storage/maria/ma_loghandler.h
storage/maria/ma_loghandler.h
+3
-2
storage/maria/unittest/ma_test_all-t
storage/maria/unittest/ma_test_all-t
+424
-0
storage/maria/unittest/ma_test_loghandler-t.c
storage/maria/unittest/ma_test_loghandler-t.c
+2
-1
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c
+2
-1
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c
+2
-1
storage/maria/unittest/ma_test_loghandler_multigroup-t.c
storage/maria/unittest/ma_test_loghandler_multigroup-t.c
+2
-2
storage/maria/unittest/ma_test_loghandler_multithread-t.c
storage/maria/unittest/ma_test_loghandler_multithread-t.c
+2
-1
storage/maria/unittest/ma_test_loghandler_noflush-t.c
storage/maria/unittest/ma_test_loghandler_noflush-t.c
+2
-1
storage/maria/unittest/ma_test_loghandler_nologs-t.c
storage/maria/unittest/ma_test_loghandler_nologs-t.c
+4
-2
storage/maria/unittest/ma_test_loghandler_pagecache-t.c
storage/maria/unittest/ma_test_loghandler_pagecache-t.c
+2
-1
storage/maria/unittest/ma_test_loghandler_purge-t.c
storage/maria/unittest/ma_test_loghandler_purge-t.c
+2
-1
No files found.
storage/maria/ma_loghandler.c
View file @
a50f1641
...
...
@@ -2807,13 +2807,15 @@ static void translog_free_link(PAGECACHE_BLOCK_LINK *direct_link)
@param last_page_ok Result of the check whether last page OK.
(for now only we check only that file length
divisible on page length).
@param no_errors suppress messages about non-critical errors
@retval 0 OK
@retval 1 Error
*/
static
my_bool
translog_get_last_page_addr
(
TRANSLOG_ADDRESS
*
addr
,
my_bool
*
last_page_ok
)
my_bool
*
last_page_ok
,
my_bool
no_errors
)
{
MY_STAT
stat_buff
,
*
local_stat
;
char
path
[
FN_REFLEN
];
...
...
@@ -2822,7 +2824,8 @@ static my_bool translog_get_last_page_addr(TRANSLOG_ADDRESS *addr,
DBUG_ENTER
(
"translog_get_last_page_addr"
);
if
(
!
(
local_stat
=
my_stat
(
translog_filename_by_fileno
(
file_no
,
path
),
&
stat_buff
,
MYF
(
MY_WME
))))
&
stat_buff
,
(
no_errors
?
MYF
(
0
)
:
MYF
(
MY_WME
)))))
DBUG_RETURN
(
1
);
DBUG_PRINT
(
"info"
,
(
"File size: %lu"
,
(
ulong
)
local_stat
->
st_size
));
if
(
local_stat
->
st_size
>
TRANSLOG_PAGE_SIZE
)
...
...
@@ -3049,6 +3052,7 @@ my_bool translog_is_log_files()
TRANSLOG_RECORD_CRC)
@param read_only Put transaction log in read-only mode
@param init_table_func function to initialize record descriptors table
@param no_errors suppress messages about non-critical errors
@todo
Free used resources in case of error.
...
...
@@ -3062,7 +3066,8 @@ my_bool translog_init_with_table(const char *directory,
uint32
server_version
,
uint32
server_id
,
PAGECACHE
*
pagecache
,
uint
flags
,
my_bool
readonly
,
void
(
*
init_table_func
)())
void
(
*
init_table_func
)(),
my_bool
no_errors
)
{
int
i
;
int
old_log_was_recovered
=
0
,
logs_found
=
0
;
...
...
@@ -3217,7 +3222,7 @@ my_bool translog_init_with_table(const char *directory,
}
/* Set horizon to the beginning of the last file first */
log_descriptor
.
horizon
=
last_page
=
MAKE_LSN
(
last_logno
,
0
);
if
(
translog_get_last_page_addr
(
&
last_page
,
&
pageok
))
if
(
translog_get_last_page_addr
(
&
last_page
,
&
pageok
,
no_errors
))
{
if
(
!
translog_is_log_files
())
{
...
...
@@ -3238,7 +3243,7 @@ my_bool translog_init_with_table(const char *directory,
else
{
last_page
-=
LSN_ONE_FILE
;
if
(
translog_get_last_page_addr
(
&
last_page
,
&
pageok
))
if
(
translog_get_last_page_addr
(
&
last_page
,
&
pageok
,
0
))
DBUG_RETURN
(
1
);
}
}
...
...
@@ -3317,7 +3322,7 @@ my_bool translog_init_with_table(const char *directory,
{
TRANSLOG_ADDRESS
current_file_last_page
;
current_file_last_page
=
current_page
;
if
(
translog_get_last_page_addr
(
&
current_file_last_page
,
&
pageok
))
if
(
translog_get_last_page_addr
(
&
current_file_last_page
,
&
pageok
,
0
))
DBUG_RETURN
(
1
);
if
(
!
pageok
)
{
...
...
@@ -3593,7 +3598,7 @@ my_bool translog_init_with_table(const char *directory,
}
file_no
--
;
page_addr
=
MAKE_LSN
(
file_no
,
TRANSLOG_PAGE_SIZE
);
translog_get_last_page_addr
(
&
page_addr
,
&
last_page_ok
);
translog_get_last_page_addr
(
&
page_addr
,
&
last_page_ok
,
0
);
/* page should be OK as it is not the last file */
DBUG_ASSERT
(
last_page_ok
);
}
...
...
@@ -5842,7 +5847,7 @@ static my_bool translog_scanner_set_last_page(TRANSLOG_SCANNER_DATA *scanner)
return
(
0
);
}
scanner
->
last_file_page
=
scanner
->
page_addr
;
return
(
translog_get_last_page_addr
(
&
scanner
->
last_file_page
,
&
page_ok
));
return
(
translog_get_last_page_addr
(
&
scanner
->
last_file_page
,
&
page_ok
,
0
));
}
...
...
storage/maria/ma_loghandler.h
View file @
a50f1641
...
...
@@ -257,7 +257,7 @@ C_MODE_START
extern
void
translog_example_table_init
();
extern
void
translog_table_init
();
#define translog_init(D,M,V,I,C,F,R) \
translog_init_with_table(D,M,V,I,C,F,R,&translog_table_init)
translog_init_with_table(D,M,V,I,C,F,R,&translog_table_init
,0
)
extern
my_bool
translog_init_with_table
(
const
char
*
directory
,
uint32
log_file_max_size
,
uint32
server_version
,
...
...
@@ -265,7 +265,8 @@ extern my_bool translog_init_with_table(const char *directory,
PAGECACHE
*
pagecache
,
uint
flags
,
my_bool
readonly
,
void
(
*
init_table_func
)());
void
(
*
init_table_func
)(),
my_bool
no_error
);
extern
my_bool
translog_write_record
(
LSN
*
lsn
,
enum
translog_record_type
type
,
TRN
*
trn
,
...
...
storage/maria/unittest/ma_test_all-t
0 → 100755
View file @
a50f1641
This diff is collapsed.
Click to expand it.
storage/maria/unittest/ma_test_loghandler-t.c
View file @
a50f1641
...
...
@@ -177,7 +177,8 @@ int main(int argc __attribute__((unused)), char *argv[])
exit
(
1
);
}
if
(
translog_init_with_table
(
"."
,
LOG_FILE_SIZE
,
50112
,
0
,
&
pagecache
,
LOG_FLAGS
,
0
,
&
translog_example_table_init
))
LOG_FLAGS
,
0
,
&
translog_example_table_init
,
0
))
{
fprintf
(
stderr
,
"Can't init loghandler (%d)
\n
"
,
errno
);
exit
(
1
);
...
...
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c
View file @
a50f1641
...
...
@@ -67,7 +67,8 @@ int main(int argc __attribute__((unused)), char *argv[])
exit
(
1
);
}
if
(
translog_init_with_table
(
"."
,
LOG_FILE_SIZE
,
50112
,
0
,
&
pagecache
,
LOG_FLAGS
,
0
,
&
translog_example_table_init
))
LOG_FLAGS
,
0
,
&
translog_example_table_init
,
0
))
{
fprintf
(
stderr
,
"Can't init loghandler (%d)
\n
"
,
errno
);
exit
(
1
);
...
...
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c
View file @
a50f1641
...
...
@@ -61,7 +61,8 @@ int main(int argc __attribute__((unused)), char *argv[])
exit
(
1
);
}
if
(
translog_init_with_table
(
"."
,
LOG_FILE_SIZE
,
50112
,
0
,
&
pagecache
,
LOG_FLAGS
,
0
,
&
translog_example_table_init
))
LOG_FLAGS
,
0
,
&
translog_example_table_init
,
0
))
{
fprintf
(
stderr
,
"Can't init loghandler (%d)
\n
"
,
errno
);
exit
(
1
);
...
...
storage/maria/unittest/ma_test_loghandler_multigroup-t.c
View file @
a50f1641
...
...
@@ -186,7 +186,7 @@ int main(int argc __attribute__((unused)), char *argv[])
exit
(
1
);
}
if
(
translog_init_with_table
(
"."
,
LOG_FILE_SIZE
,
50112
,
0
,
&
pagecache
,
0
,
0
,
&
translog_example_table_init
))
0
,
0
,
&
translog_example_table_init
,
0
))
{
fprintf
(
stderr
,
"Can't init loghandler (%d)
\n
"
,
errno
);
exit
(
1
);
...
...
@@ -350,7 +350,7 @@ int main(int argc __attribute__((unused)), char *argv[])
exit
(
1
);
}
if
(
translog_init_with_table
(
"."
,
LOG_FILE_SIZE
,
50112
,
0
,
&
pagecache
,
0
,
READONLY
,
&
translog_example_table_init
))
0
,
READONLY
,
&
translog_example_table_init
,
0
))
{
fprintf
(
stderr
,
"pass2: Can't init loghandler (%d)
\n
"
,
errno
);
exit
(
1
);
...
...
storage/maria/unittest/ma_test_loghandler_multithread-t.c
View file @
a50f1641
...
...
@@ -284,7 +284,8 @@ int main(int argc __attribute__((unused)),
exit
(
1
);
}
if
(
translog_init_with_table
(
"."
,
LOG_FILE_SIZE
,
50112
,
0
,
&
pagecache
,
LOG_FLAGS
,
0
,
&
translog_example_table_init
))
LOG_FLAGS
,
0
,
&
translog_example_table_init
,
0
))
{
fprintf
(
stderr
,
"Can't init loghandler (%d)
\n
"
,
errno
);
exit
(
1
);
...
...
storage/maria/unittest/ma_test_loghandler_noflush-t.c
View file @
a50f1641
...
...
@@ -69,7 +69,8 @@ int main(int argc __attribute__((unused)), char *argv[])
exit
(
1
);
}
if
(
translog_init_with_table
(
"."
,
LOG_FILE_SIZE
,
50112
,
0
,
&
pagecache
,
LOG_FLAGS
,
0
,
&
translog_example_table_init
))
LOG_FLAGS
,
0
,
&
translog_example_table_init
,
0
))
{
fprintf
(
stderr
,
"Can't init loghandler (%d)
\n
"
,
errno
);
exit
(
1
);
...
...
storage/maria/unittest/ma_test_loghandler_nologs-t.c
View file @
a50f1641
...
...
@@ -64,7 +64,8 @@ int main(int argc __attribute__((unused)), char *argv[])
exit
(
1
);
}
if
(
translog_init_with_table
(
"."
,
LOG_FILE_SIZE
,
50112
,
0
,
&
pagecache
,
LOG_FLAGS
,
0
,
&
translog_example_table_init
))
LOG_FLAGS
,
0
,
&
translog_example_table_init
,
0
))
{
fprintf
(
stderr
,
"Can't init loghandler (%d)
\n
"
,
errno
);
exit
(
1
);
...
...
@@ -137,7 +138,8 @@ int main(int argc __attribute__((unused)), char *argv[])
exit
(
1
);
}
if
(
translog_init_with_table
(
"."
,
LOG_FILE_SIZE
,
50112
,
0
,
&
pagecache
,
LOG_FLAGS
,
0
,
&
translog_example_table_init
))
LOG_FLAGS
,
0
,
&
translog_example_table_init
,
1
))
{
fprintf
(
stderr
,
"Can't init loghandler (%d)
\n
"
,
errno
);
exit
(
1
);
...
...
storage/maria/unittest/ma_test_loghandler_pagecache-t.c
View file @
a50f1641
...
...
@@ -94,7 +94,8 @@ int main(int argc __attribute__((unused)), char *argv[])
exit
(
1
);
}
if
(
translog_init_with_table
(
"."
,
LOG_FILE_SIZE
,
50112
,
0
,
&
pagecache
,
LOG_FLAGS
,
0
,
&
translog_example_table_init
))
LOG_FLAGS
,
0
,
&
translog_example_table_init
,
0
))
{
fprintf
(
stderr
,
"Can't init loghandler (%d)
\n
"
,
errno
);
exit
(
1
);
...
...
storage/maria/unittest/ma_test_loghandler_purge-t.c
View file @
a50f1641
...
...
@@ -64,7 +64,8 @@ int main(int argc __attribute__((unused)), char *argv[])
exit
(
1
);
}
if
(
translog_init_with_table
(
"."
,
LOG_FILE_SIZE
,
50112
,
0
,
&
pagecache
,
LOG_FLAGS
,
0
,
&
translog_example_table_init
))
LOG_FLAGS
,
0
,
&
translog_example_table_init
,
0
))
{
fprintf
(
stderr
,
"Can't init loghandler (%d)
\n
"
,
errno
);
exit
(
1
);
...
...
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