Command log
OK, here's what I've got:
I have a database with several views defined. I made a dump of this
database using this mysqldump command:
Then I go into the mysql command line. I verify the definition of the
view in the original database, and select some records from it. Then,
I create a database called test, run the backup file, check the
definition of a view, and select records. The view was created as a
MyISAM table, and it has no records. Also, what is interesting to note
is that there are errors when MySQL is loading the backup file. These
errors reference the names of the views.
mysql> use original_database
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> SHOW CREATE TABLE vHistoricalStoreScores;
+------------------------
+-----------------------------------------------------------------------
| View | Create
View
+------------------------
+------------------------------------------------------------------------
| vHistoricalStoreScores |CREATE ALGORITHM=UNDEFINED
DEFINER=`restcon`@`64.111.96.0/255.255.224.0` SQL SECURITY DEFINER
VIEW `vHistoricalStoreScores` AS select ...
mysql> SELECT * FROM vHistoricalStoreScores;
+------------------+--------------------+-----------+----------------
+------------------+-------+------+
| compilation | client_location_id | client_id | client_name |
location | month | year |
+------------------+--------------------+-----------+----------------
+------------------+-------+------+
| 4.45833333333333 | 5 | 2 | Client 2 |
Main St. | 1 | 2008 |
| 4.26388888888889 | 1 | 1 | Test Client |
Test Location | 1 | 2008 |
| 4.09027777777778 | 5 | 2 | Client 2 |
Main St. | 12 | 2007 |
+------------------+--------------------+-----------+----------------
+------------------+-------+------+
14 rows in set (0.03 sec)
mysql> CREATE DATABASE test;
Query OK, 1 row affected (0.00 sec)
mysql> USE test;
Database changed
mysql> \. original_database_backup.sql
Query OK, 0 rows affected (0.06 sec)
Query OK, 0 rows affected (0.06 sec)
....
Query OK, 0 rows affected (0.06 sec)
ERROR 1050 (42S01): Table 'vCardQuestionsNested' already exists
ERROR 1050 (42S01): Table 'vClientLocationCodeDates' already exists
ERROR 1050 (42S01): Table 'vClientLocationQuestions' already exists
ERROR 1050 (42S01): Table 'vClientLocationQuestionsNested' already
exists
ERROR 1050 (42S01): Table 'vClientQuestionsNested' already exists
ERROR 1050 (42S01): Table 'vHistoricalStoreScores' already exists
Query OK, 0 rows affected (0.01 sec)
mysql> SHOW CREATE TABLE vHistoricalStoreScores;
+------------------------
+----------------------------------------------
| Table | Create
Table
|
+------------------------
+----------------------------------------------
| vHistoricalStoreScores | CREATE TABLE `vHistoricalStoreScores` (
`compilation` double default NULL,
`client_location_id` int(10) unsigned default NULL,
`client_id` int(10) unsigned default NULL,
`client_name` varchar(40) default NULL,
`location` varchar(30) default NULL,
`month` bigint(2) default NULL,
`year` bigint(4) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+------------------------
+-----------------------------------------------
1 row in set (0.00 sec)
mysql> SELECT * FROM vHistoricalStoreScores;
Empty set (0.00 sec)
|