znone
2017-08-20 72af90041a94e9806819255254b2d093d2a2a72d
修正在某些情况下不能绑定字段到左值的问题。
2 files modified
16 ■■■■ changed files
include/qtl_common.hpp 12 ●●●● patch | view | raw | blame | history
include/qtl_mysql.hpp 4 ●●●● patch | view | raw | blame | history
include/qtl_common.hpp
@@ -14,6 +14,8 @@
#include <type_traits>
#include <tuple>
#include <memory>
#include <string>
#include <vector>
#include <functional>
#include "apply_tuple.h"
@@ -98,6 +100,12 @@
inline void bind_param(Command& command, size_t index, const T& param)
{
    command.bind_param(index, param);
}
template<typename Command, typename T>
inline void bind_field(Command& command, size_t index, T& value)
{
    bind_field(command, index, std::forward<T>(value));
}
template<typename Command, typename T>
@@ -490,7 +498,7 @@
{
    inline void operator()(Command& command, T&& value) const
    {
        bind_field(command, 0, std::forward<T>(value));
        bind_field(command, 0, std::forward<typename std::remove_reference<T>::type>(value));
    }
};
@@ -671,7 +679,7 @@
    }
    template<typename Params>
    uint64_t insert_direct(const std::string& query_text, const Params& params)
    uint64_t insert(const std::string& query_text, const Params& params)
    {
        return insert(query_text.data(), query_text.length(), params);
    }
include/qtl_mysql.hpp
@@ -558,8 +558,8 @@
        m_mysql=src.m_mysql;
        src.m_mysql=NULL;
    }
    database& operator==(const database&) = delete;
    database& operator==(database&& src)
    database& operator=(const database&) = delete;
    database& operator=(database&& src)
    {
        if(this!=&src)
        {