Commit eef31b2a authored by Pavel Vainerman's avatar Pavel Vainerman

(DBServer): Исправил ошибку (SIGSEGV) в DBServer_MySQL::query() (setbug #6219)

parent 2938d990
- делать возможность вывода в программе вывода версии (коммита) сборки
- Внести в проект реализацию протокола PLCNet // нужно ли
- написать "uniset-check" автоматический тест основных функций (getValue/setValue и т.п.) - написать "uniset-check" автоматический тест основных функций (getValue/setValue и т.п.)
- сделать, чтобы можно было Debug пускать через syslog (да ещё и на другую машину) - сделать, чтобы можно было Debug пускать через syslog (да ещё и на другую машину)
...@@ -13,9 +9,6 @@ ...@@ -13,9 +9,6 @@
- (IONotifyController): Разработать механизм заказа группы датчиков сразу (и ответ тоже группой) - (IONotifyController): Разработать механизм заказа группы датчиков сразу (и ответ тоже группой)
---------- ----------
admin:
- processing "precision"
codegen: codegen:
- Сделать работу с TestMode на основе заказа! - Сделать работу с TestMode на основе заказа!
- Сделать работу с ResetMsg на основе askTimer! // подумать нужно ли.. - Сделать работу с ResetMsg на основе askTimer! // подумать нужно ли..
...@@ -34,6 +27,9 @@ Version 2.0 ...@@ -34,6 +27,9 @@ Version 2.0
- smonit запись значений в файл - smonit запись значений в файл
- depend_invert - возможность инвертировать логику, т.е. задать не "разрешающий датчик", а "запрещающий"
- uniset-codegen: сделать в src.xml <description> и генерировать на его основе описание класса
Version 2.1 Version 2.1
============ ============
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Name: libuniset2 Name: libuniset2
Version: 2.0 Version: 2.0
Release: alt4 Release: alt5
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
...@@ -333,6 +333,10 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname ...@@ -333,6 +333,10 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
%exclude %_pkgconfigdir/libUniSet2.pc %exclude %_pkgconfigdir/libUniSet2.pc
%changelog %changelog
* Wed Aug 20 2014 Pavel Vainerman <pv@altlinux.ru> 2.0-alt5
- (iobase): rename 'jar' ==> 'debounce'
- fixed bug (setbug# 6219) in DBServer_MySQL (SIGSEGV)
* Tue Jun 10 2014 Pavel Vainerman <pv@altlinux.ru> 2.0-alt4 * Tue Jun 10 2014 Pavel Vainerman <pv@altlinux.ru> 2.0-alt4
- minor fixes.. - minor fixes..
......
...@@ -88,7 +88,7 @@ MySQLResult MySQLInterface::query( const std::string& q ) ...@@ -88,7 +88,7 @@ MySQLResult MySQLInterface::query( const std::string& q )
lastQ = q; lastQ = q;
MYSQL_RES* res = mysql_store_result(mysql); // _use_result - некорректно работает с _num_rows MYSQL_RES* res = mysql_store_result(mysql); // _use_result - некорректно работает с _num_rows
if( mysql_num_rows(res)==0 ) if( !res || mysql_num_rows(res)==0 )
return MySQLResult(); return MySQLResult();
return MySQLResult(res,true); return MySQLResult(res,true);
...@@ -104,9 +104,10 @@ bool MySQLInterface::query_ok( const string& q ) ...@@ -104,9 +104,10 @@ bool MySQLInterface::query_ok( const string& q )
lastQ = q; lastQ = q;
MYSQL_RES* res = mysql_store_result(mysql); // _use_result - некорректно работает с _num_rows MYSQL_RES* res = mysql_store_result(mysql); // _use_result - некорректно работает с _num_rows
if( mysql_num_rows(res)==0 ) if( !res || mysql_num_rows(res)==0 )
{ {
mysql_free_result(res); if( res )
mysql_free_result(res);
return false; 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