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
8029045b
Commit
8029045b
authored
Aug 04, 2001
by
sasha@mysql.sashanet.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new file_id generation method
parent
a98a7ffe
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
11 deletions
+25
-11
.bzrignore
.bzrignore
+1
-0
mysql-test/r/rpl_log.result
mysql-test/r/rpl_log.result
+9
-9
sql/log.cc
sql/log.cc
+10
-1
sql/log_event.cc
sql/log_event.cc
+2
-1
sql/sql_class.h
sql/sql_class.h
+3
-0
No files found.
.bzrignore
View file @
8029045b
...
...
@@ -375,3 +375,4 @@ support-files/mysql.server
support-files/mysql.spec
tags
tmp/*
vio/viotest-ssl
mysql-test/r/rpl_log.result
View file @
8029045b
...
...
@@ -5,8 +5,8 @@ master-bin.001 172 Intvar 1 3 INSERT_ID=1
master-bin.001 200 Query 1 4 use test; insert into t1 values (NULL)
master-bin.001 263 Query 1 5 use test; drop table t1
master-bin.001 311 Query 1 6 use test; create table t1 (word char(20) not null)
master-bin.001 386 Create_file 1 7 db=test;table=t1;file_id=1
1
;block_len=81
master-bin.001 554 Exec_load 1 8 ;file_id=1
1
master-bin.001 386 Create_file 1 7 db=test;table=t1;file_id=1;block_len=81
master-bin.001 554 Exec_load 1 8 ;file_id=1
master-bin.001 577 Query 1 9 use test; drop table t1
Log_name Pos Event_type Server_id Log_seq Info
master-bin.001 79 Query 1 2 use test; create table t1(n int not null auto_increment primary key)
...
...
@@ -22,8 +22,8 @@ master-bin.001 172 Intvar 1 3 INSERT_ID=1
master-bin.001 200 Query 1 4 use test; insert into t1 values (NULL)
master-bin.001 263 Query 1 5 use test; drop table t1
master-bin.001 311 Query 1 6 use test; create table t1 (word char(20) not null)
master-bin.001 386 Create_file 1 7 db=test;table=t1;file_id=1
1
;block_len=81
master-bin.001 554 Exec_load 1 8 ;file_id=1
1
master-bin.001 386 Create_file 1 7 db=test;table=t1;file_id=1;block_len=81
master-bin.001 554 Exec_load 1 8 ;file_id=1
master-bin.001 577 Query 1 9 use test; drop table t1
master-bin.001 625 Rotate 1 10 master-bin.002;pos=4
master-bin.001 666 Stop 1 11
...
...
@@ -46,11 +46,11 @@ slave-bin.001 225 Intvar 1 3 INSERT_ID=1
slave-bin.001 253 Query 1 4 use test; insert into t1 values (NULL)
slave-bin.001 316 Query 1 5 use test; drop table t1
slave-bin.001 364 Query 1 6 use test; create table t1 (word char(20) not null)
slave-bin.001 439 Create_file 1 7 db=test;table=t1;file_id=1
1
;block_len=81
slave-bin.001 64
7 Exec_load 1 8 ;file_id=1
1
slave-bin.001 6
70
Query 1 9 use test; drop table t1
slave-bin.001 71
8
Rotate 1 4 slave-bin.002;pos=4; forced by master
slave-bin.001 75
8
Stop 2 5
slave-bin.001 439 Create_file 1 7 db=test;table=t1;file_id=1;block_len=81
slave-bin.001 64
6 Exec_load 1 8 ;file_id=
1
slave-bin.001 6
69
Query 1 9 use test; drop table t1
slave-bin.001 71
7
Rotate 1 4 slave-bin.002;pos=4; forced by master
slave-bin.001 75
7
Stop 2 5
Log_name Pos Event_type Server_id Log_seq Info
slave-bin.002 4 Start 2 1 Server ver: $VERSION, Binlog ver: 2
slave-bin.002 79 Slave 2 10 host=127.0.0.1,port=$MASTER_MYPORT,log=master-bin.002,pos=4
...
...
sql/log.cc
View file @
8029045b
...
...
@@ -81,7 +81,7 @@ static int find_uniq_filename(char *name)
MYSQL_LOG
::
MYSQL_LOG
()
:
last_time
(
0
),
query_start
(
0
),
index_file
(
-
1
),
name
(
0
),
log_type
(
LOG_CLOSED
),
write_error
(
0
),
inited
(
0
),
log_seq
(
1
),
no_rotate
(
0
)
inited
(
0
),
log_seq
(
1
),
file_id
(
1
),
no_rotate
(
0
)
{
/*
We don't want to intialize LOCK_Log here as the thread system may
...
...
@@ -724,6 +724,15 @@ err:
return
error
;
}
uint
MYSQL_LOG
::
next_file_id
()
{
uint
res
;
pthread_mutex_lock
(
&
LOCK_log
);
res
=
file_id
++
;
pthread_mutex_unlock
(
&
LOCK_log
);
return
res
;
}
/*
Write a cached log entry to the binary log
We only come here if there is something in the cache.
...
...
sql/log_event.cc
View file @
8029045b
...
...
@@ -45,6 +45,7 @@ static void pretty_print_char(FILE* file, int c)
#ifndef MYSQL_CLIENT
static
void
pretty_print_char
(
String
*
packet
,
int
c
)
{
packet
->
append
(
'\''
);
...
...
@@ -1106,7 +1107,7 @@ Create_file_log_event::Create_file_log_event(THD* thd_arg, sql_exchange* ex,
char
*
block_arg
,
uint
block_len_arg
)
:
Load_log_event
(
thd_arg
,
ex
,
db_arg
,
table_name_arg
,
fields_arg
,
handle_dup
),
fake_base
(
0
),
block
(
block_arg
),
block_len
(
block_len_arg
),
file_id
(
thd_arg
->
file_id
=
thd_arg
->
query_id
)
file_id
(
thd_arg
->
file_id
=
mysql_bin_log
.
next_file_id
()
)
{
}
#endif
...
...
sql/sql_class.h
View file @
8029045b
...
...
@@ -65,6 +65,8 @@ class MYSQL_LOG {
bool
write_error
,
inited
;
uint32
log_seq
;
// current event sequence number
// needed this for binlog
uint
file_id
;
// current file sequence number for load data infile
// binary logging
bool
no_rotate
;
// for binlog - if log name can never change
// we should not try to rotate it or write any rotation events
// the user should use FLUSH MASTER instead of FLUSH LOGS for
...
...
@@ -99,6 +101,7 @@ public:
int
find_first_log
(
LOG_INFO
*
linfo
,
const
char
*
log_name
);
int
find_next_log
(
LOG_INFO
*
linfo
);
int
get_current_log
(
LOG_INFO
*
linfo
);
uint
next_file_id
();
inline
bool
is_open
()
{
return
log_type
!=
LOG_CLOSED
;
}
char
*
get_index_fname
()
{
return
index_file_name
;}
...
...
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