mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-06-01 16:42:34 +02:00
2018-05-31 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up SQL errors in rdadmin(1).
This commit is contained in:
parent
42ccd6c3be
commit
c6bbac7267
@ -16998,3 +16998,5 @@
|
||||
2018-05-31 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a regression in rdcatchd(8) that caused Upload events to
|
||||
be generated with the incorrect sample rate.
|
||||
2018-05-31 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Cleaned up SQL errors in rdadmin(1).
|
||||
|
@ -225,6 +225,25 @@ void RDApplication::log(RDConfig::LogPriority prio,const QString &msg)
|
||||
}
|
||||
|
||||
|
||||
bool RDApplication::dropTable(const QString &tbl_name)
|
||||
{
|
||||
bool ret=false;
|
||||
|
||||
QString sql=QString("show tables where ")+
|
||||
"Tables_in_"+config()->mysqlDbname()+"=\""+tbl_name+"\"";
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
sql=QString("drop table `")+tbl_name+"`";
|
||||
RDSqlQuery *q1=new RDSqlQuery(sql);
|
||||
delete q1;
|
||||
ret=true;
|
||||
}
|
||||
delete q;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDApplication::userChangedData()
|
||||
{
|
||||
app_user->setName(app_ripc->user());
|
||||
|
@ -56,6 +56,7 @@ class RDApplication : public QObject
|
||||
RDSystem *system();
|
||||
RDUser *user();
|
||||
void log(RDConfig::LogPriority prio,const QString &msg);
|
||||
bool dropTable(const QString &tbl_name);
|
||||
|
||||
private slots:
|
||||
void userChangedData();
|
||||
|
@ -118,6 +118,8 @@ RDSqlQuery::RDSqlQuery(const QString &query,bool reconnect):
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RDSqlDatabaseStatus::sendRecon()
|
||||
{
|
||||
if (discon){
|
||||
|
@ -48,8 +48,7 @@ class RDSqlDatabaseStatus : public QObject
|
||||
class RDSqlQuery : public QSqlQuery
|
||||
{
|
||||
public:
|
||||
// RDSqlQuery(const QString &query=QString::null, QSqlDatabase * db = 0 );
|
||||
RDSqlQuery(const QString &query=QString::null,bool reconnect=true);
|
||||
RDSqlQuery(const QString &query=QString::null,bool reconnect=true);
|
||||
};
|
||||
|
||||
// Setup the default database, returns true on success.
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#include <rdapplication.h>
|
||||
#include <rdclock.h>
|
||||
#include <rdconf.h>
|
||||
#include <rdcreate_log.h>
|
||||
@ -1464,13 +1465,9 @@ void RDSvc::remove(const QString &name)
|
||||
|
||||
QString tablename=name;
|
||||
tablename.replace(" ","_");
|
||||
sql=QString().sprintf("drop table `%s_SRT`",(const char *)tablename);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("drop table `%s_STACK`",(const char *)tablename);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
rda->dropTable(tablename+"_SRT");
|
||||
rda->dropTable(tablename+"_STACK");
|
||||
|
||||
sql=QString("delete from LOGS where ")+
|
||||
"SERVICE=\""+RDEscapeString(name)+"\"";
|
||||
|
Loading…
x
Reference in New Issue
Block a user