[Koha-bugs] [Bug 17323] MySQL 5.7 - Column search_history.time cannot be null

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Oct 5 00:14:21 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17323

Chris Cormack <chris at bigballofwax.co.nz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #55717|0                           |1
        is obsolete|                            |

--- Comment #4 from Chris Cormack <chris at bigballofwax.co.nz> ---
Created attachment 56042
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=56042&action=edit
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 at catalyst.net.nz>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list