Bug #12592 schema name is included in the VIEW name for both SHOW CREATE VIEW and mysqldum
Submitted: 15 Aug 2005 21:04 Modified: 23 Aug 2005 14:25
Reporter: Raymond DeRoo Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.10 OS:Linux (Linux)
Assigned to: Assigned Account CPU Architecture:Any

[15 Aug 2005 21:04] Raymond DeRoo
Description:
Both SHOW CREATE VIEW and mysqldump prepend the name of the schema in which the view exists. This makes porting to a different schema difficult.

How to repeat:
14:51 root@localhost:(none)~> CREATE SCHEMA csc6198;
Query OK, 1 row affected (0.00 sec)

14:51 root@localhost:(none)~> USE csc6198
Database changed
14:51 root@localhost:csc6198~> CREATE TABLE t1(id INT NOT NULL);
Query OK, 0 rows affected (0.01 sec)

14:51 root@localhost:csc6198~> CREATE VIEW v1 AS SELECT * FROM t1;
Query OK, 0 rows affected (0.03 sec)

14:52 root@localhost:csc6198~> SHOW CREATE VIEW v1\G
*************************** 1. row ***************************
       View: v1
Create View: CREATE ALGORITHM=UNDEFINED VIEW `csc6198`.`v1` AS select `csc6198`.`t1`.`id` AS `id` from `csc6198`.`t1`
1 row in set (0.00 sec)                                                                                                             

Suggested fix:
Remove the schema name from in-front of the view.
[23 Aug 2005 14:25] Andrey Hristov
Dupe of 10322