Commit 0eb012ac authored by Pavel Vainerman's avatar Pavel Vainerman

Исправил ошибки в DBInterface

parent ccbdc8a8
......@@ -3,7 +3,7 @@
Name: libuniset
Version: 1.0
Release: alt31
Release: alt32
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
......@@ -207,6 +207,10 @@ rm -f %buildroot%_libdir/*.la
%changelog
* Thu May 19 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt32
- fixed bug in DBInterface::nextRow function
- fixed bug in DBInterface::ping
* Fri May 13 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt31
- move DBServer-MySQL to extensions directory
- add pc-file for libUniSet-mysql
......
......@@ -33,6 +33,9 @@ lastQ(""),
queryok(false)
{
mysql = new MYSQL();
mysql_init(mysql);
// mysql_options(mysql,MYSQL_READ_DEFAULT_GROUP,"your_prog_name");
mysql_options(mysql,MYSQL_OPT_COMPRESS,0);
}
DBInterface::~DBInterface()
......@@ -44,10 +47,6 @@ DBInterface::~DBInterface()
// -----------------------------------------------------------------------------------------
bool DBInterface::connect( const string host, const string user, const string pswd, const string dbname)
{
mysql_init(mysql);
// mysql_options(mysql,MYSQL_READ_DEFAULT_GROUP,"your_prog_name");
mysql_options(mysql,MYSQL_OPT_COMPRESS,0);
if (!mysql_real_connect(mysql,host.c_str(), user.c_str(),pswd.c_str(),dbname.c_str(),0,NULL,0))
{
cout << error() << endl;
......@@ -108,7 +107,8 @@ bool DBInterface::nextRecord()
if( !mysql || !result || !queryok )
return false;
if( Row == mysql_fetch_row(result) )
Row = mysql_fetch_row(result);
if( Row )
return true;
return false;
......
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