Modify

Ticket #6344 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Workaround lastError bug in Qt 4.5.0

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

Description

Qt 4.5.0 modified the Qt MySQL driver and added a bug which causes a lastError to sometimes be reported, even when the last statement executed was successfully executed. Since Myth's DB upgrade code only checks lastError, non-failures are sometimes treated as failures (i.e. when executing the ALTER DATABASE statements that are passed to performActualUpdate()).

The attached patch works around the issue by simply checking the return value of exec() as well as the lastError(). It only works around the issue in the one location where I know it exists--the DB upgrade code. I've checked all other locations in dbcheck.cpp that look only at lastError() and none will be affected by the bug (i.e. their statements can be executed either as prepared or non-prepared statements). However, similar problems may exist in other parts of Myth.

I've reported the bug to Qt's bug tracker and posted a patch, but it seems to be moderated, so a link to the bug isn't yet available. The Qt patch is simple, but distros are already starting to use the buggy version of Qt, so the workaround may be worthwhile.

Attachments

mythtv-6344-workaround_for_Qt_4_5_lastError_bug.patch (624 bytes) - added by sphery <mtdean@…> 3 years ago.
lastError_bug.patch (4.0 KB) - added by OJ <olejl77@…> 3 years ago.
patch for plugins as well

Change History

Changed 3 years ago by sphery <mtdean@…>

comment:1 Changed 3 years ago by sphery <mtdean@…>

This was fixed by Janne in [20186]

comment:2 Changed 3 years ago by paulh

  • Status changed from new to closed
  • Version changed from 0.21 to head
  • Resolution set to fixed
  • Milestone changed from unknown to 0.22

Changed 3 years ago by OJ <olejl77@…>

patch for plugins as well

comment:3 Changed 3 years ago by paulh

(In [20473]) Similar to [20186] always check MSqlQuery::exec() return value this time for all the plugins. Thanks to OJ for the patch. Refs #6344.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.