Commit eb9a3684 authored by Pavel Vainerman's avatar Pavel Vainerman

Окончательно исправлена ошибка с вылетом в ping(), при неинициализированном соединении.

parent 51e57c3e
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Name: libuniset Name: libuniset
Version: 1.0 Version: 1.0
Release: alt32 Release: alt33
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
License: GPL License: GPL
Group: Development/C++ Group: Development/C++
...@@ -207,6 +207,9 @@ rm -f %buildroot%_libdir/*.la ...@@ -207,6 +207,9 @@ rm -f %buildroot%_libdir/*.la
%changelog %changelog
* Thu May 19 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt33
- fixed bug in DBInterface::ping (again). Many thanks uzum
* Thu May 19 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt32 * Thu May 19 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt32
- fixed bug in DBInterface::nextRow function - fixed bug in DBInterface::nextRow function
- fixed bug in DBInterface::ping - fixed bug in DBInterface::ping
......
...@@ -220,11 +220,10 @@ bool DBInterface::moveToRow(int ind) ...@@ -220,11 +220,10 @@ bool DBInterface::moveToRow(int ind)
// ----------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------
bool DBInterface::ping() bool DBInterface::ping()
{ {
if(!mysql) if( !mysql || !connected )
return false;
if(!connected)
return false; return false;
// внимание mysql_ping возвращает 0
// внимание mysql_ping возвращает 0
// если всё хорошо.... (поэтому мы инвертируем) // если всё хорошо.... (поэтому мы инвертируем)
return !mysql_ping(mysql); return !mysql_ping(mysql);
} }
......
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