diff --git a/include/sqlpp11/assignment.h b/include/sqlpp11/assignment.h index 529d20ae..41b66d18 100644 --- a/include/sqlpp11/assignment.h +++ b/include/sqlpp11/assignment.h @@ -42,7 +42,7 @@ namespace sqlpp { using _traits = make_traits; using _lhs_t = Lhs; - using _rhs_t = rhs_wrap_t, trivial_value_is_null_t<_lhs_t>::value>; + using _rhs_t = rhs_wrap_t>; using _nodes = detail::type_vector<_lhs_t, _rhs_t>; static_assert(can_be_null_t<_lhs_t>::value ? true diff --git a/include/sqlpp11/data_types/blob/result_field.h b/include/sqlpp11/data_types/blob/result_field.h index b6fadccb..6839fc58 100644 --- a/include/sqlpp11/data_types/blob/result_field.h +++ b/include/sqlpp11/data_types/blob/result_field.h @@ -37,9 +37,9 @@ namespace sqlpp { - template - struct result_field_t> - : public result_field_base> + template + struct result_field_t> + : public result_field_base> { const uint8_t* blob{nullptr}; // Non-owning size_t len{}; @@ -67,11 +67,11 @@ namespace sqlpp } }; - template + template inline std::ostream& operator<<( - std::ostream& os, const result_field_t>& e) + std::ostream& os, const result_field_t>& e) { - if (e.is_null() and not NullIsTrivialValue) + if (e.is_null()) { return os << "NULL"; } diff --git a/include/sqlpp11/data_types/boolean/result_field.h b/include/sqlpp11/data_types/boolean/result_field.h index a2c6db39..6b4586ce 100644 --- a/include/sqlpp11/data_types/boolean/result_field.h +++ b/include/sqlpp11/data_types/boolean/result_field.h @@ -35,9 +35,9 @@ namespace sqlpp { - template - struct result_field_t> - : public result_field_base, signed char> + template + struct result_field_t> + : public result_field_base, signed char> { template void _bind(Target& target, size_t index) diff --git a/include/sqlpp11/data_types/day_point/result_field.h b/include/sqlpp11/data_types/day_point/result_field.h index 520615ee..ad60b02f 100644 --- a/include/sqlpp11/data_types/day_point/result_field.h +++ b/include/sqlpp11/data_types/day_point/result_field.h @@ -36,9 +36,9 @@ namespace sqlpp { - template - struct result_field_t> - : public result_field_base> + template + struct result_field_t> + : public result_field_base> { template void _bind(Target& target, size_t index) @@ -53,11 +53,11 @@ namespace sqlpp } }; - template + template inline std::ostream& operator<<( - std::ostream& os, const result_field_t>& e) + std::ostream& os, const result_field_t>& e) { - if (e.is_null() and not NullIsTrivialValue) + if (e.is_null()) { os << "NULL"; } diff --git a/include/sqlpp11/data_types/floating_point/result_field.h b/include/sqlpp11/data_types/floating_point/result_field.h index 2d298337..4a267919 100644 --- a/include/sqlpp11/data_types/floating_point/result_field.h +++ b/include/sqlpp11/data_types/floating_point/result_field.h @@ -36,9 +36,9 @@ namespace sqlpp { - template - struct result_field_t> - : public result_field_base> + template + struct result_field_t> + : public result_field_base> { template void _bind(Target& target, size_t index) diff --git a/include/sqlpp11/data_types/integral/result_field.h b/include/sqlpp11/data_types/integral/result_field.h index aee172f9..e8051655 100644 --- a/include/sqlpp11/data_types/integral/result_field.h +++ b/include/sqlpp11/data_types/integral/result_field.h @@ -35,9 +35,9 @@ namespace sqlpp { - template - struct result_field_t> - : public result_field_base> + template + struct result_field_t> + : public result_field_base> { template void _bind(Target& target, size_t index) diff --git a/include/sqlpp11/data_types/no_value/result_field.h b/include/sqlpp11/data_types/no_value/result_field.h index 1aa55222..8c677a15 100644 --- a/include/sqlpp11/data_types/no_value/result_field.h +++ b/include/sqlpp11/data_types/no_value/result_field.h @@ -33,8 +33,8 @@ namespace sqlpp { - template - struct result_field_t> + template + struct result_field_t> { template void _bind(Target& /*unused*/, size_t /*unused*/) @@ -60,10 +60,10 @@ namespace sqlpp } }; - template + template inline std::ostream& operator<<( std::ostream& os, - const result_field_t>& /*unused*/) + const result_field_t>& /*unused*/) { os << "NULL"; return os; diff --git a/include/sqlpp11/data_types/text/result_field.h b/include/sqlpp11/data_types/text/result_field.h index 6d82cf51..01a3d0f5 100644 --- a/include/sqlpp11/data_types/text/result_field.h +++ b/include/sqlpp11/data_types/text/result_field.h @@ -36,9 +36,9 @@ namespace sqlpp { - template - struct result_field_t> - : public result_field_base> + template + struct result_field_t> + : public result_field_base> { const char* text{nullptr}; // Non-owning size_t len{}; @@ -74,11 +74,11 @@ namespace sqlpp } }; - template + template inline std::ostream& operator<<( - std::ostream& os, const result_field_t>& e) + std::ostream& os, const result_field_t>& e) { - if (e.is_null() and not NullIsTrivialValue) + if (e.is_null()) { return os << "NULL"; } diff --git a/include/sqlpp11/data_types/time_of_day/result_field.h b/include/sqlpp11/data_types/time_of_day/result_field.h index 17e6bfd8..fe659ff4 100644 --- a/include/sqlpp11/data_types/time_of_day/result_field.h +++ b/include/sqlpp11/data_types/time_of_day/result_field.h @@ -37,9 +37,9 @@ namespace sqlpp { - template - struct result_field_t> - : public result_field_base> + template + struct result_field_t> + : public result_field_base> { template void _bind(Target& target, size_t i) @@ -54,11 +54,11 @@ namespace sqlpp } }; - template + template inline std::ostream& operator<<( - std::ostream& os, const result_field_t>& e) + std::ostream& os, const result_field_t>& e) { - if (e.is_null() and not NullIsTrivialValue) + if (e.is_null()) { os << "NULL"; } diff --git a/include/sqlpp11/data_types/time_point/result_field.h b/include/sqlpp11/data_types/time_point/result_field.h index 2b6c4031..7bc17c6d 100644 --- a/include/sqlpp11/data_types/time_point/result_field.h +++ b/include/sqlpp11/data_types/time_point/result_field.h @@ -37,9 +37,9 @@ namespace sqlpp { - template - struct result_field_t> - : public result_field_base> + template + struct result_field_t> + : public result_field_base> { template void _bind(Target& target, size_t i) @@ -54,11 +54,11 @@ namespace sqlpp } }; - template + template inline std::ostream& operator<<( - std::ostream& os, const result_field_t>& e) + std::ostream& os, const result_field_t>& e) { - if (e.is_null() and not NullIsTrivialValue) + if (e.is_null()) { os << "NULL"; } diff --git a/include/sqlpp11/data_types/unsigned_integral/result_field.h b/include/sqlpp11/data_types/unsigned_integral/result_field.h index 19f68037..ded6ff15 100644 --- a/include/sqlpp11/data_types/unsigned_integral/result_field.h +++ b/include/sqlpp11/data_types/unsigned_integral/result_field.h @@ -35,9 +35,9 @@ namespace sqlpp { - template - struct result_field_t> - : public result_field_base> + template + struct result_field_t> + : public result_field_base> { template void _bind(Target& target, size_t index) diff --git a/include/sqlpp11/detail/field_index_sequence.h b/include/sqlpp11/detail/field_index_sequence.h index 22e2abc0..9045e63c 100644 --- a/include/sqlpp11/detail/field_index_sequence.h +++ b/include/sqlpp11/detail/field_index_sequence.h @@ -51,10 +51,9 @@ namespace sqlpp typename NameType, typename ValueType, bool CanBeNull, - bool NullIsTrivialValue, typename... Rest> struct make_field_index_sequence_impl, - field_spec_t, + field_spec_t, Rest...> { using type = typename make_field_index_sequence_impl, diff --git a/include/sqlpp11/eval.h b/include/sqlpp11/eval.h index d07faae7..361c7831 100644 --- a/include/sqlpp11/eval.h +++ b/include/sqlpp11/eval.h @@ -44,7 +44,7 @@ namespace sqlpp "Expression cannot be used in eval because it requires tables"); using _name_type = alias::a_t::_alias_t; using _value_type = value_type_of; - using _field_spec = field_spec_t<_name_type, _value_type, true, false>; + using _field_spec = field_spec_t<_name_type, _value_type, true>; using type = result_field_t; }; diff --git a/include/sqlpp11/expression.h b/include/sqlpp11/expression.h index 2d81a4f1..9e53f36a 100644 --- a/include/sqlpp11/expression.h +++ b/include/sqlpp11/expression.h @@ -45,7 +45,7 @@ namespace sqlpp { using _traits = make_traits; using _lhs_t = Lhs; - using _rhs_t = rhs_wrap_t, trivial_value_is_null_t<_lhs_t>::value>; + using _rhs_t = rhs_wrap_t>; using _nodes = detail::type_vector<_lhs_t, _rhs_t>; binary_expression_t(Lhs lhs, Rhs rhs) : _lhs(lhs), _rhs(rhs) @@ -93,7 +93,7 @@ namespace sqlpp { using _traits = make_traits; using _lhs_t = Lhs; - using _rhs_t = rhs_wrap_t, trivial_value_is_null_t<_lhs_t>::value>; + using _rhs_t = rhs_wrap_t>; using _nodes = detail::type_vector<_lhs_t, _rhs_t>; binary_expression_t(Lhs lhs, Rhs rhs) : _lhs(lhs), _rhs(rhs) @@ -164,16 +164,8 @@ namespace sqlpp static Context& _(const T& t, Context& context) { context << "("; - if (trivial_value_is_null_t::value) - { - serialize_operand(t._rhs, context); - context << " IS NULL "; - } - else - { - context << "NOT "; - serialize_operand(t._rhs, context); - } + context << "NOT "; + serialize_operand(t._rhs, context); context << ")"; return context; diff --git a/include/sqlpp11/field_spec.h b/include/sqlpp11/field_spec.h index 2e1418de..dbc8ff26 100644 --- a/include/sqlpp11/field_spec.h +++ b/include/sqlpp11/field_spec.h @@ -31,13 +31,12 @@ namespace sqlpp { - template + template struct field_spec_t { using _traits = make_traits, - tag_if>; + tag_if>; using _nodes = detail::type_vector<>; using _alias_t = NameType; @@ -64,20 +63,17 @@ namespace sqlpp template - struct is_field_compatible, - field_spec_t> + bool RightCanBeNull> + struct is_field_compatible, + field_spec_t> { static constexpr auto value = std::is_same::value and std::is_same::value and // Same value type - (LeftCanBeNull or !RightCanBeNull) and // The left hand side determines the result row and therefore must allow - // NULL if the right hand side allows it - (LeftNullIsTrivial or !RightNullIsTrivial); // as above + (LeftCanBeNull or !RightCanBeNull); // The left hand side determines the result row and therefore must allow + // NULL if the right hand side allows it }; template @@ -100,8 +96,7 @@ namespace sqlpp using type = field_spec_t, - logic::any_t<_can_be_null, _depends_on_outer_table>::value, - null_is_trivial_value_t::value>; + logic::any_t<_can_be_null, _depends_on_outer_table>::value>; }; template diff --git a/include/sqlpp11/insert_value.h b/include/sqlpp11/insert_value.h index d84b9f8f..c78e5b54 100644 --- a/include/sqlpp11/insert_value.h +++ b/include/sqlpp11/insert_value.h @@ -61,33 +61,32 @@ namespace sqlpp { using _is_insert_value = std::true_type; using _column_t = Column; - static constexpr bool _trivial_value_is_null = trivial_value_is_null_t::value; using _pure_value_t = typename value_type_of::_cpp_value_type; using _wrapped_value_t = wrap_operand_t<_pure_value_t>; using _tvin_t = tvin_t<_wrapped_value_t>; using _value_or_null_t = value_or_null_t; - insert_value_t(rhs_wrap_t<_wrapped_value_t, _trivial_value_is_null> rhs) + insert_value_t(rhs_wrap_t<_wrapped_value_t> rhs) : _is_null(rhs._is_null()), _is_default(rhs._is_default()), _value(rhs._expr._t) { } - insert_value_t(rhs_wrap_t<_tvin_t, _trivial_value_is_null> rhs) + insert_value_t(rhs_wrap_t<_tvin_t> rhs) : _is_null(rhs._is_null()), _is_default(rhs._is_default()), _value(rhs._expr._value) { } - insert_value_t(const rhs_wrap_t& /*unused*/) + insert_value_t(const rhs_wrap_t& /*unused*/) : _is_null(true), _is_default(false), _value{} { } - insert_value_t(const rhs_wrap_t& /*unused*/) + insert_value_t(const rhs_wrap_t& /*unused*/) : _is_null(false), _is_default(true), _value{} { } - insert_value_t(const rhs_wrap_t<_value_or_null_t, _trivial_value_is_null>& rhs) + insert_value_t(const rhs_wrap_t<_value_or_null_t>& rhs) : _is_null(rhs._expr._is_null), _is_default(false), _value{rhs._expr._value} { } @@ -111,7 +110,7 @@ namespace sqlpp static Context& _(const T& t, Context& context) { - if ((trivial_value_is_null_t::value and t._value._is_trivial()) or t._is_null) + if (t._is_null) { context << "NULL"; } diff --git a/include/sqlpp11/result_field.h b/include/sqlpp11/result_field.h index 66b2d90a..31ae307b 100644 --- a/include/sqlpp11/result_field.h +++ b/include/sqlpp11/result_field.h @@ -49,7 +49,7 @@ namespace sqlpp static Context& _(const T& t, Context& context) { - if (t.is_null() and not null_is_trivial_value_t::value) + if (t.is_null()) { context << "NULL"; } diff --git a/include/sqlpp11/result_field_base.h b/include/sqlpp11/result_field_base.h index 10f517f0..e2d72c3c 100644 --- a/include/sqlpp11/result_field_base.h +++ b/include/sqlpp11/result_field_base.h @@ -47,13 +47,9 @@ namespace sqlpp using _cpp_value_type = typename value_type_of::_cpp_value_type; using _cpp_storage_type = StorageType; - static constexpr bool _null_is_trivial = - column_spec_can_be_null_t<_field_spec_t>::value and - (null_is_trivial_value_t<_field_spec_t>::value or not enforce_null_result_treatment_t<_db_t>::value); using _traits = make_traits, tag::is_result_field, - tag::is_expression, - tag_if>; + tag::is_expression>; using _nodes = detail::type_vector<>; using _can_be_null = column_spec_can_be_null_t<_field_spec_t>; @@ -112,21 +108,12 @@ namespace sqlpp if (_is_null) { - if (not _null_is_trivial) - { - throw exception("accessing value of NULL field"); - } - else - { return {}; - } } return _value; } - operator typename std::conditional<_null_is_trivial or (not _can_be_null::value), - _cpp_value_type, - assert_result_field_value_is_safe_t>::type() const + operator _cpp_value_type() const { return value(); } diff --git a/include/sqlpp11/result_row.h b/include/sqlpp11/result_row.h index 65f5d103..a4568f1f 100644 --- a/include/sqlpp11/result_row.h +++ b/include/sqlpp11/result_row.h @@ -272,7 +272,7 @@ namespace sqlpp { using _field_index_sequence = detail::make_field_index_sequence<0, FieldSpecs...>; using _impl = detail::result_row_impl; - using _field_type = result_field_t>; + using _field_type = result_field_t>; bool _is_valid{false}; std::vector _dynamic_field_names; diff --git a/include/sqlpp11/rhs_wrap.h b/include/sqlpp11/rhs_wrap.h index 4d8ccb91..1c1deee1 100644 --- a/include/sqlpp11/rhs_wrap.h +++ b/include/sqlpp11/rhs_wrap.h @@ -67,11 +67,6 @@ namespace sqlpp { static bool _(const Expr& t) { - if (null_is_trivial_value_t::value) - { - return t.is_null(); - } - if (t.is_null()) { return false; @@ -109,7 +104,7 @@ namespace sqlpp }; } // namespace detail - template + template struct rhs_wrap_t { using _traits = typename Expr::_traits; @@ -127,7 +122,7 @@ namespace sqlpp bool _is_null() const { - return (TrivialValueIsNull and detail::rhs_is_trivial_t::_(_expr)) or detail::rhs_is_null_t::_(_expr); + return detail::rhs_is_null_t::_(_expr); } static constexpr bool _is_default() @@ -138,11 +133,11 @@ namespace sqlpp Expr _expr; }; - template - struct serializer_t> + template + struct serializer_t> { using _serialize_check = serialize_check_of; - using T = rhs_wrap_t; + using T = rhs_wrap_t; static Context& _(const T& t, Context& context) { diff --git a/include/sqlpp11/type_traits.h b/include/sqlpp11/type_traits.h index 7db9ac53..bcf10e10 100644 --- a/include/sqlpp11/type_traits.h +++ b/include/sqlpp11/type_traits.h @@ -173,8 +173,6 @@ namespace sqlpp SQLPP_VALUE_TRAIT_GENERATOR(must_not_insert) SQLPP_VALUE_TRAIT_GENERATOR(must_not_update) SQLPP_VALUE_TRAIT_GENERATOR(require_insert) - SQLPP_VALUE_TRAIT_GENERATOR(trivial_value_is_null) - SQLPP_VALUE_TRAIT_GENERATOR(null_is_trivial_value) SQLPP_VALUE_TRAIT_GENERATOR(is_statement) SQLPP_VALUE_TRAIT_GENERATOR(is_prepared_statement) diff --git a/test_constraints/CMakeLists.txt b/test_constraints/CMakeLists.txt index e88f1a02..f3d9ed61 100644 --- a/test_constraints/CMakeLists.txt +++ b/test_constraints/CMakeLists.txt @@ -42,7 +42,6 @@ endfunction() # Compiling these is required to fail (testing some static_assert) test_constraint(count_of_count "count\\(\\) cannot be used on an aggregate function") test_constraint(max_of_max "max\\(\\) cannot be used on an aggregate function") -test_constraint(no_conversion_operator_if_null_not_trivial "cannot convert|no viable conversion") test_constraint(require_insert "required column is missing") test_constraint(must_not_insert "one assignment is prohibited") test_constraint(must_not_update "one assignment is prohibited") diff --git a/test_constraints/no_conversion_operator_if_null_not_trivial.cpp b/test_constraints/no_conversion_operator_if_null_not_trivial.cpp deleted file mode 100644 index bd4934df..00000000 --- a/test_constraints/no_conversion_operator_if_null_not_trivial.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2013-2015, Roland Bock - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * NOTE: - * This code must not compile (it is used to test the absence of a conversion operator) - */ - -#include "Sample.h" -#include "MockDb.h" -#include - -EnforceDb edb{}; - -int main() -{ - const auto t = test::TabBar{}; - - static_assert(sqlpp::can_be_null_t::value, "t.alpha can be null"); - static_assert(not sqlpp::null_is_trivial_value_t::value, "t.alpha does not say null_is_trivial"); - - for (const auto& row : edb(select(all_of(t)).from(t).unconditionally())) - { - static_assert(sqlpp::can_be_null_t::value, "row.alpha can be null"); - static_assert(not sqlpp::null_is_trivial_value_t::value, - "row.alpha does not interpret null_is_trivial"); - - int i = row.alpha; - } - - return 0; -} diff --git a/test_serializer/Insert.cpp b/test_serializer/Insert.cpp index 5cacf6eb..dd4c6806 100644 --- a/test_serializer/Insert.cpp +++ b/test_serializer/Insert.cpp @@ -45,6 +45,8 @@ int Insert(int, char* []) compare(__LINE__, insert_into(bar).default_values(), "INSERT INTO tab_bar DEFAULT VALUES"); compare(__LINE__, insert_into(bar).set(bar.beta = "cheesecake", bar.gamma = true), "INSERT INTO tab_bar (beta,gamma) VALUES('cheesecake'," + getTrue() + ")"); + compare(__LINE__, insert_into(bar).set(bar.beta = ::sqlpp::tvin(""), bar.gamma = true), + "INSERT INTO tab_bar (beta,gamma) VALUES(NULL," + getTrue() + ")"); #if __cplusplus >= 201703L // string_view argument std::string_view cheeseCake = "cheesecake"; diff --git a/test_serializer/Where.cpp b/test_serializer/Where.cpp index 6e568196..0527525e 100644 --- a/test_serializer/Where.cpp +++ b/test_serializer/Where.cpp @@ -63,6 +63,7 @@ int Where(int, char*[]) // Sometimes compare(__LINE__, where(bar.gamma), " WHERE tab_bar.gamma"); compare(__LINE__, where(bar.gamma == false), " WHERE (tab_bar.gamma=" + getFalse() + ")"); + compare(__LINE__, where(bar.gamma == ::sqlpp::tvin(false)), " WHERE (tab_bar.gamma IS NULL)"); compare(__LINE__, where(bar.beta == "SQL"), " WHERE (tab_bar.beta='SQL')"); #if __cplusplus >= 201703L // string_view argument diff --git a/tests/MockDb.h b/tests/MockDb.h index ef781a88..6732c4a1 100644 --- a/tests/MockDb.h +++ b/tests/MockDb.h @@ -42,12 +42,10 @@ struct InternalMockData sqlpp::isolation_level _default_isolation_level; }; -template -struct MockDbT : public sqlpp::connection +struct MockDb : public sqlpp::connection { using _traits = - ::sqlpp::make_traits<::sqlpp::no_value_t, - ::sqlpp::tag_if<::sqlpp::tag::enforce_null_result_treatment, enforceNullResultTreatment>>; + ::sqlpp::make_traits<::sqlpp::no_value_t>; struct _serializer_context_t { @@ -289,9 +287,6 @@ struct MockDbT : public sqlpp::connection InternalMockData _mock_data; }; -using MockDb = MockDbT; -using EnforceDb = MockDbT; - struct MockSizeDb : public sqlpp::connection { using _traits = MockDb::_traits; @@ -500,7 +495,4 @@ struct MockSizeDb : public sqlpp::connection InternalMockData _mock_data; }; -using MockDb = MockDbT; -using EnforceDb = MockDbT; - #endif diff --git a/tests/Result.cpp b/tests/Result.cpp index aac0f0e8..86114176 100644 --- a/tests/Result.cpp +++ b/tests/Result.cpp @@ -28,24 +28,18 @@ #include "MockDb.h" #include -static_assert(not sqlpp::enforce_null_result_treatment_t::value, "MockDb interprets NULL as trivial"); -static_assert(sqlpp::enforce_null_result_treatment_t::value, "MockDb does not interpret NULL as trivial"); - int Result(int, char* []) { MockDb db = {}; - EnforceDb edb{}; const auto t = test::TabBar{}; static_assert(sqlpp::can_be_null_t::value, "t.alpha can be null"); - static_assert(not sqlpp::null_is_trivial_value_t::value, "t.alpha does not say null_is_trivial"); // Using a non-enforcing db for (const auto& row : db(select(all_of(t), t.beta.like("")).from(t).unconditionally())) { static_assert(sqlpp::can_be_null_t::value, "row.alpha can be null"); - static_assert(sqlpp::null_is_trivial_value_t::value, "row.alpha interprets null_is_trivial"); static_assert(std::is_same::value, "Yikes"); using T = sqlpp::wrap_operand_t; static_assert(sqlpp::can_be_null_t::value, "row.alpha can be null"); @@ -67,24 +61,14 @@ int Result(int, char* []) for (const auto& row : db(select(all_of(t)).from(t).unconditionally())) { static_assert(sqlpp::can_be_null_t::value, "row.alpha can be null"); - static_assert(sqlpp::null_is_trivial_value_t::value, "row.alpha interprets null_is_trivial"); } - // Using a non-enforcing db - for (const auto& row : edb(select(all_of(t)).from(t).unconditionally())) + for (const auto& row : db(select(all_of(t)).from(t).unconditionally())) { static_assert(sqlpp::can_be_null_t::value, "row.alpha can be null"); - static_assert(not sqlpp::null_is_trivial_value_t::value, - "row.alpha interprets null_is_trivial"); } sqlpp::select((t.alpha + 1).as(t.alpha)).flags(sqlpp::all).from(t); - for (const auto& row : edb(select(all_of(t)).from(t).unconditionally())) - { - static_assert(sqlpp::can_be_null_t::value, "row.alpha can be null"); - static_assert(not sqlpp::null_is_trivial_value_t::value, - "row.alpha interprets null_is_trivial"); - } return 0; }