mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#21014: Segmentation fault of mysqldump on view
mysqldump did not select the correct database before trying to dump views from it. this resulted in an empty result set, which in turn startled mysql-dump into a core-dump. this only happened for views, not for tables, and was only visible with multiple databases that weren't by sheer luck in the order mysqldump required, anyway. this fixes by selecting the correct database before dumping views; it also catches the empty set-condition if it should occur for other reasons.
This commit is contained in:

parent
b05cd02746
commit
00ec3973f7
@ -2844,3 +2844,33 @@ DROP TABLE IF EXISTS `v1`;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
drop database mysqldump_test_db;
|
||||
create database mysqldump_tables;
|
||||
use mysqldump_tables;
|
||||
create table basetable ( id serial, tag varchar(64) );
|
||||
create database mysqldump_views;
|
||||
use mysqldump_views;
|
||||
create view nasishnasifu as select mysqldump_tables.basetable.id from
|
||||
mysqldump_tables.basetable;
|
||||
|
||||
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_tables` /*!40100 DEFAULT CHARACTER SET latin1 */;
|
||||
|
||||
USE `mysqldump_tables`;
|
||||
CREATE TABLE `basetable` (
|
||||
`id` bigint(20) unsigned NOT NULL auto_increment,
|
||||
`tag` varchar(64) default NULL,
|
||||
UNIQUE KEY `id` (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHARACTER SET latin1 */;
|
||||
|
||||
USE `mysqldump_views`;
|
||||
/*!50001 CREATE TABLE `nasishnasifu` (
|
||||
`id` bigint(20) unsigned
|
||||
) */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `mysqldump_views`.`nasishnasifu` AS select `mysqldump_tables`.`basetable`.`id` AS `id` from `mysqldump_tables`.`basetable` */;
|
||||
drop view nasishnasifu;
|
||||
drop database mysqldump_views;
|
||||
drop table mysqldump_tables.basetable;
|
||||
drop database mysqldump_tables;
|
||||
|
Reference in New Issue
Block a user