[mythtv] Ticket #3061: MSqlQuery.size() removal for libmythtv

usleepless at gmail.com usleepless at gmail.com
Fri Feb 9 11:39:31 UTC 2007

On 2/9/07, MythTV <mythtv at cvs.mythtv.org> wrote:
> #3061: MSqlQuery.size() removal for libmythtv
> -----------------------+----------------------------------------------------
>  Reporter:  anonymous  |        Owner:  ijr
>      Type:  patch      |       Status:  new
>  Priority:  minor      |    Milestone:  unknown
> Component:  mythtv     |      Version:  head
>  Severity:  medium     |   Resolution:
> -----------------------+----------------------------------------------------
> Comment (by david at hardeman.nu):
>  Replying to [comment:5 luitjens]:
>  > This patch has worked just fine.  Tonight I recorded 9 programs in 2
>  hours while watching another recorded program with zero problems.  I have
>  also updated the patch to the latest head and removed a couple more
>  .size() calls and replaced some of them with .numRowsAffected().  usleep
>  is this function compatible for you?
>  Ok, I did a quick review of the patch:
>   * I couldn't find any numRowsAffected calls in the patch.
>   * There are still a lot of redundant isActive() calls left
>   * The .size() removal has been taken too far. For instance, code like
>  this is just plain ugly:
>  {{{
>  -        int qsize = query.size();
>  +        while(query.next())
>  +            qsize++
>  }}}
>  MySQL and PostgreSQL (and any other DB I've used with QT) support the
>  .size() call,

i was wondering about this, so i tested it. and you are right, .size()
does work for postgresql as well. since i patched 0.18 about a year
ago, me too was confused with the improper use of rowsAffected() in
that version.

well, it certainly makes live easier. nevertheless, most of the size()
and inActive() calls seem to be useless.

> so I see no point in not using it where appropriate.

you are right. but i for one wouldn't call the above code "ugly".

>  In order to not come across as a nag...I'll provide an updated patch later
>  today or tomorrow.

i created a patchfile to remove the rest of the inActive calls, but i
am not able to load it into track ( SPAM: LED msg ). nor am i able to
post it to the list? ( msg awaits moderater approval )



More information about the mythtv-dev mailing list