Opened 21 years ago
Closed 21 years ago
Last modified 19 years ago
#76 closed defect (wontfix)
mythgame makes two Calls to the Database when only one will do the job.
| Reported by: | Owned by: | Isaac Richards | |
|---|---|---|---|
| Priority: | minor | Milestone: | unknown |
| Component: | mythgame | Version: | head |
| Severity: | low | Keywords: | Database, query, query.exec |
| Cc: | Ticket locked: | no |
Description
By replacing these:
query.exec("DELETE FROM settings WHERE value='GameDBSchemaVer';"); query.exec(QString("INSERT INTO settings (value, data, hostname) " "VALUES ('GameDBSchemaVer', %1, NULL);").arg(newnumber));
with a sigle update.
query.exec(QString("UPDATE settings SET value='GameDBSchemaVer', data=%1, hostname=NULL WHERE value='GameDBSchemaVer';").arg(newnumber));
One call to the database can be avoided. If the settings table does not have value=GameDBSchemaVer it will be created.
Attachments (1)
Change History (4)
by , 21 years ago
| Attachment: | single_db_exec.diff added |
|---|
comment:1 by , 21 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
Might be more worthwhile to spend time on things that actually matter.
comment:2 by , 21 years ago
mythconverg.settings.value has no unique constraint. All matching rows must be deleted if there is more than one present.
comment:3 by , 21 years ago
It still wouldn't need a unique constraint if instead of deleting the GameDBSchemaVer row everytime it just updated it. But if it won't be fixed it won't be fixed,oh well, no since in crying over spilled milk (this tickets closed)!

Trades a DELETE and INSERT for a UPDATE call to the database.