Module: sip-router
Branch: master
Commit: 6033da2e644ccdca7fa57bee03f82cb03c36e45e
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6033da2…
Author: pd <peter.dunkley(a)crocodile-rcs.com>
Committer: pd <peter.dunkley(a)crocodile-rcs.com>
Date: Wed Jul 27 12:13:25 2011 +0100
srdb1, modules_k/xcap_server: Added support for XML documents larger than 64k in MySQL
- It is easily possible for some XML documents (particularly resource lists
used as a Network Address Book) to exceed 64k in size.
- Feature added by Andrew Miller at Crocodile RCS
---
lib/srdb1/schema/pr_xcap.xml | 2 +-
modules_k/xcap_server/xcap_server.c | 2 +-
utils/kamctl/mysql/presence-create.sql | 70 ++++++++++++++++----------------
3 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/lib/srdb1/schema/pr_xcap.xml b/lib/srdb1/schema/pr_xcap.xml
index 92ffda3..ef30273 100644
--- a/lib/srdb1/schema/pr_xcap.xml
+++ b/lib/srdb1/schema/pr_xcap.xml
@@ -44,7 +44,7 @@
<column>
<name>doc</name>
- <type>binary</type>
+ <type>largebinary</type>
<description>doc</description>
</column>
diff --git a/modules_k/xcap_server/xcap_server.c b/modules_k/xcap_server/xcap_server.c
index 1a041e3..db1e0f5 100644
--- a/modules_k/xcap_server/xcap_server.c
+++ b/modules_k/xcap_server/xcap_server.c
@@ -351,7 +351,7 @@ static int xcaps_put_db(str* user, str *domain, xcap_uri_t *xuri, str
*etag,
ncols++;
qcols[ncols] = &str_doc_col;
- qvals[ncols].type = DB1_STR;
+ qvals[ncols].type = DB1_BLOB;
qvals[ncols].nul = 0;
qvals[ncols].val.str_val= *doc;
ncols++;
diff --git a/utils/kamctl/mysql/presence-create.sql
b/utils/kamctl/mysql/presence-create.sql
index 740149b..3b2608c 100644
--- a/utils/kamctl/mysql/presence-create.sql
+++ b/utils/kamctl/mysql/presence-create.sql
@@ -1,20 +1,20 @@
INSERT INTO version (table_name, table_version) values
('presentity','3');
CREATE TABLE presentity (
- id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ id SERIAL PRIMARY KEY NOT NULL,
username VARCHAR(64) NOT NULL,
domain VARCHAR(64) NOT NULL,
event VARCHAR(64) NOT NULL,
etag VARCHAR(64) NOT NULL,
- expires INT(11) NOT NULL,
- received_time INT(11) NOT NULL,
- body BLOB NOT NULL,
+ expires INTEGER NOT NULL,
+ received_time INTEGER NOT NULL,
+ body BYTEA NOT NULL,
sender VARCHAR(128) NOT NULL,
- CONSTRAINT presentity_idx UNIQUE (username, domain, event, etag)
-) ENGINE=MyISAM;
+ CONSTRAINT presentity_presentity_idx UNIQUE (username, domain, event, etag)
+);
INSERT INTO version (table_name, table_version) values
('active_watchers','9');
CREATE TABLE active_watchers (
- id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ id SERIAL PRIMARY KEY NOT NULL,
presentity_uri VARCHAR(128) NOT NULL,
watcher_username VARCHAR(64) NOT NULL,
watcher_domain VARCHAR(64) NOT NULL,
@@ -25,68 +25,68 @@ CREATE TABLE active_watchers (
to_tag VARCHAR(64) NOT NULL,
from_tag VARCHAR(64) NOT NULL,
callid VARCHAR(255) NOT NULL,
- local_cseq INT(11) NOT NULL,
- remote_cseq INT(11) NOT NULL,
+ local_cseq INTEGER NOT NULL,
+ remote_cseq INTEGER NOT NULL,
contact VARCHAR(128) NOT NULL,
record_route TEXT,
- expires INT(11) NOT NULL,
- status INT(11) DEFAULT 2 NOT NULL,
+ expires INTEGER NOT NULL,
+ status INTEGER DEFAULT 2 NOT NULL,
reason VARCHAR(64) NOT NULL,
- version INT(11) DEFAULT 0 NOT NULL,
+ version INTEGER DEFAULT 0 NOT NULL,
socket_info VARCHAR(64) NOT NULL,
local_contact VARCHAR(128) NOT NULL,
- CONSTRAINT active_watchers_idx UNIQUE (presentity_uri, callid, to_tag, from_tag)
-) ENGINE=MyISAM;
+ CONSTRAINT active_watchers_active_watchers_idx UNIQUE (presentity_uri, callid,
to_tag, from_tag)
+);
INSERT INTO version (table_name, table_version) values ('watchers','3');
CREATE TABLE watchers (
- id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ id SERIAL PRIMARY KEY NOT NULL,
presentity_uri VARCHAR(128) NOT NULL,
watcher_username VARCHAR(64) NOT NULL,
watcher_domain VARCHAR(64) NOT NULL,
event VARCHAR(64) DEFAULT 'presence' NOT NULL,
- status INT(11) NOT NULL,
+ status INTEGER NOT NULL,
reason VARCHAR(64),
- inserted_time INT(11) NOT NULL,
- CONSTRAINT watcher_idx UNIQUE (presentity_uri, watcher_username, watcher_domain,
event)
-) ENGINE=MyISAM;
+ inserted_time INTEGER NOT NULL,
+ CONSTRAINT watchers_watcher_idx UNIQUE (presentity_uri, watcher_username,
watcher_domain, event)
+);
INSERT INTO version (table_name, table_version) values ('xcap','3');
CREATE TABLE xcap (
- id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ id SERIAL PRIMARY KEY NOT NULL,
username VARCHAR(64) NOT NULL,
domain VARCHAR(64) NOT NULL,
- doc BLOB NOT NULL,
- doc_type INT(11) NOT NULL,
+ doc BYTEA NOT NULL,
+ doc_type INTEGER NOT NULL,
etag VARCHAR(64) NOT NULL,
- source INT(11) NOT NULL,
+ source INTEGER NOT NULL,
doc_uri VARCHAR(128) NOT NULL,
- port INT(11) NOT NULL,
- CONSTRAINT account_doc_type_idx UNIQUE (username, domain, doc_type, doc_uri)
-) ENGINE=MyISAM;
+ port INTEGER NOT NULL,
+ CONSTRAINT xcap_account_doc_type_idx UNIQUE (username, domain, doc_type, doc_uri)
+);
-CREATE INDEX source_idx ON xcap (source);
+CREATE INDEX xcap_source_idx ON xcap (source);
INSERT INTO version (table_name, table_version) values ('pua','6');
CREATE TABLE pua (
- id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ id SERIAL PRIMARY KEY NOT NULL,
pres_uri VARCHAR(128) NOT NULL,
pres_id VARCHAR(255) NOT NULL,
- event INT(11) NOT NULL,
- expires INT(11) NOT NULL,
- desired_expires INT(11) NOT NULL,
- flag INT(11) NOT NULL,
+ event INTEGER NOT NULL,
+ expires INTEGER NOT NULL,
+ desired_expires INTEGER NOT NULL,
+ flag INTEGER NOT NULL,
etag VARCHAR(64) NOT NULL,
tuple_id VARCHAR(64),
watcher_uri VARCHAR(128) NOT NULL,
call_id VARCHAR(128) NOT NULL,
to_tag VARCHAR(64) NOT NULL,
from_tag VARCHAR(64) NOT NULL,
- cseq INT(11) NOT NULL,
+ cseq INTEGER NOT NULL,
record_route TEXT,
contact VARCHAR(128) NOT NULL,
remote_contact VARCHAR(128) NOT NULL,
- version INT(11) NOT NULL,
+ version INTEGER NOT NULL,
extra_headers TEXT NOT NULL
-) ENGINE=MyISAM;
+);