Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xmh0511 committed May 15, 2020
1 parent 88dcdb4 commit 4af97ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 2.8)
set(project_name xorm)
project(${project_name})
SET(ENABLE_XORM ON)
SET(ENABLE_MYSQL OFF)
SET(ENABLE_SQLITE ON)
SET(ENABLE_MYSQL ON)
SET(ENABLE_SQLITE OFF)
SET(ENABLE_SQLITE_CODEC OFF)
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest")
Expand Down
11 changes: 2 additions & 9 deletions xorm/mysql.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,15 +520,8 @@ namespace xorm {
auto rows = mysql_stmt_affected_rows(pStmt);
if (rows != 0) {
//bool cr = commit();
auto pr = query<std::tuple<mysql::Integer>>("SELECT LAST_INSERT_ID();");
if (pr.first) {
auto& id_arr = pr.second;
if (!id_arr.empty()) {
auto id = std::get<0>((id_arr[0]));
return { rows ,id.value() };
}
}
return { rows,0 };
auto key_id = mysql_insert_id(conn_);
return { rows,key_id };
}
return { 0 ,0 };
}
Expand Down

0 comments on commit 4af97ce

Please sign in to comment.