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
81141285
Commit
81141285
authored
Mar 09, 2006
by
pekka@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge pnousiainen@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/space/pekka/ndb/version/my51
parents
1c52ad09
6c1b0b37
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
365 additions
and
118 deletions
+365
-118
mysql-test/include/show_binlog_events.inc
mysql-test/include/show_binlog_events.inc
+4
-0
mysql-test/r/ndb_binlog_ddl_multi.result
mysql-test/r/ndb_binlog_ddl_multi.result
+67
-2
mysql-test/t/ndb_binlog_ddl_multi.test
mysql-test/t/ndb_binlog_ddl_multi.test
+54
-20
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_binlog.cc
+202
-94
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+38
-2
No files found.
mysql-test/include/show_binlog_events.inc
0 → 100644
View file @
81141285
--
let
$binlog_start
=
102
--
replace_result
$binlog_start
<
binlog_start
>
--
replace_column
2
# 4 # 5 #
--
eval
show
binlog
events
from
$binlog_start
mysql-test/r/ndb_binlog_ddl_multi.result
View file @
81141285
drop database if exists mysqltest;
drop database if exists mysqltest;
drop table if exists t1,t2;
drop table if exists t1,t2
,t3
;
drop database if exists mysqltest;
drop database if exists mysqltest;
drop table if exists t1,t2;
drop table if exists t1,t2
,t3
;
reset master;
reset master;
reset master;
reset master;
create database mysqltest;
create database mysqltest;
...
@@ -123,3 +123,68 @@ master-bin1.000001 # Table_map # # cluster.apply_status
...
@@ -123,3 +123,68 @@ master-bin1.000001 # Table_map # # cluster.apply_status
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; drop table `t1`
master-bin1.000001 # Query # # use `test`; drop table `t1`
reset master;
show tables;
Tables_in_test
reset master;
show tables;
Tables_in_test
create table t1 (a int key) engine=ndb;
create table t2 (a int key) engine=ndb;
create table t3 (a int key) engine=ndb;
rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # use `test`; create table t1 (a int key) engine=ndb
master-bin1.000001 # Query # # use `test`; create table t2 (a int key) engine=ndb
master-bin1.000001 # Query # # use `test`; create table t3 (a int key) engine=ndb
master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster.apply_status
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; rename table `test.t3` to `test.t4`
master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster.apply_status
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; rename table `test.t2` to `test.t3`
master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster.apply_status
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; rename table `test.t1` to `test.t2`
master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster.apply_status
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; rename table `test.t4` to `test.t1`
drop table t1;
drop table t2;
drop table t3;
reset master;
show tables;
Tables_in_test
reset master;
show tables;
Tables_in_test
create table t1 (a int key) engine=ndb;
insert into t1 values(1);
rename table t1 to t2;
insert into t2 values(2);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # use `test`; create table t1 (a int key) engine=ndb
master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster.apply_status
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Table_map # # test.t1
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; rename table `test.t1` to `test.t2`
master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster.apply_status
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Table_map # # test.t2
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Query # # COMMIT
drop table t2;
mysql-test/t/ndb_binlog_ddl_multi.test
View file @
81141285
...
@@ -5,18 +5,16 @@
...
@@ -5,18 +5,16 @@
--
disable_warnings
--
disable_warnings
connection
server2
;
connection
server2
;
drop
database
if
exists
mysqltest
;
drop
database
if
exists
mysqltest
;
drop
table
if
exists
t1
,
t2
;
drop
table
if
exists
t1
,
t2
,
t3
;
connection
server1
;
connection
server1
;
drop
database
if
exists
mysqltest
;
drop
database
if
exists
mysqltest
;
drop
table
if
exists
t1
,
t2
;
drop
table
if
exists
t1
,
t2
,
t3
;
--
connection
server1
--
connection
server1
reset
master
;
reset
master
;
--
connection
server2
--
connection
server2
reset
master
;
reset
master
;
--
enable_warnings
--
enable_warnings
--
let
$binlog_start
=
102
#
#
# basic test to see if ddl distribution works across
# basic test to see if ddl distribution works across
# multiple binlogs
# multiple binlogs
...
@@ -33,15 +31,10 @@ create table t1 (a int primary key) engine=ndb;
...
@@ -33,15 +31,10 @@ create table t1 (a int primary key) engine=ndb;
--
connection
server2
--
connection
server2
create
table
t2
(
a
int
primary
key
)
engine
=
ndb
;
create
table
t2
(
a
int
primary
key
)
engine
=
ndb
;
--
replace_result
$binlog_start
<
binlog_start
>
--
source
include
/
show_binlog_events
.
inc
--
replace_column
2
# 4 # 5 #
--
eval
show
binlog
events
from
$binlog_start
--
connection
server1
--
connection
server1
--
replace_result
$binlog_start
<
binlog_start
>
--
source
include
/
show_binlog_events
.
inc
--
replace_column
2
# 4 # 5 #
--
eval
show
binlog
events
from
$binlog_start
# alter table
# alter table
--
connection
server1
--
connection
server1
...
@@ -53,9 +46,7 @@ reset master;
...
@@ -53,9 +46,7 @@ reset master;
alter
table
t2
add
column
(
b
int
);
alter
table
t2
add
column
(
b
int
);
--
connections
server1
--
connections
server1
--
replace_result
$binlog_start
<
binlog_start
>
--
source
include
/
show_binlog_events
.
inc
--
replace_column
2
# 4 # 5 #
--
eval
show
binlog
events
from
$binlog_start
# alter database
# alter database
...
@@ -91,9 +82,7 @@ drop database mysqltest;
...
@@ -91,9 +82,7 @@ drop database mysqltest;
create
table
t1
(
a
int
primary
key
)
engine
=
ndb
;
create
table
t1
(
a
int
primary
key
)
engine
=
ndb
;
--
connection
server2
--
connection
server2
--
replace_result
$binlog_start
<
binlog_start
>
--
source
include
/
show_binlog_events
.
inc
--
replace_column
2
# 4 # 5 #
--
eval
show
binlog
events
from
$binlog_start
--
connection
server2
--
connection
server2
drop
table
t2
;
drop
table
t2
;
...
@@ -144,6 +133,51 @@ ENGINE =NDB;
...
@@ -144,6 +133,51 @@ ENGINE =NDB;
drop
table
t1
;
drop
table
t1
;
--
connection
server2
--
connection
server2
--
replace_result
$binlog_start
<
binlog_start
>
--
source
include
/
show_binlog_events
.
inc
--
replace_column
2
# 4 # 5 #
--
eval
show
binlog
events
from
$binlog_start
#
# Bug #17827 cluster: rename of several tables in one statement,
# gets multiply logged
#
--
connection
server1
reset
master
;
show
tables
;
--
connection
server2
reset
master
;
show
tables
;
--
connection
server1
create
table
t1
(
a
int
key
)
engine
=
ndb
;
create
table
t2
(
a
int
key
)
engine
=
ndb
;
create
table
t3
(
a
int
key
)
engine
=
ndb
;
rename
table
t3
to
t4
,
t2
to
t3
,
t1
to
t2
,
t4
to
t1
;
--
connection
server2
--
source
include
/
show_binlog_events
.
inc
drop
table
t1
;
drop
table
t2
;
drop
table
t3
;
#
# Bug #17838 binlog not setup on seconday master after rename
#
#
--
connection
server1
reset
master
;
show
tables
;
--
connection
server2
reset
master
;
show
tables
;
--
connection
server1
create
table
t1
(
a
int
key
)
engine
=
ndb
;
insert
into
t1
values
(
1
);
rename
table
t1
to
t2
;
insert
into
t2
values
(
2
);
# now we should see data in table t1 _and_ t2
# prior to bug fix, data was missing for t2
--
connection
server2
--
source
include
/
show_binlog_events
.
inc
drop
table
t2
;
sql/ha_ndbcluster_binlog.cc
View file @
81141285
This diff is collapsed.
Click to expand it.
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
View file @
81141285
...
@@ -689,9 +689,45 @@ NdbEventOperationImpl::receive_event()
...
@@ -689,9 +689,45 @@ NdbEventOperationImpl::receive_event()
error
.
code
));
error
.
code
));
DBUG_RETURN_EVENT
(
1
);
DBUG_RETURN_EVENT
(
1
);
}
}
if
(
m_eventImpl
->
m_tableImpl
)
delete
m_eventImpl
->
m_tableImpl
;
NdbTableImpl
*
tmp_table_impl
=
m_eventImpl
->
m_tableImpl
;
m_eventImpl
->
m_tableImpl
=
at
;
m_eventImpl
->
m_tableImpl
=
at
;
DBUG_PRINT
(
"info"
,
(
"switching table impl 0x%x -> 0x%x"
,
tmp_table_impl
,
at
));
// change the rec attrs to refer to the new table object
int
i
;
for
(
i
=
0
;
i
<
2
;
i
++
)
{
NdbRecAttr
*
p
=
theFirstPkAttrs
[
i
];
while
(
p
)
{
int
no
=
p
->
getColumn
()
->
getColumnNo
();
NdbColumnImpl
*
tAttrInfo
=
at
->
getColumn
(
no
);
DBUG_PRINT
(
"info"
,
(
"rec_attr: 0x%x "
"switching column impl 0x%x -> 0x%x"
,
p
,
p
->
m_column
,
tAttrInfo
));
p
->
m_column
=
tAttrInfo
;
p
=
p
->
next
();
}
}
for
(
i
=
0
;
i
<
2
;
i
++
)
{
NdbRecAttr
*
p
=
theFirstDataAttrs
[
i
];
while
(
p
)
{
int
no
=
p
->
getColumn
()
->
getColumnNo
();
NdbColumnImpl
*
tAttrInfo
=
at
->
getColumn
(
no
);
DBUG_PRINT
(
"info"
,
(
"rec_attr: 0x%x "
"switching column impl 0x%x -> 0x%x"
,
p
,
p
->
m_column
,
tAttrInfo
));
p
->
m_column
=
tAttrInfo
;
p
=
p
->
next
();
}
}
if
(
tmp_table_impl
)
delete
tmp_table_impl
;
}
}
if
(
unlikely
(
operation
>=
NdbDictionary
::
Event
::
_TE_FIRST_NON_DATA_EVENT
))
if
(
unlikely
(
operation
>=
NdbDictionary
::
Event
::
_TE_FIRST_NON_DATA_EVENT
))
...
...
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