     SET msg = CONCAT('\n', CONCAT('\n'
       '    Extra ', what, ':\n\t' , REPLACE( extras, ',', '\n\t')));
   END IF;
-    
+
   IF missing <> '' THEN
     SET res = FALSE;
     SET msg = CONCAT(msg, CONCAT('\n'

  IF LEFT(ident,1) = '`' AND RIGHT(ident,1) = '`' THEN
	RETURN TRIM(BOTH '`' FROM REPLACE(ident,'``','`'));
  END IF;
   
  IF LEFT(ident,1) = '"' AND RIGHT(ident,1) = '"' THEN
	RETURN TRIM(BOTH '"' FROM REPLACE(ident,'""','"'));
  END IF;
   
  RETURN ident;
END //


BEGIN

  SET word =
    CASE
      WHEN word IN ('BOOL', 'BOOLEAN') THEN 'TINYINT'
      WHEN word =  'INTEGER' THEN 'INT'
      WHEN word IN ('DEC', 'NUMERIC', 'FIXED') THEN 'DECIMAL'
      WHEN word IN ('DOUBLE_PRECISION') THEN 'DOUBLE'
      WHEN word = 'REAL' THEN IF (INSTR(@@GLOBAL.sql_mode, 'REAL_AS_FLOAT') > 0 , 'FLOAT' , 'DOUBLE')
      WHEN word IN ('NCHAR', 'CHARACTER', 'NATIONAL_CHARACTER') THEN 'CHAR'
      WHEN word IN ('NVARCHAR', 'VARCHARACTER', 'CHARACTER_VARYING', 'NATIONAL_VARCHAR') THEN 'VARCHAR'
      WHEN word = 'CHAR_BYTE' THEN 'BIT'
      ELSE word
	END ;

  RETURN word;
