Internal Server Error when Saving data objects in TEXT columns

See this comment. It says:

“you can have at most 10 TEXT columns of 21000 symbols in one table, and then you’re left with 157 free bytes (so you can store a 157 symbol STRING or TEXT more)”

In other words, if you have 10 TEXT columns, there is only 157 bytes available for other data. A single string column would eat up to 500 bytes, so you would not be able to have more than one additional STRING column if you have 10 TEXTs.

Btw, are you building a mobile app?

Yes, planning on doing some Android development

Just to clarify, with your replay that 157 bytes would be available, then a string column would consume 500 bytes. At this point I would expect a smaller byte value for the STRING data type. For example for TEXT 21000 bytes takes 788 bytes for internal management. May a STRING data type with a 500 byte max. limit would have an internal max. limit of 240 bytes?

A STRING column may contain up to 500 bytes, however, the allocated amount is the actual length of your string property times 3 (because of encoding).

Btw, if you are building a mobile app, sending requests with 210kb payloads is a very bad idea. You need to strive to keep your requests and responses small so that your app is responsive.

Roy,

    TEXT column takes up to 788 bytes (depending on data length; thus, if you save a text of 450 symbols - it would take 450 bytes, if it's 788 symbols - it takes 788 bytes, but if it's more than 788 symbols, like 1000 or 21000 - it still takes 788 bytes - this is how our database handles it); STRING column takes up to 500 bytes (e.g. 250 symbols would take 250 bytes and 500 symbols would take 500 bytes); INT column always takes 8 bytes.

In your case you should manually assure that the data you’re trying to save is less than 8037 bytes total. If you fully fill 10 TEXT columns it will already take 7880 bytes, leaving not so much space for other 12 STRING and 12 INT columns, so that you will almost definitely hit the limit.

Thanks for all the info. Will adjust my tables with these limits

Further data size clarification needed.

What are the sizes for :

  1. DOUBLE
  2. BOOLEAN
  3. DATE_TIME
    DATETIME - 8 bytes DOUBLE - 8 bytes BOOLEAN - 1 byte

Thanks