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
607d9fc1
Commit
607d9fc1
authored
May 28, 2013
by
Andrew McDonnell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added specific test suite for upgrade regression
parent
86d03f63
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
197 additions
and
0 deletions
+197
-0
mysql-test/suite/oqgraph/legacy_upgrade.result
mysql-test/suite/oqgraph/legacy_upgrade.result
+94
-0
mysql-test/suite/oqgraph/legacy_upgrade.test
mysql-test/suite/oqgraph/legacy_upgrade.test
+103
-0
No files found.
mysql-test/suite/oqgraph/legacy_upgrade.result
0 → 100644
View file @
607d9fc1
DROP TABLE IF EXISTS graph_base;
DROP TABLE IF EXISTS graph;
CREATE TABLE graph_base (
from_id INT UNSIGNED NOT NULL,
to_id INT UNSIGNED NOT NULL,
PRIMARY KEY (from_id,to_id),
INDEX (to_id)
) ENGINE=MyISAM;
The next error 140 + 1005 is expected
CREATE TABLE graph (
latch SMALLINT UNSIGNED NULL,
origid BIGINT UNSIGNED NULL,
destid BIGINT UNSIGNED NULL,
weight DOUBLE NULL,
seq BIGINT UNSIGNED NULL,
linkid BIGINT UNSIGNED NULL,
KEY (latch, origid, destid) USING HASH,
KEY (latch, destid, origid) USING HASH
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id';
ERROR HY000: Can't create table 'test.graph' (errno: 140 "Wrong create options")
SET GLOBAL oqgraph_allow_create_integer_latch=true;
The next warning 1287 is expected
CREATE TABLE graph (
latch SMALLINT UNSIGNED NULL,
origid BIGINT UNSIGNED NULL,
destid BIGINT UNSIGNED NULL,
weight DOUBLE NULL,
seq BIGINT UNSIGNED NULL,
linkid BIGINT UNSIGNED NULL,
KEY (latch, origid, destid) USING HASH,
KEY (latch, destid, origid) USING HASH
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id';
Warnings:
Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead
SET GLOBAL oqgraph_allow_create_integer_latch=false;
The next error 140 + 1005 is expected
CREATE TABLE graph_again (
latch SMALLINT UNSIGNED NULL,
origid BIGINT UNSIGNED NULL,
destid BIGINT UNSIGNED NULL,
weight DOUBLE NULL,
seq BIGINT UNSIGNED NULL,
linkid BIGINT UNSIGNED NULL,
KEY (latch, origid, destid) USING HASH,
KEY (latch, destid, origid) USING HASH
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id';
ERROR HY000: Can't create table 'test.graph_again' (errno: 140 "Wrong create options")
# Populating base table
INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1);
INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1);
INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3);
INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5);
# Exercising latch==2
SELECT * FROM graph WHERE latch = 2 AND origid = 1 AND weight = 1;
latch origid destid weight seq linkid
2 1 NULL 1 3 3
2 1 NULL 1 2 2
SELECT * FROM graph WHERE latch = 2 AND origid = 1 AND weight = 2;
latch origid destid weight seq linkid
2 1 NULL 2 4 4
SELECT * FROM graph WHERE latch = 2 AND origid = 1 AND (weight = 1 OR weight = 2);
latch origid destid weight seq linkid
2 1 NULL 2 4 4
2 1 NULL 1 3 3
2 1 NULL 1 2 2
# Exercising latch==1
SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=6;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=4;
latch origid destid weight seq linkid
1 1 4 NULL 0 1
1 1 4 1 1 3
1 1 4 1 2 4
SELECT * FROM graph WHERE latch=1 AND origid=4 AND destid=1;
latch origid destid weight seq linkid
1 4 1 NULL 0 4
1 4 1 1 1 3
1 4 1 1 2 1
# Adding new row to base table
INSERT INTO graph_base (from_id,to_id) VALUES (4,6);
# Deleting rows from base table
DELETE FROM graph_base WHERE from_id=5;
DELETE FROM graph_base WHERE from_id=3 AND to_id=5;
# Execising latch==1 on new data
SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=6;
latch origid destid weight seq linkid
1 1 6 NULL 0 1
1 1 6 1 1 3
1 1 6 1 2 4
1 1 6 1 3 6
SELECT * FROM graph WHERE latch=1 AND origid=6 AND destid=1;
latch origid destid weight seq linkid
DROP TABLE IF EXISTS graph;
DROP TABLE IF EXISTS graph_base;
mysql-test/suite/oqgraph/legacy_upgrade.test
0 → 100644
View file @
607d9fc1
--
disable_warnings
DROP
TABLE
IF
EXISTS
graph_base
;
DROP
TABLE
IF
EXISTS
graph
;
--
enable_warnings
CREATE
TABLE
graph_base
(
from_id
INT
UNSIGNED
NOT
NULL
,
to_id
INT
UNSIGNED
NOT
NULL
,
PRIMARY
KEY
(
from_id
,
to_id
),
INDEX
(
to_id
)
)
ENGINE
=
MyISAM
;
# Backwards compatibility test
# First we ensure the scaffolding is disabled (default situation)
# and check we cant create a table with an integer latch
# Assume this is the default, so dont explicity set false yet:
# SET GLOBAL oqgraph_allow_create_integer_latch=false;
--
echo
The
next
error
140
+
1005
is
expected
--
error
140
--
error
1005
CREATE
TABLE
graph
(
latch
SMALLINT
UNSIGNED
NULL
,
origid
BIGINT
UNSIGNED
NULL
,
destid
BIGINT
UNSIGNED
NULL
,
weight
DOUBLE
NULL
,
seq
BIGINT
UNSIGNED
NULL
,
linkid
BIGINT
UNSIGNED
NULL
,
KEY
(
latch
,
origid
,
destid
)
USING
HASH
,
KEY
(
latch
,
destid
,
origid
)
USING
HASH
)
ENGINE
=
OQGRAPH
DATA_TABLE
=
'graph_base'
ORIGID
=
'from_id'
,
DESTID
=
'to_id'
;
# Here we enable scaffolding to let us create a deprecated table
# so we can check that the new code will still allow queries to be performed
# on a legacy database
# It should still generate a warning (1287) - but I dont know how to test for that
#
# latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future
# release. Please use 'latch VARCHAR(32) NULL' instead
#
SET
GLOBAL
oqgraph_allow_create_integer_latch
=
true
;
--
echo
The
next
warning
1287
is
expected
CREATE
TABLE
graph
(
latch
SMALLINT
UNSIGNED
NULL
,
origid
BIGINT
UNSIGNED
NULL
,
destid
BIGINT
UNSIGNED
NULL
,
weight
DOUBLE
NULL
,
seq
BIGINT
UNSIGNED
NULL
,
linkid
BIGINT
UNSIGNED
NULL
,
KEY
(
latch
,
origid
,
destid
)
USING
HASH
,
KEY
(
latch
,
destid
,
origid
)
USING
HASH
)
ENGINE
=
OQGRAPH
DATA_TABLE
=
'graph_base'
ORIGID
=
'from_id'
,
DESTID
=
'to_id'
;
# Prevent further tables being create this way again
# and make sure the set is effective ...
SET
GLOBAL
oqgraph_allow_create_integer_latch
=
false
;
--
echo
The
next
error
140
+
1005
is
expected
--
error
140
--
error
1005
CREATE
TABLE
graph_again
(
latch
SMALLINT
UNSIGNED
NULL
,
origid
BIGINT
UNSIGNED
NULL
,
destid
BIGINT
UNSIGNED
NULL
,
weight
DOUBLE
NULL
,
seq
BIGINT
UNSIGNED
NULL
,
linkid
BIGINT
UNSIGNED
NULL
,
KEY
(
latch
,
origid
,
destid
)
USING
HASH
,
KEY
(
latch
,
destid
,
origid
)
USING
HASH
)
ENGINE
=
OQGRAPH
DATA_TABLE
=
'graph_base'
ORIGID
=
'from_id'
,
DESTID
=
'to_id'
;
# Regression test expected v2 behaviour in this situation
--
echo
# Populating base table
INSERT
INTO
graph_base
(
from_id
,
to_id
)
VALUES
(
1
,
2
),
(
2
,
1
);
INSERT
INTO
graph_base
(
from_id
,
to_id
)
VALUES
(
1
,
3
),
(
3
,
1
);
INSERT
INTO
graph_base
(
from_id
,
to_id
)
VALUES
(
3
,
4
),
(
4
,
3
);
INSERT
INTO
graph_base
(
from_id
,
to_id
)
VALUES
(
5
,
6
),
(
6
,
5
);
--
echo
# Exercising latch==2
SELECT
*
FROM
graph
WHERE
latch
=
2
AND
origid
=
1
AND
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
2
AND
origid
=
1
AND
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
2
AND
origid
=
1
AND
(
weight
=
1
OR
weight
=
2
);
--
echo
# Exercising latch==1
SELECT
*
FROM
graph
WHERE
latch
=
1
AND
origid
=
1
AND
destid
=
6
;
SELECT
*
FROM
graph
WHERE
latch
=
1
AND
origid
=
1
AND
destid
=
4
;
SELECT
*
FROM
graph
WHERE
latch
=
1
AND
origid
=
4
AND
destid
=
1
;
--
echo
# Adding new row to base table
INSERT
INTO
graph_base
(
from_id
,
to_id
)
VALUES
(
4
,
6
);
--
echo
# Deleting rows from base table
DELETE
FROM
graph_base
WHERE
from_id
=
5
;
DELETE
FROM
graph_base
WHERE
from_id
=
3
AND
to_id
=
5
;
--
echo
# Execising latch==1 on new data
SELECT
*
FROM
graph
WHERE
latch
=
1
AND
origid
=
1
AND
destid
=
6
;
SELECT
*
FROM
graph
WHERE
latch
=
1
AND
origid
=
6
AND
destid
=
1
;
# FIXME - if the following DROPs are missing then mysql will segfault on exit
# indicating an ordering dependency on destruction somewhere...
DROP
TABLE
IF
EXISTS
graph
;
DROP
TABLE
IF
EXISTS
graph_base
;
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