signalwire / freeswitch

FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
https://freeswitch.com/#getting-started
Other
3.32k stars 1.38k forks source link

Row size too large error when CREATE TABLE channels and using ODBC driver with MySQL #2444

Open ShaggyGS opened 2 months ago

ShaggyGS commented 2 months ago

Describe the bug I've tried to connect freeswitch to our MySQL database through ODBC driver as it described in the docs. Some of the tables was created successfully, but one table isn't probably compatible and throws error:

2024-04-25 15:11:31.982216 0.00% [ERR] switch_odbc.c:529 ERR: [CREATE TABLE channels (
   uuid  VARCHAR(256),
   direction  VARCHAR(32),
   created  VARCHAR(128),
   created_epoch  INTEGER,
   name  VARCHAR(1024),
   state  VARCHAR(64),
   cid_name  VARCHAR(1024),
   cid_num  VARCHAR(256),
   ip_addr  VARCHAR(256),
   dest  VARCHAR(1024),
   application  VARCHAR(128),
   application_data  VARCHAR(4096),
   dialplan VARCHAR(128),
   context VARCHAR(128),
   read_codec  VARCHAR(128),
   read_rate  VARCHAR(32),
   read_bit_rate  VARCHAR(32),
   write_codec  VARCHAR(128),
   write_rate  VARCHAR(32),
   write_bit_rate  VARCHAR(32),
   secure VARCHAR(64),
   hostname VARCHAR(256),
   presence_id VARCHAR(4096),
   presence_data VARCHAR(4096),
   accountcode VARCHAR(256),
   callstate  VARCHAR(64),
   callee_name  VARCHAR(1024),
   callee_num  VARCHAR(256),
   callee_direction  VARCHAR(5),
   call_uuid  VARCHAR(256),
   sent_callee_name  VARCHAR(1024),
   sent_callee_num  VARCHAR(256),
   initial_cid_name  VARCHAR(1024),
   initial_cid_num  VARCHAR(256),
   initial_ip_addr  VARCHAR(256),
   initial_dest  VARCHAR(1024),
   initial_dialplan  VARCHAR(128),
   initial_context  VARCHAR(128)
);

[STATE: HY000 CODE 1118 ERROR: [MySQL][ODBC 8.3(w) Driver][mysqld-8.0.30]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

To Reproduce Steps to reproduce the behavior:

  1. Create fresh new MySQL database on version 8.0.30 with utf8mb4_general_ci collation
  2. Add MySQL ODBC connection into /etc/freeswitch/autoload_configs/switch.conf.xml
  3. Restart/Start FreeSWITCH
  4. FreeSWITCH crashes

Expected behavior Create tables in database properly without crashing :)

Package version or git hash

summer789 commented 2 months ago

I'm also running into this issue, did you solve it?

themsley-voiceflex commented 2 months ago

It's a UTF-8 DBCS thing.... ENGINE=InnoDB DEFAULT CHARSET=latin1; works, ENGINE=InnoDB DEFAULT CHARSET=utf8; == Row size too large.

themsley-voiceflex commented 2 months ago

Also works if you reduce the size of the 3 columns there that are defined as varchar(4096). Works on 3328, fails on 3584.