Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL Warnings: Truncated incorrect time value and SQL Error: Incorrect TIMESTAMP value #142

Open
jcervantes-sipecom opened this issue Mar 2, 2023 · 1 comment

Comments

@jcervantes-sipecom
Copy link

  • The version of the plugin: 2.1.4
  • The version of your GLPI: 10.0.6
  • The steps to reproduce your issue:
  1. I migrate from GLPI 9.5.9 and My Dashboard 1.8.3 (Tarball - Plugin folder) to GLPI 10.0.6 and My Dasboard 2.1.4 (Marketplace - Marketplace folder)
  2. I got these errors when trying to access My Dashboard:
SQL Warnings: 1292: Truncated incorrect time value: '1173:36:13' 1292: Truncated incorrect time value: '1102:36:13' 1292: Truncated incorrect time value: '1051:48:13' 1292: Truncated incorrect time value: '1003:58:12' 1292: Truncated incorrect time value: '956:02:13' in query "SELECT COUNT(`glpi_tickets`.`id`) AS nb FROM `glpi_tickets` WHERE `glpi_tickets`.`is_deleted` = 0 AND `glpi_tickets`.`takeintoaccount_delay_stat` IS NOT NULL AND `glpi_tickets`.`time_to_own` IS NOT NULL AND (`glpi_tickets`.`takeintoaccount_delay_stat` > TIME_TO_SEC(TIMEDIFF(`glpi_tickets`.`time_to_own`, `glpi_tickets`.`date`)) OR (`glpi_tickets`.`takeintoaccount_delay_stat` = 0 AND `glpi_tickets`.`time_to_own` < NOW()))AND ( `glpi_tickets`.`entities_id` IN ('0', '10', '12', '14', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '1') ) AND `status` IN (5,6)"
SQL Error "1525": Incorrect TIMESTAMP value: '-12-31 23:59:59' in query "SELECT COUNT(`solutiontypes_id`) as count, `glpi_solutiontypes`.`name`as namesolution, `glpi_itilsolutions`.`solutiontypes_id` FROM `glpi_itilsolutions` LEFT JOIN `glpi_tickets` ON (`glpi_itilsolutions`.`items_id` = `glpi_tickets`.`id` AND `glpi_itilsolutions`.`itemType` = 'Ticket') LEFT JOIN `glpi_solutiontypes` ON (`glpi_itilsolutions`.`solutiontypes_id` = `glpi_solutiontypes`.`id`) WHERE `glpi_tickets`.`is_deleted` = 0 AND `glpi_tickets`.`entities_id` IN (0,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,1) AND (`glpi_tickets`.`date` <= '-12-31 23:59:59') AND (`glpi_tickets`.`date` > ADDDATE('-01-01 00:00:00' , INTERVAL 1 DAY)) GROUP BY `solutiontypes_id`"
Uncaught Exception Error: Call to a member function fetch_array() on bool in /glpi/src/DBmysql.php at line 524
@jcervantes-sipecom
Copy link
Author

I guess for the first error is causing by timediff() data type limit range:

MySQL retrieves and displays TIME values in 'HH:MM:SS' format (or 'HHH:MM:SS' format for large hours values). TIME values may range from '-838:59:59' to '838:59:59'.

https://dev.mysql.com/doc/refman/5.7/en/time.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant