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

Wrong condition to check Begin options #342

Open
kpeu3i opened this issue Sep 12, 2024 · 1 comment
Open

Wrong condition to check Begin options #342

kpeu3i opened this issue Sep 12, 2024 · 1 comment

Comments

@kpeu3i
Copy link

kpeu3i commented Sep 12, 2024

There is a bug on this line https://github.com/DATA-DOG/go-sqlmock/blob/master/sqlmock.go#L256

	if expected.txOpts != nil &&
		expected.txOpts.Isolation != opts.Isolation &&
		expected.txOpts.ReadOnly != opts.ReadOnly {
		return nil, fmt.Errorf("expected transaction options do not match: %+v, got: %+v", expected.txOpts, opts)
	}

but should be:

	if expected.txOpts != nil &&
		(expected.txOpts.Isolation != opts.Isolation || expected.txOpts.ReadOnly != opts.ReadOnly) {
		return nil, fmt.Errorf("expected transaction options do not match: %+v, got: %+v", expected.txOpts, opts)
	}
@kpeu3i
Copy link
Author

kpeu3i commented Sep 17, 2024

@ninadingole please check

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