diff --git a/ChangeLog b/ChangeLog index 8793bfba..09fd3ab7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15057,3 +15057,6 @@ * Fixed a regression in 'rdlibrary/audio_cart.cpp' that caused cuts to be shown as invalid when 'Schedule Cuts by weight' was selected. +2016-03-30 Fred Gleason + * Fixed a bug in 'utils/rdmaint/rdmaint.cpp' that caused purging + of ELR data from services containing a '-' in its name to fail. diff --git a/utils/rdmaint/rdmaint.cpp b/utils/rdmaint/rdmaint.cpp index 212397fb..541ba045 100644 --- a/utils/rdmaint/rdmaint.cpp +++ b/utils/rdmaint/rdmaint.cpp @@ -2,9 +2,7 @@ // // A Utility for running periodic system maintenance. // -// (C) Copyright 2008 Fred Gleason -// -// $Id: rdmaint.cpp,v 1.9.4.4 2013/11/13 23:36:39 cvs Exp $ +// (C) Copyright 2008-2016 Fred Gleason // // 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 @@ -234,10 +232,9 @@ void MainObject::PurgeElr() while(q->next()) { QString tablename=q->value(0).toString()+"_SRT"; tablename.replace(" ","_"); - sql=QString().sprintf("delete from %s where EVENT_DATETIME<\"%s 00:00:00\"", - (const char *)tablename, - (const char *)dt.addDays(-q->value(1).toInt()). - toString("yyyy-MM-dd")); + sql=QString("delete from `")+tablename+"` where "+ + "EVENT_DATETIME<\""+ + dt.addDays(-q->value(1).toInt()).toString("yyyy-MM-dd")+" 00:00:00\""; q1=new RDSqlQuery(sql); delete q1; }