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
a1d5b9fe
Commit
a1d5b9fe
authored
Mar 08, 2007
by
tomas@poseidon.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed ndb_restore defaults handeling for structured printout
extended ndb_restore_print test with tests
parent
e53f8734
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
234 additions
and
31 deletions
+234
-31
mysql-test/r/ndb_restore_print.result
mysql-test/r/ndb_restore_print.result
+197
-18
mysql-test/t/ndb_restore_print.test
mysql-test/t/ndb_restore_print.test
+29
-1
ndb/tools/restore/restore_main.cpp
ndb/tools/restore/restore_main.cpp
+8
-12
No files found.
mysql-test/r/ndb_restore_print.result
View file @
a1d5b9fe
...
...
@@ -11,7 +11,7 @@ create table t1
,g1 VARCHAR(32) BINARY, g2 VARCHAR(255) BINARY, g3 VARCHAR(1000) BINARY
,h1 BINARY(1), h2 BINARY(8), h3 BINARY(255)
,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000)
) engine
ndb
;
) engine
myisam
;
insert into t1 values
(1
,0x1, 0x17, 0x789a, 0x789abcde, 0xfedc0001
...
...
@@ -48,6 +48,185 @@ insert into t1 values
,NULL,NULL,NULL
,NULL,NULL,NULL
);
select pk
,hex(a1), hex(a2), hex(a3), hex(a4), hex(a5)
,b1, b2
,c1 , c2
,d1 , d2
,e1 , e2
,f1 , f2, f3
,g1 , g2, g3
,hex(h1), hex(h2), hex(h3)
,hex(i1), hex(i2), hex(i3)
from t1 order by pk;
pk 1
hex(a1) 1
hex(a2) 17
hex(a3) 789A
hex(a4) 789ABCDE
hex(a5) FEDC0001
b1 127
b2 255
c1 32767
c2 65535
d1 2147483647
d2 4294967295
e1 9223372036854775807
e2 18446744073709551615
f1 1
f2 12345678901234567890123456789012
f3 123456789
g1 1
g2 12345678901234567890123456789012
g3 123456789
hex(h1) 12
hex(h2) 123456789ABCDEF0
hex(h3) 012345000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
hex(i1) 12
hex(i2) 123456789ABCDEF0
hex(i3) 00123450
pk 2
hex(a1) 0
hex(a2) 0
hex(a3) 0
hex(a4) 0
hex(a5) 0
b1 -128
b2 0
c1 -32768
c2 0
d1 -2147483648
d2 0
e1 -9223372036854775808
e2 0
f1
f2
f3
g1
g2
g3
hex(h1) 00
hex(h2) 0000000000000000
hex(h3) 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
hex(i1) 00
hex(i2) 00
hex(i3) 00
pk 3
hex(a1) NULL
hex(a2) NULL
hex(a3) NULL
hex(a4) NULL
hex(a5) NULL
b1 NULL
b2 NULL
c1 NULL
c2 NULL
d1 NULL
d2 NULL
e1 NULL
e2 NULL
f1 NULL
f2 NULL
f3 NULL
g1 NULL
g2 NULL
g3 NULL
hex(h1) NULL
hex(h2) NULL
hex(h3) NULL
hex(i1) NULL
hex(i2) NULL
hex(i3) NULL
alter table t1 engine ndb;
select pk
,hex(a1), hex(a2), hex(a3), hex(a4), hex(a5)
,b1, b2
,c1 , c2
,d1 , d2
,e1 , e2
,f1 , f2, f3
,g1 , g2, g3
,hex(h1), hex(h2), hex(h3)
,hex(i1), hex(i2), hex(i3)
from t1 order by pk;
pk 1
hex(a1) 1
hex(a2) 17
hex(a3) 789A
hex(a4) 789ABCDE
hex(a5) FEDC0001
b1 127
b2 255
c1 32767
c2 65535
d1 2147483647
d2 4294967295
e1 9223372036854775807
e2 18446744073709551615
f1 1
f2 12345678901234567890123456789012
f3 123456789
g1 1
g2 12345678901234567890123456789012
g3 123456789
hex(h1) 12
hex(h2) 123456789ABCDEF0
hex(h3) 012345000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
hex(i1) 12
hex(i2) 123456789ABCDEF0
hex(i3) 00123450
pk 2
hex(a1) 0
hex(a2) 0
hex(a3) 0
hex(a4) 0
hex(a5) 0
b1 -128
b2 0
c1 -32768
c2 0
d1 -2147483648
d2 0
e1 -9223372036854775808
e2 0
f1
f2
f3
g1
g2
g3
hex(h1) 00
hex(h2) 0000000000000000
hex(h3) 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
hex(i1) 00
hex(i2) 00
hex(i3) 00
pk 3
hex(a1) NULL
hex(a2) NULL
hex(a3) NULL
hex(a4) NULL
hex(a5) NULL
b1 NULL
b2 NULL
c1 NULL
c2 NULL
d1 NULL
d2 NULL
e1 NULL
e2 NULL
f1 NULL
f2 NULL
f3 NULL
g1 NULL
g2 NULL
g3 NULL
hex(h1) NULL
hex(h2) NULL
hex(h3) NULL
hex(i1) NULL
hex(i2) NULL
hex(i3) NULL
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM test.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
...
...
@@ -89,35 +268,35 @@ SELECT @the_backup_id:=backup_id FROM test.backup_info;
@the_backup_id:=backup_id
<the_backup_id>
DROP TABLE test.backup_info;
'1'
;'1';'12345678901234567890123456789012';'123456789';'1';'12345678901234567890123456789012';'123456789';'0x20';'0x123456789ABCDEF020';'0x012345000020';'0x1200000020';'0x123456789ABCDEF000000020';
'0x00123450000020'
'1'
'1' '12345678901234567890123456789012' '123456789' '1' '12345678901234567890123456789012' '123456789' '0x20' '0x123456789ABCDEF020' '0x012345000020' '0x1200000020' '0x123456789ABCDEF000000020'
'0x00123450000020'
t1
--
1
;1;12345678901234567890123456789012;123456789;1;12345678901234567890123456789012;123456789;0x20;0x123456789ABCDEF020;0x012345000020;0x1200000020;0x123456789ABCDEF000000020;
0x00123450000020
1
1 12345678901234567890123456789012 123456789 1 12345678901234567890123456789012 123456789 0x20 0x123456789ABCDEF020 0x012345000020 0x1200000020 0x123456789ABCDEF000000020
0x00123450000020
t2
--
1
;
11
2
;
12
3
;
13
4
;
14
5
;
15
1
11
2
12
3
13
4
14
5
15
t3
--
1
;
21
2
;
22
3
;
23
4
;
24
5
;
25
1
21
2
22
3
23
4
24
5
25
t4
--
1
;
31
2
;
32
3
;
33
4
;
34
5
;
35
1
31
2
32
3
33
4
34
5
35
drop table t1;
drop table t2;
drop table t3;
...
...
mysql-test/t/ndb_restore_print.test
View file @
a1d5b9fe
...
...
@@ -19,7 +19,7 @@ create table t1
,
g1
VARCHAR
(
32
)
BINARY
,
g2
VARCHAR
(
255
)
BINARY
,
g3
VARCHAR
(
1000
)
BINARY
,
h1
BINARY
(
1
),
h2
BINARY
(
8
),
h3
BINARY
(
255
)
,
i1
VARBINARY
(
32
),
i2
VARBINARY
(
255
),
i3
VARBINARY
(
1000
)
)
engine
ndb
;
)
engine
myisam
;
# max values
insert
into
t1
values
...
...
@@ -63,6 +63,34 @@ insert into t1 values
,
NULL
,
NULL
,
NULL
);
--
vertical_results
select
pk
,
hex
(
a1
),
hex
(
a2
),
hex
(
a3
),
hex
(
a4
),
hex
(
a5
)
,
b1
,
b2
,
c1
,
c2
,
d1
,
d2
,
e1
,
e2
,
f1
,
f2
,
f3
,
g1
,
g2
,
g3
,
hex
(
h1
),
hex
(
h2
),
hex
(
h3
)
,
hex
(
i1
),
hex
(
i2
),
hex
(
i3
)
from
t1
order
by
pk
;
alter
table
t1
engine
ndb
;
select
pk
,
hex
(
a1
),
hex
(
a2
),
hex
(
a3
),
hex
(
a4
),
hex
(
a5
)
,
b1
,
b2
,
c1
,
c2
,
d1
,
d2
,
e1
,
e2
,
f1
,
f2
,
f3
,
g1
,
g2
,
g3
,
hex
(
h1
),
hex
(
h2
),
hex
(
h3
)
,
hex
(
i1
),
hex
(
i2
),
hex
(
i3
)
from
t1
order
by
pk
;
--
horizontal_results
--
source
include
/
ndb_backup
.
inc
--
let
ndb_restore_filter
=
test
t1
...
...
ndb/tools/restore/restore_main.cpp
View file @
a1d5b9fe
...
...
@@ -79,14 +79,10 @@ enum ndb_restore_options {
OPT_APPEND
,
OPT_VERBOSE
};
/*
the below formatting options follow the formatting from mysqldump
do not change unless to adopt to changes in mysqldump
*/
static
const
char
*
opt_fields_enclosed_by
=
""
;
static
const
char
*
opt_fields_terminated_by
=
";"
;
static
const
char
*
opt_fields_optionally_enclosed_by
=
""
;
static
const
char
*
opt_lines_terminated_by
=
"
\n
"
;
static
const
char
*
opt_fields_enclosed_by
=
NULL
;
static
const
char
*
opt_fields_terminated_by
=
NULL
;
static
const
char
*
opt_fields_optionally_enclosed_by
=
NULL
;
static
const
char
*
opt_lines_terminated_by
=
NULL
;
static
const
char
*
tab_path
=
NULL
;
static
int
opt_append
;
...
...
@@ -321,13 +317,13 @@ readArguments(int *pargc, char*** pargv)
do not change unless to adopt to changes in mysqldump
*/
g_ndbrecord_print_format
.
fields_enclosed_by
=
opt_fields_enclosed_by
;
opt_fields_enclosed_by
?
opt_fields_enclosed_by
:
""
;
g_ndbrecord_print_format
.
fields_terminated_by
=
opt_fields_terminated_by
;
opt_fields_terminated_by
?
opt_fields_terminated_by
:
"
\t
"
;
g_ndbrecord_print_format
.
fields_optionally_enclosed_by
=
opt_fields_optionally_enclosed_by
;
opt_fields_optionally_enclosed_by
?
opt_fields_optionally_enclosed_by
:
""
;
g_ndbrecord_print_format
.
lines_terminated_by
=
opt_lines_terminated_by
;
opt_lines_terminated_by
?
opt_lines_terminated_by
:
"
\n
"
;
if
(
g_ndbrecord_print_format
.
fields_optionally_enclosed_by
[
0
]
==
'\0'
)
g_ndbrecord_print_format
.
null_string
=
"
\\
N"
;
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