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

select for update got an error #610

Closed
576470954 opened this issue Sep 14, 2023 · 2 comments
Closed

select for update got an error #610

576470954 opened this issue Sep 14, 2023 · 2 comments

Comments

@576470954
Copy link
Contributor

What happened:
when I write sql "select sth for update" and use QueryContext func.Why I use QueryContext(not ExecContext) because I want to
get the rows:
image
I got error:
image

What you expected to happen:
execute normally

How to reproduce it (as minimally and precisely as possible):
sql and func like my code

Anything else we need to know?:
the reason maybe in seata-go, it QueryContext and then ExecContext, so the mysql conn is something wrong
this is the QueryContext code:
image
and then :after exec the business func (showed upon) in line 178, it exec line:185
image
and this conn cant use twice(watching in mysql has been set to true, and haven't set to false after queryContext complete)
image
In mysql driver QueryContext func haven't finish the mc unless err != nil(it's diff with ExecContext func)
image

@576470954
Copy link
Contributor Author

I change the code swap the business func and exec in select_for_update_executor.go
and the QueryContext func can use with in an Tx
image

@marsevilspirit
Copy link
Contributor

assign me please

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

No branches or pull requests

3 participants