schemas/_regproc.mysql.sql
author Alain Begey <alain@unlish.com>
Mon, 14 Apr 2014 23:00:19 +0200
changeset 9717 a6834e2dcc1b
parent 3928 2ced335a9b55
permissions -rw-r--r--
[forms] Add autocomplete attribute for formrenderers If you set form.autocomplete = False, the form renderer in the open form tag will add the html option 'autocomplete=off'. It allows to disable the functionality of some browsers to fill in some forms automatically (for instance a profile with login/password) Closes #3747294

/* -*- 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 ;;