Commit cb621471 authored by Aleksey Vinogradov's avatar Aleksey Vinogradov

Merge branch 'etersoft'

Conflicts: extensions/DBServer-MySQL/DBInterface.cc
parents 36ba9983 0eb012ac
......@@ -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
......
......@@ -34,6 +34,9 @@ queryok(false),
connected(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()
......@@ -45,10 +48,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;
......@@ -110,7 +109,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