Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#6591 closed patch (fixed)

Check MSqlQuery::exec() return value

Reported by: sphery <mtdean@…> Owned by: Janne Grunau
Priority: minor Milestone: 0.22
Component: MythTV - General Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The attached patches modify usage of MSqlQuery::exec() to check the return value. The most important reason for doing this is because QSqlQuery::lastError() may indicate an error even when the query executed successfully (see http://www.qtsoftware.com/developer/task-tracker/index_html?id=248078&method=entry ) in Qt 4.5.

Attachments (8)

mythtv-6591-check_return_value_of_MSqlQuery_exec-important.patch (4.1 KB) - added by sphery <mtdean@…> 15 years ago.
Most important fixes in mythtv--cases that rely on QSqlQuery::lastError() and ignore MSqlQuery::exec()
mythtv-6591-check_return_value_of_MSqlQuery_exec-libmythtv.patch (34.7 KB) - added by sphery <mtdean@…> 15 years ago.
Fixes all unchecked exec() calls in libmythtv. Mostly just adds new log messages or rearranges success checks. Fixes a couple DBError messages with copy/paste errors (wrong function name)
mythtv-6591-check_return_value_of_MSqlQuery_exec-libmythtv.2.patch (34.8 KB) - added by sphery <mtdean@…> 15 years ago.
mythtv-6591-check_return_value_of_MSqlQuery_exec-libmythtv.patch had one mistake, use this version, instead
mythtv-6591-check_return_value_of_MSqlQuery_exec-programs.patch (46.3 KB) - added by sphery <mtdean@…> 15 years ago.
Fixes all occurrences in programs. These are the last occurrences in mythtv. (Haven't checked mythplugins.)
mythtv-6591-check_return_value_of_MSqlQuery_exec-libmythtv.3.patch (29.3 KB) - added by sphery <mtdean@…> 15 years ago.
Updated patch--removes unnecessary isActive() calls and programdata changes (which were fixed by Daniel in a previous commit).
mythtv-6591-check_return_value_of_MSqlQuery_exec-programs.2.patch (45.1 KB) - added by sphery <mtdean@…> 15 years ago.
Updated patch--removes unnecessary isActive() calls.
mythplugins-6591-check_return_value_of_MSqlQuery_exec.patch (50.7 KB) - added by sphery <mtdean@…> 15 years ago.
Fixes all occurrences in mythplugins. Adds logging, removes unnecessary isActive() and size() calls.
mythplugins-6591-check_return_value_of_MSqlQuery_exec.2.patch (51.3 KB) - added by sphery <mtdean@…> 15 years ago.
Updated mythplugins patch--was missing a couple of #includes for mythdb.h

Download all attachments as: .zip

Change History (13)

Changed 15 years ago by sphery <mtdean@…>

Most important fixes in mythtv--cases that rely on QSqlQuery::lastError() and ignore MSqlQuery::exec()

Changed 15 years ago by sphery <mtdean@…>

Fixes all unchecked exec() calls in libmythtv. Mostly just adds new log messages or rearranges success checks. Fixes a couple DBError messages with copy/paste errors (wrong function name)

Changed 15 years ago by sphery <mtdean@…>

mythtv-6591-check_return_value_of_MSqlQuery_exec-libmythtv.patch had one mistake, use this version, instead

Changed 15 years ago by sphery <mtdean@…>

Fixes all occurrences in programs. These are the last occurrences in mythtv. (Haven't checked mythplugins.)

comment:1 Changed 15 years ago by Janne Grunau

Milestone: unknown0.22
Owner: changed from Isaac Richards to Janne Grunau
Status: newaccepted

comment:2 Changed 15 years ago by Janne Grunau

Resolution: fixed
Status: acceptedclosed

(In [20663]) Use MSqlQuery exec's return value instead lastError to check for errors.

lastError will return stale errors even if the last query was successful. fixes #6591

patch by: Micheal T Dean < mtdean thirdcontact com >

Changed 15 years ago by sphery <mtdean@…>

Updated patch--removes unnecessary isActive() calls and programdata changes (which were fixed by Daniel in a previous commit).

Changed 15 years ago by sphery <mtdean@…>

Updated patch--removes unnecessary isActive() calls.

comment:3 Changed 15 years ago by Janne Grunau

(In [20664]) check msqlquery::exec return value in libmythtv. Refs #6591

adds DBErrors, removes unnecessary isActive() calls, fixes copy and past errors in a couple of DBErrors.

based on patch by: Micheal T Dean < mtdean thirdcontact com >

Changed 15 years ago by sphery <mtdean@…>

Fixes all occurrences in mythplugins. Adds logging, removes unnecessary isActive() and size() calls.

Changed 15 years ago by sphery <mtdean@…>

Updated mythplugins patch--was missing a couple of #includes for mythdb.h

comment:4 Changed 15 years ago by Janne Grunau

(In [20765]) Check MSqlQuery::exec return values in mythtv/programs. Refs #6591

based on patch by: Micheal T Dean < mtdean thirdcontact com >

comment:5 Changed 15 years ago by paulh

(In [20936]) Check MSqlQuery::exec() return value in MythPlugins?. Patch from Micheal T Dean. Refs #6591.

Note: See TracTickets for help on using tickets.