Bug #62844 --single-transaction option has no effect
Submitted: 20 Oct 2011 13:36 Modified: 20 Oct 2011 13:54
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:5.1.59 OS:Windows (7/64bit)
Assigned to: CPU Architecture:Any

[20 Oct 2011 13:36] Peter Laursen
Description:
http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html says:
--single-transaction ... This option issues a BEGIN SQL statement before dumping data from the server

.. but there is no BEGIN SQL statement in the dump generated

How to repeat:
C:\Program Files\MySQL\MySQL Server 5.1\bin>mysqldump -uroot -p --single-transac
tion dddd
Enter password: ********
-- MySQL dump 10.13  Distrib 5.1.59, for Win64 (unknown)
--
-- Host: localhost    Database: dddd
-- ------------------------------------------------------
-- Server version       5.1.59-community

/*!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 */;
/*!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 */;

--
-- Table structure for table `t1`
--

DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` (
  `c1` int(11) NOT NULL AUTO_INCREMENT,
  `c2` int(11) DEFAULT '99',
  `c3` int(11) DEFAULT NULL,
  `c4` char(10) DEFAULT NULL,
  `c5` char(10) DEFAULT NULL,
  `c6` char(10) DEFAULT 'abc',
  `c7` varchar(50) DEFAULT 'xyz',
  `c8` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`c1`),
  KEY `NewIndex1` (`c3`)
) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `t1`
--

LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT INTO `t1` VALUES (1,99,99,'a','b','abc','xyz','z'),(2,99,98,'c','d','abc'
,'xyz','y'),(3,99,27,'e','f','abc','xyz','x'),(4,99,96,'g','h','abc','xyz','v'),
(5,99,95,'i','j','abc','xyz','u'),(6,99,94,'k','l','abc','xyz','t'),(7,99,93,'m'
,'n','abc','xyz','s'),(66,22,100,'a','b','abc','xyz',NULL);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!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 */;
/*!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 */;

-- Dump completed on 2011-10-20 15:21:41

C:\Program Files\MySQL\MySQL Server 5.1\bin>

Suggested fix:
Not sure. Maybe I am missing something?
[20 Oct 2011 13:54] Peter Laursen
I am an idiot!

The BEGIN statement is not written to the dump of course but executed on *source*.
Please ignore.