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
05269b7b
Commit
05269b7b
authored
Mar 16, 2009
by
Tatiana A. Nurnberg
Browse files
Options
Browse Files
Download
Plain Diff
automerge
parents
2849db95
bfcfbbbc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
29 deletions
+52
-29
mysql-test/include/ndb_backup.inc
mysql-test/include/ndb_backup.inc
+34
-17
mysql-test/suite/ndb/r/ndb_restore.result
mysql-test/suite/ndb/r/ndb_restore.result
+9
-6
mysql-test/suite/ndb/r/ndb_restore_print.result
mysql-test/suite/ndb/r/ndb_restore_print.result
+9
-6
No files found.
mysql-test/include/ndb_backup.inc
View file @
05269b7b
...
...
@@ -3,27 +3,44 @@
# in test cases and can be reused. #
######################################################
# Bug#41307: Tests using include/ndb_backup.inc won't work on Windows due to
# 'grep' call
# This test is disabled on Windows via the next line until the above bug is
# resolved
--
source
include
/
not_windows
.
inc
--
exec
$NDB_MGM
--
no
-
defaults
--
ndb
-
connectstring
=
"
$NDB_CONNECTSTRING
"
-
e
"start backup"
>>
$NDB_TOOLS_OUTPUT
# there is no neat way to find the backupid, this is a hack to find it...
let
$dump_file
=
$MYSQLTEST_VARDIR
/
tmp
/
tmp
.
dat
;
--
exec
$NDB_TOOLS_DIR
/
ndb_select_all
--
ndb
-
connectstring
=
"
$NDB_CONNECTSTRING
"
-
d
sys
--
delimiter
=
','
SYSTAB_0
|
grep
520093696
>
$dump_file
CREATE
TEMPORARY
TABLE
test
.
backup_info
(
id
INT
,
backup_id
INT
)
ENGINE
=
HEAP
;
--
replace_result
$dump_file
DUMP_FILE
eval
LOAD
DATA
INFILE
'$dump_file'
INTO
TABLE
test
.
backup_info
FIELDS
TERMINATED
BY
','
;
# To find the backupid, we must dump this data to a table, and SELECT
# what we want into an outfile. This could be accomplished with grep, but
# grep isn't Windows-portable
--
disable_query_log
# create a table to help us out
--
disable_warnings
# leave this on until done with the entire process
# cleanup
DROP
TABLE
IF
EXISTS
helper1
;
CREATE
TABLE
helper1
(
c1
VARCHAR
(
20
));
# dump raw data to file
let
$ndb_backup_file1
=
$MYSQLTEST_VARDIR
/
ndb_backup_tmp
.
dat
;
let
$ndb_backup_file2
=
$MYSQLTEST_VARDIR
/
tmp
.
dat
;
--
error
0
,
1
--
remove_file
$ndb_backup_file1
--
exec
$NDB_TOOLS_DIR
/
ndb_select_all
--
ndb
-
connectstring
=
"
$NDB_CONNECTSTRING
"
-
d
sys
--
delimiter
=
','
SYSTAB_0
>
$ndb_backup_file1
# load the table from the raw data file
eval
LOAD
DATA
INFILE
'$ndb_backup_file1'
INTO
TABLE
helper1
;
--
remove_file
$ndb_backup_file1
# output what we need
eval
SELECT
*
FROM
helper1
WHERE
c1
LIKE
'%520093696%'
INTO
OUTFILE
'$ndb_backup_file2'
;
# cleanup
DROP
TABLE
helper1
;
--
enable_warnings
--
enable_query_log
CREATE
TEMPORARY
TABLE
IF
NOT
EXISTS
test
.
backup_info
(
id
INT
,
backup_id
INT
)
ENGINE
=
MEMORY
;
--
replace_result
$MYSQLTEST_VARDIR
<
MYSQLTEST_VARDIR
>
eval
LOAD
DATA
INFILE
'$ndb_backup_file2'
INTO
TABLE
test
.
backup_info
FIELDS
TERMINATED
BY
','
;
--
remove_file
$ndb_backup_file2
# Load backup id into environment variable
let
the_backup_id
=
`SELECT backup_id from test.backup_info`
;
DROP
TABLE
test
.
backup_info
;
remove_file
$dump_file
;
DROP
TABLE
test
.
backup_info
;
mysql-test/suite/ndb/r/ndb_restore.result
View file @
05269b7b
...
...
@@ -131,8 +131,9 @@ create table t9 engine=myisam as select * from t9_c;
create table t10 engine=myisam as select * from t10_c;
ForceVarPart: 0
ForceVarPart: 1
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
(id INT, backup_id INT) ENGINE = MEMORY;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
ForceVarPart: 0
...
...
@@ -286,8 +287,9 @@ auto_increment
10001
ALTER TABLE t7_c
PARTITION BY LINEAR KEY (`dardtestard`);
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
(id INT, backup_id INT) ENGINE = MEMORY;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
select count(*) from t1;
...
...
@@ -490,8 +492,9 @@ select * from t9_c) a;
count(*)
3
drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
(id INT, backup_id INT) ENGINE = MEMORY;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
drop table if exists t2_c;
...
...
mysql-test/suite/ndb/r/ndb_restore_print.result
View file @
05269b7b
...
...
@@ -227,8 +227,9 @@ hex(h3) NULL
hex(i1) NULL
hex(i2) NULL
hex(i3) NULL
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
(id INT, backup_id INT) ENGINE = MEMORY;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
1;0x1;0x17;0x789A;0x789ABCDE;0xFEDC0001;127;255;32767;65535;2147483647;4294967295;9223372036854775807;18446744073709551615;1;12345678901234567890123456789012;123456789;1;12345678901234567890123456789012;123456789;0x12;0x123456789ABCDEF0;0x012345;0x12;0x123456789ABCDEF0;0x00123450
2;0x0;0x0;0x0;0x0;0x0;-128;0;-32768;0;-2147483648;0;-9223372036854775808;0;;;;;;;0x0;0x0;0x0;0x0;0x0;0x0
...
...
@@ -257,8 +258,9 @@ create table t4 (pk int key, a int) engine ndb;
insert into t2 values (1,11),(2,12),(3,13),(4,14),(5,15);
insert into t3 values (1,21),(2,22),(3,23),(4,24),(5,25);
insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
(id INT, backup_id INT) ENGINE = MEMORY;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
'1' '1' '12345678901234567890123456789012' '123456789' '1' '12345678901234567890123456789012' '123456789' '0x20' '0x123456789ABCDEF020' '0x012345000020' '0x1200000020' '0x123456789ABCDEF000000020' '0x00123450000020'
...
...
@@ -297,8 +299,9 @@ create table t1
insert into t1 values(1, 8388607, 16777215);
insert into t1 values(2, -8388608, 0);
insert into t1 values(3, -1, 1);
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
(id INT, backup_id INT) ENGINE = MEMORY;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
DROP TABLE test.backup_info;
1;8388607;16777215
2;-8388608;0
...
...
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