Skip to content

Fix invalid SQL queries causing MySQL compatibility issues in WebUI #1137

@coderabbitai

Description

@coderabbitai

Problem Description

The WebUI fails to load timestamp ranges properly when using MySQL as the underlying storage engine due to invalid SQL syntax in CAST operations.

Root Cause

The keyword "INTEGER" is not a valid target for CAST operations in MySQL, causing SQL syntax errors.

Impact

  • Timestamp range functionality broken in WebUI when using MySQL storage engine
  • Error logs show: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTEGER'"

Solution

Replace "INTEGER" with "UNSIGNED" in CAST operations to ensure MySQL compatibility while maintaining MariaDB compatibility.

Steps to Reproduce

  1. Configure MySQL as the underlying storage engine
  2. Compress logs with valid timestamps
  3. Check WebUI - timestamp range fails to load properly
  4. Check container logs for SQL syntax errors

Related

Validation

  • Issue resolved with UNSIGNED keyword
  • MariaDB compatibility maintained
  • WebUI timestamp functionality restored

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions