mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 04:47:18 +08:00
Fix incorrect for_update function, #583
This commit is contained in:
parent
d6f5e498b9
commit
505adb546a
@ -162,9 +162,8 @@ namespace sqlpp
|
||||
return context;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
auto for_update(T&& t) -> decltype(statement_t<void, no_for_update_t>().for_update(std::forward<T>(t)))
|
||||
inline auto for_update() -> decltype(statement_t<void, no_for_update_t>().for_update())
|
||||
{
|
||||
return statement_t<void, no_for_update_t>().for_update(std::forward<T>(t));
|
||||
return statement_t<void, no_for_update_t>().for_update();
|
||||
}
|
||||
} // namespace sqlpp
|
||||
|
@ -51,6 +51,9 @@ int ForUpdate(int, char* [])
|
||||
const auto foo = test::TabFoo{};
|
||||
// const auto bar = test::TabBar{};
|
||||
|
||||
compare(__LINE__, sqlpp::for_update(),
|
||||
" FOR UPDATE ");
|
||||
|
||||
// Unconditionally
|
||||
compare(__LINE__, select(foo.omega).from(foo).unconditionally().for_update(),
|
||||
"SELECT tab_foo.omega FROM tab_foo FOR UPDATE ");
|
||||
|
Loading…
Reference in New Issue
Block a user