Skip to content
Snippets Groups Projects
Verified Commit 5dd43882 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

clean up and update tests

parent 923a2140
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,6 @@ BEGIN ...@@ -52,7 +52,6 @@ BEGIN
-- move to archive_isa before deleting -- move to archive_isa before deleting
INSERT IGNORE INTO archive_isa (child, child_iversion, parent, direct) INSERT IGNORE INTO archive_isa (child, child_iversion, parent, direct)
-- TODO copy rpath as well
SELECT e.child, IVersion AS child_iversion, e.parent, rpath = EntityID SELECT e.child, IVersion AS child_iversion, e.parent, rpath = EntityID
FROM isa_cache AS e FROM isa_cache AS e
WHERE e.child = EntityID; WHERE e.child = EntityID;
......
...@@ -33,7 +33,7 @@ DECLARE aggVal VARCHAR(255) DEFAULT NULL; ...@@ -33,7 +33,7 @@ DECLARE aggVal VARCHAR(255) DEFAULT NULL;
#-- get aggVal if possible #-- get aggVal if possible
IF agg IS NOT NULL THEN IF agg IS NOT NULL THEN
IF versioned THEN IF versioned THEN
-- TODO -- TODO versioned queries
SELECT 1 FROM id_agg_with_versioning_not_implemented; SELECT 1 FROM id_agg_with_versioning_not_implemented;
END IF; END IF;
SET @stmtIDAggValStr = CONCAT( SET @stmtIDAggValStr = CONCAT(
......
...@@ -103,7 +103,6 @@ POV_LABEL: BEGIN ...@@ -103,7 +103,6 @@ POV_LABEL: BEGIN
ELSEIF o = "(" or o = "!(" THEN ELSEIF o = "(" or o = "!(" THEN
IF versioned THEN IF versioned THEN
-- TODO is vText = NULL even possible?
SET sTextData = IF(vText IS NULL, ' SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `date_data` UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_date_data`', SET sTextData = IF(vText IS NULL, ' SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `date_data` UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_date_data`',
IF(vDateTimeDotNotation IS NULL, NULL, IF(vDateTimeDotNotation IS NULL, NULL,
CONCAT(' SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `date_data` AS subdata WHERE ', getDateWhereClause(vDateTimeDotNotation, o), ' UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_date_data` AS subdata WHERE ', getDateWhereClause(vDateTimeDotNotation, o)))); CONCAT(' SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `date_data` AS subdata WHERE ', getDateWhereClause(vDateTimeDotNotation, o), ' UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_date_data` AS subdata WHERE ', getDateWhereClause(vDateTimeDotNotation, o))));
......
...@@ -62,7 +62,7 @@ BEGIN ...@@ -62,7 +62,7 @@ BEGIN
-- expand with all children -- expand with all children
SELECT conv( concat( substring(uid,16,3), substring(uid,10,4), substring(uid,1,8)),16,10) div 10000 - (141427 * 24 * 60 * 60 * 1000) as current_mills INTO t3 from (select uuid() uid) as alias; SELECT conv( concat( substring(uid,16,3), substring(uid,10,4), substring(uid,1,8)),16,10) div 10000 - (141427 * 24 * 60 * 60 * 1000) as current_mills INTO t3 from (select uuid() uid) as alias;
IF ecount > 0 THEN IF ecount > 0 THEN
-- TODO versioning -- TODO versioned queries
call getChildren(propertiesTable, False); call getChildren(propertiesTable, False);
END IF; END IF;
......
...@@ -33,6 +33,84 @@ SELECT tap.has_schema('_caosdb_schema_unit_tests',''); ...@@ -33,6 +33,84 @@ SELECT tap.has_schema('_caosdb_schema_unit_tests','');
-- TABLES -- TABLES
-- *************************************************************** -- ***************************************************************
-- ***************************************************************
-- TABLE _caosdb_schema_unit_tests.archive_isa
-- ***************************************************************
SELECT tap.has_table('_caosdb_schema_unit_tests','archive_isa','');
SELECT tap.table_collation_is('_caosdb_schema_unit_tests','archive_isa','utf8_unicode_ci','');
SELECT tap.table_engine_is('_caosdb_schema_unit_tests','archive_isa','InnoDB','');
-- COLUMNS
SELECT tap.columns_are('_caosdb_schema_unit_tests','archive_isa','`child`,`child_iversion`,`parent`,`direct`','');
-- COLUMN archive_isa.child
SELECT tap.has_column('_caosdb_schema_unit_tests','archive_isa','child','');
SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','archive_isa','child','int(10) unsigned','');
SELECT tap.col_extra_is('_caosdb_schema_unit_tests','archive_isa','child','','');
SELECT tap.col_default_is('_caosdb_schema_unit_tests','archive_isa','child',NULL,'');
SELECT tap.col_charset_is('_caosdb_schema_unit_tests','archive_isa','child',NULL,'');
SELECT tap.col_collation_is('_caosdb_schema_unit_tests','archive_isa','child',NULL,'');
-- COLUMN archive_isa.child_iversion
SELECT tap.has_column('_caosdb_schema_unit_tests','archive_isa','child_iversion','');
SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','archive_isa','child_iversion','int(10) unsigned','');
SELECT tap.col_extra_is('_caosdb_schema_unit_tests','archive_isa','child_iversion','','');
SELECT tap.col_default_is('_caosdb_schema_unit_tests','archive_isa','child_iversion',NULL,'');
SELECT tap.col_charset_is('_caosdb_schema_unit_tests','archive_isa','child_iversion',NULL,'');
SELECT tap.col_collation_is('_caosdb_schema_unit_tests','archive_isa','child_iversion',NULL,'');
-- COLUMN archive_isa.parent
SELECT tap.has_column('_caosdb_schema_unit_tests','archive_isa','parent','');
SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','archive_isa','parent','int(10) unsigned','');
SELECT tap.col_extra_is('_caosdb_schema_unit_tests','archive_isa','parent','','');
SELECT tap.col_default_is('_caosdb_schema_unit_tests','archive_isa','parent',NULL,'');
SELECT tap.col_charset_is('_caosdb_schema_unit_tests','archive_isa','parent',NULL,'');
SELECT tap.col_collation_is('_caosdb_schema_unit_tests','archive_isa','parent',NULL,'');
-- COLUMN archive_isa.direct
SELECT tap.has_column('_caosdb_schema_unit_tests','archive_isa','direct','');
SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','archive_isa','direct','tinyint(1)','');
SELECT tap.col_extra_is('_caosdb_schema_unit_tests','archive_isa','direct','','');
SELECT tap.col_default_is('_caosdb_schema_unit_tests','archive_isa','direct',1,'');
SELECT tap.col_charset_is('_caosdb_schema_unit_tests','archive_isa','direct',NULL,'');
SELECT tap.col_collation_is('_caosdb_schema_unit_tests','archive_isa','direct',NULL,'');
-- INDEXES
SELECT tap.indexes_are('_caosdb_schema_unit_tests','archive_isa','`parent`,`child`','');
-- INDEX archive_isa.child
SELECT tap.has_index('_caosdb_schema_unit_tests','archive_isa','child','');
SELECT tap.index_is_type('_caosdb_schema_unit_tests','archive_isa','child','BTREE','');
SELECT tap.is_indexed('_caosdb_schema_unit_tests','archive_isa','`child`,`child_iversion`','');
-- INDEX archive_isa.parent
SELECT tap.has_index('_caosdb_schema_unit_tests','archive_isa','parent','');
SELECT tap.index_is_type('_caosdb_schema_unit_tests','archive_isa','parent','BTREE','');
SELECT tap.is_indexed('_caosdb_schema_unit_tests','archive_isa','`parent`','');
-- CONSTRAINTS
SELECT tap.constraints_are('_caosdb_schema_unit_tests','archive_isa','`archive_isa_ibfk_1`,`archive_isa_ibfk_2`','');
-- CONSTRAINT archive_isa.archive_isa_ibfk_1
SELECT tap.has_constraint('_caosdb_schema_unit_tests','archive_isa','archive_isa_ibfk_1','');
SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','archive_isa','archive_isa_ibfk_1','FOREIGN KEY','');
SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','archive_isa','archive_isa_ibfk_1','CASCADE','');
SELECT tap.fk_on_update('_caosdb_schema_unit_tests','archive_isa','archive_isa_ibfk_1','RESTRICT','');
-- CONSTRAINT archive_isa.archive_isa_ibfk_2
SELECT tap.has_constraint('_caosdb_schema_unit_tests','archive_isa','archive_isa_ibfk_2','');
SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','archive_isa','archive_isa_ibfk_2','FOREIGN KEY','');
SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','archive_isa','archive_isa_ibfk_2','CASCADE','');
SELECT tap.fk_on_update('_caosdb_schema_unit_tests','archive_isa','archive_isa_ibfk_2','RESTRICT','');
-- *************************************************************** -- ***************************************************************
-- TABLE _caosdb_schema_unit_tests.collection_type -- TABLE _caosdb_schema_unit_tests.collection_type
-- *************************************************************** -- ***************************************************************
...@@ -2588,6 +2666,13 @@ SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initBackRefer ...@@ -2588,6 +2666,13 @@ SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initBackRefer
SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initBackReference','DEFINER',''); SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initBackReference','DEFINER','');
SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initBackReference','CONTAINS SQL',''); SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initBackReference','CONTAINS SQL','');
-- PROCEDURES _caosdb_schema_unit_tests.initDisjunctionFilter
SELECT tap.has_procedure('_caosdb_schema_unit_tests','initDisjunctionFilter','');
SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','initDisjunctionFilter','NO','');
SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','initDisjunctionFilter','DEFINER','');
SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','initDisjunctionFilter','CONTAINS SQL','');
-- PROCEDURES _caosdb_schema_unit_tests.initPOVRefidsTable -- PROCEDURES _caosdb_schema_unit_tests.initPOVRefidsTable
SELECT tap.has_procedure('_caosdb_schema_unit_tests','initPOVRefidsTable',''); SELECT tap.has_procedure('_caosdb_schema_unit_tests','initPOVRefidsTable','');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment