oqgraph-dev team mailing list archive
-
oqgraph-dev team
-
Mailing list archive
-
Message #00064
Almost progress - unable to insert, read only
I have added code to open(),etc. to check for the correct table extension
attributes. Amongst other things I have taken the liberty of adding a version
extension attribute; this may not be the best way but one thing to consider in
the future is how to handle upgrades of existing tables if any structural
information changes.
I'll post my diffs later, in the meantime, before I go to bed, I am at the
point where I get the following error.
MariaDB [test]> INSERT INTO tol_tree (origid,destid) SELECT parent,id FROM
tol WHERE parent IS NOT NULL;ERROR 1036 (HY000): Table 'tol_tree' is read only
The tree of life is:
MariaDB [test]> describe tol;
+-------------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------------+------+-----+---------+-------+
| id | int(10) unsigned | NO | PRI | 0 | |
| parent | int(10) unsigned | YES | | NULL | |
| position | int(11) | YES | | NULL | |
| name | varchar(100) | YES | MUL | NULL | |
| description | varchar(200) | YES | | NULL | |
+-------------+------------------+------+-----+---------+-------+
Graph table:
MariaDB [test]> CREATE TABLE tol_tree (
-> 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='tol' origid='id' destid='id' version=1;
Query OK, 0 rows affected (0.05 sec)
MariaDB [test]> describe tol_tree;
+--------+----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+----------------------+------+-----+---------+-------+
| latch | smallint(5) unsigned | YES | MUL | NULL | |
| origid | bigint(20) unsigned | YES | | NULL | |
| destid | bigint(20) unsigned | YES | | NULL | |
| weight | double | YES | | NULL | |
| seq | bigint(20) unsigned | YES | | NULL | |
| linkid | bigint(20) unsigned | YES | | NULL | |
+--------+----------------------+------+-----+---------+-------+
Follow ups
References