mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
Updated create_attr test for varchar latch
This commit is contained in:
commit
eda7f5eb20
2 changed files with 203 additions and 35 deletions
122
mysql-test/suite/oqgraph/create_attr.result
Normal file
122
mysql-test/suite/oqgraph/create_attr.result
Normal file
|
@ -0,0 +1,122 @@
|
|||
DROP TABLE IF EXISTS not_backing;
|
||||
DROP TABLE IF EXISTS backing;
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE `not_backing` (
|
||||
id int(10) unsigned NOT NULL DEFAULT '0',
|
||||
id2 int(10) unsigned NOT NULL DEFAULT '0',
|
||||
info varchar(20) DEFAULT NULL,
|
||||
KEY name (info)
|
||||
) DEFAULT CHARSET=latin1;
|
||||
CREATE TABLE backing (
|
||||
id int(10) unsigned NOT NULL DEFAULT '0',
|
||||
id2 int(10) unsigned NOT NULL DEFAULT '0',
|
||||
parent int(10) unsigned DEFAULT NULL,
|
||||
weight real(10,4) NOT NULL DEFAULT 0.0,
|
||||
info varchar(20) DEFAULT NULL,
|
||||
not_id_type varchar(20) DEFAULT NULL,
|
||||
not_weight_type varchar(20) DEFAULT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY name (info)
|
||||
) DEFAULT CHARSET=latin1;
|
||||
CREATE TABLE oqtable ( 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;
|
||||
# Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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, ORIGID='id', DESTID='id2';
|
||||
# Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='', ORIGID='id', DESTID='id2';
|
||||
# Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='', ORIGID='id';
|
||||
# Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='', DESTID='id2';
|
||||
# Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='bogus', ORIGID='id', DESTID='id2';
|
||||
# Expect: 'Table 'test.bogus' doesn't exist''
|
||||
DESCRIBE oqtable;
|
||||
ERROR 42S02: Table 'test.bogus' doesn't exist
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='backing', DESTID='id2';
|
||||
# Expect 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='', DESTID='id2';
|
||||
# Expect 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='bogus', DESTID='id2';
|
||||
# Expect Invalid OQGRAPH backing store ('/oqtable'.origid attribute not set to a valid column of 'backing')'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('/oqtable'.origid attribute not set to a valid column of 'backing')' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='not_id_type', DESTID='id2';
|
||||
# Expect 'Column 'backing.not_id_type' is not a not-null integer type'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Column 'backing.not_id_type' is not a not-null integer type' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id';
|
||||
# Expect 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='';
|
||||
# Expect 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='bogus';
|
||||
# Expect Invalid OQGRAPH backing store ('/oqtable'.destid attribute not set to a valid column of 'backing')'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('/oqtable'.destid attribute not set to a valid column of 'backing')' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='not_id_type';
|
||||
# Expect 'Column 'backing.not_id_type' is not a not-null integer type'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Column 'backing.not_id_type' is not a not-null integer type' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='id';
|
||||
# Expect 'Invalid OQGRAPH backing store ('/oqtable'.destid attribute set to same column as origid attribute)'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('/oqtable'.destid attribute set to same column as origid attribute)' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='';
|
||||
# Expect 'Invalid OQGRAPH backing store ('/oqtable'.weight attribute not set to a valid column of 'backing')'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('/oqtable'.weight attribute not set to a valid column of 'backing')' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='bogus';
|
||||
# Expect 'Invalid OQGRAPH backing store ('/oqtable'.weight attribute not set to a valid column of 'backing')'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('/oqtable'.weight attribute not set to a valid column of 'backing')' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='not_weight_type';
|
||||
# Expect 'Column 'backing.not_weight_type' is not a not-null real type'
|
||||
DESCRIBE oqtable;
|
||||
ERROR HY000: Got error -1 'Column 'backing.not_weight_type' is not a not-null real type' from OQGRAPH
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='weight';
|
||||
DESCRIBE oqtable;
|
||||
Field Type Null Key Default Extra
|
||||
latch varchar(32) 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
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
DROP TABLE IF EXISTS backing;
|
||||
DROP TABLE IF EXISTS not_backing;
|
|
@ -7,12 +7,14 @@ DROP TABLE IF EXISTS oqtable;
|
|||
|
||||
CREATE TABLE `not_backing` (
|
||||
id int(10) unsigned NOT NULL DEFAULT '0',
|
||||
id2 int(10) unsigned NOT NULL DEFAULT '0',
|
||||
info varchar(20) DEFAULT NULL,
|
||||
KEY name (info)
|
||||
) DEFAULT CHARSET=latin1;
|
||||
|
||||
CREATE TABLE backing (
|
||||
id int(10) unsigned NOT NULL DEFAULT '0',
|
||||
id2 int(10) unsigned NOT NULL DEFAULT '0',
|
||||
parent int(10) unsigned DEFAULT NULL,
|
||||
weight real(10,4) NOT NULL DEFAULT 0.0,
|
||||
info varchar(20) DEFAULT NULL,
|
||||
|
@ -24,16 +26,46 @@ CREATE TABLE backing (
|
|||
|
||||
|
||||
# oqgraph v2 create table should fail (missing attributes)
|
||||
CREATE TABLE oqtable ( 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;
|
||||
CREATE TABLE oqtable ( 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;
|
||||
--echo # Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
||||
# no table reference
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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, ORIGID='id', DESTID='id2';
|
||||
--echo # Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
# attributes test
|
||||
# empty table reference
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='';
|
||||
CREATE TABLE oqtable ( 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='', ORIGID='id', DESTID='id2';
|
||||
--echo # Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
# empty table reference
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='', ORIGID='id';
|
||||
--echo # Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
||||
# empty table reference
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='', DESTID='id2';
|
||||
--echo # Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
@ -41,15 +73,27 @@ DESCRIBE oqtable;
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='bogus';
|
||||
--error 1296
|
||||
CREATE TABLE oqtable ( 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='bogus', ORIGID='id', DESTID='id2';
|
||||
--echo # Expect: 'Table 'test.bogus' doesn't exist''
|
||||
--error 1146
|
||||
DESCRIBE oqtable;
|
||||
|
||||
# FIXME - I dont know what this test was for
|
||||
# FIXME - Are we checking that the backing tbale has a primary key etc., or doesn't it matter?
|
||||
# invalid table reference
|
||||
#--disable_warnings
|
||||
#DROP TABLE IF EXISTS oqtable;
|
||||
#--enable_warnings
|
||||
#CREATE TABLE oqtable ( 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='not_backing';
|
||||
#--error 1296
|
||||
#DESCRIBE oqtable;
|
||||
|
||||
# missing origid
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='not_backing';
|
||||
CREATE TABLE oqtable ( 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='backing', DESTID='id2';
|
||||
--echo # Expect 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
@ -57,7 +101,8 @@ DESCRIBE oqtable;
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='';
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='', DESTID='id2';
|
||||
--echo # Expect 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
@ -65,7 +110,8 @@ DESCRIBE oqtable;
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='bogus';
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='bogus', DESTID='id2';
|
||||
--echo # Expect Invalid OQGRAPH backing store ('/oqtable'.origid attribute not set to a valid column of 'backing')'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
@ -73,7 +119,8 @@ DESCRIBE oqtable;
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='not_id_type';
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='not_id_type', DESTID='id2';
|
||||
--echo # Expect 'Column 'backing.not_id_type' is not a not-null integer type'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
@ -81,7 +128,8 @@ DESCRIBE oqtable;
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id';
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id';
|
||||
--echo # Expect 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
@ -89,7 +137,8 @@ DESCRIBE oqtable;
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='';
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='';
|
||||
--echo # Expect 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
@ -97,7 +146,8 @@ DESCRIBE oqtable;
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='bogus';
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='bogus';
|
||||
--echo # Expect Invalid OQGRAPH backing store ('/oqtable'.destid attribute not set to a valid column of 'backing')'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
@ -105,23 +155,8 @@ DESCRIBE oqtable;
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='not_id_type';
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
# invalid origid with valid destid
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='bogus',DESTID='id';
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
# wrong type origid with valid destid
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='not_id_type',DESTID='id';
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='not_id_type';
|
||||
--echo # Expect 'Column 'backing.not_id_type' is not a not-null integer type'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
@ -129,16 +164,26 @@ DESCRIBE oqtable;
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='id';
|
||||
# this should fail when we put a check in for ORIGID != DESTID
|
||||
# --error 1296
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='id';
|
||||
--echo # Expect 'Invalid OQGRAPH backing store ('/oqtable'.destid attribute set to same column as origid attribute)'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
# invalid weight reference
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='id',WEIGHT='bogus';
|
||||
CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='';
|
||||
--echo # Expect 'Invalid OQGRAPH backing store ('/oqtable'.weight attribute not set to a valid column of 'backing')'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
# invalid weight reference
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='bogus';
|
||||
--echo # Expect 'Invalid OQGRAPH backing store ('/oqtable'.weight attribute not set to a valid column of 'backing')'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
@ -146,7 +191,8 @@ DESCRIBE oqtable;
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='id',WEIGHT='not_weight_type';
|
||||
CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='not_weight_type';
|
||||
--echo # Expect 'Column 'backing.not_weight_type' is not a not-null real type'
|
||||
--error 1296
|
||||
DESCRIBE oqtable;
|
||||
|
||||
|
@ -154,7 +200,7 @@ DESCRIBE oqtable;
|
|||
--disable_warnings
|
||||
DROP TABLE IF EXISTS oqtable;
|
||||
--enable_warnings
|
||||
CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='id',WEIGHT='weight';
|
||||
CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='weight';
|
||||
DESCRIBE oqtable;
|
||||
|
||||
# cleanup
|
||||
|
|
Loading…
Reference in a new issue