schemas/_regproc.mysql.sql
author Aurelien Campeas <aurelien.campeas@logilab.fr>
Fri, 25 Jan 2013 13:28:23 +0100
changeset 8682 20bd1cdf86ae
parent 3928 2ced335a9b55
permissions -rw-r--r--
[cwctl] fix cubicweb-ctl shell command (closes #2583919) * add an uri parsing utility that documents a bit the uri cubicweb supports out of the box * cwctl: use this utility and refactor a bit for clarity (the novelty here being real support for old style 'myapp', or: * 'inmemory://myapp' * 'pyro://pyro-ns-host:pyro-ns-port/myapp' (pyro access through a pyro concentrator) * 'pyroloc://host:port/pyro-instance-id' (direct access to a pyro repository) * 'zmqpickle-tcp://host:port' * dbapi: refactor to sort out some of the complexity and restore functionality lost in 62213a34726e

/* -*- sql -*- 

   mysql specific registered procedures, 

*/

/* XXX limit_size version dealing with format as postgres version does.
   XXX mysql doesn't support overloading, each function should have a different name
       
   NOTE: fulltext renamed since it cause a mysql name conflict
 */

CREATE FUNCTION text_limit_size(vfulltext TEXT, maxsize INT)
RETURNS TEXT
NO SQL
BEGIN
    IF LENGTH(vfulltext) < maxsize THEN
       RETURN vfulltext;
    ELSE
       RETURN SUBSTRING(vfulltext from 1 for maxsize) || '...';
    END IF;
END ;;