mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-21 16:38:54 +02:00
2014-08-27 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in 'lib/rdcreate_log.cpp' that caused auxiliary table creation to fail.
This commit is contained in:
parent
711c589edb
commit
79953efa7f
@ -14401,3 +14401,6 @@
|
|||||||
* Removed code that disabled 'Delete cuts before importing' checkbox
|
* Removed code that disabled 'Delete cuts before importing' checkbox
|
||||||
when no 'To Cart' value was specified in the 'Dropbox Configuration'
|
when no 'To Cart' value was specified in the 'Dropbox Configuration'
|
||||||
dialog in 'rdadmin/edit_dropbox.cpp'.
|
dialog in 'rdadmin/edit_dropbox.cpp'.
|
||||||
|
2014-08-27 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Fixed a regression in 'lib/rdcreate_log.cpp' that caused auxiliary
|
||||||
|
table creation to fail.
|
||||||
|
@ -38,7 +38,7 @@ void RDCreateLogTable(const QString &name)
|
|||||||
|
|
||||||
QString RDCreateLogTableSql(QString name)
|
QString RDCreateLogTableSql(QString name)
|
||||||
{
|
{
|
||||||
return QString("create table if not exists `")+RDLog::tableName(name)+"`"+
|
return QString("create table if not exists `")+name+"`"+
|
||||||
"(ID INT NOT NULL PRIMARY KEY,"+
|
"(ID INT NOT NULL PRIMARY KEY,"+
|
||||||
"COUNT INT NOT NULL,"+
|
"COUNT INT NOT NULL,"+
|
||||||
"TYPE INT DEFAULT 0,"+
|
"TYPE INT DEFAULT 0,"+
|
||||||
@ -86,7 +86,7 @@ QString RDCreateLogTableSql(QString name)
|
|||||||
|
|
||||||
QString RDCreateClockTableSql(QString name)
|
QString RDCreateClockTableSql(QString name)
|
||||||
{
|
{
|
||||||
return QString("create table `")+RDClock::tableName(name)+"` ("+
|
return QString("create table `")+name+"` ("+
|
||||||
"ID int unsigned auto_increment not null primary key,"+
|
"ID int unsigned auto_increment not null primary key,"+
|
||||||
"EVENT_NAME char(64) not null,"+
|
"EVENT_NAME char(64) not null,"+
|
||||||
"START_TIME int not null,"+
|
"START_TIME int not null,"+
|
||||||
@ -97,7 +97,7 @@ QString RDCreateClockTableSql(QString name)
|
|||||||
|
|
||||||
QString RDCreateReconciliationTableSql(QString name)
|
QString RDCreateReconciliationTableSql(QString name)
|
||||||
{
|
{
|
||||||
QString sql=QString("create table `")+RDSvc::svcTableName(name)+"` ("+
|
QString sql=QString("create table `")+name+"` ("+
|
||||||
"ID int unsigned auto_increment primary key,"+
|
"ID int unsigned auto_increment primary key,"+
|
||||||
"LENGTH int,"+
|
"LENGTH int,"+
|
||||||
"LOG_NAME char(64),"+
|
"LOG_NAME char(64),"+
|
||||||
|
@ -1326,7 +1326,7 @@ void RDSvc::create(const QString exemplar) const
|
|||||||
//
|
//
|
||||||
// Create Service Reconciliation Table
|
// Create Service Reconciliation Table
|
||||||
//
|
//
|
||||||
sql=RDCreateReconciliationTableSql(svc_name);
|
sql=RDCreateReconciliationTableSql(RDSvc::svcTableName(svc_name));
|
||||||
q=new RDSqlQuery(sql);
|
q=new RDSqlQuery(sql);
|
||||||
delete q;
|
delete q;
|
||||||
}
|
}
|
||||||
|
@ -461,7 +461,7 @@ void EditClock::saveAsData()
|
|||||||
}
|
}
|
||||||
delete q;
|
delete q;
|
||||||
edit_clock->setName(clockname);
|
edit_clock->setName(clockname);
|
||||||
sql=RDCreateClockTableSql(clockname);
|
sql=RDCreateClockTableSql(RDClock::tableName(clockname));
|
||||||
q=new RDSqlQuery(sql);
|
q=new RDSqlQuery(sql);
|
||||||
delete q;
|
delete q;
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ void ListClocks::addData()
|
|||||||
(const char *)clockname);
|
(const char *)clockname);
|
||||||
q=new RDSqlQuery(sql);
|
q=new RDSqlQuery(sql);
|
||||||
delete q;
|
delete q;
|
||||||
sql=RDCreateClockTableSql(clockname);
|
sql=RDCreateClockTableSql(RDClock::tableName(clockname));
|
||||||
q=new RDSqlQuery(sql);
|
q=new RDSqlQuery(sql);
|
||||||
delete q;
|
delete q;
|
||||||
EditClock *clock_dialog=new EditClock(clockname,true,&new_clocks,
|
EditClock *clock_dialog=new EditClock(clockname,true,&new_clocks,
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include <rddbcheck.h>
|
#include <rddbcheck.h>
|
||||||
#include <rdcart.h>
|
#include <rdcart.h>
|
||||||
#include <rdlog.h>
|
#include <rdlog.h>
|
||||||
|
#include <rdclock.h>
|
||||||
#include <rdcreate_log.h>
|
#include <rdcreate_log.h>
|
||||||
#include <rdescape_string.h>
|
#include <rdescape_string.h>
|
||||||
#include <rdwavefile.h>
|
#include <rdwavefile.h>
|
||||||
@ -283,20 +284,16 @@ void MainObject::CheckClocks()
|
|||||||
QSqlQuery *q1;
|
QSqlQuery *q1;
|
||||||
QSqlQuery *q2;
|
QSqlQuery *q2;
|
||||||
QSqlQuery *q3;
|
QSqlQuery *q3;
|
||||||
QString clockname;
|
|
||||||
QString eventname;
|
QString eventname;
|
||||||
|
|
||||||
sql="select NAME from CLOCKS";
|
sql="select NAME from CLOCKS";
|
||||||
q=new QSqlQuery(sql);
|
q=new QSqlQuery(sql);
|
||||||
while(q->next()) {
|
while(q->next()) {
|
||||||
clockname=q->value(0).toString();
|
|
||||||
clockname.replace(" ","_");
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check the CLK Table
|
// Check the CLK Table
|
||||||
//
|
//
|
||||||
sql=QString().sprintf ("select EVENT_NAME,ID from %s_CLK",
|
sql=QString("select EVENT_NAME,ID from ")+
|
||||||
(const char *)clockname);
|
RDClock::tableName(q->value(0).toString());
|
||||||
q1=new QSqlQuery(sql);
|
q1=new QSqlQuery(sql);
|
||||||
if(q1->isActive()) {
|
if(q1->isActive()) {
|
||||||
//
|
//
|
||||||
@ -309,15 +306,14 @@ void MainObject::CheckClocks()
|
|||||||
if(q2->first()) {
|
if(q2->first()) {
|
||||||
if(q1->value(0)!=q2->value(0)) { // Make sure the cases match!
|
if(q1->value(0)!=q2->value(0)) { // Make sure the cases match!
|
||||||
printf(" Clock %s's linkage to event %s is broken -- fix (y/N)? ",
|
printf(" Clock %s's linkage to event %s is broken -- fix (y/N)? ",
|
||||||
(const char *)clockname,
|
(const char *)q->value(0).toString(),
|
||||||
(const char *)q2->value(0).toString());
|
(const char *)q2->value(0).toString());
|
||||||
fflush(NULL);
|
fflush(NULL);
|
||||||
if(UserResponse()) {
|
if(UserResponse()) {
|
||||||
sql=QString().sprintf("update %s_CLK set EVENT_NAME=\"%s\"\
|
sql=QString("update ")+
|
||||||
where ID=%d",
|
RDClock::tableName(q->value(0).toString())+
|
||||||
(const char *)clockname,
|
" set EVENT_NAME=\""+RDEscapeString(q2->value(0).toString())+
|
||||||
(const char *)q2->value(0).toString(),
|
"\""+QString().sprintf(" where ID=%d",q1->value(1).toInt());
|
||||||
q1->value(1).toInt());
|
|
||||||
q3=new QSqlQuery(sql);
|
q3=new QSqlQuery(sql);
|
||||||
delete q3;
|
delete q3;
|
||||||
}
|
}
|
||||||
@ -331,7 +327,7 @@ void MainObject::CheckClocks()
|
|||||||
(const char *)q->value(0).toString());
|
(const char *)q->value(0).toString());
|
||||||
fflush(NULL);
|
fflush(NULL);
|
||||||
if(UserResponse()) {
|
if(UserResponse()) {
|
||||||
sql=RDCreateClockTableSql(clockname);
|
sql=RDCreateClockTableSql(RDClock::tableName(q->value(0).toString()));
|
||||||
q2=new QSqlQuery(sql);
|
q2=new QSqlQuery(sql);
|
||||||
delete q2;
|
delete q2;
|
||||||
}
|
}
|
||||||
@ -339,7 +335,6 @@ void MainObject::CheckClocks()
|
|||||||
delete q1;
|
delete q1;
|
||||||
}
|
}
|
||||||
delete q;
|
delete q;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user