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
f81ff454
Commit
f81ff454
authored
Mar 08, 2007
by
tomas@poseidon.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new apply_status table test adoption
new apply_status table ndb_restore adoption
parent
afdbe36a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
34 deletions
+69
-34
mysql-test/r/ndb_restore_compat.result
mysql-test/r/ndb_restore_compat.result
+4
-4
mysql-test/r/rpl_ndb_log.result
mysql-test/r/rpl_ndb_log.result
+4
-4
mysql-test/r/rpl_truncate_7ndb.result
mysql-test/r/rpl_truncate_7ndb.result
+26
-26
storage/ndb/tools/restore/consumer_restore.cpp
storage/ndb/tools/restore/consumer_restore.cpp
+35
-0
No files found.
mysql-test/r/ndb_restore_compat.result
View file @
f81ff454
...
...
@@ -45,8 +45,8 @@ SYSTEM_VALUES_ID VALUE
0 2039
1 3
SELECT * FROM mysql.ndb_apply_status WHERE server_id=0;
server_id epoch
0 151
server_id epoch
log_name start_pos end_pos
0 151
0 0
TRUNCATE GL;
TRUNCATE ACCOUNT;
TRUNCATE TRANSACTION;
...
...
@@ -99,6 +99,6 @@ SYSTEM_VALUES_ID VALUE
0 2297
1 5
SELECT * FROM mysql.ndb_apply_status WHERE server_id=0;
server_id epoch
0 331
server_id epoch
log_name start_pos end_pos
0 331
0 0
DROP DATABASE BANK;
mysql-test/r/rpl_ndb_log.result
View file @
f81ff454
...
...
@@ -87,12 +87,12 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000002 # Query 1 # COMMIT
show binary logs;
Log_name File_size
master-bin.000001 17
02
master-bin.000002
593
master-bin.000001 17
40
master-bin.000002
612
start slave;
show binary logs;
Log_name File_size
slave-bin.000001 1
797
slave-bin.000001 1
835
slave-bin.000002 198
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
...
...
@@ -126,7 +126,7 @@ slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F
slave-bin.000002 # Query 2 # COMMIT
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002
593 # # master-bin.000002 Yes Yes # 0 0 593
# None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002
612 # # master-bin.000002 Yes Yes # 0 0 612
# None 0 No #
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1;
...
...
mysql-test/r/rpl_truncate_7ndb.result
View file @
f81ff454
...
...
@@ -33,12 +33,12 @@ master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 219 Query 1 283 BEGIN
master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 323 Table_map 1 9
5
table_id: # (mysql.ndb_apply_status)
master-bin.000001 3
78 Write_rows 1 137
table_id: #
master-bin.000001 4
20 Write_rows 1 184
table_id: # flags: STMT_END_F
master-bin.000001 4
67 Query 1 532
COMMIT
master-bin.000001 5
32 Query 1 612
use `test`; TRUNCATE TABLE t1
master-bin.000001 6
12 Query 1 688
use `test`; DROP TABLE t1
master-bin.000001 323 Table_map 1 9
8
table_id: # (mysql.ndb_apply_status)
master-bin.000001 3
81 Write_rows 1 156
table_id: #
master-bin.000001 4
39 Write_rows 1 203
table_id: # flags: STMT_END_F
master-bin.000001 4
86 Query 1 551
COMMIT
master-bin.000001 5
51 Query 1 631
use `test`; TRUNCATE TABLE t1
master-bin.000001 6
31 Query 1 707
use `test`; DROP TABLE t1
**** On Master ****
CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
INSERT INTO t1 VALUES (1,1), (2,2);
...
...
@@ -69,23 +69,23 @@ master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 219 Query 1 283 BEGIN
master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 323 Table_map 1 9
5
table_id: # (mysql.ndb_apply_status)
master-bin.000001 3
78 Write_rows 1 137
table_id: #
master-bin.000001 4
20 Write_rows 1 184
table_id: # flags: STMT_END_F
master-bin.000001 4
67 Query 1 532
COMMIT
master-bin.000001 5
32 Query 1 612
use `test`; TRUNCATE TABLE t1
master-bin.000001 6
12 Query 1 688
use `test`; DROP TABLE t1
master-bin.000001
688 Query 1 805
use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 8
05 Query 1 869
BEGIN
master-bin.000001 8
69
Table_map 1 40 table_id: # (test.t1)
master-bin.000001 9
09 Table_map 1 95
table_id: # (mysql.ndb_apply_status)
master-bin.000001 9
64 Write_rows 1 137
table_id: #
master-bin.000001 10
06 Write_rows 1 184
table_id: # flags: STMT_END_F
master-bin.000001 10
53 Query 1 1118
COMMIT
master-bin.000001 11
18 Query 1 1182
BEGIN
master-bin.000001 1
182
Table_map 1 40 table_id: # (test.t1)
master-bin.000001 12
22 Table_map 1 95
table_id: # (mysql.ndb_apply_status)
master-bin.000001 1
277 Write_rows 1 137
table_id: #
master-bin.000001 13
19 Delete_rows 1 176
table_id: # flags: STMT_END_F
master-bin.000001 1
358 Query 1 1423
COMMIT
master-bin.000001 14
23 Query 1 1499
use `test`; DROP TABLE t1
master-bin.000001 323 Table_map 1 9
8
table_id: # (mysql.ndb_apply_status)
master-bin.000001 3
81 Write_rows 1 156
table_id: #
master-bin.000001 4
39 Write_rows 1 203
table_id: # flags: STMT_END_F
master-bin.000001 4
86 Query 1 551
COMMIT
master-bin.000001 5
51 Query 1 631
use `test`; TRUNCATE TABLE t1
master-bin.000001 6
31 Query 1 707
use `test`; DROP TABLE t1
master-bin.000001
707 Query 1 824
use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 8
24 Query 1 888
BEGIN
master-bin.000001 8
88
Table_map 1 40 table_id: # (test.t1)
master-bin.000001 9
28 Table_map 1 98
table_id: # (mysql.ndb_apply_status)
master-bin.000001 9
86 Write_rows 1 156
table_id: #
master-bin.000001 10
44 Write_rows 1 203
table_id: # flags: STMT_END_F
master-bin.000001 10
91 Query 1 1156
COMMIT
master-bin.000001 11
56 Query 1 1220
BEGIN
master-bin.000001 1
220
Table_map 1 40 table_id: # (test.t1)
master-bin.000001 12
60 Table_map 1 98
table_id: # (mysql.ndb_apply_status)
master-bin.000001 1
318 Write_rows 1 156
table_id: #
master-bin.000001 13
76 Delete_rows 1 195
table_id: # flags: STMT_END_F
master-bin.000001 1
415 Query 1 1480
COMMIT
master-bin.000001 14
80 Query 1 1556
use `test`; DROP TABLE t1
storage/ndb/tools/restore/consumer_restore.cpp
View file @
f81ff454
...
...
@@ -617,6 +617,7 @@ BackupRestore::update_apply_status(const RestoreMetaData &metaData)
return
true
;
bool
result
=
false
;
unsigned
apply_table_format
=
0
;
m_ndb
->
setDatabaseName
(
NDB_REP_DB
);
m_ndb
->
setSchemaName
(
"def"
);
...
...
@@ -629,8 +630,33 @@ BackupRestore::update_apply_status(const RestoreMetaData &metaData)
<<
dict
->
getNdbError
()
<<
endl
;
return
false
;
}
if
(
ndbtab
->
getColumn
(
0
)
->
getType
()
==
NdbDictionary
::
Column
::
Unsigned
&&
ndbtab
->
getColumn
(
1
)
->
getType
()
==
NdbDictionary
::
Column
::
Bigunsigned
)
{
if
(
ndbtab
->
getNoOfColumns
()
==
2
)
{
apply_table_format
=
1
;
}
else
if
(
ndbtab
->
getColumn
(
2
)
->
getType
()
==
NdbDictionary
::
Column
::
Varchar
&&
ndbtab
->
getColumn
(
3
)
->
getType
()
==
NdbDictionary
::
Column
::
Bigunsigned
&&
ndbtab
->
getColumn
(
4
)
->
getType
()
==
NdbDictionary
::
Column
::
Bigunsigned
)
{
apply_table_format
=
2
;
}
}
if
(
apply_table_format
==
0
)
{
err
<<
Ndb_apply_table
<<
" has wrong format
\n
"
;
return
false
;
}
Uint32
server_id
=
0
;
Uint64
epoch
=
metaData
.
getStopGCP
();
Uint64
zero
=
0
;
char
empty_string
[
1
];
empty_string
[
0
]
=
0
;
NdbTransaction
*
trans
=
m_ndb
->
startTransaction
();
if
(
!
trans
)
{
...
...
@@ -653,6 +679,15 @@ BackupRestore::update_apply_status(const RestoreMetaData &metaData)
<<
op
->
getNdbError
()
<<
endl
;
goto
err
;
}
if
((
apply_table_format
==
2
)
&&
(
op
->
setValue
(
2u
,
(
const
char
*
)
&
empty_string
,
1
)
||
op
->
setValue
(
3u
,
(
const
char
*
)
&
zero
,
sizeof
(
zero
))
||
op
->
setValue
(
4u
,
(
const
char
*
)
&
zero
,
sizeof
(
zero
))))
{
err
<<
Ndb_apply_table
<<
": "
<<
op
->
getNdbError
()
<<
endl
;
goto
err
;
}
if
(
trans
->
execute
(
NdbTransaction
::
Commit
))
{
err
<<
Ndb_apply_table
<<
": "
...
...
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