UPDATE statements are Noop
mindaugasrukas opened this issue · 4 comments
I'm using GMS for integration tests.
Maybe I'm using it wrong, but I'm facing an issue that UPDATE
queries don't work.
Environment:
Start a go-mysql-server instance with DB.
Using MySQL client, populate dummy data CREATE TABLE
.
Test scenario using mysql client:
INSERT
some dummy dataX
into memoryDB - works without any issuesSELECT
to see the dataX
is there - works without issues. I receive anX
.UPDATE
the dataY
- produces no errors.SELECT
to see the dataY
is there - it doesn't work. I receive the originalX
instead ofY
data.
I think I tried all options and everything, but it looks like no matter what, the UPDATE
is never reflected in the DB.
UPDATE: I'm using it via gotest.
Hmm, I guess I found the issue, but I'm not sure how that is related.
If your table schema contains a CONSTRAINT
, then it fails:
CONSTRAINT Table_userID_fk FOREIGN KEY (userID) REFERENCES Users(id),
Everything worked as expected after I deleted that constraint from the test schema.
This sounds like it might be a bug. Can you give us more information so we can reproduce it? Do you have a sequence of commands that produces this behavior? (For instance, was the foreign key constraint on your test table, or referencing the test table?)
I'll try to repro and provide the details.
Resolving as we didn't get a specific repro.