SQL Error

Hi i’m facing the errors below, I’m currently using Centos 7.4 | Apache 2.4 | PHP 7.0.26 | MariaDB 10.2.11
 
2017/12/30 13:49:02 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_2` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 13:49:46 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_2` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 13:50:53 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_3` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 13:51:03 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_2` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 13:53:21 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_2` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 13:53:22 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_3` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 13:53:22 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_4` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 13:53:22 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_5` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 13:53:22 -- Start running step #62017/12/30 13:53:22 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_6` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 13:53:22 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_7` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 13:53:22 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_8_review` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 13:59:50 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_2` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 14:02:01 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_2` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7) 
 

6 answers

Profile photo of Mall Staff 184060.00 $tone December 30, 2017
Public

Hi there,

INSERT INTO `ub_migrate_map_step_2` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)2017/12/30 13:49:46

As you see our tool was process with a correct MySQL date time for mat: 2017/12/30 13:49:46
It seem relates to your MySQL settings. You could look a workaround to re-setting your MySQL server in this post:
https://stackoverflow.com/questions/9192027/invalid-default-value-for-create-date-timestamp-field
After re-setting your MySQL server successfully, you could continue with our tool normally.
Regards,
Mall.

#
Profile photo of ubdev Staff 98150.00 $tone December 31, 2017
Public

Hi there,
Glad it helps.
We have the ticket closed for now, should you have additional question, please get back to us here, or submit a new ticket. 
Regards,
Ubertheme team

#2
Profile photo of mattbelair 60.00 $tone March 14, 2018
Public

Hello,
 
I am running into the same issue and the workaround/restart did not solve the issue.
 
added this to my.conf:
 
sql-mode                = “STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ALLOW_INVALID_DATES”
 
Restarted mysql and still get:
 
CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘current_timestamp()’ for column ‘created_time’ at row 1. The SQL statement executed was: INSERT INTO `ub_migrate_map_step_2` (`can_reset`, `created_time`, `offset`, `entity_name`, `m1_id`, `m2_id`, `m2_model_class`, `m2_key_field`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)
 
Thank you!

#3

Please login or Register to Submit Answer

Written By

Comments