mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
40 lines
1.1 KiB
Text
40 lines
1.1 KiB
Text
DROP TABLE IF EXISTS graph_base;
|
|
DROP TABLE IF EXISTS graph;
|
|
CREATE TABLE graph_base (
|
|
von INT NOT NULL,
|
|
nach INT NOT NULL,
|
|
weight DOUBLE NOT NULL,
|
|
PRIMARY KEY (von,nach),
|
|
INDEX (von)
|
|
) 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='von' DESTID='nach' WEIGHT='weight';
|
|
INSERT INTO graph_base(von,nach,weight) VALUES (3,5,2), (5,4,1), (5,6,1);
|
|
SELECT * FROM graph_base;
|
|
von nach weight
|
|
3 5 2
|
|
5 4 1
|
|
5 6 1
|
|
SELECT * FROM graph;
|
|
latch origid destid weight seq linkid
|
|
NULL 3 5 2 NULL NULL
|
|
NULL 5 4 1 NULL NULL
|
|
NULL 5 6 1 NULL NULL
|
|
INSERT INTO graph_base(von,nach,weight) VALUES (6,3,1);
|
|
SELECT * FROM graph;
|
|
latch origid destid weight seq linkid
|
|
NULL 3 5 2 NULL NULL
|
|
NULL 5 4 1 NULL NULL
|
|
NULL 5 6 1 NULL NULL
|
|
NULL 6 3 1 NULL NULL
|
|
FLUSH TABLES;
|
|
DROP TABLE graph_base;
|
|
DROP TABLE graph;
|