+USE tap;
+
 DELIMITER //
 
 /****************************************************************************/

      (SELECT SHA1( -- COLUMNS
        GROUP_CONCAT(
          SHA1(
            CONCAT_WS('',`table_catalog`,`table_schema`,`table_name`,`column_name`,
              `ordinal_position`,`column_default`,`is_nullable`,`data_type`,
              `character_set_name`,`character_maximum_length`,`character_octet_length`,
              `numeric_precision`,`numeric_scale`,`datetime_precision`,`collation_name`,
              `column_type`,`column_key`,`extra`,`privileges`,`column_comment`,
              `generation_expression`)
      ))) sha
      FROM `information_schema`.`columns`
      WHERE `table_schema` = sname
      AND `table_name` = tname

DETERMINISTIC
BEGIN
  DECLARE ret CHAR(40);
  DECLARE ver INT;

  SET ver = (SELECT tap.mysql_version());

  SELECT SHA1(GROUP_CONCAT(sha)) INTO ret
  FROM 
