Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPDATE statements are Noop #2213

Closed
mindaugasrukas opened this issue Dec 22, 2023 · 4 comments
Closed

UPDATE statements are Noop #2213

mindaugasrukas opened this issue Dec 22, 2023 · 4 comments

Comments

@mindaugasrukas
Copy link

mindaugasrukas commented Dec 22, 2023

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.

@mindaugasrukas
Copy link
Author

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.

@nicktobey
Copy link
Contributor

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?)

@nicktobey nicktobey reopened this Dec 27, 2023
@mindaugasrukas
Copy link
Author

I'll try to repro and provide the details.

@timsehn
Copy link
Sponsor Contributor

timsehn commented Feb 28, 2024

Resolving as we didn't get a specific repro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants