title: ALTER VIEW inserts database prefix for one view only
body: <p>Having a strange problem.</p>
  
  <p>I use several db views in my app. All of the views just reference their tables without prefix the db name, e.g.</p>
  
  <pre><code>SELECT  `foo`, `bar`
  FROM    `tablename`
  </code></pre>
  
  <p>However, I have one view which is as follows:</p>
  
  <pre><code>SELECT  `foo`, `bar`
  FROM    `database_name`.`table_name`
  </code></pre>
  
  <p>This is causing headaches when performing schema comparisons.</p>
  
  <p>I've edited the view several times using ALTER VIEW but every time it reinserts the database name as a prefix. I've also dropped and re-created it from scratch but same result.</p>
  
  <p>It only does it for this one view though.</p>
  
  <p>I'm using MySQL Workbench 6.3.10. Here's the full statement:</p>
  
  <pre><code>CREATE 
      ALGORITHM = UNDEFINED 
      DEFINER = `root`@`localhost` 
      SQL SECURITY DEFINER
  VIEW `reporting_base` AS
      SELECT 
          `b`.`creditor_id` AS `creditor_id`,
          `c`.`creditor_name` AS `creditor_name`,
          `c`.`group_name` AS `group_name`,
          `rd`.`base_date` AS `base_date`,
          `rd`.`year` AS `year`,
          `rd`.`period` AS `period`,
          `rd`.`week` AS `week`,
          `b`.`id` AS `branch_id`,
          `b`.`branch_name` AS `branch_name`,
          `b`.`area` AS `area`,
          `b`.`manager` AS `manager`,
          `s`.`id` AS `staff_id`,
          `s`.`type` AS `staff_type`,
          `s`.`full_name` AS `staff_name`
      FROM
          (((`database_name`.`reporting_dates` `rd`
          JOIN `database_name`.`branches` `b`)
          JOIN `database_name`.`creditors` `c` ON (((`c`.`id` = `b`.`creditor_id`)
              AND (`c`.`include_in_reports` = 1))))
          LEFT JOIN (SELECT 
              0 AS `id`,
                  `database_name`.`creditors`.`id` AS `creditor_id`,
                  'n/a' AS `type`,
                  'n/a' AS `full_name`
          FROM
              `database_name`.`creditors` UNION SELECT 
              `database_name`.`staff`.`id` AS `id`,
                  `database_name`.`staff`.`creditor_id` AS `creditor_id`,
                  `database_name`.`staff`.`type` AS `type`,
                  `database_name`.`staff`.`full_name` AS `full_name`
          FROM
              `database_name`.`staff`) `s` ON ((`s`.`creditor_id` = `c`.`id`)))
      WHERE
          (`rd`.`base_date` &lt;= UTC_DATE())
  </code></pre>