diff --git a/ChangeLog b/ChangeLog index 4414000a..8328f039 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23788,3 +23788,6 @@ 2022-12-13 Fred Gleason * Fixed a regression in 'RDLibraryModel' that could throw a SQL error when processing notifications for added carts. +2022-12-13 Fred Gleason + * Fixed a bug in 'RDLog::create()' that threw a SQL error when + attempting to create a log with a name that already existed. diff --git a/lib/rdlog.cpp b/lib/rdlog.cpp index 2ee3c64a..90dbc48b 100644 --- a/lib/rdlog.cpp +++ b/lib/rdlog.cpp @@ -534,6 +534,11 @@ bool RDLog::create(const QString &name,const QString &svc_name, RDSvc::ShelflifeOrigin shelforigin; QString desc_tmpl; + if(RDLog::exists(name)) { + *err_msg=QObject::tr("Log already exists!"); + return false; + } + sql=QString("select ")+ "`DEFAULT_LOG_SHELFLIFE`,"+ // 00 "`LOG_SHELFLIFE_ORIGIN`,"+ // 01 @@ -578,7 +583,7 @@ bool RDLog::create(const QString &name,const QString &svc_name, } q=new RDSqlQuery(sql); if(!q->isActive()) { - *err_msg=QObject::tr("Log already exists!"); + *err_msg=QObject::tr("Insertion into LOGS table failed!"); delete q; return false; }