Summary: | MySQL 5.7 - Column search_history.time cannot be null | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Searching | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | major | ||
Priority: | P5 - low | CC: | julian.maurice, kyle, m.de.rooy, mtj, ztajoli |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Bug Depends on: | |||
Bug Blocks: | 17258 | ||
Attachments: |
Bug 17323: Column search_history.time cannot be null
Bug 17323: Column search_history.time cannot be null Bug 17323: Column search_history.time cannot be null Bug 17323: Column search_history.time cannot be null |
Description
Jonathan Druart
2016-09-20 10:24:55 UTC
Created attachment 55715 [details] [review] Bug 17323: Column search_history.time cannot be null When doing a search, with SearchHistory pref switched on: DBD::mysql::st execute failed: Column 'time' cannot be null [for Statement " INSERT INTO search_history( userid, sessionid, query_desc, query_cgi, type, total, time ) VALUES( ?, ?, ?, ?, ?, ?, ? ) " with ParamValues: 0="7874", 1='12338a0bd8da63e32c79ee84f8493a07', 2="kw,wrdl: d", 3='q=d', 4='biblio', 5=6104, 6=undef] at C4/Search/History.pm line 34. Since MySLQ 5.7, undef does not mean "the default value". To let the DBMS set the default value (CURRENT_TIMESTAMP), the parameter should not be passed Test plan: OPAC+Intranet, swith the 2 SearchHistory syspref on Do a search => Without this patch, you will get an error in the log and the row will not be inserted in the table. => With this patch, everything must go fine Created attachment 55717 [details] [review] Bug 17323: Column search_history.time cannot be null When doing a search, with SearchHistory pref switched on: DBD::mysql::st execute failed: Column 'time' cannot be null [for Statement " INSERT INTO search_history( userid, sessionid, query_desc, query_cgi, type, total, time ) VALUES( ?, ?, ?, ?, ?, ?, ? ) " with ParamValues: 0="7874", 1='12338a0bd8da63e32c79ee84f8493a07', 2="kw,wrdl: d", 3='q=d', 4='biblio', 5=6104, 6=undef] at C4/Search/History.pm line 34. Since MySLQ 5.7, undef does not mean "the default value". To let the DBMS set the default value (CURRENT_TIMESTAMP), the parameter should not be passed Test plan: OPAC+Intranet, swith the 2 SearchHistory syspref on Do a search => Without this patch, you will get an error in the log and the row will not be inserted in the table. => With this patch, everything must go fine This is a major one! Created attachment 56042 [details] [review] Bug 17323: Column search_history.time cannot be null When doing a search, with SearchHistory pref switched on: DBD::mysql::st execute failed: Column 'time' cannot be null [for Statement " INSERT INTO search_history( userid, sessionid, query_desc, query_cgi, type, total, time ) VALUES( ?, ?, ?, ?, ?, ?, ? ) " with ParamValues: 0="7874", 1='12338a0bd8da63e32c79ee84f8493a07', 2="kw,wrdl: d", 3='q=d', 4='biblio', 5=6104, 6=undef] at C4/Search/History.pm line 34. Since MySLQ 5.7, undef does not mean "the default value". To let the DBMS set the default value (CURRENT_TIMESTAMP), the parameter should not be passed Test plan: OPAC+Intranet, swith the 2 SearchHistory syspref on Do a search => Without this patch, you will get an error in the log and the row will not be inserted in the table. => With this patch, everything must go fine Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Created attachment 57647 [details] [review] Bug 17323: Column search_history.time cannot be null When doing a search, with SearchHistory pref switched on: DBD::mysql::st execute failed: Column 'time' cannot be null [for Statement " INSERT INTO search_history( userid, sessionid, query_desc, query_cgi, type, total, time ) VALUES( ?, ?, ?, ?, ?, ?, ? ) " with ParamValues: 0="7874", 1='12338a0bd8da63e32c79ee84f8493a07', 2="kw,wrdl: d", 3='q=d', 4='biblio', 5=6104, 6=undef] at C4/Search/History.pm line 34. Since MySLQ 5.7, undef does not mean "the default value". To let the DBMS set the default value (CURRENT_TIMESTAMP), the parameter should not be passed Test plan: OPAC+Intranet, swith the 2 SearchHistory syspref on Do a search => Without this patch, you will get an error in the log and the row will not be inserted in the table. => With this patch, everything must go fine Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Not verified with MySQL 5.7. But this looks good to me. Works under Jessie. Pushed to master for 16.11, thanks Jonathan! Pushed to 3.22.x, will be in 3.22.13 Pushed to 16.05.x, for 16.05.06 release ERROR: Bareword "dt_from_string" not allowed while "strict subs" in use at C4/Search/History.pm line 47. Look here: userid, sessionid, query_desc, query_cgi, type, total} . ( Look better :) Different brackets (In reply to Marcel de Rooy from comment #9) > ERROR: > Bareword "dt_from_string" not allowed while "strict subs" in use at > C4/Search/History.pm line 47. > > Look here: > userid, sessionid, query_desc, query_cgi, type, total} . ( > > Look better :) Different brackets Nope Look even better :) (In reply to Marcel de Rooy from comment #10) > (In reply to Marcel de Rooy from comment #9) > > ERROR: > > Bareword "dt_from_string" not allowed while "strict subs" in use at > > C4/Search/History.pm line 47. > > > > Look here: > > userid, sessionid, query_desc, query_cgi, type, total} . ( > > > > Look better :) Different brackets > > Nope Look even better :) Forget this. Remains of 17600 ;) |