2022-12-13 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in 'RDLog::create()' that threw a SQL error when
	attempting to create a log with a name that already existed.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2022-12-13 13:51:12 -05:00
parent e0890f05bd
commit a851df85de
2 changed files with 9 additions and 1 deletions

View File

@ -23788,3 +23788,6 @@
2022-12-13 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in 'RDLibraryModel' that could throw a SQL
error when processing notifications for added carts.
2022-12-13 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in 'RDLog::create()' that threw a SQL error when
attempting to create a log with a name that already existed.

View File

@ -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;
}