2016-06-10 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in 'rdairplay/list_logs.cpp' that failed to process
	SQL NULL date values correctly.
This commit is contained in:
Fred Gleason 2016-06-10 17:14:22 -04:00
parent ff89b31f61
commit c19b241907
2 changed files with 11 additions and 6 deletions

View File

@ -15219,3 +15219,6 @@
2016-06-10 Fred Gleason <fredg@paravelsystems.com>
* Updated 'NEWS'.
* Incremented the package version to 2.14.0.
2016-06-10 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in 'rdairplay/list_logs.cpp' that failed to process
SQL NULL date values correctly.

View File

@ -234,12 +234,14 @@ void ListLogs::RefreshList()
if(services_list.size()==0) {
return;
}
sql=QString().sprintf("select NAME,DESCRIPTION,SERVICE from LOGS \
where (TYPE=0)&&(LOG_EXISTS=\"Y\")&&\
((START_DATE<=\"%s\")||(START_DATE=\"0000-00-00\"))&&\
((END_DATE>=\"%s\")||(END_DATE=\"0000-00-00\"))&&(",
(const char *)current_date.toString("yyyy-MM-dd"),
(const char *)current_date.toString("yyyy-MM-dd"));
sql=QString("select NAME,DESCRIPTION,SERVICE from LOGS ")+
"where (TYPE=0)&&(LOG_EXISTS=\"Y\")&&"+
"((START_DATE<=\""+current_date.toString("yyyy-MM-dd")+"\")||"+
"(START_DATE=\"0000-00-00\")||"+
"(START_DATE is null))&&"+
"((END_DATE>=\""+current_date.toString("yyyy-MM-dd")+"\")||"+
"(END_DATE=\"0000-00-00\")||"+
"(END_DATE is null))&&(";
for ( QStringList::Iterator it = services_list.begin();
it != services_list.end(); ++it ) {
sql+=QString().sprintf("SERVICE=\"%s\"||",