dolthub/go-mysql-server

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:

  1. INSERT some dummy data X into memoryDB - works without any issues
  2. SELECT to see the data X is there - works without issues. I receive an X.
  3. UPDATE the data Y - produces no errors.
  4. SELECT to see the data Y is there - it doesn't work. I receive the original X instead of Y 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.