Problem
Noticed error messages in log along the lines of:
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'service' at row 1: INSERT INTO {cas_server_tickets} (uid, service, ticket, timestamp, valid) VALUES ....
This occurs because URL string is too long for the 'service' field.
Proposed resolution
Solution is to increase the size of the service field to 512 chars. I have added a patch for review.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | increase-service-field-size-2315593-6.patch | 827 bytes | reswild |
| #1 | increase-service-field-size-2315593-1.patch | 1.14 KB | evilfurryone |
Comments
Comment #1
evilfurryone commentedComment #2
bkosborneDoes this patch work for you? I thought the max length of a varchar was 255.
Comment #3
dobie_gillis commentedThe max length of a varchar is 65,535 in mysql >= 5.0.3. http://stackoverflow.com/a/13506920/173630
Comment #4
reswild commentedI ran into this issue recently when working with a login service that adds long query strings to the service url. In my case 512 chars wasn't enough either, so I set it to 1024.
There might be a better way of doing this though.
Comment #5
bkosborneThis patch needs to be updated to include an update hook as well - to increase the size for sites that already have the module installed. And sure, it makes sense to increase to 1024.
Comment #6
reswild commentedHere is a new version of the patch that increases the field length to 1024.
The update hook was already included.
Comment #7
bkosborneLooks good, thanks!