Commit f0a9ad91 authored by unknown's avatar unknown

BUG #7815

Changes per serg to http://lists.mysql.com/internals/30281

Re-enabled --delayed-insert


client/mysqldump.c:
  BUG #7815 
  
  Changes per serg on patch: http://lists.mysql.com/internals/30281
  
  1. Re-enabled --delayed-insert
       - modified options, removed code that was in place until bug was 
         fixed    
  2. Moved the call to get_table_structure to dump_table 
    - Use added 'ignore_flag' variable to determine what exactly is
      being ignored - whole table or just delayed insert ability
  3. Changed return type of ignore_table to char with byte value that
     determines what exactly is being ignored - the whole table, or
     delayed inserts
  4. Added ignore_table flags IGNORE_DATA and IGNORE_INSERT_DELAYED
  5. Added logic in get_table_structure to not append INSERT data text
     if the table's data isn't going to be dumped because the return
     value from ignore_table is IGNORE_DATA
  6. Changed the name of numFields to numfields. Studly caps aren't
     consistent with the rest of the code!
  7. Added inclusive list to check_if_ignore_table to set the flag to
     IGNORE_INSERT_DELAYED if the table type doesn't support delayed
     inserts.
  8. More documentation
mysql-test/r/mysqldump.result:
  BUG #7815 new results
mysql-test/r/mysqldump-max.result:
  BUG #7815
  
  New test results
mysql-test/t/mysqldump-max.test:
  BUG #7815
  New test for testing if insert delayed is applied to tables that support
  it in mysqldump, but only if all storage engines in test have been compiled
  in
parent 7a19e76c
This diff is collapsed.
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
drop table if exists t2;
Warnings:
Note 1051 Unknown table 't2'
drop table if exists t3;
Warnings:
Note 1051 Unknown table 't3'
drop table if exists t4;
Warnings:
Note 1051 Unknown table 't4'
drop table if exists t5;
Warnings:
Note 1051 Unknown table 't5'
drop table if exists t6;
Warnings:
Note 1051 Unknown table 't6'
create table t1 (id int(8), name varchar(32));
create table t2 (id int(8), name varchar(32)) ENGINE="MyISAM";
create table t3 (id int(8), name varchar(32)) ENGINE="MEMORY";
create table t4 (id int(8), name varchar(32)) ENGINE="HEAP";
create table t5 (id int(8), name varchar(32)) ENGINE="ARCHIVE";
create table t6 (id int(8), name varchar(32)) ENGINE="InnoDB";
insert into t1 values (1, 'first value');
insert into t1 values (2, 'first value');
insert into t1 values (3, 'first value');
insert into t1 values (4, 'first value');
insert into t1 values (5, 'first value');
insert into t2 values (1, 'first value');
insert into t2 values (2, 'first value');
insert into t2 values (3, 'first value');
insert into t2 values (4, 'first value');
insert into t2 values (5, 'first value');
insert into t3 values (1, 'first value');
insert into t3 values (2, 'first value');
insert into t3 values (3, 'first value');
insert into t3 values (4, 'first value');
insert into t3 values (5, 'first value');
insert into t4 values (1, 'first value');
insert into t4 values (2, 'first value');
insert into t4 values (3, 'first value');
insert into t4 values (4, 'first value');
insert into t4 values (5, 'first value');
insert into t5 values (1, 'first value');
insert into t5 values (2, 'first value');
insert into t5 values (3, 'first value');
insert into t5 values (4, 'first value');
insert into t5 values (5, 'first value');
insert into t6 values (1, 'first value');
insert into t6 values (2, 'first value');
insert into t6 values (3, 'first value');
insert into t6 values (4, 'first value');
insert into t6 values (5, 'first value');
select * from t1;
id name
1 first value
2 first value
3 first value
4 first value
5 first value
select * from t2;
id name
1 first value
2 first value
3 first value
4 first value
5 first value
select * from t3;
id name
1 first value
2 first value
3 first value
4 first value
5 first value
select * from t4;
id name
1 first value
2 first value
3 first value
4 first value
5 first value
select * from t5;
id name
1 first value
2 first value
3 first value
4 first value
5 first value
select * from t6;
id name
1 first value
2 first value
3 first value
4 first value
5 first value
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!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 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `test`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`;
CREATE TABLE `t3` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`;
CREATE TABLE `t4` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t4` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`;
CREATE TABLE `t5` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t5` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`;
CREATE TABLE `t6` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t6` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!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 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `test`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`;
CREATE TABLE `t3` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`;
CREATE TABLE `t4` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t4` DISABLE KEYS */;
INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`;
CREATE TABLE `t5` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t5` DISABLE KEYS */;
INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`;
CREATE TABLE `t6` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t6` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
drop table t1;
drop table t2;
drop table t3;
drop table t4;
drop table t5;
drop table t6;
......@@ -614,9 +614,7 @@ CREATE TABLE `t1` (
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
LOCK TABLES `t1` WRITE;
INSERT IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
UNLOCK TABLES;
INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
......
# Embedded server doesn't support external clients
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_archive.inc
--disable-warnings
drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
drop table if exists t5;
drop table if exists t6;
--enable-warnings
create table t1 (id int(8), name varchar(32));
create table t2 (id int(8), name varchar(32)) ENGINE="MyISAM";
create table t3 (id int(8), name varchar(32)) ENGINE="MEMORY";
create table t4 (id int(8), name varchar(32)) ENGINE="HEAP";
create table t5 (id int(8), name varchar(32)) ENGINE="ARCHIVE";
create table t6 (id int(8), name varchar(32)) ENGINE="InnoDB";
insert into t1 values (1, 'first value');
insert into t1 values (2, 'first value');
insert into t1 values (3, 'first value');
insert into t1 values (4, 'first value');
insert into t1 values (5, 'first value');
insert into t2 values (1, 'first value');
insert into t2 values (2, 'first value');
insert into t2 values (3, 'first value');
insert into t2 values (4, 'first value');
insert into t2 values (5, 'first value');
insert into t3 values (1, 'first value');
insert into t3 values (2, 'first value');
insert into t3 values (3, 'first value');
insert into t3 values (4, 'first value');
insert into t3 values (5, 'first value');
insert into t4 values (1, 'first value');
insert into t4 values (2, 'first value');
insert into t4 values (3, 'first value');
insert into t4 values (4, 'first value');
insert into t4 values (5, 'first value');
insert into t5 values (1, 'first value');
insert into t5 values (2, 'first value');
insert into t5 values (3, 'first value');
insert into t5 values (4, 'first value');
insert into t5 values (5, 'first value');
insert into t6 values (1, 'first value');
insert into t6 values (2, 'first value');
insert into t6 values (3, 'first value');
insert into t6 values (4, 'first value');
insert into t6 values (5, 'first value');
select * from t1;
select * from t2;
select * from t3;
select * from t4;
select * from t5;
select * from t6;
--exec $MYSQL_DUMP --skip-comments --delayed-insert --insert-ignore --databases test
--exec $MYSQL_DUMP --skip-comments --delayed-insert --databases test
drop table t1;
drop table t2;
drop table t3;
drop table t4;
drop table t5;
drop table t6;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment