summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2010-04-29 14:10:54 +0200
committerjasplin <qt-info@nokia.com>2010-04-29 14:10:54 +0200
commitb438f4f919d3dbeec6e1190fe351595c3c6e48e9 (patch)
tree13bacbcf304604992248e1431988a46304eee672
parent35ac562fe47e5a4a8e27856a7fed23175f7aad8b (diff)
Removed obsolete columns from 'indexConfig'table.
-rw-r--r--src/bm/bmrequest.cpp38
-rw-r--r--src/bmserver/main.cpp3
2 files changed, 6 insertions, 35 deletions
diff --git a/src/bm/bmrequest.cpp b/src/bm/bmrequest.cpp
index 97c234f..3eda076 100644
--- a/src/bm/bmrequest.cpp
+++ b/src/bm/bmrequest.cpp
@@ -5712,26 +5712,19 @@ QByteArray BMRequest_IndexGetConfig::toReplyBuffer()
// Get config ID and non-filter attributes ...
query = createQuery();
if (!query->exec(
- QString(
- "SELECT id, baseTimestamp, loEvalTimestamp, hiEvalTimestamp, evalTimestep, "
- "medianWinSize FROM indexConfig WHERE name='%1';").arg(configName))) {
+ QString("SELECT id, baseTimestamp, medianWinSize FROM indexConfig WHERE name='%1';")
+ .arg(configName))) {
reply = errorReply(*query, name(), QString("failed to get config (exec() failed (1))"));
deleteQuery(query);
return xmlConvert(reply);
}
int configId;
int baseTimestamp;
- int evalLoTime;
- int evalHiTime;
- int evalStep;
int medianWinSize;
if (query->next()) {
configId = query->value(0).toInt();
baseTimestamp = query->value(1).toInt();
- evalLoTime = query->value(2).toInt();
- evalHiTime = query->value(3).toInt();
- evalStep = query->value(4).toInt();
- medianWinSize = query->value(5).toInt();
+ medianWinSize = query->value(2).toInt();
} else {
reply = errorReply(*query, name(), QString("index config '%1' not found").arg(configName));
deleteQuery(query);
@@ -5815,13 +5808,8 @@ QByteArray BMRequest_IndexGetConfig::toReplyBuffer()
//--------------------------------------
- reply += QString(
- "<args baseTimestamp=\"%1\" evalLoTime=\"%2\" evalHiTime=\"%3\" evalStep=\"%4\" "
- "medianWinSize=\"%5\" />")
+ reply += QString("<args baseTimestamp=\"%1\" medianWinSize=\"%2\" />")
.arg(baseTimestamp)
- .arg(evalLoTime)
- .arg(evalHiTime)
- .arg(evalStep)
.arg(medianWinSize);
for (int i = 0; i < testCaseFilter.size(); ++i)
@@ -5866,18 +5854,6 @@ void BMRequest_IndexGetConfig::handleReply_JSON(const QStringList &args) const
.arg(argsElem.attributeNode("baseTimestamp").value().toInt(&ok));
Q_ASSERT(ok);
- reply += QString(",\n\"evalLoTime\": %1")
- .arg(argsElem.attributeNode("evalLoTime").value().toInt(&ok));
- Q_ASSERT(ok);
-
- reply += QString(",\n\"evalHiTime\": %1")
- .arg(argsElem.attributeNode("evalHiTime").value().toInt(&ok));
- Q_ASSERT(ok);
-
- reply += QString(",\n\"evalStep\": %1")
- .arg(argsElem.attributeNode("evalStep").value().toInt(&ok));
- Q_ASSERT(ok);
-
reply += QString(",\n\"medianWinSize\": %1")
.arg(argsElem.attributeNode("medianWinSize").value().toInt(&ok));
Q_ASSERT(ok);
@@ -6051,12 +6027,10 @@ QByteArray BMRequest_IndexPutConfig::toReplyBuffer()
// Insert into main table ...
if (!query->exec(
QString(
- "INSERT INTO indexConfig (name, baseTimestamp, loEvalTimestamp, hiEvalTimestamp, "
- "evalTimestep, medianWinSize) "
- "VALUES ('%1', %2, %3, %4, %5, %6);")
+ "INSERT INTO indexConfig (name, baseTimestamp, medianWinSize) "
+ "VALUES ('%1', %2, %3);")
.arg(configName)
.arg(baseTimestamp)
- .arg(-1).arg(-1).arg(-1) // ### obsolete, so use dummy values for now
.arg(medianWinSize))) {
reply = errorReply(*query, name(), "failed to insert into indexConfig");
deleteQuery(query, Rollback);
diff --git a/src/bmserver/main.cpp b/src/bmserver/main.cpp
index 9ee80f9..a8c5d3c 100644
--- a/src/bmserver/main.cpp
+++ b/src/bmserver/main.cpp
@@ -122,9 +122,6 @@ static bool initDatabase(const QString &dbfile, QString *error)
"CREATE TABLE indexConfig(id INTEGER PRIMARY KEY AUTOINCREMENT"
", name TEXT NOT NULL"
", baseTimestamp INTEGER NOT NULL"
- ", loEvalTimestamp INTEGER NOT NULL"
- ", hiEvalTimestamp INTEGER NOT NULL"
- ", evalTimestep INTEGER NOT NULL"
", medianWinSize INTEGER NOT NULL"
", UNIQUE(name));");
Q_ASSERT(ok);