Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1
-
MOODLE_21_STABLE
-
MOODLE_22_STABLE
-
w37_
MDL-29321_m22_largevarchar -
Description
In 1.7 we still supported ancient MySQL that did not support varchars longer than 255, unfortunately text filed can not be used everywhere thanks to restrictions in oracle and mssql.
Places that could use longer varchars (in separate issues later):
- user preference value - breaks very very often in gradebook
- extrnal URLs (rss client block, user profile url)
- any multilang field (course full name translated to 20 languages for example) - the multilang syntax has big overhead
What is the proper limit now:
- mssql - NVARCHAR recommended <= 4000 chars, larger is treated as text http://msdn.microsoft.com/en-us/library/ms186939.aspx
- oracle - VARCHAR2 has limit 4000bytes, that is a lousy 4000/3=1333 utf-8 chars, lets ignore this fast&stupid database http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm
- mysql - VARCHAR 65,535 chars http://dev.mysql.com/doc/refman/5.0/en/char.html
- postgresql - 1GB oh my! http://www.postgresql.org/docs/8.3/static/datatype-character.html
It looks like the reasonable maximum is either 2048 or 4000 chars.
Hopefully people with higher unicode chars do not use oracle, anyway anybody who counts string length in bytes these days is crazy...