Afficher un message
Vieux 13/02/2008, 22h18   #14
lawpoop@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mysqldump and VIEW definitions

On Feb 13, 11:21 am, Axel Schwenke <axel.schwe...@gmx.de> wrote:

>
> Can you try what you get for the above example?
>


OK, now I think I've got it. How blind am I? If I'm going to use --
skip-opt, I've also got to use --add-drop-table, or else the 'view as
table' doesn't get dropped.


mysqldump--skip-comments --skip-opt --complete-insert --add-drop-table
test
Enter password:
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS,
FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE,
SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`c1` int(11) default NULL
);

DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 CREATE TABLE `v1` (
`c1` int(11)
) */;
/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`user`@`ip_address/
subnet_mask` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`c1` AS
`c1` from `t1`*/;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;


Can I save some face by claiming this is still counter-intuitive and
user-unfriendly? Thanks for everyone's !

  Réponse avec citation
 
Page generated in 0,05162 seconds with 9 queries