Opened 18 years ago
Closed 17 years ago
#5122 closed patch (fixed)
Program airdate set to 2000 when using EIT
| Reported by: | Owned by: | Stuart Auchterlonie | |
|---|---|---|---|
| Priority: | minor | Milestone: | unknown |
| Component: | eit | Version: | unknown |
| Severity: | low | Keywords: | eit fixup airdate |
| Cc: | Shane Shrybman | Ticket locked: | no |
Description
When using EIT and when the fixup routine does not set the airdate (ie. defaults to 0000), the airdate in the program table ends up getting set to 2000. When using the guide listing in mythweb, the program info popup will show '2000' rather than the set originalairdate. Mythweb will only show the originalairdate if the airdate='0000'. Both mythweb and the libmythtv/programinfo.cpp and libmythtv/programinfo.cpp expect the airdate to be set to 0000 (database default) if the airdate has not be set from the eit data.
The reason for this is that when DBEvent::GetOverlappingPrograms (eit.cpp) retrieves the airdate, the prog.airdate variable is set to '0' even though it is actually set to '0000' in the database. The '0' is then subsequently passed to DBEvent::UpdateDB which then updates the database. For whatever reason when mysql sees '0' it actually sets airdate to '2000' . This behaviour can be replicated by executing
UPDATE program SET airdate='0';
The airdate is then actually set to '2000'.
The attached patch, sets prog.airdate to QString::null if it retrieves '0' from the database. The current routine UpdateDB has the correct code to detect the null condition and set the airdate to '0000' when updating the database.
Attachments (1)
Change History (4)
by , 18 years ago
| Attachment: | myth_eit_2000_fix.diff added |
|---|
comment:1 by , 17 years ago
| Cc: | added |
|---|---|
| Component: | mythtv → eit |
| Keywords: | eit fixup airdate added |
| Owner: | changed from to |
| Severity: | medium → low |
| Status: | new → assigned |
| Type: | defect → patch |
Hi Bill, Thanks for your debugging work and the patch!
I don't use EIT but I can confirm the MySQL behaviour.
UPDATE program SET airdate='0'; airdate is set to '2000'
UPDATE program SET airdate=0; airdate is set to '0000'
I will get one of the EIT experts to have a look.
comment:2 by , 17 years ago
Sounds more like it's guessing the 4 digit year from a presumably 2 digit year... from http://dev.mysql.com/doc/refman/5.0/en/y2k-issues.html :
For DATETIME, DATE, TIMESTAMP, and YEAR types, MySQL interprets dates with ambiguous year values using the following rules:
- Year values in the range 00-69 are converted to 2000-2069.
- Year values in the range 70-99 are converted to 1970-1999.

patch