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

Mysql "... update nowait" does not return error #926

Open
wildwind123 opened this issue May 26, 2024 · 0 comments
Open

Mysql "... update nowait" does not return error #926

wildwind123 opened this issue May 26, 2024 · 0 comments

Comments

@wildwind123
Copy link

wildwind123 commented May 26, 2024

on this mysql query, does not return error, and return empty rows, if query is locked for update

rows, err := sqlx.Query("select id from payment where status in (1, 2) for update nowait;")

should return error like

SQL Error [3572] [HY000]: Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set.

but error is return on QueryRow

row := sqlx.QueryRow("select id from payment where status in (1, 2) for update nowait;")

	var id int

	err = row.Scan(&id)
	if err != nil {
		t.Error(err)
	}

how make get err on sqlx.Query ?

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

1 participant