fix record size causing mysql table create failure (FSCORE-512)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15938 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2009-12-12 21:12:18 +00:00
parent 8d71550ced
commit 49be528be5
1 changed files with 51 additions and 50 deletions

View File

@ -1141,95 +1141,95 @@ static void core_event_handler(switch_event_t *event)
static char create_complete_sql[] =
"CREATE TABLE complete (\n"
" sticky INTEGER,\n"
" a1 VARCHAR(4096),\n"
" a2 VARCHAR(4096),\n"
" a3 VARCHAR(4096),\n"
" a4 VARCHAR(4096),\n"
" a5 VARCHAR(4096),\n"
" a6 VARCHAR(4096),\n"
" a7 VARCHAR(4096),\n"
" a8 VARCHAR(4096),\n"
" a9 VARCHAR(4096),\n"
" a10 VARCHAR(4096),\n"
" hostname VARCHAR(4096)\n"
" a1 VARCHAR(128),\n"
" a2 VARCHAR(128),\n"
" a3 VARCHAR(128),\n"
" a4 VARCHAR(128),\n"
" a5 VARCHAR(128),\n"
" a6 VARCHAR(128),\n"
" a7 VARCHAR(128),\n"
" a8 VARCHAR(128),\n"
" a9 VARCHAR(128),\n"
" a10 VARCHAR(128),\n"
" hostname VARCHAR(1024)\n"
");\n";
static char create_alias_sql[] =
"CREATE TABLE aliases (\n"
" sticky INTEGER,\n"
" alias VARCHAR(4096),\n"
" alias VARCHAR(128),\n"
" command VARCHAR(4096),\n"
" hostname VARCHAR(4096)\n"
" hostname VARCHAR(1024)\n"
");\n";
static char create_channels_sql[] =
"CREATE TABLE channels (\n"
" uuid VARCHAR(4096),\n"
" direction VARCHAR(4096),\n"
" created VARCHAR(4096),\n"
" uuid VARCHAR(1024),\n"
" direction VARCHAR(32),\n"
" created VARCHAR(128),\n"
" created_epoch INTEGER,\n"
" name VARCHAR(4096),\n"
" state VARCHAR(4096),\n"
" cid_name VARCHAR(4096),\n"
" cid_num VARCHAR(4096),\n"
" ip_addr VARCHAR(4096),\n"
" dest VARCHAR(4096),\n"
" application VARCHAR(4096),\n"
" name VARCHAR(1024),\n"
" state VARCHAR(64),\n"
" cid_name VARCHAR(1024),\n"
" cid_num VARCHAR(256),\n"
" ip_addr VARCHAR(256),\n"
" dest VARCHAR(1024),\n"
" application VARCHAR(128),\n"
" application_data VARCHAR(4096),\n"
" dialplan VARCHAR(4096),\n"
" context VARCHAR(4096),\n"
" read_codec VARCHAR(4096),\n"
" read_rate VARCHAR(4096),\n"
" write_codec VARCHAR(4096),\n"
" write_rate VARCHAR(4096),\n"
" secure VARCHAR(4096),\n"
" hostname VARCHAR(4096),\n"
" dialplan VARCHAR(128),\n"
" context VARCHAR(128),\n"
" read_codec VARCHAR(128),\n"
" read_rate VARCHAR(32),\n"
" write_codec VARCHAR(128),\n"
" write_rate VARCHAR(32),\n"
" secure VARCHAR(32),\n"
" hostname VARCHAR(1024),\n"
" presence_id VARCHAR(4096),\n"
" presence_data VARCHAR(4096)\n"
");\ncreate index uuindex on channels (uuid,hostname);\n";
static char create_calls_sql[] =
"CREATE TABLE calls (\n"
" call_created VARCHAR(4096),\n"
" call_created VARCHAR(128),\n"
" call_created_epoch INTEGER,\n"
" function VARCHAR(4096),\n"
" caller_cid_name VARCHAR(4096),\n"
" caller_cid_num VARCHAR(4096),\n"
" caller_dest_num VARCHAR(4096),\n"
" caller_chan_name VARCHAR(4096),\n"
" caller_uuid VARCHAR(4096),\n"
" callee_cid_name VARCHAR(4096),\n"
" callee_cid_num VARCHAR(4096),\n"
" callee_dest_num VARCHAR(4096),\n"
" callee_chan_name VARCHAR(4096),\n"
" function VARCHAR(1024),\n"
" caller_cid_name VARCHAR(1024),\n"
" caller_cid_num VARCHAR(256),\n"
" caller_dest_num VARCHAR(256),\n"
" caller_chan_name VARCHAR(1024),\n"
" caller_uuid VARCHAR(1024),\n"
" callee_cid_name VARCHAR(1024),\n"
" callee_cid_num VARCHAR(256),\n"
" callee_dest_num VARCHAR(256),\n"
" callee_chan_name VARCHAR(1024),\n"
" callee_uuid VARCHAR(4096),\n"
" hostname VARCHAR(4096)\n"
" hostname VARCHAR(1024)\n"
");\n"
"create index eruuindex on calls (caller_uuid,hostname);\n"
"create index eeuuindex on calls (callee_uuid,hostname);\n";
static char create_interfaces_sql[] =
"CREATE TABLE interfaces (\n"
" type VARCHAR(4096),\n"
" name VARCHAR(4096),\n"
" type VARCHAR(128),\n"
" name VARCHAR(1024),\n"
" description VARCHAR(4096),\n"
" ikey VARCHAR(4096),\n"
" ikey VARCHAR(1024),\n"
" filename VARCHAR(4096),\n"
" syntax VARCHAR(4096),\n"
" hostname VARCHAR(4096)\n"
" hostname VARCHAR(1024)\n"
");\n";
static char create_tasks_sql[] =
"CREATE TABLE tasks (\n"
" task_id INTEGER,\n"
" task_desc VARCHAR(4096),\n"
" task_group VARCHAR(4096),\n"
" task_group VARCHAR(1024),\n"
" task_sql_manager INTEGER,\n"
" hostname VARCHAR(4096)\n"
" hostname VARCHAR(1024)\n"
");\n";
static char create_nat_sql[] =
"CREATE TABLE nat (\n"
" sticky INTEGER,\n"
" port INTEGER,\n"
" proto INTEGER,\n"
" hostname VARCHAR(4096)\n"
" hostname VARCHAR(1024)\n"
");\n";
switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_t manage)
@ -1338,6 +1338,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
switch_cache_db_execute_sql(dbh, "delete from aliases where sticky=0", NULL);
switch_cache_db_execute_sql(dbh, "delete from nat where sticky=0", NULL);
switch_cache_db_execute_sql(dbh, "create index alias1 on aliases (alias)", NULL);
switch_cache_db_execute_sql(dbh, "create index tasks1 on tasks (hostname,task_id)", NULL);
switch_cache_db_execute_sql(dbh, "create index complete1 on complete (a1,hostname)", NULL);
switch_cache_db_execute_sql(dbh, "create index complete2 on complete (a2,hostname)", NULL);
switch_cache_db_execute_sql(dbh, "create index complete3 on complete (a3,hostname)", NULL);