xkcd-Bucket icon indicating copy to clipboard operation
xkcd-Bucket copied to clipboard

Warn when adding a value too long for bucket_values.value

Open dgw opened this issue 10 years ago • 1 comments

Bucket silently truncates (or rather, lets the database engine truncate) values that don't fit in the default VARCHAR(32) bucket_values.value column. Not only that, but the full-length version is what's inserted into Bucket's cache and used until the next bot restart, when the truncated version from the database is loaded and used instead.

It would be better to let users know when they add a value if it's too long for the database.

If there's interest in adding this, I might try to teach myself enough Perl to write it. Advice would be helpful, though, like how to get the width of the column (cache it on startup?).

dgw avatar Jan 31 '15 17:01 dgw

uh, I suppose you could query the table (describe $vartablename) and get the column's size. Or you could just put it in a config option.

Mostly, it might make sense to just increase the default column size in the sql. Disk space is cheap these days.

zigdon avatar Feb 01 '15 22:02 zigdon