Skip to content

Commit

Permalink
fix mysql optional query with clang
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacyking committed Jul 4, 2023
1 parent d8817ad commit 32efe11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
configuration: [ Debug, Release ]
os: [ ubuntu-latest, windows-latest ] # [ macos-latest, ubuntu-latest, windows-latest ]
os: [ macos-latest, ubuntu-latest, windows-latest ]

steps:
- name: Checkout Code
Expand Down
5 changes: 3 additions & 2 deletions include/mysql.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ class mysql {
T t{};
int index = 0;
iguana::for_each(t, [&](auto item, auto i) {
set_param_bind(param_binds.at(index++), t.*item, index, mp);
set_param_bind(param_binds[index], t.*item, index, mp);
index++;
});

if (index == 0) {
Expand All @@ -462,7 +463,7 @@ class mysql {
while (mysql_stmt_fetch(stmt_) == 0) {
iguana::for_each(t, [&mp, &param_binds, &t, this](auto item, auto i) {
constexpr auto Idx = decltype(i)::value;
set_value(param_binds[Idx], t.*item, Idx, mp);
set_value(param_binds.at(Idx), t.*item, Idx, mp);
});

for (auto &p : mp) {
Expand Down

0 comments on commit 32efe11

Please sign in to comment.