[mythtv] Request: MythHelp

usleepless at gmail.com usleepless at gmail.com
Wed Feb 7 14:51:06 UTC 2007


Stuart,

On 2/7/07, Stuart Morgan <stuart at tase.co.uk> wrote:
> On Wednesday 7 February 2007 12:56, usleepless at gmail.com wrote:
> > Stuart,
> >
> > On 2/7/07, Stuart Morgan <stuart at tase.co.uk> wrote:
> > > On Wednesday 7 February 2007 12:02, usleepless at gmail.com wrote:
> > > > > You seem to have taken rejection on the postgreSQL issue very
> > > > > personally and so you now spend your time being destructive instead
> > > > > of
> > >
> > > constructive.
> > >
> > > > > Ideas and patches are rejected all the time, even my own, most
> people
> > > > > accept that and move on, why can't you?
> > > >
> > > > don't you see i have moved on? i am happy with my own
> > > > mythtv-0.18-postgresql, and am contributing to the freebsd port of
> > > > 0.20. i just will never run it myself, since the port doesn't address
> > > > the mysql issue. and i have no need for 0.20.
> > >
> > > This thread is evidence to the contrary. You're still bringing up the
> > > postgreSQL issue, still complaining about what you perceive to be bugs
> in
> > > the code and which you have no intention of fixing.
> >
> > ad hominem.
>
> *sigh*
>
> You're the one trying to deflect the arguments.

although we have disagreement, i do respect you, and your
determination in this thread and your openeness.

we are slightly offtopic, since i have my own issue with the perceived
"hostileness" ( my perception, that is ).

and my issue is the db-layer. that's why end up here.

> > i interpret this as you don't have a clue either why the .isActive()
> > and .size() calls are there in the first place?
>
> You're right I've no clue why we are doing:
> if (query.isActive() && query.size() && query.next())

that is very honest. thank you.

> That doesn't mean the right solution is to do away with .isActive()
> and .size() completely.

that is not what i am saying either.

> If .next() were sufficient consider why QT provides .size() and .isActive().

you are partially right, but consider this too:
  http://doc.trolltech.com/3.3/qsqlquery.html#size

not all db drivers have this feature, so it might have been a good
idea to try to avoid it completely. i know the counter-argument is:
but we use mysql exclusively, we don't have a problem. my argument
would be:
 - if other dbms systems don't even implement .size() it sure isn't critical
 - why call size() anyways when it makes no sense?
 - you _are having problems with mysql ( scheduler, mysql is fragile )

> .next() will return false in at least three different situations:
> 1) The Query failed (bad query, database problems etc) - checked by
> isActive().
> 2) The query returned no results - checked by .size()
> 3) We have reached the end of the result set

ad 3) or they query returned no results to begin with ( == 2 )

> It's good practice to check whether the result is what we expect and throw
> an
> error if that isn't the case. This is always the case, even if it is
> extremely unlikely to occur.
>
> So the correct method would be something like:
>
> if (query.isActive())
> {
>     if (query.size > 0)
>     {
>         while (query.next())
>         {
>             // fetch the result
>         }
>     }
>     else
>     {
>         // error, the query produced no results
>     }
> }
> else
> {
>  // error, the query failed
> }

very true, but this is never done, so:

  if(.isActive() && .size()>0 && .next())

equals ( == )

  if(.next())

i would be very happy to contribute to mythtv. and i would be willing
to do the bulk of the work. and this could pave the way for an easy
transition to an embedded db as well.

and when that's done, i am willing to contribute more: scheduler
optimizations, roundtrip optimizations. not pgsql specific: generic
optimizations, ipc.

i hope you guys think it over.

regards,

usleep ( who is actually delighted me and my gf can skip through all
the crap that is on tv, so there is gratitude as well. we hardly ever
watch live tv anymore, we have 4 tuners to record as much as possible
)


More information about the mythtv-dev mailing list