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
Change History
Changed 3 years ago by sphery <mtdean@…>
- Attachment mythtv-6344-workaround_for_Qt_4_5_lastError_bug.patch added
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@…>
- Attachment lastError_bug.patch added
patch for plugins as well
