string field (with max_limit 4000) accepts more than 4000 characters limit.

raom
Kilo Explorer

Hi Team,

I found that when we create a string field with max_limit 4000, it is accepting more than 4000 characters in the field. When I enter more than 4000 characters and tried to save it, the form was saved successfully with more than 4000 characters. Would like to know why it is accepting like that as the field max_length having only 4,000. I would like to know if this issue is with out of box itself.

Thanks in advance.

Rao M.

5 REPLIES 5

Srinivas Balusu
Kilo Guru

I hope this can give you some info on that.


see section 8.1 in below



http://wiki.servicenow.com/index.php?title=Introduction_to_Fields#Database_Field_Types&gsc.tab=0


steve_au
Kilo Contributor

I've also found this interesting. A new call description (task.description) can be > 100,000 chars even though the specified max limit is 4,000. What is the purpose of this max limit if it's not enforced?



I've noticed in the dictionary there's fields of the same type (string) with char limits > 1,000,000.



Weird.


dantenow
ServiceNow Employee
ServiceNow Employee

Hi Rao,



Per our wiki Database Field Types Wiki Article (http://wiki.servicenow.com/index.php?title=Introduction_to_Fields#Database_Field_Types&gsc.tab=0) the database may translate the value you provide in the max_length field to the closest matching database field type.   On MYSQL instances, a 4000 character max_length maps to MEDIUMTEXT data type which has a maximum length of 16,777,215 (224 − 1) characters. MySQL :: MySQL 5.7 Reference Manual :: 11.1.3 String Type Overview



Best Regards,



Dante


dharanikumar
Giga Guru

Hi,



If we set field max length to more than 255 then it is more characters than we expected.
I think its not about 4000