Skip to content

The entities table contains residuals

Summary

The entities table is not cleaned up properly.

Expected Behavior

After inserting and deleting Entities the entities table does not contain residuals (like domain ids).

Actual Behavior

It can occur that a Domain persists.

Steps to Reproduce the Problem

  1. Start a server with an empty database in debug mode
  2. Perform the python integration tests in tests/test_query.py
  3. Check the entities table using mysql

The initial state of the entities table:

MariaDB [caosdb]> select * from entities;

+----+---------------------------------------+------------+------+
| id | description                           | role       | acl  |
+----+---------------------------------------+------------+------+
|  0 | The default domain.                   | ROLE       |    0 |
|  1 | The default recordtype.               | ROLE       |    0 |
|  2 | The default record.                   | ROLE       |    0 |
|  3 | The default file.                     | ROLE       |    0 |
|  4 | The default property.                 | ROLE       |    0 |
|  7 | The default datatype.                 | ROLE       |    0 |
|  8 | The QueryTemplate role.               | ROLE       |    0 |
| 11 | The default reference data type.      | DATATYPE   |    0 |
| 12 | The default integer data type.        | DATATYPE   |    0 |
| 13 | The default double data type.         | DATATYPE   |    0 |
| 14 | The default text data type.           | DATATYPE   |    0 |
| 15 | The default datetime data type.       | DATATYPE   |    0 |
| 16 | The default timespan data type.       | DATATYPE   |    0 |
| 17 | The default file reference data type. | DATATYPE   |    0 |
| 18 | The defaulf boolean data type         | DATATYPE   |    0 |
| 20 | Name of an entity                     | PROPERTY   |    0 |
| 21 | Unit of an entity.                    | PROPERTY   |    0 |
| 24 | Description of an entity.             | PROPERTY   |    0 |
| 50 | The SQLite file data type.            | DATATYPE   |    0 |
| 99 | NULL                                  | RECORDTYPE |    0 |
+----+---------------------------------------+------------+------+
20 rows in set (0.121 sec)

After the integrationtests, there is an additional row:

| 105 | NULL                                  | DOMAIN     |    0 |

Specifications

I did this with server commit 5f9962cb. pyint: 6f6a570

Possible fixes

Do you have ideas how the issue can be resolved?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information