I'm using a dockerized MySQL 5.7.13 as part of an integration test of an application. The way the system works is as follows:
- I start up the main application. It opens up a connection to MySQL, but does not perform any queries.
I start the integration test setup and drop the old table if it was left behind by the previous run:
DROP TABLE IF EXISTS unit_deviceI then go on and create the table like this:
CREATE TABLE IF NOT EXISTS unit_device ( id CHAR(36) NOT NULL, unit_id CHAR(36), device_id CHAR(36), deleted_at DATETIME, PRIMARY KEY (id) )I then insert some values into the table and trigger work in the main application which makes one SELECT:
SELECT unit_id, device_id FROM unit_device WHERE deleted_at IS NULLThen I drop the table:
DROP TABLE IF EXISTS unit_device
However, when I try to run this query, it hangs seemingly forever for some reason. If I close the connection from the main application, the query resumes. One thing that seems suspicious is that once the main application has made its select once, I can see the following information in the output of show engine innodb status: 1 read views open inside InnoDB
I must be doing something seriously wrong here, but after hours of research I was still unable to figure out what's causing the hang, or whether the problem is in the test or the main application.