This topic was marked solved by Pandos, on March 6th, 2015, 08:45 AM
Data too long for column 'featured' at row 1

emanuele

  • Posts: 125
Data too long for column 'featured' at row 1
« on March 5th, 2015, 09:44 PM »
Clean install of the current HEAD of the master branch.
MySQL 5.6.17.

Creating an album I got this message:
Code: [Select]
Data too long for column 'featured' at row 1
File: /home/emanuele/webserver/htdocs/wedge/gz/app/media_Aeva-Gallery2.php
Line: 1675

The workaround I used is to change the column to tinyint. :P

Pandos

  • Living on the edge of Wedge
  • Posts: 635
Re: Data too long for column 'featured' at row 1
« Reply #1, on March 6th, 2015, 08:29 AM »Last edited on March 6th, 2015, 08:45 AM
Yes! THX for the find.
BIT should be instead tinyint. Means the same, but display is handled very different.
And "outdated" since MySQL 5.0.3 ;)

PR is on the way.
# dpkg-reconfigure brain
error: brain is not installed or configured

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Data too long for column 'featured' at row 1
« Reply #2, on March 6th, 2015, 04:43 PM »
http://dev.mysql.com/doc/refman/5.0/en/bit-type.html

It's not 'outdated', it's just that it's stricter... (Or did BIT even exist before 5.0...?)

I've never met this problem, though!
Then again, I think wedge.org is mostly running on TINYINT field (otherwise I'd have had to convert manually, and I don't think I did. At least not all fields...) My local install is working fine, and that's with a recent MySQL, so I don't know... Setting, or something?

Apparently, the solution would be to use SET field = b'0' or b'1' instead of SET field = 0 or 1, but it's ugly...

I should remind you that I actually modified the database years ago to use BIT instead of TINYINT where possible... :^^;: (For reasons of "saving space", IIRC. Someone must have advocated for this...)
Going back doesn't sound great to me... :(

Pandos

  • Living on the edge of Wedge
  • Posts: 635