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: Korey <k.m.fort@…> 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)

single_db_exec.diff (826 bytes ) - added by Korey <k.m.fort@…> 21 years ago.
Trades a DELETE and INSERT for a UPDATE call to the database.

Download all attachments as: .zip

Change History (4)

by Korey <k.m.fort@…>, 21 years ago

Attachment: single_db_exec.diff added

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

comment:1 by Isaac Richards, 21 years ago

Resolution: wontfix
Status: newclosed

Might be more worthwhile to spend time on things that actually matter.

comment:2 by anonymous, 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 (none), 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)!

Note: See TracTickets for help on using tickets.