Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix test queryer test #1079

Merged
merged 2 commits into from
Sep 1, 2022
Merged

Fix test queryer test #1079

merged 2 commits into from
Sep 1, 2022

Conversation

joshbuddy
Copy link
Contributor

This fixes the TestQueryer test to exec for the multistatement insertion, as well as fixing the value of n

sqlite3_test.go Outdated
@@ -1091,7 +1096,7 @@ func TestQueryer(t *testing.T) {
}
n = n + 1
}
if n != 3 {
if n != 4 {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a 1-indexed loop, so n is 4 when its looped three times. We could insert 0,1,2 and start at 0 instead, that way n would be 3 when its done. If you prefer that I'll make that change.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be more intuitive to have n be the number of rows that were returned, in which case it should start at 0. Whether you change it to insert 0, 1, 2, or change it to compare against n+1 is fine to me.

@@ -1091,7 +1096,7 @@ func TestQueryer(t *testing.T) {
}
n = n + 1
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the missing call to rows.Err() after the loop.

@joshbuddy
Copy link
Contributor Author

@rittneje @mattn I've made those changes

@joriszwart joriszwart mentioned this pull request Sep 1, 2022
@mattn mattn merged commit f92b6bb into mattn:master Sep 1, 2022
@mattn
Copy link
Owner

mattn commented Sep 1, 2022

Thank you

@joshbuddy joshbuddy deleted the fix-test-queryer-test branch September 1, 2022 15:27
patrickdevivo referenced this pull request in mergestat/mergestat Oct 26, 2022
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) |
require | patch | `v1.14.15` -> `v1.14.16` |

---

### Release Notes

<details>
<summary>mattn/go-sqlite3</summary>

###
[`v1.14.16`](https://github.com/mattn/go-sqlite3/releases/tag/v1.14.16)

[Compare
Source](https://github.com/mattn/go-sqlite3/compare/v1.14.15...v1.14.16)

#### What's Changed

- Add build tag to enable OSTRACE() logging by
[@&#8203;benbjohnson](https://github.com/benbjohnson) in
[https://github.com/mattn/go-sqlite3/pull/1067](https://github.com/mattn/go-sqlite3/pull/1067)
- TestQueryer: actually check Rows returned by
[@&#8203;ohwgiles](https://github.com/ohwgiles) in
[https://github.com/mattn/go-sqlite3/pull/1062](https://github.com/mattn/go-sqlite3/pull/1062)
- Update README to fix reference URL by
[@&#8203;shibukawa](https://github.com/shibukawa) in
[https://github.com/mattn/go-sqlite3/pull/1082](https://github.com/mattn/go-sqlite3/pull/1082)
- Fix test queryer test by
[@&#8203;joshbuddy](https://github.com/joshbuddy) in
[https://github.com/mattn/go-sqlite3/pull/1079](https://github.com/mattn/go-sqlite3/pull/1079)
- Rollback on constraint failure by
[@&#8203;joshbuddy](https://github.com/joshbuddy) in
[https://github.com/mattn/go-sqlite3/pull/1071](https://github.com/mattn/go-sqlite3/pull/1071)
- Fix "ennviroment" by
[@&#8203;RewardedIvan](https://github.com/RewardedIvan) in
[https://github.com/mattn/go-sqlite3/pull/1077](https://github.com/mattn/go-sqlite3/pull/1077)
- こんにちわ is wrong Japanse, Correct word is こんにちは by
[@&#8203;KiYugadgeter](https://github.com/KiYugadgeter) in
[https://github.com/mattn/go-sqlite3/pull/1085](https://github.com/mattn/go-sqlite3/pull/1085)
- Add test for sqlite_math_functions tag by
[@&#8203;lggruspe](https://github.com/lggruspe) in
[https://github.com/mattn/go-sqlite3/pull/1059](https://github.com/mattn/go-sqlite3/pull/1059)
- remove unuseful ldflags for windows platform. by
[@&#8203;kkqy](https://github.com/kkqy) in
[https://github.com/mattn/go-sqlite3/pull/1084](https://github.com/mattn/go-sqlite3/pull/1084)
- Cross Compiling for Mac OS via `musl-cross` by
[@&#8203;jodosha](https://github.com/jodosha) in
[https://github.com/mattn/go-sqlite3/pull/1090](https://github.com/mattn/go-sqlite3/pull/1090)
- Update README.md to include vtable feature by
[@&#8203;dvas0004](https://github.com/dvas0004) in
[https://github.com/mattn/go-sqlite3/pull/1100](https://github.com/mattn/go-sqlite3/pull/1100)
- Updating vtable example, "BestIndex" method by
[@&#8203;dvas0004](https://github.com/dvas0004) in
[https://github.com/mattn/go-sqlite3/pull/1099](https://github.com/mattn/go-sqlite3/pull/1099)
- Update amalgamation code by
[@&#8203;mattn](https://github.com/mattn) in
[https://github.com/mattn/go-sqlite3/pull/1104](https://github.com/mattn/go-sqlite3/pull/1104)

#### New Contributors

- [@&#8203;ohwgiles](https://github.com/ohwgiles) made their first
contribution in
[https://github.com/mattn/go-sqlite3/pull/1062](https://github.com/mattn/go-sqlite3/pull/1062)
- [@&#8203;shibukawa](https://github.com/shibukawa) made their first
contribution in
[https://github.com/mattn/go-sqlite3/pull/1082](https://github.com/mattn/go-sqlite3/pull/1082)
- [@&#8203;joshbuddy](https://github.com/joshbuddy) made their first
contribution in
[https://github.com/mattn/go-sqlite3/pull/1079](https://github.com/mattn/go-sqlite3/pull/1079)
- [@&#8203;RewardedIvan](https://github.com/RewardedIvan) made their
first contribution in
[https://github.com/mattn/go-sqlite3/pull/1077](https://github.com/mattn/go-sqlite3/pull/1077)
- [@&#8203;KiYugadgeter](https://github.com/KiYugadgeter) made their
first contribution in
[https://github.com/mattn/go-sqlite3/pull/1085](https://github.com/mattn/go-sqlite3/pull/1085)
- [@&#8203;lggruspe](https://github.com/lggruspe) made their first
contribution in
[https://github.com/mattn/go-sqlite3/pull/1059](https://github.com/mattn/go-sqlite3/pull/1059)
- [@&#8203;kkqy](https://github.com/kkqy) made their first
contribution in
[https://github.com/mattn/go-sqlite3/pull/1084](https://github.com/mattn/go-sqlite3/pull/1084)
- [@&#8203;jodosha](https://github.com/jodosha) made their first
contribution in
[https://github.com/mattn/go-sqlite3/pull/1090](https://github.com/mattn/go-sqlite3/pull/1090)
- [@&#8203;dvas0004](https://github.com/dvas0004) made their first
contribution in
[https://github.com/mattn/go-sqlite3/pull/1100](https://github.com/mattn/go-sqlite3/pull/1100)

**Full Changelog**:
mattn/go-sqlite3@v1.14.15...v1.14.16

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click
this checkbox.

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/mergestat/mergestat).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xLjUiLCJ1cGRhdGVkSW5WZXIiOiIzNC4xLjUifQ==-->
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants