title: Why is MySQL Workbench telling me I need a semicolon?
body: <p>This code has passed several online validation tests. I don't know what is wrong. After the <code>CONCAT</code> function, it says I need a semicolon, though there already is one there. And on the <code>end</code> it says it is extraneous input when it is expecting an end of statement. What gives?</p>
  
  <pre><code>create procedure AddColumnUnlessExists(
      IN dbName tinytext,
      IN tableName tinytext,
      IN fieldName tinytext,
      IN fieldDef text)
  begin
      IF NOT EXISTS (
          SELECT * FROM information_schema.COLUMNS
          WHERE column_name=fieldName
          and table_name=tableName
          and table_schema=dbName
          )
      THEN
          set @ddl = CONCAT('ALTER TABLE ', dbName, '.', tableName, ' ADD COLUMN ', fieldName, ' ', fieldDef);
          prepare stmt from @ddl;
          execute stmt;
      END IF;
  end;
  </code></pre>