C mysql (C API Commands out of sync; you can't run this command now)
错误出现在当一个用户使用查询,另一个用户再使用此sql连接进行查询的时候;
原因是因为上一次使用此sql连接进行查询时没有将所有的结果集给释放掉,在所有使用此sql连接进行查询的地方将所有的结果集给释放掉,正确的做法如下
MYSQL_RES *result_ptr = mysql_store_result(tpSqlConn);
if (result_ptr)
{
MYSQL_ROW row = mysql_fetch_row(result_ptr);
if (row)
{
rtn_str = row[];
} mysql_free_result(result_ptr); // 释放当前查询的所有结果集. 否则下次查询将会出错.
while (!mysql_next_result(tpSqlConn))
{
result_ptr = mysql_store_result(tpSqlConn);
mysql_free_result(result_ptr);
}
}
C mysql (C API Commands out of sync; you can't run this command now)的更多相关文章
- python mysql 2014 Commands out of sync; you can't run this command now
这个问题出现再 mysql和c 的api. 简单的解决方法是不使用api直接把整个连接和命令传过去. 例如,cmd = 'mysql -h 192.168.32.210 -P 3316 -u bfd ...
- 使用otl,报错:mysql Commands out of sync; you can't run this command now
1.代码如下: void TestCache(otl_connect& otlConn) { try { ] = {}; sprintf(sql,"call test1(1)&quo ...
- error:2014 Commands out of sync; you can't run this command now
如下错误: 分析原因: 前端ajax请求后台,共用同一个链接. 搜索别人的解决方案:http://blog.csdn.net/grass_ring/article/details/3499402 用m ...
- _mysql_exceptions.ProgrammingError:(2014, "commands out of sync; you can't run this command now")
今天,测试dashboard上的一些graph, 发现,当多个graph同时向后台请求数据(异步)的时候, 出现了上述错误.而且,三个bug交替出现,另外两个bug分别是:python stop re ...
- mysql_query error:Commands out of sync;you can't run this command now
MYSQL_REST *result没有释放, 用mysql_free_result(result)即可.
- centos下安装mysql(安装,启动,停止,服务端口查询,用户密码设定)
http://www.2cto.com/database/201305/208114.html http://smilemonkey.iteye.com/blog/673848 netstat -na ...
- MySql: ”Commands out of sync“Error (Connect/C++)
使用 Connector/C++ 查询 Mysql , 连续调用存储过程时 会出现如下: Commands out of sync; you can't run this command now,st ...
- CDH版本大数据集群下搭建Hue(hadoop-2.6.0-cdh5.5.4.gz + hue-3.9.0-cdh5.5.4.tar.gz)(博主推荐)
不多说,直接上干货! 我的集群机器情况是 bigdatamaster(192.168.80.10).bigdataslave1(192.168.80.11)和bigdataslave2(192.168 ...
- 亿级用户下的新浪微博平台架构 前端机(提供 API 接口服务),队列机(处理上行业务逻辑,主要是数据写入),存储(mc、mysql、mcq、redis 、HBase等)
https://mp.weixin.qq.com/s/f319mm6QsetwxntvSXpKxg 亿级用户下的新浪微博平台架构 炼数成金前沿推荐 2014-12-04 序言 新浪微博在2014年3月 ...
随机推荐
- linq操作符:分区操作符
Linq中的分区指的是在不重新排列元素的情况下,将输入序列划分为两部分,然后返回其中一个部分的操作. 一.Take操作符 Take(int n)表示将从序列的开头返回数量为n的连续元素,常用于分页.其 ...
- 安装JDK时提示 IllegalArgumentException:Invalid characters in hostname的解决方法
今天在windows7_x64上安装JDK的时候提示IllegalArgumentException:Invalid characters in hostname, 解决方法: 1.打开[控制面板\系 ...
- 常用网络名词mark & 网络学习笔记
自 治 系 统 ( A S, A utonomous System ) IGP 内部网关协议 I n t e r i o r G a t e w a y P r o t o c o l 域 内 选 路 ...
- What is "found.000" ? How to deal with it?
最近在ubuntu系统中发现双系统的win盘中有一些文件夹,名字是“found.000”,甚是疑惑,遂查而记之. found.000文件夹里面的一些后缀名为CHK的文件是你在使用“磁盘碎片整理程序”整 ...
- 关于Python的装饰器 decorator
装饰器的原理:其实就是高阶函数,接收原函数以在之前之后进行操作. 语法格式是固定的:先定义一个函数,再使用@语法调用该函数. 例子一: import functools # 定义装饰器,固定格式 de ...
- Oracle数据库的语句级读一致性
数据库:Oracle 前提:假定100万行的记录,在最后一行有一个数据a=1. 实验:你在9:00的时候查找数据,9:05的时候查到最后一行:但是,在9:01的时候有人修改了最后一行数据并提交(com ...
- QA:Initialization of bean failed; nested exception is java.lang.AbstractMethodError
Q: <hibernate.version>5.2.10.Final</hibernate.version><dependency> <groupId> ...
- SQL Server 存储过程,带事务的存储过程(创建存储过程,删除存储过程,修改存储过
存储过程 创建存储过程 use pubs --pubs为数据库 go create procedure MyPRO --procedure为创建存储过程关键字,也可以简写proc,MyPRO为存储过程 ...
- ping失败的结果分析
①Request timed out 这是大家经常碰到的提示信息,很多文章中说这是对方机器置了过滤ICMP数据包,从上面工作过程来看,这是不完全正确的,至少有下几种情况. a. 对方已关机,或者网络上 ...
- MYSQL类型与JAVA类型对应表
MYSQL类型与JAVA类型对应表: 类型名称 显示长度 数据库类型 JAVA类型 JDBC类型索引(int) VARCHAR L+N VARCHAR java.lang.String 12 CHAR ...