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
2e620e3d
Commit
2e620e3d
authored
Apr 12, 2007
by
tomas@whalegate.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user
parents
ec6476cb
f9a900f8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
30 deletions
+39
-30
mysql-test/r/ndb_restore.result
mysql-test/r/ndb_restore.result
+1
-1
mysql-test/t/ndb_restore.test
mysql-test/t/ndb_restore.test
+5
-2
storage/ndb/tools/restore/consumer_restore.cpp
storage/ndb/tools/restore/consumer_restore.cpp
+31
-25
storage/ndb/tools/restore/restore_main.cpp
storage/ndb/tools/restore/restore_main.cpp
+2
-2
No files found.
mysql-test/r/ndb_restore.result
View file @
2e620e3d
...
...
@@ -16,7 +16,7 @@ CREATE TABLE `t2_c` (
`descrpooppo` varchar(64) default NULL,
`svcutonsa` varchar(64) NOT NULL default '',
PRIMARY KEY (`capgotod`),
KEY `i
_
quadaddsvr` (`gotod`)
KEY `i
quadaddsvr` (`gotod`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO `t2_c` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST');
CREATE TABLE `t3_c` (
...
...
mysql-test/t/ndb_restore.test
View file @
2e620e3d
...
...
@@ -15,7 +15,10 @@ CREATE TABLE `t1_c` (
PRIMARY
KEY
(
`capgoaledatta`
,
`goaledatta`
,
`maturegarbagefa`
)
)
ENGINE
=
ndbcluster
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
`t1_c`
VALUES
(
2
,
'3'
,
'q3plus.qt'
),(
4
,
'4'
,
'q3plus.qt'
),(
1
,
'3'
,
'q3.net'
),(
3
,
'4'
,
'q3.net'
),(
3
,
'20'
,
'threetrees.qt'
);
#
# Bug #27758 Restoring NDB backups makes table usable in SQL nodes
# - space in key made table unusable after restore
#
CREATE
TABLE
`t2_c`
(
`capgotod`
smallint
(
5
)
unsigned
NOT
NULL
auto_increment
,
`gotod`
smallint
(
5
)
unsigned
NOT
NULL
default
'0'
,
...
...
@@ -24,7 +27,7 @@ CREATE TABLE `t2_c` (
`descrpooppo`
varchar
(
64
)
default
NULL
,
`svcutonsa`
varchar
(
64
)
NOT
NULL
default
''
,
PRIMARY
KEY
(
`capgotod`
),
KEY
`i
_
quadaddsvr`
(
`gotod`
)
KEY
`i
quadaddsvr`
(
`gotod`
)
)
ENGINE
=
ndbcluster
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
`t2_c`
VALUES
(
5
,
4
,
''
,
'q3.net'
,
'addavp:MK_CASELECTOR=1'
,
'postorod rattoaa'
),(
2
,
1
,
'4'
,
''
,
'addavp:MK_BRANDTAD=345'
,
'REDS Brandtad'
),(
3
,
2
,
'4'
,
'q3.net'
,
'execorder'
,
'fixedRatediPO REDS'
),(
1
,
1
,
'3'
,
''
,
'addavp:MK_BRANDTAD=123'
,
'TEST Brandtad'
),(
6
,
5
,
''
,
'told.q3.net'
,
'addavp:MK_BRANDTAD=123'
,
'Brandtad Toldzone'
),(
4
,
3
,
'3'
,
'q3.net'
,
'addavp:MK_POOLHINT=2'
,
'ratedi PO TEST'
);
...
...
storage/ndb/tools/restore/consumer_restore.cpp
View file @
2e620e3d
...
...
@@ -813,7 +813,7 @@ BackupRestore::table(const TableS & table){
BaseString
tmp
(
name
);
Vector
<
BaseString
>
split
;
if
(
tmp
.
split
(
split
,
"/"
)
!=
3
){
err
<<
"Invalid table name format
"
<<
name
<<
endl
;
err
<<
"Invalid table name format
`"
<<
name
<<
"`"
<<
endl
;
return
false
;
}
...
...
@@ -881,7 +881,7 @@ BackupRestore::table(const TableS & table){
if
(
dict
->
createTable
(
copy
)
==
-
1
)
{
err
<<
"Create table
"
<<
table
.
getTableName
()
<<
"
failed: "
err
<<
"Create table
`"
<<
table
.
getTableName
()
<<
"`
failed: "
<<
dict
->
getNdbError
()
<<
endl
;
if
(
dict
->
getNdbError
().
code
==
771
)
{
...
...
@@ -898,12 +898,13 @@ BackupRestore::table(const TableS & table){
}
return
false
;
}
info
<<
"Successfully restored table "
<<
table
.
getTableName
()
<<
endl
;
info
<<
"Successfully restored table `"
<<
table
.
getTableName
()
<<
"`"
<<
endl
;
}
const
NdbDictionary
::
Table
*
tab
=
dict
->
getTable
(
split
[
2
].
c_str
());
if
(
tab
==
0
){
err
<<
"Unable to find table:
"
<<
split
[
2
].
c_str
()
<<
endl
;
err
<<
"Unable to find table:
`"
<<
split
[
2
].
c_str
()
<<
"`"
<<
endl
;
return
false
;
}
if
(
m_restore_meta
)
...
...
@@ -965,12 +966,15 @@ BackupRestore::endOfTables(){
for
(
size_t
i
=
0
;
i
<
m_indexes
.
size
();
i
++
){
NdbTableImpl
&
indtab
=
NdbTableImpl
::
getImpl
(
*
m_indexes
[
i
]);
BaseString
tmp
(
indtab
.
m_primaryTable
.
c_str
());
Vector
<
BaseString
>
split
;
if
(
tmp
.
split
(
split
,
"/"
)
!=
3
){
err
<<
"Invalid table name format "
<<
indtab
.
m_primaryTable
.
c_str
()
<<
endl
;
return
false
;
{
BaseString
tmp
(
indtab
.
m_primaryTable
.
c_str
());
if
(
tmp
.
split
(
split
,
"/"
)
!=
3
)
{
err
<<
"Invalid table name format `"
<<
indtab
.
m_primaryTable
.
c_str
()
<<
"`"
<<
endl
;
return
false
;
}
}
m_ndb
->
setDatabaseName
(
split
[
0
].
c_str
());
...
...
@@ -978,39 +982,41 @@ BackupRestore::endOfTables(){
const
NdbDictionary
::
Table
*
prim
=
dict
->
getTable
(
split
[
2
].
c_str
());
if
(
prim
==
0
){
err
<<
"Unable to find base table
\"
"
<<
split
[
2
].
c_str
()
<<
"
\"
for index
"
<<
indtab
.
getName
()
<<
endl
;
err
<<
"Unable to find base table
`
"
<<
split
[
2
].
c_str
()
<<
"
` for index `
"
<<
indtab
.
getName
()
<<
"`"
<<
endl
;
return
false
;
}
NdbTableImpl
&
base
=
NdbTableImpl
::
getImpl
(
*
prim
);
NdbIndexImpl
*
idx
;
int
id
;
char
idxName
[
255
],
buf
[
255
];
if
(
sscanf
(
indtab
.
getName
(),
"%[^/]/%[^/]/%d/%s"
,
buf
,
buf
,
&
id
,
idxName
)
!=
4
){
err
<<
"Invalid index name format "
<<
indtab
.
getName
()
<<
endl
;
return
false
;
Vector
<
BaseString
>
split_idx
;
{
BaseString
tmp
(
indtab
.
getName
());
if
(
tmp
.
split
(
split_idx
,
"/"
)
!=
4
)
{
err
<<
"Invalid index name format `"
<<
indtab
.
getName
()
<<
"`"
<<
endl
;
return
false
;
}
}
if
(
NdbDictInterface
::
create_index_obj_from_table
(
&
idx
,
&
indtab
,
&
base
))
{
err
<<
"Failed to create index
"
<<
idxName
<<
" on "
<<
split
[
2
].
c_str
()
<<
endl
;
err
<<
"Failed to create index
`"
<<
split_idx
[
3
]
<<
"
`
on "
<<
split
[
2
].
c_str
()
<<
endl
;
return
false
;
}
idx
->
setName
(
idxName
);
idx
->
setName
(
split_idx
[
3
].
c_str
()
);
if
(
dict
->
createIndex
(
*
idx
)
!=
0
)
{
delete
idx
;
err
<<
"Failed to create index
"
<<
idxName
<<
"
on "
<<
split
[
2
].
c_str
()
<<
endl
err
<<
"Failed to create index
`"
<<
split_idx
[
3
].
c_str
()
<<
"
` on `"
<<
split
[
2
].
c_str
()
<<
"`"
<<
endl
<<
dict
->
getNdbError
()
<<
endl
;
return
false
;
}
delete
idx
;
info
<<
"Successfully created index
"
<<
idxName
<<
"
on "
<<
split
[
2
].
c_str
()
<<
endl
;
info
<<
"Successfully created index
`"
<<
split_idx
[
3
].
c_str
()
<<
"
` on `"
<<
split
[
2
].
c_str
()
<<
"`"
<<
endl
;
}
return
true
;
}
...
...
storage/ndb/tools/restore/restore_main.cpp
View file @
2e620e3d
...
...
@@ -783,8 +783,8 @@ main(int argc, char** argv)
for
(
Uint32
j
=
0
;
j
<
g_consumers
.
size
();
j
++
)
if
(
!
g_consumers
[
j
]
->
table
(
*
table
))
{
err
<<
"Restore: Failed to restore table: "
;
err
<<
table
->
getTableName
()
<<
" ... Exiting "
<<
endl
;
err
<<
"Restore: Failed to restore table:
`
"
;
err
<<
table
->
getTableName
()
<<
"
`
... Exiting "
<<
endl
;
exitHandler
(
NDBT_FAILED
);
}
}
else
{
...
...
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