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

Add test for sqlite_math_functions tag #1059

Merged
merged 6 commits into from
Sep 17, 2022

Conversation

lggruspe
Copy link
Contributor

Hello, this is a continuation of #1037, which fixes #990.

Changes

  • Adds test to check if sqlite math functions are compiled in
  • Update github workflow to include sqlite_math_functions tag in full test

@rittneje @nkt-dk

README.md Outdated Show resolved Hide resolved
@lggruspe lggruspe force-pushed the sqlite-math-functions branch from 6999866 to 6acc037 Compare August 16, 2022 20:05
@lggruspe lggruspe force-pushed the sqlite-math-functions branch from 6acc037 to fe6ab89 Compare September 10, 2022 10:49
@lggruspe lggruspe requested review from mattn and rittneje and removed request for mattn and rittneje September 10, 2022 10:50
}

for _, query := range queries {
if _, err := db.Query(query); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Right now you are dropping the Rows object. That means you are only checking for an error from sqlite3_prepare_v2 and not sqlite3_step. For completeness we should check both, which is why QueryRow would be preferable.

var result float64
if err := db.QueryRow(query).Scan(&result); err != nil {
    t.Errorf("invoking math function query %q: %v", query, err)
}
// For the purposes of this test, we don't care about the output, just that the query succeeded.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see... thanks for the review :)

@mattn
Copy link
Owner

mattn commented Sep 17, 2022

Seems okay to me.

@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2022

Codecov Report

Base: 46.09% // Head: 46.09% // No change to project coverage 👍

Coverage data is based on head (d37b86e) compared to base (7476442).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1059   +/-   ##
=======================================
  Coverage   46.09%   46.09%           
=======================================
  Files          11       11           
  Lines        1499     1499           
=======================================
  Hits          691      691           
  Misses        669      669           
  Partials      139      139           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rittneje
Copy link
Collaborator

Failure is due to unrelated issue introduced in #1085.

@rittneje rittneje merged commit 17f6553 into mattn:master Sep 17, 2022
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==-->
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

Successfully merging this pull request may close these issues.

Trying to use maths function (from SQLite v3.35) does not work
5 participants