List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:November 3 2009 9:19am
Subject:bzr push into mysql-5.1-bugteam branch (svoj:3158 to 3159)
View as plain text  
 3159 Sergey Vojtovich	2009-11-03 [merge]
      Merge innodb-5.1-ss6129 to mysql-5.1-bugteam.

    added:
      mysql-test/r/innodb_bug47777.result
      mysql-test/t/innodb_bug47777.test
    modified:
      mysql-test/lib/mtr_cases.pm
      mysql-test/r/innodb-autoinc.result
      mysql-test/r/innodb_bug44369.result
      mysql-test/r/innodb_bug46000.result
      mysql-test/t/disabled.def
      mysql-test/t/innodb-autoinc.test
      mysql-test/t/innodb_bug34300.test
      mysql-test/t/innodb_bug39438.test
      mysql-test/t/innodb_bug44369.test
      mysql-test/t/innodb_bug46000.test
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/os/os0proc.c
      storage/innobase/row/row0mysql.c
 3158 Vladislav Vaintroub	2009-11-03 [merge]
      merge

    removed:
      storage/innodb_plugin/README
      storage/innodb_plugin/handler/handler0vars.h
      storage/innodb_plugin/handler/win_delay_loader.cc
      storage/innodb_plugin/win-plugin/
      storage/innodb_plugin/win-plugin/README
      storage/innodb_plugin/win-plugin/win-plugin.diff
    added:
      mysql-test/include/have_case_insensitive_fs.inc
      mysql-test/include/not_windows_embedded.inc
      mysql-test/r/case_insensitive_fs.require
      mysql-test/r/grant_lowercase_fs.result
      mysql-test/r/locale.result
      mysql-test/r/sp-bugs.result
      mysql-test/std_data/latin1.xml
      mysql-test/suite/binlog/r/binlog_delete_and_flush_index.result
      mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_verbose.result
      mysql-test/suite/binlog/r/binlog_stm_do_db.result
      mysql-test/suite/binlog/std_data/update-full-row.binlog
      mysql-test/suite/binlog/std_data/update-partial-row.binlog
      mysql-test/suite/binlog/std_data/write-full-row.binlog
      mysql-test/suite/binlog/std_data/write-partial-row.binlog
      mysql-test/suite/binlog/t/binlog_delete_and_flush_index.test
      mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_verbose.test
      mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt
      mysql-test/suite/binlog/t/binlog_stm_do_db.test
      mysql-test/suite/innodb/r/innodb-consistent.result
      mysql-test/suite/innodb/r/innodb_bug44571.result
      mysql-test/suite/innodb/t/innodb-consistent-master.opt
      mysql-test/suite/innodb/t/innodb-consistent.test
      mysql-test/suite/innodb/t/innodb_bug44571.test
      mysql-test/suite/rpl/t/rpl_get_master_version_and_clock-slave.opt
      mysql-test/t/grant_lowercase_fs.test
      mysql-test/t/locale.test
      mysql-test/t/sp-bugs.test
      storage/innodb_plugin/mysql-test/innodb-consistent-master.opt
      storage/innodb_plugin/mysql-test/innodb-consistent.result
      storage/innodb_plugin/mysql-test/innodb-consistent.test
      storage/innodb_plugin/mysql-test/innodb_bug44369.result
      storage/innodb_plugin/mysql-test/innodb_bug44369.test
      storage/innodb_plugin/mysql-test/innodb_bug44571.result
      storage/innodb_plugin/mysql-test/innodb_bug44571.test
      storage/innodb_plugin/mysql-test/innodb_bug46000.result
      storage/innodb_plugin/mysql-test/innodb_bug46000.test
      storage/innodb_plugin/revert_gen.sh
      storage/innodb_plugin/scripts/export.sh
      storage/innodb_plugin/ut/ut0auxconf_have_gcc_atomics.c
    renamed:
      mysql-test/r/bug40113.result => mysql-test/r/innodb_lock_wait_timeout_1.result
      mysql-test/t/bug40113-master.opt => mysql-test/t/innodb_lock_wait_timeout_1-master.opt
      mysql-test/t/bug40113.test => mysql-test/t/innodb_lock_wait_timeout_1.test
    modified:
      Makefile.am
      client/mysql.cc
      client/mysqlbinlog.cc
      client/mysqltest.cc
      configure.in
      include/myisam.h
      include/mysql.h
      include/mysql.h.pp
      libmysql/libmysql.c
      libmysql/libmysql.def
      libmysqld/libmysqld.def
      mysql-test/collections/default.experimental
      mysql-test/extra/binlog_tests/binlog.test
      mysql-test/extra/rpl_tests/rpl_loaddata.test
      mysql-test/extra/rpl_tests/rpl_stm_000001.test
      mysql-test/include/check-warnings.test
      mysql-test/include/mtr_warnings.sql
      mysql-test/lib/My/SafeProcess/safe_kill_win.cc
      mysql-test/lib/mtr_cases.pm
      mysql-test/lib/mtr_report.pm
      mysql-test/mysql-test-run.pl
      mysql-test/r/alter_table.result
      mysql-test/r/analyse.result
      mysql-test/r/ctype_ldml.result
      mysql-test/r/explain.result
      mysql-test/r/func_group.result
      mysql-test/r/gis-rtree.result
      mysql-test/r/gis.result
      mysql-test/r/grant.result
      mysql-test/r/grant3.result
      mysql-test/r/group_min_max.result
      mysql-test/r/innodb_mysql.result
      mysql-test/r/join.result
      mysql-test/r/lowercase_fs_off.result
      mysql-test/r/myisam.result
      mysql-test/r/myisam_crash_before_flush_keys.result
      mysql-test/r/mysqltest.result
      mysql-test/r/olap.result
      mysql-test/r/partition_pruning.result
      mysql-test/r/ps_grant.result
      mysql-test/r/range.result
      mysql-test/r/select.result
      mysql-test/r/sp-error.result
      mysql-test/r/subselect.result
      mysql-test/r/system_mysql_db.result
      mysql-test/r/update.result
      mysql-test/r/view_grant.result
      mysql-test/r/xa.result
      mysql-test/std_data/Index.xml
      mysql-test/suite/binlog/r/binlog_row_binlog.result
      mysql-test/suite/binlog/r/binlog_stm_binlog.result
      mysql-test/suite/funcs_1/r/is_columns_mysql.result
      mysql-test/suite/funcs_1/r/is_statistics.result
      mysql-test/suite/innodb/r/innodb-zip.result
      mysql-test/suite/innodb/t/innodb-zip.test
      mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
      mysql-test/suite/rpl/r/rpl_loaddata.result
      mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
      mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
      mysql-test/t/alter_table.test
      mysql-test/t/analyse.test
      mysql-test/t/ctype_ldml.test
      mysql-test/t/explain.test
      mysql-test/t/flush_read_lock_kill.test
      mysql-test/t/func_group.test
      mysql-test/t/gis-rtree.test
      mysql-test/t/gis.test
      mysql-test/t/grant3.test
      mysql-test/t/innodb_bug34300.test
      mysql-test/t/innodb_mysql.test
      mysql-test/t/join.test
      mysql-test/t/kill.test
      mysql-test/t/lowercase_fs_off.test
      mysql-test/t/myisam.test
      mysql-test/t/myisam_crash_before_flush_keys.test
      mysql-test/t/mysqltest.test
      mysql-test/t/olap.test
      mysql-test/t/partition_open_files_limit.test
      mysql-test/t/plugin.test
      mysql-test/t/plugin_load.test
      mysql-test/t/range.test
      mysql-test/t/select.test
      mysql-test/t/sp-error.test
      mysql-test/t/subselect.test
      mysql-test/t/update.test
      mysql-test/t/view_grant.test
      mysql-test/t/xa.test
      mysys/mf_keycache.c
      mysys/my_getopt.c
      mysys/typelib.c
      scripts/mysql_system_tables.sql
      scripts/mysql_system_tables_fix.sql
      sql/event_data_objects.cc
      sql/events.cc
      sql/field.cc
      sql/field.h
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster_binlog.cc
      sql/handler.cc
      sql/handler.h
      sql/item.cc
      sql/item.h
      sql/item_cmpfunc.cc
      sql/item_cmpfunc.h
      sql/item_geofunc.cc
      sql/item_subselect.cc
      sql/log.cc
      sql/log_event.cc
      sql/log_event_old.cc
      sql/mysqld.cc
      sql/opt_range.cc
      sql/opt_sum.cc
      sql/records.cc
      sql/slave.cc
      sql/slave.h
      sql/sp.cc
      sql/sp_head.cc
      sql/sql_acl.cc
      sql/sql_base.cc
      sql/sql_binlog.cc
      sql/sql_cache.cc
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_db.cc
      sql/sql_delete.cc
      sql/sql_insert.cc
      sql/sql_load.cc
      sql/sql_locale.cc
      sql/sql_parse.cc
      sql/sql_partition.cc
      sql/sql_plugin.cc
      sql/sql_prepare.cc
      sql/sql_rename.cc
      sql/sql_select.cc
      sql/sql_select.h
      sql/sql_show.cc
      sql/sql_table.cc
      sql/sql_tablespace.cc
      sql/sql_trigger.cc
      sql/sql_udf.cc
      sql/sql_update.cc
      sql/sql_view.cc
      sql/sql_yacc.yy
      sql/time.cc
      storage/blackhole/ha_blackhole.cc
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/handler/ha_innodb.h
      storage/innodb_plugin/CMakeLists.txt
      storage/innodb_plugin/ChangeLog
      storage/innodb_plugin/Makefile.am
      storage/innodb_plugin/btr/btr0btr.c
      storage/innodb_plugin/btr/btr0sea.c
      storage/innodb_plugin/buf/buf0buf.c
      storage/innodb_plugin/buf/buf0lru.c
      storage/innodb_plugin/buf/buf0rea.c
      storage/innodb_plugin/dict/dict0crea.c
      storage/innodb_plugin/dict/dict0dict.c
      storage/innodb_plugin/fil/fil0fil.c
      storage/innodb_plugin/fsp/fsp0fsp.c
      storage/innodb_plugin/handler/ha_innodb.cc
      storage/innodb_plugin/handler/ha_innodb.h
      storage/innodb_plugin/handler/handler0alter.cc
      storage/innodb_plugin/include/buf0buf.h
      storage/innodb_plugin/include/buf0buf.ic
      storage/innodb_plugin/include/buf0lru.h
      storage/innodb_plugin/include/buf0rea.h
      storage/innodb_plugin/include/buf0types.h
      storage/innodb_plugin/include/dict0crea.h
      storage/innodb_plugin/include/dict0dict.h
      storage/innodb_plugin/include/dict0mem.h
      storage/innodb_plugin/include/fsp0fsp.h
      storage/innodb_plugin/include/lock0lock.h
      storage/innodb_plugin/include/log0log.h
      storage/innodb_plugin/include/log0log.ic
      storage/innodb_plugin/include/log0recv.h
      storage/innodb_plugin/include/mtr0mtr.h
      storage/innodb_plugin/include/os0file.h
      storage/innodb_plugin/include/os0sync.h
      storage/innodb_plugin/include/page0page.h
      storage/innodb_plugin/include/page0zip.h
      storage/innodb_plugin/include/rem0cmp.h
      storage/innodb_plugin/include/rem0rec.ic
      storage/innodb_plugin/include/row0ins.h
      storage/innodb_plugin/include/row0mysql.h
      storage/innodb_plugin/include/srv0srv.h
      storage/innodb_plugin/include/trx0rec.h
      storage/innodb_plugin/include/trx0rec.ic
      storage/innodb_plugin/include/trx0roll.h
      storage/innodb_plugin/include/trx0sys.ic
      storage/innodb_plugin/include/trx0trx.h
      storage/innodb_plugin/include/univ.i
      storage/innodb_plugin/include/ut0auxconf.h
      storage/innodb_plugin/include/ut0byte.h
      storage/innodb_plugin/include/ut0byte.ic
      storage/innodb_plugin/include/ut0ut.h
      storage/innodb_plugin/lock/lock0lock.c
      storage/innodb_plugin/log/log0log.c
      storage/innodb_plugin/log/log0recv.c
      storage/innodb_plugin/mem/mem0mem.c
      storage/innodb_plugin/mtr/mtr0mtr.c
      storage/innodb_plugin/mysql-test/innodb-analyze.test
      storage/innodb_plugin/mysql-test/innodb-zip.result
      storage/innodb_plugin/mysql-test/innodb-zip.test
      storage/innodb_plugin/mysql-test/innodb_bug34300.test
      storage/innodb_plugin/mysql-test/innodb_bug36169.test
      storage/innodb_plugin/mysql-test/innodb_bug36172.test
      storage/innodb_plugin/mysql-test/innodb_file_format.result
      storage/innodb_plugin/mysql-test/innodb_file_format.test
      storage/innodb_plugin/os/os0file.c
      storage/innodb_plugin/page/page0cur.c
      storage/innodb_plugin/page/page0page.c
      storage/innodb_plugin/page/page0zip.c
      storage/innodb_plugin/plug.in
      storage/innodb_plugin/rem/rem0cmp.c
      storage/innodb_plugin/row/row0ins.c
      storage/innodb_plugin/row/row0merge.c
      storage/innodb_plugin/row/row0mysql.c
      storage/innodb_plugin/srv/srv0srv.c
      storage/innodb_plugin/srv/srv0start.c
      storage/innodb_plugin/sync/sync0rw.c
      storage/innodb_plugin/sync/sync0sync.c
      storage/innodb_plugin/thr/thr0loc.c
      storage/innodb_plugin/trx/trx0rec.c
      storage/innodb_plugin/trx/trx0roll.c
      storage/innodb_plugin/trx/trx0trx.c
      storage/innodb_plugin/ut/ut0auxconf_atomic_pthread_t_solaris.c
      storage/innodb_plugin/ut/ut0ut.c
      storage/myisam/ha_myisam.cc
      storage/myisam/mi_check.c
      storage/myisam/sort.c
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      strings/ctype-simple.c
      strings/ctype-uca.c
      vio/viosslfactories.c
      mysql-test/r/innodb_lock_wait_timeout_1.result
      mysql-test/t/innodb_lock_wait_timeout_1.test
=== modified file 'mysql-test/lib/mtr_cases.pm'
--- a/mysql-test/lib/mtr_cases.pm	2009-10-20 10:05:28 +0000
+++ b/mysql-test/lib/mtr_cases.pm	2009-11-03 08:46:04 +0000
@@ -522,6 +522,8 @@ sub collect_one_suite($)
       next if ($test->{'name'} eq 'main.innodb_bug46000');
       # Disable for Innodb Plugin until the fix for Plugin is received
       next if ($test->{'name'} eq 'main.innodb_bug44369');
+      # Disable for Innodb Plugin until the fix for Plugin is received
+      next if ($test->{'name'} eq 'main.innodb_bug47777');
       # Copy test options
       my $new_test= My::Test->new();
       while (my ($key, $value) = each(%$test))

=== modified file 'mysql-test/r/innodb-autoinc.result'
--- a/mysql-test/r/innodb-autoinc.result	2009-09-23 12:12:12 +0000
+++ b/mysql-test/r/innodb-autoinc.result	2009-11-02 15:06:58 +0000
@@ -867,6 +867,7 @@ INSERT INTO t2 SELECT NULL FROM t1;
 Got one of the listed errors
 DROP TABLE t1;
 DROP TABLE t2;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
 CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
 INSERT INTO t1 VALUES (null);
 INSERT INTO t1 VALUES (null);
@@ -882,6 +883,12 @@ d1
 INSERT INTO t1 VALUES(null);
 Got one of the listed errors
 ALTER TABLE t1 AUTO_INCREMENT = 3;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `d1` int(11) NOT NULL AUTO_INCREMENT,
+  PRIMARY KEY (`d1`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
 INSERT INTO t1 VALUES(null);
 SELECT * FROM t1;
 d1
@@ -889,3 +896,233 @@ d1
 3
 4
 DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name	Value
+auto_increment_increment	1
+auto_increment_offset	1
+CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-127, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `c1` tinyint(4) NOT NULL AUTO_INCREMENT,
+  `c2` varchar(10) DEFAULT NULL,
+  PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1	c2
+-127	innodb
+-1	innodb
+1	NULL
+2	NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+Warnings:
+Warning	1264	Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (-127, 'innodb');
+Warnings:
+Warning	1264	Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `c1` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
+  `c2` varchar(10) DEFAULT NULL,
+  PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1	c2
+1	NULL
+2	innodb
+3	innodb
+4	NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-32767, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `c1` smallint(6) NOT NULL AUTO_INCREMENT,
+  `c2` varchar(10) DEFAULT NULL,
+  PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1	c2
+-32767	innodb
+-1	innodb
+1	NULL
+2	NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+Warnings:
+Warning	1264	Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (-32757, 'innodb');
+Warnings:
+Warning	1264	Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `c1` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
+  `c2` varchar(10) DEFAULT NULL,
+  PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1	c2
+1	NULL
+2	innodb
+3	innodb
+4	NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-8388607, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `c1` mediumint(9) NOT NULL AUTO_INCREMENT,
+  `c2` varchar(10) DEFAULT NULL,
+  PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1	c2
+-8388607	innodb
+-1	innodb
+1	NULL
+2	NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+Warnings:
+Warning	1264	Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (-8388607, 'innodb');
+Warnings:
+Warning	1264	Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `c1` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
+  `c2` varchar(10) DEFAULT NULL,
+  PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1	c2
+1	NULL
+2	innodb
+3	innodb
+4	NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-2147483647, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `c1` int(11) NOT NULL AUTO_INCREMENT,
+  `c2` varchar(10) DEFAULT NULL,
+  PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1	c2
+-2147483647	innodb
+-1	innodb
+1	NULL
+2	NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+Warnings:
+Warning	1264	Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (-2147483647, 'innodb');
+Warnings:
+Warning	1264	Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `c1` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `c2` varchar(10) DEFAULT NULL,
+  PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1	c2
+1	NULL
+2	innodb
+3	innodb
+4	NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-9223372036854775807, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `c1` bigint(20) NOT NULL AUTO_INCREMENT,
+  `c2` varchar(10) DEFAULT NULL,
+  PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1	c2
+-9223372036854775807	innodb
+-1	innodb
+1	NULL
+2	NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+Warnings:
+Warning	1264	Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (-9223372036854775807, 'innodb');
+Warnings:
+Warning	1264	Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `c1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+  `c2` varchar(10) DEFAULT NULL,
+  PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1	c2
+1	NULL
+2	innodb
+3	innodb
+4	NULL
+DROP TABLE t1;
+CREATE TABLE T1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) AUTO_INCREMENT=10 ENGINE=InnoDB;
+CREATE INDEX i1 on T1(c2);
+SHOW CREATE TABLE T1;
+Table	Create Table
+T1	CREATE TABLE `T1` (
+  `c1` int(11) NOT NULL AUTO_INCREMENT,
+  `c2` int(11) DEFAULT NULL,
+  PRIMARY KEY (`c1`),
+  KEY `i1` (`c2`)
+) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
+INSERT INTO T1 (c2) values (0);
+SELECT * FROM T1;
+c1	c2
+10	0
+DROP TABLE T1;

=== modified file 'mysql-test/r/innodb_bug44369.result'
--- a/mysql-test/r/innodb_bug44369.result	2009-10-05 11:17:48 +0000
+++ b/mysql-test/r/innodb_bug44369.result	2009-11-02 14:59:44 +0000
@@ -2,13 +2,13 @@ create table bug44369 (DB_ROW_ID int) en
 ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
 create table bug44369 (db_row_id int) engine=innodb;
 ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
-show errors;
+show warnings;
 Level	Code	Message
-Error	1005	Error creating table 'test/bug44369' with column name 'db_row_id'. 'db_row_id' is a reserved name. Please try to re-create the table with a different column name.
+Warning	1005	Error creating table 'test/bug44369' with column name 'db_row_id'. 'db_row_id' is a reserved name. Please try to re-create the table with a different column name.
 Error	1005	Can't create table 'test.bug44369' (errno: -1)
 create table bug44369 (db_TRX_Id int) engine=innodb;
 ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
-show errors;
+show warnings;
 Level	Code	Message
-Error	1005	Error creating table 'test/bug44369' with column name 'db_TRX_Id'. 'db_TRX_Id' is a reserved name. Please try to re-create the table with a different column name.
+Warning	1005	Error creating table 'test/bug44369' with column name 'db_TRX_Id'. 'db_TRX_Id' is a reserved name. Please try to re-create the table with a different column name.
 Error	1005	Can't create table 'test.bug44369' (errno: -1)

=== modified file 'mysql-test/r/innodb_bug46000.result'
--- a/mysql-test/r/innodb_bug46000.result	2009-10-05 11:09:07 +0000
+++ b/mysql-test/r/innodb_bug46000.result	2009-11-02 14:59:44 +0000
@@ -2,16 +2,16 @@ create table bug46000(`id` int,key `GEN_
 ERROR HY000: Can't create table 'test.bug46000' (errno: -1)
 create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb;
 ERROR HY000: Can't create table 'test.bug46000' (errno: -1)
-show errors;
+show warnings;
 Level	Code	Message
-Error	1005	Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
+Warning	1005	Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
 Error	1005	Can't create table 'test.bug46000' (errno: -1)
 create table bug46000(id int) engine=innodb;
 create index GEN_CLUST_INDEX on bug46000(id);
 ERROR HY000: Can't create table '#sql-temporary' (errno: -1)
-show errors;
+show warnings;
 Level	Code	Message
-Error	1005	Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
+Warning	1005	Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
 Error	1005	Can't create table '#sql-temporary' (errno: -1)
 create index idx on bug46000(id);
 drop table bug46000;

=== added file 'mysql-test/r/innodb_bug47777.result'
--- a/mysql-test/r/innodb_bug47777.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/innodb_bug47777.result	2009-11-02 14:41:40 +0000
@@ -0,0 +1,13 @@
+create table bug47777(c2 linestring not null, primary key (c2(1))) engine=innodb;
+insert into bug47777 values (geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'));
+select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
+count(*)
+1
+update bug47777 set c2=GeomFromText('POINT(1 1)');
+select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
+count(*)
+0
+select count(*) from bug47777 where c2 = GeomFromText('POINT(1 1)');
+count(*)
+1
+drop table bug47777;

=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def	2009-09-29 08:12:04 +0000
+++ b/mysql-test/t/disabled.def	2009-11-03 08:46:04 +0000
@@ -10,7 +10,7 @@
 #
 ##############################################################################
 kill                     : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
-innodb_bug39438          : Bug#42383 2009-01-28 lsoares "This fails in embedded and on windows.  Note that this test is not run on windows and on embedded in PB for main trees currently"
 query_cache_28249        : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
 partition_innodb_builtin : Bug#32430 2009-09-25 mattiasj Waiting for push of Innodb changes
 partition_innodb_plugin  : Bug#32430 2009-09-25 mattiasj Waiting for push of Innodb changes
+innodb-autoinc           : Bug#48482 2009-11-02 svoj innodb-autoinc.test fails with results difference

=== modified file 'mysql-test/t/innodb-autoinc.test'
--- a/mysql-test/t/innodb-autoinc.test	2009-09-23 12:12:12 +0000
+++ b/mysql-test/t/innodb-autoinc.test	2009-11-02 15:06:58 +0000
@@ -482,6 +482,7 @@ DROP TABLE t2;
 # 44030: Error: (1500) Couldn't read the MAX(ID) autoinc value from
 # the index (PRIMARY)
 # This test requires a restart of the server
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
 CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
 INSERT INTO t1 VALUES (null);
 INSERT INTO t1 VALUES (null);
@@ -492,9 +493,130 @@ SELECT * FROM t1;
 # The MySQL and InnoDB data dictionaries should now be out of sync.
 # The select should print message to the error log
 SELECT * FROM t1;
+# MySQL have made a change (http://lists.mysql.com/commits/75268) that no
+# longer results in the two data dictionaries being out of sync. If they
+# revert their changes then this check for ER_AUTOINC_READ_FAILED will need
+# to be enabled.
 -- error ER_AUTOINC_READ_FAILED,1467
 INSERT INTO t1 VALUES(null);
 ALTER TABLE t1 AUTO_INCREMENT = 3;
+SHOW CREATE TABLE t1;
 INSERT INTO t1 VALUES(null);
 SELECT * FROM t1;
 DROP TABLE t1;
+
+# If the user has specified negative values for an AUTOINC column then
+# InnoDB should ignore those values when setting the table's max value.
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+# TINYINT
+CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-127, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-127, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+#
+# SMALLINT
+#
+CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-32767, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-32757, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+#
+# MEDIUMINT
+#
+CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-8388607, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-8388607, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+#
+# INT
+#
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-2147483647, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-2147483647, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+#
+# BIGINT
+#
+CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-9223372036854775807, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-9223372036854775807, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+#
+# End negative number check
+
+##
+# 47125: auto_increment start value is ignored if an index is created
+# and engine=innodb
+#
+CREATE TABLE T1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) AUTO_INCREMENT=10 ENGINE=InnoDB;
+CREATE INDEX i1 on T1(c2);
+SHOW CREATE TABLE T1;
+INSERT INTO T1 (c2) values (0);
+SELECT * FROM T1;
+DROP TABLE T1;

=== modified file 'mysql-test/t/innodb_bug34300.test'
--- a/mysql-test/t/innodb_bug34300.test	2009-10-08 09:13:16 +0000
+++ b/mysql-test/t/innodb_bug34300.test	2009-11-03 08:46:04 +0000
@@ -9,7 +9,6 @@
 -- disable_result_log
 
 # set packet size and reconnect 
-let $max_packet=`select @@global.max_allowed_packet`;
 SET @@global.max_allowed_packet=16777216;
 --connect (newconn, localhost, root,,)
 

=== modified file 'mysql-test/t/innodb_bug39438.test'
--- a/mysql-test/t/innodb_bug39438.test	2008-12-14 20:31:13 +0000
+++ b/mysql-test/t/innodb_bug39438.test	2009-11-03 08:46:04 +0000
@@ -9,6 +9,10 @@
 
 -- source include/have_innodb.inc
 
+--disable_query_log
+call mtr.add_suppression("InnoDB: Error: table 'test/bug39438'");
+--enable_query_log
+
 SET storage_engine=InnoDB;
 
 # we care only that the following SQL commands do not crash the server

=== modified file 'mysql-test/t/innodb_bug44369.test'
--- a/mysql-test/t/innodb_bug44369.test	2009-10-05 11:17:48 +0000
+++ b/mysql-test/t/innodb_bug44369.test	2009-11-02 14:59:44 +0000
@@ -13,9 +13,9 @@ create table bug44369 (DB_ROW_ID int) en
 --error ER_CANT_CREATE_TABLE
 create table bug44369 (db_row_id int) engine=innodb;
 
-show errors;
+show warnings;
 
 --error ER_CANT_CREATE_TABLE
 create table bug44369 (db_TRX_Id int) engine=innodb;
 
-show errors;
+show warnings;

=== modified file 'mysql-test/t/innodb_bug46000.test'
--- a/mysql-test/t/innodb_bug46000.test	2009-10-05 11:09:07 +0000
+++ b/mysql-test/t/innodb_bug46000.test	2009-11-02 14:59:44 +0000
@@ -14,7 +14,7 @@ create table bug46000(`id` int,key `GEN_
 --error ER_CANT_CREATE_TABLE
 create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb;
 
-show errors;
+show warnings;
 
 create table bug46000(id int) engine=innodb;
 
@@ -24,7 +24,7 @@ create table bug46000(id int) engine=inn
 create index GEN_CLUST_INDEX on bug46000(id);
 
 --replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
-show errors;
+show warnings;
 
 # This 'create index' operation should succeed, no
 # temp table left from last failed create index

=== added file 'mysql-test/t/innodb_bug47777.test'
--- a/mysql-test/t/innodb_bug47777.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/innodb_bug47777.test	2009-11-02 14:41:40 +0000
@@ -0,0 +1,24 @@
+# This is the test for bug 47777. GEOMETRY
+# data is treated as BLOB data in innodb.
+# Consequently, its key value generation/storing
+# should follow the process for the BLOB
+# datatype as well.
+
+--source include/have_innodb.inc
+
+create table bug47777(c2 linestring not null, primary key (c2(1))) engine=innodb;
+
+insert into bug47777 values (geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'));
+
+# Verify correct row get inserted.
+select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
+
+# Update table bug47777 should be successful.
+update bug47777 set c2=GeomFromText('POINT(1 1)');
+
+# Verify the row get updated successfully. The original
+# c2 value should be changed to GeomFromText('POINT(1 1)').
+select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
+select count(*) from bug47777 where c2 = GeomFromText('POINT(1 1)');
+
+drop table bug47777;

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	2009-11-01 23:13:11 +0000
+++ b/storage/innobase/handler/ha_innodb.cc	2009-11-02 15:00:51 +0000
@@ -41,7 +41,7 @@ have disabled the InnoDB inlining in thi
 #include <mysql/plugin.h>
 
 #ifndef MYSQL_SERVER
-/* This is needed because of Bug #3596.  Let us hope that pthread_mutex_t
+/* This is needed because of Bug #3596. Let us hope that pthread_mutex_t
 is defined the same in both builds: the MySQL server and the InnoDB plugin. */
 extern pthread_mutex_t LOCK_thread_count;
 #endif /* MYSQL_SERVER */
@@ -54,6 +54,7 @@ static ulong commit_threads = 0;
 static pthread_mutex_t commit_threads_m;
 static pthread_cond_t commit_cond;
 static pthread_mutex_t commit_cond_m;
+static pthread_mutex_t analyze_mutex;
 static bool innodb_inited = 0;
 
 /*
@@ -1932,6 +1933,7 @@ innobase_init(
 	pthread_mutex_init(&prepare_commit_mutex, MY_MUTEX_INIT_FAST);
 	pthread_mutex_init(&commit_threads_m, MY_MUTEX_INIT_FAST);
 	pthread_mutex_init(&commit_cond_m, MY_MUTEX_INIT_FAST);
+	pthread_mutex_init(&analyze_mutex, MY_MUTEX_INIT_FAST);
 	pthread_cond_init(&commit_cond, NULL);
 	innodb_inited= 1;
 
@@ -1971,6 +1973,7 @@ innobase_end(handlerton *hton, ha_panic_
 		pthread_mutex_destroy(&prepare_commit_mutex);
 		pthread_mutex_destroy(&commit_threads_m);
 		pthread_mutex_destroy(&commit_cond_m);
+		pthread_mutex_destroy(&analyze_mutex);
 		pthread_cond_destroy(&commit_cond);
 	}
 
@@ -2215,6 +2218,8 @@ innobase_rollback(
 
 	innobase_release_stat_resources(trx);
 
+	trx->n_autoinc_rows = 0; /* Reset the number AUTO-INC rows required */
+
 	/* If we had reserved the auto-inc lock for some table (if
 	we come here to roll back the latest SQL statement) we
 	release it now before a possibly lengthy rollback */
@@ -3240,7 +3245,10 @@ ha_innobase::store_key_val_for_row(
 		} else if (mysql_type == MYSQL_TYPE_TINY_BLOB
 			|| mysql_type == MYSQL_TYPE_MEDIUM_BLOB
 			|| mysql_type == MYSQL_TYPE_BLOB
-			|| mysql_type == MYSQL_TYPE_LONG_BLOB) {
+			|| mysql_type == MYSQL_TYPE_LONG_BLOB
+			/* MYSQL_TYPE_GEOMETRY data is treated
+			as BLOB data in innodb. */
+			|| mysql_type == MYSQL_TYPE_GEOMETRY) {
 
 			CHARSET_INFO*	cs;
 			ulint		key_len;
@@ -5186,7 +5194,7 @@ create_table_def(
 		if (dict_col_name_is_reserved(field->field_name)){
 			push_warning_printf(
 				(THD*) trx->mysql_thd,
-				MYSQL_ERROR::WARN_LEVEL_ERROR,
+				MYSQL_ERROR::WARN_LEVEL_WARN,
 				ER_CANT_CREATE_TABLE,
 				"Error creating table '%s' with "
 				"column name '%s'. '%s' is a "
@@ -5433,13 +5441,15 @@ ha_innobase::create(
 	1. <database_name>/<table_name>: for normal table creation
 	2. full path: for temp table creation, or sym link
 
-	When srv_file_per_table is on, check for full path pattern, i.e.
+	When srv_file_per_table is on and mysqld_embedded is off,
+	check for full path pattern, i.e.
 	X:\dir\...,		X is a driver letter, or
 	\\dir1\dir2\...,	UNC path
 	returns error if it is in full path format, but not creating a temp.
 	table. Currently InnoDB does not support symbolic link on Windows. */
 
 	if (srv_file_per_table
+	    && !mysqld_embedded
 	    && (!create_info->options & HA_LEX_CREATE_TMP_TABLE)) {
 
 		if ((name[1] == ':')
@@ -5595,18 +5605,22 @@ ha_innobase::create(
 	setup at this stage and so we use thd. */
 
 	/* We need to copy the AUTOINC value from the old table if
-	this is an ALTER TABLE. */
+	this is an ALTER TABLE or CREATE INDEX because CREATE INDEX
+	does a table copy too. */
 
 	if (((create_info->used_fields & HA_CREATE_USED_AUTO)
-	    || thd_sql_command(thd) == SQLCOM_ALTER_TABLE)
-	    && create_info->auto_increment_value != 0) {
-
-		/* Query was ALTER TABLE...AUTO_INCREMENT = x; or
-		CREATE TABLE ...AUTO_INCREMENT = x; Find out a table
-		definition from the dictionary and get the current value
-		of the auto increment field. Set a new value to the
-		auto increment field if the value is greater than the
-		maximum value in the column. */
+	    || thd_sql_command(thd) == SQLCOM_ALTER_TABLE
+	    || thd_sql_command(thd) == SQLCOM_CREATE_INDEX)
+	    && create_info->auto_increment_value > 0) {
+
+		/* Query was one of :
+		CREATE TABLE ...AUTO_INCREMENT = x; or
+		ALTER TABLE...AUTO_INCREMENT = x;   or
+		CREATE INDEX x on t(...);
+		Find out a table definition from the dictionary and get
+		the current value of the auto increment field. Set a new
+		value to the auto increment field if the value is greater
+		than the maximum value in the column. */
 
 		auto_inc_value = create_info->auto_increment_value;
 
@@ -6428,9 +6442,15 @@ ha_innobase::analyze(
 	THD*		thd,		/* in: connection thread handle */
 	HA_CHECK_OPT*	check_opt)	/* in: currently ignored */
 {
+	/* Serialize ANALYZE TABLE inside InnoDB, see
+	Bug#38996 Race condition in ANALYZE TABLE */
+	pthread_mutex_lock(&analyze_mutex);
+
 	/* Simply call ::info() with all the flags */
 	info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);
 
+	pthread_mutex_unlock(&analyze_mutex);
+
 	return(0);
 }
 
@@ -7866,6 +7886,7 @@ ha_innobase::get_auto_increment(
 	AUTOINC counter after attempting to insert the row. */
 	if (innobase_autoinc_lock_mode != AUTOINC_OLD_STYLE_LOCKING) {
 		ulonglong	need;
+		ulonglong	current;
 		ulonglong	next_value;
 		ulonglong	col_max_value;
 
@@ -7874,11 +7895,12 @@ ha_innobase::get_auto_increment(
 		col_max_value = innobase_get_int_col_max_value(
 			table->next_number_field);
 
+		current = *first_value > col_max_value ? autoinc : *first_value;
 		need = *nb_reserved_values * increment;
 
 		/* Compute the last value in the interval */
 		next_value = innobase_next_autoinc(
-			*first_value, need, offset, col_max_value);
+			current, need, offset, col_max_value);
 
 		prebuilt->autoinc_last_value = next_value;
 
@@ -8503,7 +8525,7 @@ innobase_index_name_is_reserved(
 					innobase_index_reserve_name) == 0) {
 			/* Push warning to mysql */
 			push_warning_printf((THD*) trx->mysql_thd,
-					    MYSQL_ERROR::WARN_LEVEL_ERROR,
+					    MYSQL_ERROR::WARN_LEVEL_WARN,
 					    ER_CANT_CREATE_TABLE,
 					    "Cannot Create Index with name "
 					    "'%s'. The name is reserved "

=== modified file 'storage/innobase/os/os0proc.c'
--- a/storage/innobase/os/os0proc.c	2006-09-05 01:52:15 +0000
+++ b/storage/innobase/os/os0proc.c	2009-11-02 15:00:26 +0000
@@ -591,6 +591,7 @@ os_mem_alloc_large(
 			fprintf(stderr, "InnoDB: HugeTLB: Warning: Failed to"
 				" attach shared memory segment, errno %d\n",
 				errno);
+			ptr = NULL;
 		}
 
 		/* Remove the shared memory segment so that it will be

=== modified file 'storage/innobase/row/row0mysql.c'
--- a/storage/innobase/row/row0mysql.c	2009-10-05 11:17:48 +0000
+++ b/storage/innobase/row/row0mysql.c	2009-11-02 14:59:19 +0000
@@ -2089,7 +2089,7 @@ Scans a table create SQL string and adds
 the foreign key constraints declared in the string. This function
 should be called after the indexes for a table have been created.
 Each foreign key constraint must be accompanied with indexes in
-bot participating tables. The indexes are allowed to contain more
+both participating tables. The indexes are allowed to contain more
 fields than mentioned in the constraint. Check also that foreign key
 constraints which reference this table are ok. */
 


Attachment: [text/bzr-bundle] bzr/svoj@sun.com-20091103091902-vwszwwpfi1f4zrpn.bundle
Thread
bzr push into mysql-5.1-bugteam branch (svoj:3158 to 3159)Sergey Vojtovich3 Nov