<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>183268</bug_id>
          
          <creation_ts>2007-06-26 14:10 0000</creation_ts>
          <short_desc>mythfilldatabase erroneously deletes record schedules for the current day</short_desc>
          <delta_ts>2007-08-06 21:43:28 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>digitalaudiorock@hotmail.com</reporter>
          <assigned_to>cardoe@gentoo.org</assigned_to>
          <cc>henson@acm.org</cc>

      

      
          <long_desc isprivate="0">
            <who>digitalaudiorock@hotmail.com</who>
            <bug_when>2007-06-26 14:10:43 0000</bug_when>
            <thetext>mythfilldata always deletes records from the record table with types of single, override, or dontrecord whose enddate is the current day.

The problem is in the clearOldDBEntries in the file filldata.cpp:

query.prepare(&quot;DELETE FROM record WHERE (type = :SINGLE &quot;
                  &quot;OR type = :OVERRIDE OR type = :DONTRECORD) &quot;
                  &quot;AND enddate &lt; NOW();&quot;);
    query.bindValue(&quot;:SINGLE&quot;, kSingleRecord);
    query.bindValue(&quot;:OVERRIDE&quot;, kOverrideRecord);
    query.bindValue(&quot;:DONTRECORD&quot;, kDontRecord);
    query.exec();

Since enddate is a date column (not datetime) it&apos;s getting compared to NOW() as a datetime at 12:00AM, thus always less than NOW().  Using either CURDATE(), CURRENT_DATE, or CAST(NOW() AS DATE) in place of NOW() would work correctly.


Reproducible: Always

Steps to Reproduce:
1. Schedule a &quot;record only this showing&quot; type for the current day.
2. Run mythfilldatabase.


Actual Results:  
The schedule gets deleted.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-06-26 14:14:36 0000</bug_when>
            <thetext>Always provide ebuild name and version in bug summary, please.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>digitalaudiorock@hotmail.com</who>
            <bug_when>2007-06-26 14:30:20 0000</bug_when>
            <thetext>Sorry...I forgot to include that this is occuring in:

media-tv/mythtv-0.20.1_p13344
dev-db/mysql-5.0.42

...though it appears to be the same in media-tv/mythtv-0.20_p12325.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2007-06-28 18:23:35 0000</bug_when>
            <thetext>Have you filed this upstream?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>digitalaudiorock@hotmail.com</who>
            <bug_when>2007-06-29 16:24:09 0000</bug_when>
            <thetext>At the time I entered this, I thought it might be something that had already been resolved upstream.  As far as I can see I don&apos;t think it has been, so I will file a bug today.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>digitalaudiorock@hotmail.com</who>
            <bug_when>2007-06-29 17:14:52 0000</bug_when>
            <thetext>I filed this mythtv bug:

http://svn.mythtv.org/trac/ticket/3681

I found that this doesn&apos;t appear to have been corrected in 0.21 either, though the code is now in /libs/libmythtv/programdata.cpp rather than /programs/mythfilldatabase/filldata.cpp.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>digitalaudiorock@hotmail.com</who>
            <bug_when>2007-07-02 17:26:59 0000</bug_when>
            <thetext>It appears that this has been resolved upstream for both 0.20 and 0.21.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2007-07-02 17:50:26 0000</bug_when>
            <thetext>This will be fixed in a mythtv ebuild newer then 13794. So &gt;=media-tv/mythtv-0.21_p13794</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2007-08-06 21:42:01 0000</bug_when>
            <thetext>Fixed in mythtv-0.20.1_p14146</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2007-08-06 21:43:28 0000</bug_when>
            <thetext>*** Bug 187445 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
      
    </bug>

</bugzilla>