 DROP FUNCTION IF EXISTS col_type_is //
 CREATE FUNCTION col_type_is(sname VARCHAR(64), tname VARCHAR(64), cname VARCHAR(64), ctype LONGTEXT, description TEXT)
 RETURNS TEXT
+DETERMINISTIC
+CONTAINS SQL
 BEGIN
   IF description = '' THEN
     SET description = CONCAT('Column ', quote_ident(tname), '.', quote_ident(cname),

DROP FUNCTION IF EXISTS _col_has_primary_key //
CREATE FUNCTION _col_has_primary_key(sname VARCHAR(64), tname VARCHAR(64), cname VARCHAR(64))
RETURNS BOOLEAN
BEGIN
  DECLARE ret BOOLEAN;


DROP FUNCTION IF EXISTS columns_are //
CREATE FUNCTION columns_are(sname VARCHAR(64), tname VARCHAR(64), want TEXT, description TEXT)
RETURNS TEXT
DETERMINISTIC
CONTAINS SQL
BEGIN
  DECLARE sep       CHAR(1) DEFAULT ',';
  DECLARE seplength INTEGER DEFAULT CHAR_LENGTH(sep);
