UnownHash / Golbat

The Unlicense
36 stars 19 forks source link

route descriptions too long to fit into DB column #204

Closed comstud closed 9 months ago

comstud commented 9 months ago

I'm seeing a number of these:

ERRO 2024-01-13 14:26:18 Failed to decode route insert route error: Error 1406 (22001): Data too long for column 'description' at row 1

I tried to truncate... which should truncate on character boundary, not octet boundary... but, I've got this now, lol.

WARN 2024-01-13 16:53:47 truncating description for route id 'yokohamaWCS3kml'. Orig description: 赤レンガ倉庫の日本最古の荷役用エレベーター前と、桜木町駅前のポケふた(※)「ピカチュウ」を結ぶルート。新港中央広場を通り抜け、ヨコハマエアキャビンを眺めながら汽車道を歩こう。

(WCSとは、ポケモンのゲーム部門・カードゲーム部門・『ポケモン GO』部門・『ポケモンユナイト』部門の4部門の世界一を決める大会のこと。毎年世界中から、各地域や国の激戦を勝ち抜いたプレイヤーが参加し、世界チャンピオンを巡って熱いバトルが繰り広げられます。)

※ポケモンマンホール「ポケふた」とは、ポケモンの絵が描かれたマンホール蓋のこと。1枚1枚がすべてオリジナルデザインで、世界にひとつだけのマンホール蓋です。
ERRO 2024-01-13 16:53:47 Failed to decode route insert route error: Error 1366 (22007): Incorrect string value: '\xE3' for column `golbat`.`route`.`description` at row 1
comstud commented 9 months ago

Ah, my truncate method actually does truncate by octets. Oops. Ok.

comstud commented 9 months ago

Alright, PRed with a fun way to truncate on rune boundary.

comstud commented 9 months ago

Perhaps this should be done when the *Route is formed so that Description is consistent throughout, even if truncated?

comstud commented 9 months ago

I think I meant to leave that question on the PR, not the issue. :) I copied it over there now.