sqlite_orm icon indicating copy to clipboard operation
sqlite_orm copied to clipboard

SOS

Open fool404 opened this issue 3 years ago • 4 comments

 const auto filter0 =  c(&TestRec::Get_m_strStopTime) == "00-00-00";
 const auto filter1 =  not m_oCheckBox[0].GetCheck() or c(&TestRec::Get_m_nWorkStationID) == nID;
 const auto filter2 = not m_oCheckBox[1].GetCheck() or c(&TestRec::Get_m_strBatchNo) == strOrderNo;
 const auto filter3 =  not m_oCheckBox[2].GetCheck() or like(&TestRec::Get_m_strStartTime, strStartTime +"%");

  auto v = dv.m_ptrStorage->get_all<TestRec>(where( filter2 /*&& filter1 && filter2 &&  filter3*/));


If I use constants, it works fine, such as the first one. If I use string variables, the source code error location is as follows

      template<class A, class T, class E>
        std::string string_from_expression(const conditions::like_t<A, T, E> &l, bool noTableName) const {
            std::stringstream ss;
            ss << this->string_from_expression(l.arg, noTableName) << " ";
            ss << static_cast<std::string>(l) << " ";
            ss << this->string_from_expression(l.pattern, noTableName);
            l.arg3.apply([&ss, this, noTableName](auto &value) {
                ss << " ESCAPE " << this->string_from_expression(value, noTableName);
            });
            return ss.str();
        }

fool404 avatar Jul 08 '22 05:07 fool404

 const auto filter0 =  c(&TestRec::Get_m_strStopTime) == "00-00-00";
 const auto filter1 =  not m_oCheckBox[0].GetCheck() or c(&TestRec::Get_m_nWorkStationID) == nID;
 const auto filter2 = not m_oCheckBox[1].GetCheck() or c(&TestRec::Get_m_strBatchNo) == strOrderNo;
 const auto filter3 =  not m_oCheckBox[2].GetCheck() or like(&TestRec::Get_m_strStartTime, strStartTime +"%");

  auto v = dv.m_ptrStorage->get_all<TestRec>(where( filter2 /*&& filter1 && filter2 &&  filter3*/));


If I use constants, it works fine, such as the first one. If I use string variables, the source code error location is as follows

      template<class A, class T, class E>
        std::string string_from_expression(const conditions::like_t<A, T, E> &l, bool noTableName) const {
            std::stringstream ss;
            ss << this->string_from_expression(l.arg, noTableName) << " ";
            ss << static_cast<std::string>(l) << " ";
            ss << this->string_from_expression(l.pattern, noTableName);
            l.arg3.apply([&ss, this, noTableName](auto &value) {
                ss << " ESCAPE " << this->string_from_expression(value, noTableName);
            });
            return ss.str();
        }

fool404 avatar Jul 08 '22 06:07 fool404

post make_storage call to repro this issue

fnc12 avatar Jul 08 '22 06:07 fnc12

@fool404 also post error text and line

fnc12 avatar Jul 21 '22 08:07 fnc12

@fool404 are you here?

fnc12 avatar Jul 25 '22 20:07 fnc12

closing due to inactivity

fnc12 avatar Oct 08 '23 13:10 fnc12