[mythtv] SQL prepare / bindValue patch for mythtv

David =?unknown-8bit?Q?H=E4rdeman?= david at 2gen.com
Mon Dec 6 23:27:41 UTC 2004


A sage old MythTV wizard once said...

On Sat, Nov 20, 2004 at 12:46:10AM -0500, Isaac Richards wrote:
>Looks like a very good start.  
[...]
>Instead of changing all those "s to 's in the queries, I'd also really 
>prefer if things were switched to use the prepare/bindValue methods. 
>I think it's cleaner, and it takes care of proper quoting/etc..


I've now completed part one of this *phew*

The result is a 200k patch which changes almost all code under mythtv/libs 
to prepare/bindValue functions, available here:
http://www.hardeman.nu/~david/mythpatch/mythtv-libs-preparebindvalue.patch

The patch obviously touches alot of files, and has been lightly tested, 
so thread carefully...on the other hand, the number of files also means 
that the patch might bitrot quite quickly (so I'd be happy if people 
tested it and gave feedback/commited it as quickly as possible).

Regards,
David Härdeman
david (at) 2gen (dot) com



TODO
====
(after patch is applied that is)

o videosource.cpp
o channelsettings.cpp
o profilegroup.cpp
o settings.cpp
whereClause() / setClause() / insertClause() needs to be converted but 
it requires some more work, so I've postponed it for now


o ProgramInfo::SetPositionMapDelta
under the if(isVideo) conditional, a seemingly erroneous use of chanid 
as the parameter to filename was made, I fixed it but fix might need a 
second look


o proglist.cpp
All the setViewFrom* functions could probably share alot of code


o programinfo.cpp
FromProgram and it's callees need some fixing, doing it will be hairy 
though so I've postponed it


o tv_rec.cpp
What is the purpose of "SELECT NULL" statement? (a reimplementation of 
KickDatabase?)


o other
programs/ and possibly other dirs under mythtv also needs the same kind 
of fixes


diffstat output
===============
 libmyth/mythcontext.cpp          |  123 ++---
 libmyth/mythdialogs.cpp          |   83 +--
 libmyth/settings.cpp             |   72 +--
 libmythtv/channel.cpp            |   27 -
 libmythtv/channeleditor.cpp      |   90 ++-
 libmythtv/channelsettings.cpp    |   61 +-
 libmythtv/datadirect.cpp         |  135 +++--
 libmythtv/dvbcam.cpp             |   22 
 libmythtv/dvbchannel.cpp         |   71 +--
 libmythtv/dvbrecorder.cpp        |   55 +-
 libmythtv/guidegrid.cpp          |   70 +--
 libmythtv/hdtvrecorder.cpp       |   33 -
 libmythtv/jobqueue.cpp           |  263 ++++-------
 libmythtv/profilegroup.cpp       |  142 +++---
 libmythtv/progfind.cpp           |   69 +--
 libmythtv/progfind.h             |    4 
 libmythtv/proglist.cpp           |  197 ++++----
 libmythtv/programinfo.cpp        |  893 ++++++++++++++++++---------------------
 libmythtv/recordingprofile.cpp   |  125 ++---
 libmythtv/scheduledrecording.cpp |  149 +++---
 libmythtv/tv_play.cpp            |   16 
 libmythtv/tv_rec.cpp             |  610 ++++++++++++--------------
 libmythtv/videosource.cpp        |  161 +++----
 libmythui/mythmainwindow.cpp     |   73 +--
 24 files changed, 1776 insertions(+), 1768 deletions(-)



More information about the mythtv-dev mailing list