id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,mlocked 6344,Workaround lastError bug in Qt 4.5.0,sphery ,Isaac Richards,"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.",defect,closed,minor,0.22,MythTV - General,head,medium,fixed,,,0