Commit a3209cd2 authored by yiwenshao's avatar yiwenshao

modify reuse.cc:rawMySQLReturnValue_to_ResType to handle null input

parent 49d287e7
......@@ -225,7 +225,8 @@ main(int argc,char**argv) {
SharedProxyState *shared_ps =
new SharedProxyState(ci, embeddedDir , master_key, determineSecurityRating());
assert(shared_ps!=NULL);
std::string query1 = "insert into student values(1,\"ZHAOYUN\"),(2,'XC'),(3,'KK')";
//std::string query1 = "insert into student values(1,\"ZHAOYUN\"),(2,'XC'),(3,'KK')";
std::string query1 = "insert into student values(NULL)";
std::vector<std::string> querys{query1};
for(auto item:querys){
std::cout<<item<<std::endl;
......
......@@ -51,7 +51,7 @@ main() {
ConnectionInfo ci("localhost", "root", "letmein",3306);
SharedProxyState *shared_ps = new SharedProxyState(ci, embeddedDir , master_key, determineSecurityRating());
assert(shared_ps!=NULL);
std::string query1 = "insert into child values(1,\"zh Z D D\")";
std::string query1 = "insert into student values(NULL)";
std::vector<std::string> querys{query1};
for(auto item:querys){
std::cout<<item<<std::endl;
......
This diff is collapsed.
......@@ -121,8 +121,9 @@ ResType rawMySQLReturnValue_to_ResType(bool isNULL,rawMySQLReturnValue *inRow,in
for(auto inRows:inRow->rowValues) {
std::vector<Item *> curTempRow = itemNullVector(types.size());
for(int i=0;i< (int)(inRows.size());i++){
curTempRow[i] = (MySQLFieldTypeToItem(types[i],inRows[i]) );
}
if(inRows[i]!="NULL")
curTempRow[i] = (MySQLFieldTypeToItem(types[i],inRows[i]));//why unsinged processing is not needed here?
}
rows.push_back(curTempRow);
}
return ResType(true,0,in_last_insert_id,std::move(names),std::move(types),std::move(rows));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment