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.

Comments

evilfurryone’s picture

bkosborne’s picture

Does this patch work for you? I thought the max length of a varchar was 255.

dobie_gillis’s picture

The max length of a varchar is 65,535 in mysql >= 5.0.3. http://stackoverflow.com/a/13506920/173630

reswild’s picture

I 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.

bkosborne’s picture

This 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.

reswild’s picture

StatusFileSize
new827 bytes

Here is a new version of the patch that increases the field length to 1024.

The update hook was already included.

bkosborne’s picture

Status: Needs review » Fixed

Looks good, thanks!

  • bkosborne committed 0354529 on 7.x-1.x authored by reswild
    Issue #2315593 by evilfurryone, reswild: CAS Server service field size
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.