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 re missing default values #6661

Open
3 of 4 tasks
AnonTester opened this issue Feb 12, 2024 · 0 comments
Open
3 of 4 tasks

SQL warnings re missing default values #6661

AnonTester opened this issue Feb 12, 2024 · 0 comments

Comments

@AnonTester
Copy link

AnonTester commented Feb 12, 2024

Prerequisites

  • Can you reproduce the problem in a fresh installation of the "develop" branch?
  • Do you have any errors in the PHP error log, or javascript console?
  • Did you check the osTicket forums?
  • Did you perform a cursory search to see if your bug or enhancement is already reported?

For more information on how to write a good bug report

Description

MariaDB enabled more default warnings and I'm seeing the following warnings in my logs:

2024-02-12 15:02:02 [] @  [] WARNING 1364: Field 'updated' doesn't have a default value : INSERT INTO `ost_thread_entry` SET `created` = NOW(), `type` = 'M', `thread_id` = 70605, `format` = 'html', `user_id` = 576, `poster` = 'xxx', `source` = 'Email', `flags` = 576, `recipients` = '{\"to\":[\"xxxx Support [<xxx>](mailto:xxx)\"]}', `pid` = 322215, `body` = ' <div><p class=\"MsoNormal\"><span style=\"font-size:11.0pt\">Thanks! </span><span style=\"font-size:11.0pt\"></span></p> <p class=\"MsoNormal\"><span style=\"font-size:11.0pt\"><p> </p></span></p> <div style=\"border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm\"><p class=\"MsoNormal\"><b><span lang=\"EN-US\" style=\"font-size:11.0pt\">From:</span></b> <span lang=\"EN-US\" style=\"font-size:11.0pt\">Support <br /> <b>Sent:</b> Monday, February 12, 2024 2:56 PM<br /> <b>To:</b> xxx<br /> <b>Subject:</b> [#xxx] Re: xxx</span></p> </div> <p class=\"MsoNormal\"><p> </p

2024-02-12 15:02:37 [] @  [] WARNING 1364: Field 'team_id' doesn't have a default value : INSERT INTO `ost_thread_event` SET `thread_type` = 'T', `staff_id` = 86, `dept_id` = 1, `topic_id` = 34, `timestamp` = NOW(), `uid_type` = 'S', `uid` = 86, `username` = 'xxx', `event_id` = 2, `data` = '{\"status\":[2,\"Resolved\"]}', `thread_id` = 70605

2024-02-15 15:40:04 [] @  [] WARNING 1364: Field 'staff_id' doesn't have a default value : INSERT INTO `ost_thread_event` SET `thread_type` = 'T', `dept_id` = 1, `topic_id` = 34, `timestamp` = NOW(), `uid_type` = 'U', `uid` = 646, `username` = 'SYSTEM', `event_id` = 1, `thread_id` = 70615

2024-02-22 11:21:28 [] @  [] WARNING 1364: Field 'body' doesn't have a default value : INSERT INTO `ost_draft` SET `namespace` = 'ticket.response.69735', `created` = NOW(), `staff_id` = 2

2024-02-21 10:39:26 [] @  [] WARNING 1364: Field 'logger' doesn't have a default value : INSERT INTO ost_syslog SET created=NOW(), updated=NOW() ,title='Invalid CSRF Token __CSRFToken__',log_type='Warning',log='Invalid CSRF token [xxx] on https://xxx/scp/login.php',ip_address='xxx'

2024-03-18 12:53:32 admin[admin] @ localhost [] WARNING 1048: Column 'lock_id' cannot be null : UPDATE `ost_ticket` SET `lock_id` = NULL, `updated` = NOW() WHERE `ost_ticket`.`ticket_id` = 71055 LIMIT 1

Steps to Reproduce

  1. upgrade MariaDB to 10.11.6-0+deb12u1 on debian 12
  2. work on some tickets
  3. check logs

Expected behavior: [What you expected to happen]
no errors in logs and default values set for db inserts where no values are given

Actual behavior: [What actually happened]
errors in logs about missing default values or code does not properly add the values

see here for mariadb changes in logging which showed up the warnings, but the root cause is missing default value in db or missing value for those fields
https://mariadb.com/kb/en/sql-mode/

Versions

osTicket v1.18 (checked mysql base file in dev github and no default values set for either)

Debian 12, kernel 5.10.0-16-amd64, php 8.2.15,
mariadb Ver 15.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper

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