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
5fa61317
Commit
5fa61317
authored
Jun 29, 2013
by
Andrew McDonnell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Missed result for boundary conditions
parent
02a4003d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
252 additions
and
0 deletions
+252
-0
mysql-test/suite/oqgraph/boundary_conditions.result
mysql-test/suite/oqgraph/boundary_conditions.result
+252
-0
No files found.
mysql-test/suite/oqgraph/boundary_conditions.result
0 → 100644
View file @
5fa61317
DROP TABLE IF EXISTS graph_base;
DROP TABLE IF EXISTS graph;
DROP TABLE IF EXISTS graph2;
CREATE TABLE graph2 (
latch VARCHAR(32) 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';
SELECT * FROM graph2 WHERE latch='dijkstras' AND origid=1 AND destid=6;
ERROR 42S02: Table 'test.graph_base' doesn't exist
DROP TABLE graph2;
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;
CREATE TABLE graph (
latch VARCHAR(32) 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';
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);
# No Search/0 - result should return same rows as inserted for origid,destid,weight
# FIXME - THIS CODE IS CURRENTLY BROKEN - see https://bugs.launchpad.net/oqgraph/+bug/1195778
SELECT * FROM graph WHERE latch='no_search';
latch origid destid weight seq linkid
no_search NULL NULL NULL NULL 1
no_search NULL NULL NULL NULL 2
no_search NULL NULL NULL NULL 3
no_search NULL NULL NULL NULL 4
no_search NULL NULL NULL NULL 5
no_search NULL NULL NULL NULL 6
SELECT * FROM graph WHERE latch='no_search' and destid=2 and origid=1;
latch origid destid weight seq linkid
no_search 1 2 1 3 1
no_search 1 2 1 2 3
no_search 1 2 1 1 2
SELECT * FROM graph WHERE latch='no_search' and origid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='no_search' and destid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='no_search' and origid=666;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='no_search' and origid=NULL;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='0' ;
latch origid destid weight seq linkid
0 NULL NULL NULL NULL 1
0 NULL NULL NULL NULL 2
0 NULL NULL NULL NULL 3
0 NULL NULL NULL NULL 4
0 NULL NULL NULL NULL 5
0 NULL NULL NULL NULL 6
SELECT * FROM graph WHERE latch='0' and destid=2 and origid=1;
latch origid destid weight seq linkid
0 1 2 1 3 1
0 1 2 1 2 3
0 1 2 1 1 2
SELECT * FROM graph WHERE latch='0' and origid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='0' and destid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='0' and origid=666;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='0' and origid=NULL;
latch origid destid weight seq linkid
# Expect no result, because of autocast
SELECT * FROM graph WHERE latch=1 ;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=1 and destid=2 and origid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=1 and origid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=1 and destid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=1 and origid=666;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=1 and origid=NULL;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=2 ;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=2 and destid=2 and origid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=2 and origid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=2 and destid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=2 and origid=666;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=2 and origid=NULL;
latch origid destid weight seq linkid
# Should this return an error? it seems we treat it as just another bogus latch
SELECT * FROM graph WHERE latch='ThisExceeds32Characters456789012';
latch origid destid weight seq linkid
# Expect no result, because of invalid latch
SELECT * FROM graph WHERE latch='bogus';
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='bogus' and destid=2 and origid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='bogus' and origid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='bogus' and destid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='bogus' and origid=666;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='bogus' and origid=NULL;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='666';
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='666' and destid=2 and origid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='666' and origid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='666' and destid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='666' and origid=666;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='666' and origid=NULL;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='-1';
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='-1' and destid=2 and origid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='-1' and origid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='-1' and destid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='-1' and origid=666;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='-1' and origid=NULL;
latch origid destid weight seq linkid
# Make sure we dont crash if someone passed in a UTF string
SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄';
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and destid=2 and origid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and origid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and destid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and origid=666;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and origid=NULL;
latch origid destid weight seq linkid
# Expect no result, because of autocast and deprecated syntax
# Allows 0 and NULL to have same effect
SELECT * FROM graph WHERE latch=0;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=0 and destid=2 and origid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=0 and origid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=0 and destid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=0 and origid=666;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=0 and origid=NULL;
latch origid destid weight seq linkid
# Expect no result, because of NULL latch
SELECT * FROM graph WHERE latch=NULL;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=NULL and destid=2 and origid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=NULL and origid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=NULL and destid=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=NULL and origid=666;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=NULL and origid=NULL;
latch origid destid weight seq linkid
# With no latch, original data in origid and destid columns
SELECT * FROM graph;
latch origid destid weight seq linkid
NULL 1 2 1 NULL NULL
NULL 2 1 1 NULL NULL
NULL 1 3 1 NULL NULL
NULL 3 1 1 NULL NULL
NULL 3 4 1 NULL NULL
NULL 4 3 1 NULL NULL
NULL 5 6 1 NULL NULL
NULL 6 5 1 NULL NULL
SELECT * FROM graph WHERE destid=2 and origid=1;
latch origid destid weight seq linkid
NULL 1 2 1 NULL NULL
SELECT * FROM graph WHERE origid=1;
latch origid destid weight seq linkid
NULL 1 2 1 NULL NULL
NULL 1 3 1 NULL NULL
SELECT * FROM graph WHERE destid=1;
latch origid destid weight seq linkid
NULL 2 1 1 NULL NULL
NULL 3 1 1 NULL NULL
SELECT * FROM graph WHERE origid=666;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE origid=NULL;
latch origid destid weight seq linkid
INSERT INTO graph_base(from_id, to_id) VALUES (1,2);
ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY'
DELETE FROM graph_base;
FLUSH TABLES;
TRUNCATE TABLE graph_base;
DROP TABLE graph_base;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=6;
ERROR 42S02: Table 'test.graph_base' doesn't exist
DROP TABLE graph;
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