Too many CiviCRM custom fields breaks logging resulting in mysterious errors
Overview
If for some strange reason you decide to create a lot of custom fields - and use detailed logging you can break stuff rather badly without getting a nice warning.
Reproduction steps
- Turn on detailed logging
- Create yourself a custom field group - or use one you've prepared earlier.
- Add a lot of text fields with max length. This probably depends on database settings - for mariadb what your database innodb_page_size variable is set to.
- At some point you will be able to add new fields to the custom group - but the row size will be exceeded when these fields are added to the log_custom_group_value_thing_table.
- From this point on any operation attempting to write data into that table will result in errors when Detail logging is turned on. However due to the joys of detailed logging it will say something like field X doesn't exist - however it does - but field Y will exist on that table but not on the log_table.
- You will possibly notice a small error message showing when turning detailed logging on.
Current behaviour
You get errors like this when turning
[nativecode=1118 ** Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs]
Expected behaviour
You should probably not be able to create custom fields after a certain point. however perhaps more to the point - if there is an error turning detailed logging on and it relates to a schema mismatch then perhaps it would be better to - turn the detailed logging back off - return a Computer says no message - along with a list of log tables that don't match what they should.