testing and debugging
This commit is contained in:
parent
5d765958e5
commit
a1ab1339e3
10 changed files with 38 additions and 47 deletions
|
@ -305,6 +305,7 @@ DB::Session DB::MySQL::findSession(const std::string& accessToken) {
|
|||
|
||||
Statement session(con, selectSession);
|
||||
session.bind(a.data(), MYSQL_TYPE_STRING);
|
||||
session.execute();
|
||||
|
||||
std::vector<std::vector<std::any>> result = session.fetchResult();
|
||||
if (result.empty())
|
||||
|
|
|
@ -94,19 +94,19 @@ std::vector<std::vector<std::any>> DB::MySQL::Statement::fetchResult() {
|
|||
} break;
|
||||
case MYSQL_TYPE_TINY:
|
||||
line[i] = uint8_t{0};
|
||||
bind[i].buffer = &std::any_cast<std::string&>(line[i]);
|
||||
bind[i].buffer = &std::any_cast<uint8_t&>(line[i]);
|
||||
break;
|
||||
case MYSQL_TYPE_SHORT:
|
||||
line[i] = uint16_t{0};
|
||||
bind[i].buffer = &std::any_cast<std::string&>(line[i]);
|
||||
bind[i].buffer = &std::any_cast<uint16_t&>(line[i]);
|
||||
break;
|
||||
case MYSQL_TYPE_LONG:
|
||||
line[i] = uint32_t{0};
|
||||
bind[i].buffer = &std::any_cast<std::string&>(line[i]);
|
||||
bind[i].buffer = &std::any_cast<uint32_t&>(line[i]);
|
||||
break;
|
||||
case MYSQL_TYPE_LONGLONG:
|
||||
line[i] = uint64_t{0};
|
||||
bind[i].buffer = &std::any_cast<std::string&>(line[i]);
|
||||
bind[i].buffer = &std::any_cast<uint64_t&>(line[i]);
|
||||
break;
|
||||
default:
|
||||
throw std::runtime_error("Unsupported data fetching statement result " + std::to_string(field->type));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue