Bug 20144: [sql_modes] Set value for creator_batches.timestamp
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 6 Feb 2018 16:28:38 +0000 (13:28 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 13 Feb 2018 16:58:59 +0000 (13:58 -0300)
Fix for:
Incorrect datetime value: 'now()' for column 'timestamp'

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/db_dependent/Creators/Lib.t

index 248c4e7..858b886 100644 (file)
@@ -238,13 +238,13 @@ $query = '
   INSERT INTO creator_batches
     (batch_id , item_number, borrower_number,
      timestamp, branch_code, creator)
-  VALUES (?,?,?,?,?,?)';
+  VALUES (?,?,?,NOW(),?,?)';
 $insert_sth = $dbh->prepare($query);
-$insert_sth->execute( 11, $item_number1, $borrowernumber1, 'now()', $library1->{branchcode}, 'Labels' );
+$insert_sth->execute( 11, $item_number1, $borrowernumber1, $library1->{branchcode}, 'Labels' );
 
-$insert_sth->execute( 12, $item_number2, $borrowernumber2, 'now()', $library2->{branchcode}, 'Labels' );
+$insert_sth->execute( 12, $item_number2, $borrowernumber2, $library2->{branchcode}, 'Labels' );
 
-$insert_sth->execute( 12, $item_number3, $borrowernumber3, 'now()', $library3->{branchcode}, 'Labels' );
+$insert_sth->execute( 12, $item_number3, $borrowernumber3, $library3->{branchcode}, 'Labels' );
 
 ###########################################################
 #                     Testing Subs