- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
为这个系上安全带。
很奇怪,我在网上找不到任何关于此类错误的信息,但这让我抓狂。希望你们能对这个问题有所了解。
我正在使用 MySQL++ 从表中获取一些基本数据。它可以很好地连接到数据库并且查询似乎有效,但是运行 mysql::Query::store() 会导致 malloc 错误。
mysqlpp::Connection conn(false);
if(conn.connect("demo", "127.0.0.1", "root", "")) // works
{
std::string sql = "SELECT * FROM `items`";
mysqlpp::Query query = conn.query(sql); // works
mysqlpp::StoreQueryResult res = query.store(); // fails
if(res)
{
mysqlpp::StoreQueryResult::const_iterator it;
for(it = res.begin(); it != res.end(); ++it)
{
mysqlpp::Row row = *it;
// Do some things
}
}
else
{
std::cerr<<"Failed to get item list: "<<query.error()<<std::endl;
return false;
}
}
else
{
std::cerr<<"DB connection failed: "<<conn.error()<<std::endl;
return false;
}
gdb 回溯给了我
(gdb) backtrace
#0 0x00007fff841ed499 in malloc_error_break ()
#1 0x00007fff84117183 in free ()
#2 0x000000010029d66c in mysqlpp::Field::~Field ()
#3 0x0000000100493e4d in mysqlpp::ResultBase::ResultBase (this=0x1004805c8, res=0x100480660, dbd=0x100480660, te=122) at result.cpp:40
#4 0x0000000100494690 in mysqlpp::StoreQueryResult::StoreQueryResult (this=0x100480730, res=0x100303e30, dbd=0x100802600) at result.cpp:103
#5 0x0000000100491242 in mysqlpp::Query::store (this=0x3, str=0x100303da0 "SELECT * FROM `items`", len=4298128944) at query.cpp:534
#6 0x00000001004916dc in mysqlpp::Query::store (this=0x3, s=@0x100480848) at query.cpp:508
#7 0x00000001004917c3 in mysqlpp::Query::store (this=0x3) at query.cpp:483
#8 0x0000000100297464 in Load ()
....
Load () 是正在运行的函数。
IF 我做了两次查询(我这样做是出于好奇),
mysqlpp::Query query = conn.query(sql);
query = conn.query(sql);
mysqlpp::StoreQueryResult res = query.store();
我没有收到 malloc 错误,但我收到了 SQL 错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM `items`' at line 1
我的g++版本是
g++ (MacPorts gcc47 4.7.3_0) 4.7.3
有什么想法吗?我以前使用过 MySQL++,对此我从来没有遇到过任何问题。
此外,这个 Load() 序列恰好在一个动态链接库中。(我有一个加载/卸载系统。)如果我注释掉 MySQL 部分,编译并加载库, 一切安好。如果我然后取消注释该部分,重新编译并重新加载库(主程序仍在运行),查询将成功运行!!! wtf
任何帮助都是不可思议的。谢谢!!
最佳答案
同样的问题。我的解决方案,检查行是否:
mysqlpp::StoreQueryResult res = query.store(); // fails
if(res.num_rows()){
...
}
关于c++ - mysqlpp::Query::store() 上的 MySQL++ malloc_error_break,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16431260/
我一直在尝试将 Redux 集成到项目中。 我按照使用示例进行操作,但收到错误store.getState is not a function。 所以我知道其他人也问过类似的问题,但情况略有不同。 R
我正在尝试将我的第一个应用程序上传到 App Store。我已完成 iTunes Connect 所需的所有步骤,我的应用程序状态为“等待上传”。 我相信下一步是使用 Application Load
已关闭。这个问题是 off-topic 。目前不接受答案。 想要改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 已关闭10 年前。 Improve th
App Store 有所谓的“服务器到服务器”通知。也就是说,当您购买应用内功能时,Apple 服务器会向您服务器的回调方法(发送收据数据)发出 HTTPS 请求。 问题是 - 收据数据中似乎没有用户
我已经将我的第一个应用程序上载到App Store,但是我没有放置我的App需要位置服务和wifi的UIRequiredDeviceCapabilities。结果:该应用程序没有像应做的那样开始寻找坐
由于iOS 8将于本月发布,并且我的应用仅支持32位(因为第3个库仅兼容32位),因此我不确定如果我将新版本的应用提交给我,则该应用的新版本是否会被拒绝App Store将于下个月发布,因为它不支持6
我有一个让我有些困惑的问题。 为了将我的应用提交到App Store,我必须输入Bundle ID后缀。如您所知,Bundle ID会获得Bundle ID后缀的确切名称(您在Bundle ID后缀上
如问题所述,我想知道更新后的应用程序一旦获得批准,是否会自动发布到应用程序商店中? 我的更新已完成并且已经过测试,由于需要几天的时间才能批准,因此我希望现在将其提交批准。同时,我需要在服务器上更改一些
获取应用程序提交到 Apple App Store 的屏幕截图的最简单方法是什么,需要包含的各种尺寸是多少? 另外,是否允许状态栏?我相信我听说它不是,但是包括 Facebook 和 Quora 在内
我在 iTunes 商店中有一个应用程序,其分发证书(在 key 链访问中)将于明天到期。它是一年前生成的,尽管我最近更新了我的 iPhone 开发者计划,但我还没有更新任何证书或签名。 当我将测试设
我的商店包含以下 reducer : export const centralStampState = { layoutState : layoutReducer, //this one is n
我即将将我的应用程序提交到 Apple App Store,并且我了解到 Apple 需要两周时间才能对其进行审核,然后才能上线。但是,在 iTunes Connect 的定价部分,它询问我什么时候发
如果我的应用程序正在接受审核或已获得批准(因此处于 Ready For Sale 状态或同等状态),我可以编辑哪些应用程序信息而无需提交应用程序的新版本? 最佳答案 据此Apple Documenta
我已经在Opera管理控制台上进行了全面检查,看不到他们在哪里提到付款方式。他们说明何时制作,但没有说明。即Paypal,Cheque等。 有人知道他们如何付款吗? 最佳答案 当金额达到200美元时,
我上传了我的二进制文件并创建了屏幕截图。我做的所有屏幕截图都是 640x960,我将它们上传为 PNG。这背后的想法是,我应该以尽可能最好的质量把它交给他们,这样当他们将它们重新压缩成 320x480
我从Microsoft下载了Windows 8 app samples,并下载了这些示例之一加速度传感器示例 我不知道如何测试它以计划使用此功能的软件? 我没有水面设备,想知道只有一种方法可以做到吗?
我正在为TestFlight上传第二个应用程序。第一次进展顺利,但这次却被拒绝了。 We have started the review of your beta app, but we are no
不确定这是正确的论坛,如果不是,我提前道歉。 某处是否有 App Store 新版本的提要?还是带有类别和发布日期的应用提要/列表? 此列表已从 App Store 中消失,我想看看是否可以制作一个应
我有一个 JSON 存储,定义如下 var subAccountStore = new Ext.data.JsonStore({ autoLoad: true, proxy: { ty
我有一个提交到应用商店的应用被拒绝,原因是: 2.30 不符合 Mac OS X 文件系统文档的应用将被拒绝 他们声称我的应用正在修改不受支持的 ~/Library/Preferences/com.a
我是一名优秀的程序员,十分优秀!