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

Data too long for column TimePeriod#range_value #724

Open
yhabteab opened this issue Mar 28, 2024 · 1 comment
Open

Data too long for column TimePeriod#range_value #724

yhabteab opened this issue Mar 28, 2024 · 1 comment
Labels
area/schema bug Something isn't working

Comments

@yhabteab
Copy link
Member

Describe the bug

I've just faced the following stack trace while testing another unrelated issue #713.

2024-03-28T14:53:46.468+0100    FATAL   main    Error 1406 (22001): Data too long for column 'range_value' at row 3
can't perform "INSERT INTO \"timeperiod_range\" (\"id\", \"timeperiod_id\", \"range_key\", \"range_value\", \"environment_id\") VALUES (:id, :timeperiod_id, :range_key, :range_value, :environment_id)"
github.com/icinga/icingadb/internal.CantPerformQuery
        /Users/yhabteab/Workspace/go/icingadb/internal/internal.go:30
github.com/icinga/icingadb/pkg/icingadb.(*DB).NamedBulkExec.func1.(*DB).NamedBulkExec.func1.1.2.1
        /Users/yhabteab/Workspace/go/icingadb/pkg/icingadb/db.go:391
github.com/icinga/icingadb/pkg/retry.WithBackoff
        /Users/yhabteab/Workspace/go/icingadb/pkg/retry/retry.go:49
github.com/icinga/icingadb/pkg/icingadb.(*DB).NamedBulkExec.func1.(*DB).NamedBulkExec.func1.1.2
        /Users/yhabteab/Workspace/go/icingadb/pkg/icingadb/db.go:386
golang.org/x/sync/errgroup.(*Group).Go.func1
        /Users/yhabteab/go/pkg/mod/golang.org/x/sync@v0.6.0/errgroup/errgroup.go:78
runtime.goexit
        /opt/homebrew/Cellar/go/1.22.1/libexec/src/runtime/asm_arm64.s:1222
can't retry
github.com/icinga/icingadb/pkg/retry.WithBackoff
        /Users/yhabteab/Workspace/go/icingadb/pkg/retry/retry.go:68
github.com/icinga/icingadb/pkg/icingadb.(*DB).NamedBulkExec.func1.(*DB).NamedBulkExec.func1.1.2
        /Users/yhabteab/Workspace/go/icingadb/pkg/icingadb/db.go:386
golang.org/x/sync/errgroup.(*Group).Go.func1
        /Users/yhabteab/go/pkg/mod/golang.org/x/sync@v0.6.0/errgroup/errgroup.go:78
runtime.goexit
        /opt/homebrew/Cellar/go/1.22.1/libexec/src/runtime/asm_arm64.s:1222
exit status 1
@yhabteab
Copy link
Member Author

mysql> show create table timeperiod_range\G
*************************** 1. row ***************************
       Table: timeperiod_range
Create Table: CREATE TABLE `timeperiod_range` (
  `id` binary(20) NOT NULL COMMENT 'sha1(environment.id + range_id + timeperiod_id)',
  `environment_id` binary(20) NOT NULL COMMENT 'env.id',
  `timeperiod_id` binary(20) NOT NULL COMMENT 'timeperiod.id',
  `range_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `range_value` varchar(255) COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC

The range_value column can only store 255 characters, but if you have a time period like from this issue configured :), it won't be able to handle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/schema bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant