List:Commits« Previous MessageNext Message »
From:Tatjana A Nuernberg Date:April 21 2006 1:08am
Subject:bk commit into 5.0 tree (tnurnberg:1.2169) BUG#19025
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of azundris. When azundris does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2169 06/04/21 01:08:21 tnurnberg@stripped +3 -0
  Bug#19025: mysqldump doesn't correctly dump "auto_increment = [int]"
  
  per-table AUTO_INCREMENT=... will now be printed in SHOW CREATE TABLE (and
  consequently, in mysqldump) if the table has an auto_increment column and
  an auto_increment is defined that is not the default (a step of 1).

  mysql-test/t/auto_increment_dump.test
    1.1 06/04/21 01:08:14 tnurnberg@stripped +49 -0
    Bug#19025: mysqldump doesn't correctly dump "auto_increment = [int]"
    
    tests whether mysqldump/"show create table" include per-table auto-increment steps
    where applicable (that is, where an auto-increment column is present and the step
    is not the default, 1).

  mysql-test/r/auto_increment_dump.result
    1.1 06/04/21 01:08:14 tnurnberg@stripped +54 -0
    Bug#19025: mysqldump doesn't correctly dump "auto_increment = [int]"
    
    tests whether mysqldump/"show create table" include per-table auto-increment steps
    where applicable (that is, where an auto-increment column is present and the step
    is not the default, 1).

  sql/sql_show.cc
    1.314 06/04/21 01:08:14 tnurnberg@stripped +7 -0
    Bug#19025: mysqldump doesn't correctly dump "auto_increment = [int]"
    
    functionality was missing from sql_show.cc; added. per-table AUTO_INCREMENT=...
    will now be printed in SHOW CREATE TABLE (and consequently, in mysqldump) if
    the table has an auto_increment column and an auto_increment is defined that
    is not the default (a step of 1).

  mysql-test/t/auto_increment_dump.test
    1.0 06/04/21 01:08:14 tnurnberg@stripped +0 -0
    BitKeeper file /home/mysql-5.0-maint-19025/mysql-test/t/auto_increment_dump.test

  mysql-test/r/auto_increment_dump.result
    1.0 06/04/21 01:08:14 tnurnberg@stripped +0 -0
    BitKeeper file /home/mysql-5.0-maint-19025/mysql-test/r/auto_increment_dump.result

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	tnurnberg
# Host:	salvation.intern.azundris.com
# Root:	/home/mysql-5.0-maint-19025

--- 1.313/sql/sql_show.cc	2006-03-20 11:17:41 +01:00
+++ 1.314/sql/sql_show.cc	2006-04-21 01:08:14 +02:00
@@ -1005,6 +1005,13 @@
       packet->append(STRING_WITH_LEN(" ENGINE="));
     packet->append(file->table_type());
     
+    if (table->found_next_number_field && (file->auto_increment_value !=
1))
+    {
+      packet->append(STRING_WITH_LEN(" AUTO_INCREMENT="));
+      end= longlong10_to_str(file->auto_increment_value, buff,10);
+      packet->append(buff, (uint) (end - buff));
+    }
+    
     if (share->table_charset &&
 	!(thd->variables.sql_mode & MODE_MYSQL323) &&
 	!(thd->variables.sql_mode & MODE_MYSQL40))
--- New file ---
+++ mysql-test/r/auto_increment_dump.result	06/04/21 01:08:14
DROP TABLE IF EXISTS `t1`;
SET SQL_WARNINGS=1;
CREATE TABLE `t1` (
t1_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
t1_name VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (t1_id)
) AUTO_INCREMENT = 1000;
SHOW CREATE TABLE `t1`;
Table	Create Table
t1	CREATE TABLE `t1` (
  `t1_id` int(10) unsigned NOT NULL auto_increment,
  `t1_name` varchar(255) default NULL,
  PRIMARY KEY  (`t1_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=latin1
DROP TABLE `t1`;
CREATE TABLE `t1` (
t1_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
t1_name VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (t1_id)
) AUTO_INCREMENT = 1;
SHOW CREATE TABLE `t1`;
Table	Create Table
t1	CREATE TABLE `t1` (
  `t1_id` int(10) unsigned NOT NULL auto_increment,
  `t1_name` varchar(255) default NULL,
  PRIMARY KEY  (`t1_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE `t1`;
CREATE TABLE `t1` (
t1_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
t1_name VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (t1_id)
);
SHOW CREATE TABLE `t1`;
Table	Create Table
t1	CREATE TABLE `t1` (
  `t1_id` int(10) unsigned NOT NULL auto_increment,
  `t1_name` varchar(255) default NULL,
  PRIMARY KEY  (`t1_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE `t1`;
CREATE TABLE `t1` (
t1_id INT(10) UNSIGNED NOT NULL,
t1_name VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (t1_id)
);
SHOW CREATE TABLE `t1`;
Table	Create Table
t1	CREATE TABLE `t1` (
  `t1_id` int(10) unsigned NOT NULL,
  `t1_name` varchar(255) default NULL,
  PRIMARY KEY  (`t1_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE `t1`;

--- New file ---
+++ mysql-test/t/auto_increment_dump.test	06/04/21 01:08:14
#
# Test of whether auto_increment=... shows in mysqldump / show create table
# Bug #19025
#

--disable_warnings
DROP TABLE IF EXISTS `t1`;
--enable_warnings
SET SQL_WARNINGS=1;

CREATE TABLE `t1` (
    t1_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    t1_name VARCHAR(255) DEFAULT NULL,
    PRIMARY KEY (t1_id)
) AUTO_INCREMENT = 1000;

SHOW CREATE TABLE `t1`;

DROP TABLE `t1`;

CREATE TABLE `t1` (
    t1_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    t1_name VARCHAR(255) DEFAULT NULL,
    PRIMARY KEY (t1_id)
) AUTO_INCREMENT = 1;

SHOW CREATE TABLE `t1`;

DROP TABLE `t1`;

CREATE TABLE `t1` (
    t1_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    t1_name VARCHAR(255) DEFAULT NULL,
    PRIMARY KEY (t1_id)
);

SHOW CREATE TABLE `t1`;

DROP TABLE `t1`;

CREATE TABLE `t1` (
    t1_id INT(10) UNSIGNED NOT NULL,
    t1_name VARCHAR(255) DEFAULT NULL,
    PRIMARY KEY (t1_id)
);

SHOW CREATE TABLE `t1`;

DROP TABLE `t1`;

Thread
bk commit into 5.0 tree (tnurnberg:1.2169) BUG#19025Tatjana A Nuernberg21 Apr