码迷,mamicode.com
首页 > 数据库 > 详细

oracle读取ip_num用uint32_t接收,出错及解决

时间:2018-06-26 12:22:04      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:abort   discover   int   解决   result   符号   pass   接收   end   

 

start_ip_num = rset->getNumber(1);
end_ip_num = rset->getNumber(2);
2988 info_log("GetIpLibraryFromOracle data rset [%zu,%zu,%d]\n",rset->getNumber(1),rset->getNumber(2),rset->getNumber(3));
src/ResultToDB.cpp:2988: warning: cannot pass objects of non-POD type ‘class oracle::occi::Number‘ through ‘...‘; call will abort at runtime 

 

 

ip_num是ip转成数字的32位无符号整数。我用uint32_t 来接收从oracle读取的start_ip_num 和end_ip_num ,然后打印到Log里。结果是[3395598328,46913028405240,242],第一个数是正确的,第二个是错误的,原本第一个数和第个二数要相同(数据库里是相同的)。


uint32_t start_ip_num = 0;
uint32_t end_ip_num = 0;
start_ip_num = rset->getNumber(1);
end_ip_num = rset->getNumber(2);
int departid= rset->getNumber(3);

2018-06-12 15:44:17 src/ResultToDB.cpp:2723|flow_discover <INFO>GetIpLibraryFromOracle start

2018-06-12 15:44:17 src/ResultToDB.cpp:2990|GetIpLibraryFromOracle <INFO>GetIpLibraryFromOracle data [339
5598328,46913028405240,242]

2018-06-12 15:44:17 src/ResultToDB.cpp:2990|GetIpLibraryFromOracle <INFO>GetIpLibraryFromOracle data [339
5596779,46913028403691,242]

2018-06-12 15:44:17 src/ResultToDB.cpp:2990|GetIpLibraryFromOracle <INFO>GetIpLibraryFromOracle data [339
5598326,46913028405238,242]

2018-06-12 15:44:17 src/ResultToDB.cpp:2990|GetIpLibraryFromOracle <INFO>GetIpLibraryFromOracle data [339
5596757,46913028403669,242]

2018-06-12 15:44:17 src/ResultToDB.cpp:2990|GetIpLibraryFromOracle <INFO>GetIpLibraryFromOracle data [339
5598327,46913028405239,242]

2018-06-12 15:44:17 src/ResultToDB.cpp:2725|flow_discover <INFO>GetIpLibraryFromOracle end size[0]

第一个rset->getNumber(1)对了,rset->getNumber(2);错了

 

用uint64_t 接收就第一个数和第个二数相同。

2018-06-12 15:50:23 src/ResultToDB.cpp:2723|flow_discover <INFO>GetIpLibraryFromOracle start

2018-06-12 15:50:23 src/ResultToDB.cpp:2990|GetIpLibraryFromOracle <INFO>GetIpLibraryFromOracle data [339
5598328,3395598328,242]

2018-06-12 15:50:23 src/ResultToDB.cpp:2990|GetIpLibraryFromOracle <INFO>GetIpLibraryFromOracle data [339
5596779,3395596779,242]

2018-06-12 15:50:23 src/ResultToDB.cpp:2990|GetIpLibraryFromOracle <INFO>GetIpLibraryFromOracle data [339
5598326,3395598326,242]

2018-06-12 15:50:23 src/ResultToDB.cpp:2990|GetIpLibraryFromOracle <INFO>GetIpLibraryFromOracle data [339
5596757,3395596757,242]

2018-06-12 15:50:23 src/ResultToDB.cpp:2990|GetIpLibraryFromOracle <INFO>GetIpLibraryFromOracle data [339
5598327,3395598327,242]

2018-06-12 15:50:23 src/ResultToDB.cpp:2725|flow_discover <INFO>GetIpLibraryFromOracle end size[0]

为什么用uint32_t 第一个是对的,用uint64_t 两个都是对的??我目前还没有找出答案!

oracle读取ip_num用uint32_t接收,出错及解决

标签:abort   discover   int   解决   result   符号   pass   接收   end   

原文地址:https://www.cnblogs.com/baofengc/p/9228250.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!