mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-06-03 01:22:42 +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>
|
2018-05-31 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Fixed a regression in rdcatchd(8) that caused Upload events to
|
* Fixed a regression in rdcatchd(8) that caused Upload events to
|
||||||
be generated with the incorrect sample rate.
|
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()
|
void RDApplication::userChangedData()
|
||||||
{
|
{
|
||||||
app_user->setName(app_ripc->user());
|
app_user->setName(app_ripc->user());
|
||||||
|
@ -56,6 +56,7 @@ class RDApplication : public QObject
|
|||||||
RDSystem *system();
|
RDSystem *system();
|
||||||
RDUser *user();
|
RDUser *user();
|
||||||
void log(RDConfig::LogPriority prio,const QString &msg);
|
void log(RDConfig::LogPriority prio,const QString &msg);
|
||||||
|
bool dropTable(const QString &tbl_name);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void userChangedData();
|
void userChangedData();
|
||||||
|
@ -118,6 +118,8 @@ RDSqlQuery::RDSqlQuery(const QString &query,bool reconnect):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RDSqlDatabaseStatus::sendRecon()
|
void RDSqlDatabaseStatus::sendRecon()
|
||||||
{
|
{
|
||||||
if (discon){
|
if (discon){
|
||||||
|
@ -48,8 +48,7 @@ class RDSqlDatabaseStatus : public QObject
|
|||||||
class RDSqlQuery : public QSqlQuery
|
class RDSqlQuery : public QSqlQuery
|
||||||
{
|
{
|
||||||
public:
|
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.
|
// Setup the default database, returns true on success.
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <qmessagebox.h>
|
#include <qmessagebox.h>
|
||||||
|
|
||||||
|
#include <rdapplication.h>
|
||||||
#include <rdclock.h>
|
#include <rdclock.h>
|
||||||
#include <rdconf.h>
|
#include <rdconf.h>
|
||||||
#include <rdcreate_log.h>
|
#include <rdcreate_log.h>
|
||||||
@ -1464,13 +1465,9 @@ void RDSvc::remove(const QString &name)
|
|||||||
|
|
||||||
QString tablename=name;
|
QString tablename=name;
|
||||||
tablename.replace(" ","_");
|
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);
|
rda->dropTable(tablename+"_SRT");
|
||||||
q=new RDSqlQuery(sql);
|
rda->dropTable(tablename+"_STACK");
|
||||||
delete q;
|
|
||||||
|
|
||||||
sql=QString("delete from LOGS where ")+
|
sql=QString("delete from LOGS where ")+
|
||||||
"SERVICE=\""+RDEscapeString(name)+"\"";
|
"SERVICE=\""+RDEscapeString(name)+"\"";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user