2021-04-06 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in rdlogmanager(1) that could cause SQL errors to
	be thrown when processing ELR records containing null values
	in the 'EXT_START_TIME' column.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-04-06 12:50:17 -04:00
parent 75387491da
commit 231ee06057
2 changed files with 14 additions and 2 deletions

View File

@@ -21406,3 +21406,7 @@
* Fixed a bug in rdimport(1) where the title of an existing cart * Fixed a bug in rdimport(1) where the title of an existing cart
would be overwritten with a default title even when no title would be overwritten with a default title even when no title
was found in the file metadata. was found in the file metadata.
2021-04-06 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in rdlogmanager(1) that could cause SQL errors to
be thrown when processing ELR records containing null values
in the 'EXT_START_TIME' column.

View File

@@ -2,7 +2,7 @@
// //
// Abstract a Rivendell Report Descriptor // Abstract a Rivendell Report Descriptor
// //
// (C) Copyright 2002-2004,2016-2018 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as // it under the terms of the GNU General Public License version 2 as
@@ -542,7 +542,8 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate,
"EVENT_DATETIME="+RDCheckDateTime(q1->value(4).toDateTime(), "EVENT_DATETIME="+RDCheckDateTime(q1->value(4).toDateTime(),
"yyyy-MM-dd hh:mm:ss")+","+ "yyyy-MM-dd hh:mm:ss")+","+
QString().sprintf("EVENT_TYPE=%d,",q1->value(5).toInt())+ QString().sprintf("EVENT_TYPE=%d,",q1->value(5).toInt())+
"EXT_START_TIME=\""+RDEscapeString(q1->value(6).toString())+"\","+ "EXT_START_TIME="+
RDCheckDateTime(q1->value(6).toTime(),"hh:mm:ss")+","+
QString().sprintf("EXT_LENGTH=%d,",q1->value(7).toInt())+ QString().sprintf("EXT_LENGTH=%d,",q1->value(7).toInt())+
"EXT_DATA=\""+RDEscapeString(q1->value(8).toString())+"\","+ "EXT_DATA=\""+RDEscapeString(q1->value(8).toString())+"\","+
"EXT_EVENT_ID=\""+RDEscapeString(q1->value(9).toString())+"\","+ "EXT_EVENT_ID=\""+RDEscapeString(q1->value(9).toString())+"\","+
@@ -613,6 +614,10 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate,
ret=ExportRadioTraffic(filename,startdate,enddate,mixname,0); ret=ExportRadioTraffic(filename,startdate,enddate,mixname,0);
break; break;
// case RDReport::RadioTraffic2:
// ret=ExportRadioTraffic(filename,startdate,enddate,mixname,1);
// break;
case RDReport::VisualTraffic: case RDReport::VisualTraffic:
ret=ExportDeltaflex(filename,startdate,enddate,mixname); ret=ExportDeltaflex(filename,startdate,enddate,mixname);
break; break;
@@ -667,10 +672,13 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate,
QString post_cmd=RDDateDecode(postExportCommand(RDReport::Linux),startdate, QString post_cmd=RDDateDecode(postExportCommand(RDReport::Linux),startdate,
report_station,report_config,serviceName()); report_station,report_config,serviceName());
system(post_cmd.toUtf8()); system(post_cmd.toUtf8());
sql=QString("delete from ELR_LINES where ")+ sql=QString("delete from ELR_LINES where ")+
"SERVICE_NAME=\""+RDEscapeString(mixname)+"\""; "SERVICE_NAME=\""+RDEscapeString(mixname)+"\"";
RDSqlQuery::apply(sql); RDSqlQuery::apply(sql);
// printf("RDReport mixname: %s\n",mixname.toUtf8().constData());
return ret; return ret;
} }