Bug 27821 - sanitize_zero_date does not handle datetime
Summary: sanitize_zero_date does not handle datetime
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 26997
Blocks: 7806
  Show dependency treegraph
 
Reported: 2021-03-01 10:12 UTC by Jonathan Druart
Modified: 2021-12-13 21:11 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.04,20.05.10,19.11.16


Attachments
Bug 27821: Make sanitize_zero_date support datetime and timestamp (1.40 KB, patch)
2021-03-01 10:14 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2021-03-01 10:12:46 UTC
Only datatype "date" is handled correctly.

Atomic update generated errors: main::sanitize_zero_date(): DBI Exception: DBD::mysql::db do failed: Truncated incorrect CHAR(10) value: '2021-03-01 09:43:56' [for Statement "                                   
        UPDATE old_issues
        SET returndate = NULL
        WHERE CAST(returndate AS CHAR(10)) = '0000-00-00';
    "] at (eval 1481) line 5
Comment 1 Jonathan Druart 2021-03-01 10:14:02 UTC
RMaints, keep an eye on this one, you may need to backport it quickly.
Comment 2 Jonathan Druart 2021-03-01 10:14:57 UTC
Created attachment 117432 [details] [review]
Bug 27821: Make sanitize_zero_date support datetime and timestamp
Comment 3 Jonathan Druart 2021-03-01 10:29:21 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 4 Fridolin Somers 2021-03-04 09:24:08 UTC
Pushed to 20.11.x for 20.11.04
Comment 5 Andrew Fuerste-Henry 2021-03-05 20:13:42 UTC
Pushed to 20.05.x for 20.05.10
Comment 6 Victor Grousset/tuxayo 2021-03-22 15:25:41 UTC
Backported: Pushed to 19.11.x branch for 19.11.16