List:Commits« Previous MessageNext Message »
From:kevin.lewis Date:July 19 2011 2:06am
Subject:bzr push into mysql-trunk branch (kevin.lewis:3255 to 3256) WL#5756
View as plain text  
 3256 kevin.lewis@stripped	2011-07-18
      WL#5756 -  InnoDB: Support Page Sizes 4k and 8k
      
      This patch allows one to change the page size of an entire InnoDB database
      at bootstrap.  
      
      A new parameter is introduced to specify the InnoDB universal page size.
      It must be put into the config or the command line when starting mysqld.
      UNIV_PAGE_SIZE and UNIV_PAGE_SHIFT_SIZE are now mapped to integer variables
      srv_page_size and srv_page_size_shift.  Since they are no longer constants,
      a number of code locations were changed to handle variables instead.
      
      The extent size of a filespace remains 1Mb.  So the number of pages needed
      to fill that extent changes with page size.
      
      Quite a few testcases are modified or added.  Individual tests that depend
      on the page size or assume a specific page size are moved to
         suite/innodb/t/innodb_16k.test
      and some are modified in innodb_8k.test and innodb_4k.test.
      Some tests and whole test files are isolated to 16k pages only if the
      purpose of the test can be fully accomplished with only 16k pages.

    added:
      mysql-test/include/have_innodb_16k.inc
      mysql-test/include/have_innodb_4k.inc
      mysql-test/include/have_innodb_8k.inc
      mysql-test/suite/innodb/r/innodb_16k.result
      mysql-test/suite/innodb/r/innodb_4k.result
      mysql-test/suite/innodb/r/innodb_8k.result
      mysql-test/suite/innodb/t/innodb_16k.test
      mysql-test/suite/innodb/t/innodb_4k.test
      mysql-test/suite/innodb/t/innodb_8k.test
      mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result
      mysql-test/suite/sys_vars/r/innodb_page_size_basic.result
      mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test
      mysql-test/suite/sys_vars/t/innodb_page_size_basic.test
    modified:
      mysql-test/suite/innodb/r/innodb-create-options.result*
      mysql-test/suite/innodb/r/innodb-index.result*
      mysql-test/suite/innodb/r/innodb-system-table-view.result*
      mysql-test/suite/innodb/r/innodb-zip.result*
      mysql-test/suite/innodb/r/innodb.result
      mysql-test/suite/innodb/r/innodb_buffer_pool_load.result*
      mysql-test/suite/innodb/r/innodb_bug53591.result*
      mysql-test/suite/innodb/r/innodb_index_large_prefix.result*
      mysql-test/suite/innodb/r/innodb_mysql.result*
      mysql-test/suite/innodb/t/innodb-create-options.test*
      mysql-test/suite/innodb/t/innodb-index.test*
      mysql-test/suite/innodb/t/innodb-system-table-view.test*
      mysql-test/suite/innodb/t/innodb-zip.test*
      mysql-test/suite/innodb/t/innodb.test*
      mysql-test/suite/innodb/t/innodb_buffer_pool_load.test*
      mysql-test/suite/innodb/t/innodb_bug36172.test*
      mysql-test/suite/innodb/t/innodb_bug53591.test*
      mysql-test/suite/innodb/t/innodb_bug60049.test*
      mysql-test/suite/innodb/t/innodb_index_large_prefix.test*
      mysql-test/suite/innodb/t/innodb_mysql.test*
      mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test*
      mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test*
      mysql-test/suite/innodb/t/innodb_trx_weight.test*
      mysql-test/suite/sys_vars/r/all_vars.result
      storage/innobase/buf/buf0buddy.c
      storage/innobase/fil/fil0fil.c
      storage/innobase/fsp/fsp0fsp.c
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/handler/i_s.cc
      storage/innobase/include/buf0buf.h
      storage/innobase/include/buf0types.h
      storage/innobase/include/dict0mem.h
      storage/innobase/include/fsp0types.h
      storage/innobase/include/sync0rw.ic
      storage/innobase/include/trx0sys.h
      storage/innobase/include/univ.i
      storage/innobase/row/row0merge.c
      storage/innobase/srv/srv0srv.c
      storage/innobase/srv/srv0start.c
      storage/innobase/trx/trx0sys.c
 3255 Calvin Sun	2011-07-12
      mysql-5.6-labs-innodb-features: change the naming to "labs-innodb-features".

    modified:
      VERSION
=== added file 'mysql-test/include/have_innodb_16k.inc'
--- a/mysql-test/include/have_innodb_16k.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/have_innodb_16k.inc	revid:kevin.lewis@stripped
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value = 16384`)
+{
+  --skip Test requires InnoDB with 16k Page size.
+}

=== added file 'mysql-test/include/have_innodb_4k.inc'
--- a/mysql-test/include/have_innodb_4k.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/have_innodb_4k.inc	revid:kevin.lewis@stripped
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value = 4096`)
+{
+  --skip Test requires InnoDB with 4k Page size.
+}

=== added file 'mysql-test/include/have_innodb_8k.inc'
--- a/mysql-test/include/have_innodb_8k.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/have_innodb_8k.inc	revid:kevin.lewis@stripped
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value = 8192`)
+{
+  --skip Test requires InnoDB with 8k Page size.
+}

=== modified file 'mysql-test/suite/innodb/r/innodb-create-options.result' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/r/innodb-create-options.result	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/r/innodb-create-options.result	revid:kevin.lewis@stripped
@@ -75,31 +75,31 @@ SHOW WARNINGS;
 Level	Code	Message
 Warning	1478	InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
 Error	1005	Can't create table 'test.t1' (errno: 1478)
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=8
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=2
 ALTER TABLE t1 ADD COLUMN f1 INT;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=8
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=2
 DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	KEY_BLOCK_SIZE=16
+t1	Compressed	KEY_BLOCK_SIZE=1
 ALTER TABLE t1 ADD COLUMN f1 INT;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	KEY_BLOCK_SIZE=16
+t1	Compressed	KEY_BLOCK_SIZE=1
 # Test 3) StrictMode=ON, ALTER with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 ( i INT );
@@ -121,18 +121,18 @@ SHOW WARNINGS;
 Level	Code	Message
 Warning	1478	InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
 Error	1005	Can't create table '#sql-temporary' (errno: 1478)
-ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=8;
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
 ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
 SHOW WARNINGS;
 Level	Code	Message
 Warning	1478	InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
 Error	1005	Can't create table '#sql-temporary' (errno: 1478)
-ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	KEY_BLOCK_SIZE=16
+t1	Compressed	KEY_BLOCK_SIZE=1
 ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 Level	Code	Message
@@ -169,7 +169,7 @@ Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
 t1	Dynamic	row_format=DYNAMIC
-ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
 ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
 SHOW WARNINGS;
 Level	Code	Message
@@ -181,12 +181,12 @@ Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
 t1	Compressed	row_format=COMPRESSED
-ALTER TABLE t1 KEY_BLOCK_SIZE=16;
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=16
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=1
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
 ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
@@ -297,7 +297,7 @@ DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT;
 SHOW WARNINGS;
 Level	Code	Message
-ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
 ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
 SHOW WARNINGS;
 Level	Code	Message
@@ -339,7 +339,7 @@ SET GLOBAL innodb_file_format=Barracuda;
 #         values during strict mode.
 SET GLOBAL innodb_file_per_table=OFF;
 DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=16;
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1;
 ERROR HY000: Can't create table 'test.t1' (errno: 1478)
 SHOW WARNINGS;
 Level	Code	Message
@@ -517,31 +517,31 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTI
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
 t1	Dynamic	row_format=DYNAMIC KEY_BLOCK_SIZE=4
 DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=8
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=2
 ALTER TABLE t1 ADD COLUMN f1 INT;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=8
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=2
 DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	KEY_BLOCK_SIZE=16
+t1	Compressed	KEY_BLOCK_SIZE=1
 ALTER TABLE t1 ADD COLUMN f1 INT;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	KEY_BLOCK_SIZE=16
+t1	Compressed	KEY_BLOCK_SIZE=1
 # Test 11) StrictMode=OFF, ALTER with each ROW_FORMAT & a valid KEY_BLOCK_SIZE
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 ( i INT );
@@ -580,23 +580,23 @@ TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
 t1	Dynamic	row_format=DYNAMIC KEY_BLOCK_SIZE=4
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 ( i INT );
-ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=8;
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
 Warnings:
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=8 unless ROW_FORMAT=COMPRESSED.
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
 SHOW WARNINGS;
 Level	Code	Message
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=8 unless ROW_FORMAT=COMPRESSED.
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Redundant	row_format=REDUNDANT KEY_BLOCK_SIZE=8
+t1	Redundant	row_format=REDUNDANT KEY_BLOCK_SIZE=2
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 ( i INT );
-ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	KEY_BLOCK_SIZE=16
+t1	Compressed	KEY_BLOCK_SIZE=1
 ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 Level	Code	Message
@@ -650,23 +650,23 @@ TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
 t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=4
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
-ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=8;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=2;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	KEY_BLOCK_SIZE=8
+t1	Compressed	KEY_BLOCK_SIZE=2
 # Test 13) StrictMode=OFF, CREATE with a valid KEY_BLOCK_SIZE
 #          ALTER with each ROW_FORMAT
 DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=16;
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 Level	Code	Message
 SHOW CREATE TABLE t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `i` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=16
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1
 ALTER TABLE t1 ADD COLUMN f1 INT;
 SHOW WARNINGS;
 Level	Code	Message
@@ -675,40 +675,40 @@ Table	Create Table
 t1	CREATE TABLE `t1` (
   `i` int(11) DEFAULT NULL,
   `f1` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=16
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1
 ALTER TABLE t1 ROW_FORMAT=COMPACT;
 Warnings:
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
 SHOW WARNINGS;
 Level	Code	Message
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compact	row_format=COMPACT KEY_BLOCK_SIZE=16
+t1	Compact	row_format=COMPACT KEY_BLOCK_SIZE=1
 ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
 Warnings:
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
 SHOW WARNINGS;
 Level	Code	Message
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Redundant	row_format=REDUNDANT KEY_BLOCK_SIZE=16
+t1	Redundant	row_format=REDUNDANT KEY_BLOCK_SIZE=1
 ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
 Warnings:
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
 SHOW WARNINGS;
 Level	Code	Message
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Dynamic	row_format=DYNAMIC KEY_BLOCK_SIZE=16
+t1	Dynamic	row_format=DYNAMIC KEY_BLOCK_SIZE=1
 ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
 SHOW WARNINGS;
 Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
-t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=16
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=1
 ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
 SHOW WARNINGS;
 Level	Code	Message
@@ -721,7 +721,8 @@ Level	Code	Message
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
 t1	Compact	row_format=COMPACT
-# Test 14) StrictMode=OFF, CREATE with an invalid KEY_BLOCK_SIZE, it defaults to 8
+# Test 14) StrictMode=OFF, CREATE with an invalid KEY_BLOCK_SIZE,
+# it defaults to half of the page size.
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=15;
 Warnings:

=== modified file 'mysql-test/suite/innodb/r/innodb-index.result' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/r/innodb-index.result	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/r/innodb-index.result	revid:kevin.lewis@stripped
@@ -1,50 +1,3 @@
-set global innodb_file_per_table=on;
-set global innodb_file_format='Barracuda';
-CREATE TABLE t1_purge (
-A INT,
-B BLOB, C BLOB, D BLOB, E BLOB,
-F BLOB, G BLOB, H BLOB,
-PRIMARY KEY (B(767), C(767), D(767), E(767), A),
-INDEX (A)
-) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-INSERT INTO t1_purge VALUES (1,
-REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
-REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
-CREATE TABLE t2_purge (
-A INT PRIMARY KEY,
-B BLOB, C BLOB, D BLOB, E BLOB,
-F BLOB, G BLOB, H BLOB, I BLOB,
-J BLOB, K BLOB, L BLOB,
-INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-INSERT INTO t2_purge VALUES (1,
-REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
-REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
-REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
-CREATE TABLE t3_purge (
-A INT,
-B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
-F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
-PRIMARY KEY (B(767), C(767), D(767), E(767), A),
-INDEX (A)
-) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-INSERT INTO t3_purge SELECT * FROM t1_purge;
-CREATE TABLE t4_purge (
-A INT PRIMARY KEY,
-B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
-F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
-J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
-INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-INSERT INTO t4_purge SELECT * FROM t2_purge;
-DELETE FROM t1_purge;
-DELETE FROM t2_purge;
-DELETE FROM t3_purge;
-DELETE FROM t4_purge;
-SELECT sleep(10);
-sleep(10)
-0
-drop table t1_purge, t2_purge, t3_purge, t4_purge;
-set global innodb_file_per_table=0;
-set global innodb_file_format=Antelope;
 create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
 insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
 commit;
@@ -796,188 +749,6 @@ explain select * from t1 order by a;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	2	Using index
 drop table t1;
-create table t2(d varchar(17) primary key) engine=innodb default charset=utf8;
-create table t3(a int primary key) engine=innodb;
-insert into t3 values(22),(44),(33),(55),(66);
-insert into t2 values ('jejdkrun87'),('adfd72nh9k'),
-('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
-create table t1(a int, b blob, c text, d text not null)
-engine=innodb default charset = utf8;
-insert into t1
-select a,left(repeat(d,100*a),65535),repeat(d,20*a),d from t2,t3;
-drop table t2, t3;
-select count(*) from t1 where a=44;
-count(*)
-5
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-a	length(b)	b=left(repeat(d,100*a),65535)	length(c)	c=repeat(d,20*a)	d
-22	22000	1	4400	1	adfd72nh9k
-22	35200	1	7040	1	adfdijn0loKNHJik
-22	28600	1	5720	1	adfdijnmnb78k
-22	26400	1	5280	1	adfdpplkeock
-22	22000	1	4400	1	jejdkrun87
-33	33000	1	6600	1	adfd72nh9k
-33	52800	1	10560	1	adfdijn0loKNHJik
-33	42900	1	8580	1	adfdijnmnb78k
-33	39600	1	7920	1	adfdpplkeock
-33	33000	1	6600	1	jejdkrun87
-44	44000	1	8800	1	adfd72nh9k
-44	65535	1	14080	1	adfdijn0loKNHJik
-44	57200	1	11440	1	adfdijnmnb78k
-44	52800	1	10560	1	adfdpplkeock
-44	44000	1	8800	1	jejdkrun87
-55	55000	1	11000	1	adfd72nh9k
-55	65535	1	17600	1	adfdijn0loKNHJik
-55	65535	1	14300	1	adfdijnmnb78k
-55	65535	1	13200	1	adfdpplkeock
-55	55000	1	11000	1	jejdkrun87
-66	65535	1	13200	1	adfd72nh9k
-66	65535	1	21120	1	adfdijn0loKNHJik
-66	65535	1	17160	1	adfdijnmnb78k
-66	65535	1	15840	1	adfdpplkeock
-66	65535	1	13200	1	jejdkrun87
-alter table t1 add primary key (a), add key (b(20));
-ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
-delete from t1 where a%2;
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-alter table t1 add primary key (a,b(255),c(255)), add key (b(767));
-select count(*) from t1 where a=44;
-count(*)
-5
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-a	length(b)	b=left(repeat(d,100*a),65535)	length(c)	c=repeat(d,20*a)	d
-22	22000	1	4400	1	adfd72nh9k
-22	35200	1	7040	1	adfdijn0loKNHJik
-22	28600	1	5720	1	adfdijnmnb78k
-22	26400	1	5280	1	adfdpplkeock
-22	22000	1	4400	1	jejdkrun87
-44	44000	1	8800	1	adfd72nh9k
-44	65535	1	14080	1	adfdijn0loKNHJik
-44	57200	1	11440	1	adfdijnmnb78k
-44	52800	1	10560	1	adfdpplkeock
-44	44000	1	8800	1	jejdkrun87
-66	65535	1	13200	1	adfd72nh9k
-66	65535	1	21120	1	adfdijn0loKNHJik
-66	65535	1	17160	1	adfdijnmnb78k
-66	65535	1	15840	1	adfdpplkeock
-66	65535	1	13200	1	jejdkrun87
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL DEFAULT '0',
-  `b` blob NOT NULL,
-  `c` text NOT NULL,
-  `d` text NOT NULL,
-  PRIMARY KEY (`a`,`b`(255),`c`(255)),
-  KEY `b` (`b`(767))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-explain select * from t1 where b like 'adfd%';
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	b	NULL	NULL	NULL	15	Using where
-drop table t1;
-set global innodb_file_per_table=on;
-set global innodb_file_format='Barracuda';
-create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
-i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob,
-q blob,r blob,s blob,t blob,u blob)
-engine=innodb row_format=dynamic;
-create index t1a on t1 (a(767));
-create index t1b on t1 (b(767));
-create index t1c on t1 (c(767));
-create index t1d on t1 (d(767));
-create index t1e on t1 (e(767));
-create index t1f on t1 (f(767));
-create index t1g on t1 (g(767));
-create index t1h on t1 (h(767));
-create index t1i on t1 (i(767));
-create index t1j on t1 (j(767));
-create index t1k on t1 (k(767));
-create index t1l on t1 (l(767));
-create index t1m on t1 (m(767));
-create index t1n on t1 (n(767));
-create index t1o on t1 (o(767));
-create index t1p on t1 (p(767));
-create index t1q on t1 (q(767));
-create index t1r on t1 (r(767));
-create index t1s on t1 (s(767));
-create index t1t on t1 (t(767));
-create index t1u on t1 (u(767));
-ERROR HY000: Too big row
-create index t1ut on t1 (u(767), t(767));
-ERROR HY000: Too big row
-create index t1st on t1 (s(767), t(767));
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` blob,
-  `b` blob,
-  `c` blob,
-  `d` blob,
-  `e` blob,
-  `f` blob,
-  `g` blob,
-  `h` blob,
-  `i` blob,
-  `j` blob,
-  `k` blob,
-  `l` blob,
-  `m` blob,
-  `n` blob,
-  `o` blob,
-  `p` blob,
-  `q` blob,
-  `r` blob,
-  `s` blob,
-  `t` blob,
-  `u` blob,
-  KEY `t1a` (`a`(767)),
-  KEY `t1b` (`b`(767)),
-  KEY `t1c` (`c`(767)),
-  KEY `t1d` (`d`(767)),
-  KEY `t1e` (`e`(767)),
-  KEY `t1f` (`f`(767)),
-  KEY `t1g` (`g`(767)),
-  KEY `t1h` (`h`(767)),
-  KEY `t1i` (`i`(767)),
-  KEY `t1j` (`j`(767)),
-  KEY `t1k` (`k`(767)),
-  KEY `t1l` (`l`(767)),
-  KEY `t1m` (`m`(767)),
-  KEY `t1n` (`n`(767)),
-  KEY `t1o` (`o`(767)),
-  KEY `t1p` (`p`(767)),
-  KEY `t1q` (`q`(767)),
-  KEY `t1r` (`r`(767)),
-  KEY `t1s` (`s`(767)),
-  KEY `t1t` (`t`(767)),
-  KEY `t1st` (`s`(767),`t`(767))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
-create index t1u on t1 (u(767));
-ERROR HY000: Too big row
-alter table t1 row_format=compact;
-create index t1u on t1 (u(767));
-drop table t1;
-SET @r=REPEAT('a',500);
-CREATE TABLE t1(a INT,
-v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
-v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
-v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
-v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
-v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
-v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
-) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-CREATE INDEX idx1 ON t1(a,v1);
-INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
-UPDATE t1 SET a=1000;
-DELETE FROM t1;
-DROP TABLE t1;
 set global innodb_file_per_table=0;
 set global innodb_file_format=Antelope;
 set global innodb_file_format_max=Antelope;

=== modified file 'mysql-test/suite/innodb/r/innodb-system-table-view.result' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/r/innodb-system-table-view.result	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/r/innodb-system-table-view.result	revid:kevin.lewis@stripped
@@ -1,11 +1,6 @@
 TABLE_ID	NAME	FLAG	N_COLS	SPACE
 11	SYS_FOREIGN	0	7	0
 12	SYS_FOREIGN_COLS	0	7	0
-INDEX_ID	NAME	TABLE_ID	TYPE	N_FIELDS	PAGE_NO	SPACE
-11	ID_IND	11	3	1	302	0
-12	FOR_IND	11	0	1	303	0
-13	REF_IND	11	0	1	304	0
-14	ID_IND	12	3	2	305	0
 TABLE_ID	NAME	POS	MTYPE	PRTYPE	LEN
 11	ID	0	1	524292	0
 11	FOR_NAME	1	1	524292	0

=== modified file 'mysql-test/suite/innodb/r/innodb-zip.result' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/r/innodb-zip.result	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/r/innodb-zip.result	revid:kevin.lewis@stripped
@@ -121,12 +121,12 @@ CREATE TABLE t1(
 c TEXT NOT NULL, d TEXT NOT NULL,
 PRIMARY KEY (c(767),d(767)))
 ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is {checked_valid}. You have to change some columns to TEXT or BLOBs
 CREATE TABLE t1(
 c TEXT NOT NULL, d TEXT NOT NULL,
 PRIMARY KEY (c(767),d(767)))
 ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is {checked_valid}. You have to change some columns to TEXT or BLOBs
 CREATE TABLE t1(
 c TEXT NOT NULL, d TEXT NOT NULL,
 PRIMARY KEY (c(767),d(767)))
@@ -134,7 +134,7 @@ ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_
 drop table t1;
 CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
 ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is {checked_valid}. You have to change some columns to TEXT or BLOBs
 CREATE TABLE t1(c TEXT, PRIMARY KEY (c(438)))
 ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
 INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
@@ -196,8 +196,6 @@ Error	1005	Can't create table 'test.t2' 
 create table t3 (id int primary key) engine = innodb key_block_size = 1;
 create table t4 (id int primary key) engine = innodb key_block_size = 2;
 create table t5 (id int primary key) engine = innodb key_block_size = 4;
-create table t6 (id int primary key) engine = innodb key_block_size = 8;
-create table t7 (id int primary key) engine = innodb key_block_size = 16;
 create table t8 (id int primary key) engine = innodb row_format = compressed;
 create table t9 (id int primary key) engine = innodb row_format = dynamic;
 create table t10(id int primary key) engine = innodb row_format = compact;
@@ -210,36 +208,34 @@ test	t11	Redundant
 test	t3	Compressed
 test	t4	Compressed
 test	t5	Compressed
-test	t6	Compressed
-test	t7	Compressed
 test	t8	Compressed
 test	t9	Dynamic
-drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
+drop table t1, t3, t4, t5, t8, t9, t10, t11;
 create table t1 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compressed;
+key_block_size = 4 row_format = compressed;
 create table t2 (id int primary key) engine = innodb
-key_block_size = 8 row_format = redundant;
+key_block_size = 4 row_format = redundant;
 ERROR HY000: Can't create table 'test.t2' (errno: 1478)
 show warnings;
 Level	Code	Message
 Warning	1478	InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
 Error	1005	Can't create table 'test.t2' (errno: 1478)
 create table t3 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compact;
+key_block_size = 4 row_format = compact;
 ERROR HY000: Can't create table 'test.t3' (errno: 1478)
 show warnings;
 Level	Code	Message
 Warning	1478	InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
 Error	1005	Can't create table 'test.t3' (errno: 1478)
 create table t4 (id int primary key) engine = innodb
-key_block_size = 8 row_format = dynamic;
+key_block_size = 4 row_format = dynamic;
 ERROR HY000: Can't create table 'test.t4' (errno: 1478)
 show warnings;
 Level	Code	Message
 Warning	1478	InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
 Error	1005	Can't create table 'test.t4' (errno: 1478)
 create table t5 (id int primary key) engine = innodb
-key_block_size = 8 row_format = default;
+key_block_size = 4 row_format = default;
 SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
 table_schema	table_name	row_format
 test	t1	Compressed
@@ -290,18 +286,6 @@ show warnings;
 Level	Code	Message
 Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
 Error	1005	Can't create table 'test.t3' (errno: 1478)
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-ERROR HY000: Can't create table 'test.t4' (errno: 1478)
-show warnings;
-Level	Code	Message
-Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error	1005	Can't create table 'test.t4' (errno: 1478)
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-ERROR HY000: Can't create table 'test.t5' (errno: 1478)
-show warnings;
-Level	Code	Message
-Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error	1005	Can't create table 'test.t5' (errno: 1478)
 create table t6 (id int primary key) engine = innodb row_format = compressed;
 ERROR HY000: Can't create table 'test.t6' (errno: 1478)
 show warnings;
@@ -341,18 +325,6 @@ show warnings;
 Level	Code	Message
 Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
 Error	1005	Can't create table 'test.t3' (errno: 1478)
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-ERROR HY000: Can't create table 'test.t4' (errno: 1478)
-show warnings;
-Level	Code	Message
-Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error	1005	Can't create table 'test.t4' (errno: 1478)
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-ERROR HY000: Can't create table 'test.t5' (errno: 1478)
-show warnings;
-Level	Code	Message
-Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error	1005	Can't create table 'test.t5' (errno: 1478)
 create table t6 (id int primary key) engine = innodb row_format = compressed;
 ERROR HY000: Can't create table 'test.t6' (errno: 1478)
 show warnings;
@@ -385,7 +357,7 @@ select @@innodb_file_format_max;
 Antelope
 create table zip_table (
 c1 int
-) engine = innodb key_block_size = 8;
+) engine = innodb key_block_size = 4;
 select @@innodb_file_format_max;
 @@innodb_file_format_max
 Barracuda

=== modified file 'mysql-test/suite/innodb/r/innodb.result'
--- a/mysql-test/suite/innodb/r/innodb.result	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/r/innodb.result	revid:kevin.lewis@stripped
@@ -1663,10 +1663,10 @@ count(*)
 drop table t1;
 SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
 variable_value
-511
+{checked_valid}
 SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
 variable_value
-16384
+{checked_valid}
 SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
 variable_value - @innodb_rows_deleted_orig
 71
@@ -3070,7 +3070,7 @@ c21 CHAR(255), c22 CHAR(255), c23 CHAR(2
 c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
 c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
 ) ENGINE = InnoDB;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is {checked_valid}. You have to change some columns to TEXT or BLOBs
 DROP TABLE IF EXISTS t1;
 Warnings:
 Note	1051	Unknown table 'test.t1'

=== added file 'mysql-test/suite/innodb/r/innodb_16k.result'
--- a/mysql-test/suite/innodb/r/innodb_16k.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb_16k.result	revid:kevin.lewis@stripped
@@ -0,0 +1,534 @@
+SET default_storage_engine=InnoDB;
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# Test 1) Show the page size from Inofrmation Schema
+SELECT variable_value FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_page_size';
+variable_value
+16384
+# Test 2) With 4k pages, the number of buffer pool pages is different.
+SELECT variable_value FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
+variable_value
+512
+# Test 3) With 4k pages, the root page numbers are different.
+#         Pulled from innodb-system-table-view.test
+SELECT NAME, TABLE_ID, PAGE_NO FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
+NAME	TABLE_ID	PAGE_NO
+ID_IND	11	302
+FOR_IND	11	303
+REF_IND	11	304
+ID_IND	12	305
+PRIMARY	13	307
+PRIMARY	14	309
+# Test 4) With 4k pages, the maximum row size is less than for
+#         larger pages;  Redundant: 8123, Compact: 8126.
+#         Compressed: 8126, Dynamic: 8126.
+#         Each row format has its own amount of overhead that
+#         varies depending on number of fields and other overhead.
+SET SESSION innodb_strict_mode = ON;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(200), c40 CHAR(211)
+) ROW_FORMAT=redundant;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(200), c40 CHAR(212)
+) ROW_FORMAT=redundant;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8123. You have to change some columns to TEXT or BLOBs
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(250), c40 CHAR(246)
+) ROW_FORMAT=compact;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(250), c40 CHAR(247)
+) ROW_FORMAT=compact;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(200), c40 CHAR(159)
+) ROW_FORMAT=compressed;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(200), c40 CHAR(160)
+) ROW_FORMAT=compressed;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(250), c40 CHAR(246)
+) ROW_FORMAT=dynamic;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(250), c40 CHAR(247)
+) ROW_FORMAT=dynamic;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+# Test 5) Make sure that KEY_BLOCK_SIZE=16, 8, 4, 2 & 1
+#         are all accepted.
+SET SESSION innodb_strict_mode = ON;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=16
+ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=8
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=4
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=2
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=1
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED
+DROP TABLE t1;
+SET SESSION innodb_strict_mode = OFF;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=16
+ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=8
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=4
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=2
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=1
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED
+DROP TABLE t1;
+# Test 6) Make sure that KEY_BLOCK_SIZE = 8 and 16
+# are all rejected when innodb_file_per_table=OFF
+SET SESSION innodb_strict_mode = ON;
+set global innodb_file_per_table = OFF;
+show variables like 'innodb_file_per_table';
+Variable_name	Value
+innodb_file_per_table	OFF
+create table t4 (id int primary key) engine = innodb key_block_size = 8;
+ERROR HY000: Can't create table 'test.t4' (errno: 1478)
+show warnings;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Error	1005	Can't create table 'test.t4' (errno: 1478)
+create table t5 (id int primary key) engine = innodb key_block_size = 16;
+ERROR HY000: Can't create table 'test.t5' (errno: 1478)
+show warnings;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Error	1005	Can't create table 'test.t5' (errno: 1478)
+set global innodb_file_per_table = ON;
+set global innodb_file_format = `Antelope`;
+show variables like 'innodb_file%';
+Variable_name	Value
+innodb_file_format	Antelope
+innodb_file_format_check	ON
+innodb_file_format_max	Barracuda
+innodb_file_per_table	ON
+create table t4 (id int primary key) engine = innodb key_block_size = 8;
+ERROR HY000: Can't create table 'test.t4' (errno: 1478)
+show warnings;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Error	1005	Can't create table 'test.t4' (errno: 1478)
+create table t5 (id int primary key) engine = innodb key_block_size = 16;
+ERROR HY000: Can't create table 'test.t5' (errno: 1478)
+show warnings;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Error	1005	Can't create table 'test.t5' (errno: 1478)
+SET GLOBAL innodb_file_format = `Barracuda`;
+# Test 7) This series of tests were moved from innodb-index to here
+# because the second alter table t1 assumes a 16k page size.
+# Moving the test allows the rest of innodb-index to be run on all
+# page sizes.  The previously disabled portions of this test were
+# moved as well.
+create table t2(d varchar(17) primary key) engine=innodb default charset=utf8;
+create table t3(a int primary key) engine=innodb;
+insert into t3 values(22),(44),(33),(55),(66);
+insert into t2 values ('jejdkrun87'),('adfd72nh9k'),
+('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
+create table t1(a int, b blob, c text, d text not null)
+engine=innodb default charset = utf8;
+insert into t1
+select a,left(repeat(d,100*a),65535),repeat(d,20*a),d from t2,t3;
+drop table t2, t3;
+select count(*) from t1 where a=44;
+count(*)
+5
+select a,
+length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
+a	length(b)	b=left(repeat(d,100*a),65535)	length(c)	c=repeat(d,20*a)	d
+22	22000	1	4400	1	adfd72nh9k
+22	35200	1	7040	1	adfdijn0loKNHJik
+22	28600	1	5720	1	adfdijnmnb78k
+22	26400	1	5280	1	adfdpplkeock
+22	22000	1	4400	1	jejdkrun87
+33	33000	1	6600	1	adfd72nh9k
+33	52800	1	10560	1	adfdijn0loKNHJik
+33	42900	1	8580	1	adfdijnmnb78k
+33	39600	1	7920	1	adfdpplkeock
+33	33000	1	6600	1	jejdkrun87
+44	44000	1	8800	1	adfd72nh9k
+44	65535	1	14080	1	adfdijn0loKNHJik
+44	57200	1	11440	1	adfdijnmnb78k
+44	52800	1	10560	1	adfdpplkeock
+44	44000	1	8800	1	jejdkrun87
+55	55000	1	11000	1	adfd72nh9k
+55	65535	1	17600	1	adfdijn0loKNHJik
+55	65535	1	14300	1	adfdijnmnb78k
+55	65535	1	13200	1	adfdpplkeock
+55	55000	1	11000	1	jejdkrun87
+66	65535	1	13200	1	adfd72nh9k
+66	65535	1	21120	1	adfdijn0loKNHJik
+66	65535	1	17160	1	adfdijnmnb78k
+66	65535	1	15840	1	adfdpplkeock
+66	65535	1	13200	1	jejdkrun87
+alter table t1 add primary key (a), add key (b(20));
+ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
+delete from t1 where a%2;
+check table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	check	status	OK
+alter table t1 add primary key (a,b(255),c(255)), add key (b(767));
+select count(*) from t1 where a=44;
+count(*)
+5
+select a,
+length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
+a	length(b)	b=left(repeat(d,100*a),65535)	length(c)	c=repeat(d,20*a)	d
+22	22000	1	4400	1	adfd72nh9k
+22	35200	1	7040	1	adfdijn0loKNHJik
+22	28600	1	5720	1	adfdijnmnb78k
+22	26400	1	5280	1	adfdpplkeock
+22	22000	1	4400	1	jejdkrun87
+44	44000	1	8800	1	adfd72nh9k
+44	65535	1	14080	1	adfdijn0loKNHJik
+44	57200	1	11440	1	adfdijnmnb78k
+44	52800	1	10560	1	adfdpplkeock
+44	44000	1	8800	1	jejdkrun87
+66	65535	1	13200	1	adfd72nh9k
+66	65535	1	21120	1	adfdijn0loKNHJik
+66	65535	1	17160	1	adfdijnmnb78k
+66	65535	1	15840	1	adfdpplkeock
+66	65535	1	13200	1	jejdkrun87
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL DEFAULT '0',
+  `b` blob NOT NULL,
+  `c` text NOT NULL,
+  `d` text NOT NULL,
+  PRIMARY KEY (`a`,`b`(255),`c`(255)),
+  KEY `b` (`b`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+check table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	check	status	OK
+explain select * from t1 where b like 'adfd%';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	b	NULL	NULL	NULL	15	Using where
+drop table t1;
+# Test 8) Test creating a table that could lead to undo log overflow.
+# In the undo log, we write a 768-byte prefix (REC_MAX_INDEX_COL_LEN)
+# of each externally stored column that appears as a column prefix in an index.
+# For this test case, it would suffice to write 1 byte, though.
+# This test was moved from mysql-index.test
+CREATE TABLE t1(a BLOB,b BLOB,c BLOB,d BLOB,e BLOB,f BLOB,g BLOB,h BLOB,
+i BLOB,j BLOB,k BLOB,l BLOB,m BLOB,n BLOB,o BLOB,p BLOB,
+q BLOB,r BLOB,s BLOB,t BLOB,u BLOB)
+ROW_FORMAT=dynamic;
+CREATE INDEX t1a ON t1 (a(767));
+CREATE INDEX t1b ON t1 (b(767));
+CREATE INDEX t1c ON t1 (c(767));
+CREATE INDEX t1d ON t1 (d(767));
+CREATE INDEX t1e ON t1 (e(767));
+CREATE INDEX t1f ON t1 (f(767));
+CREATE INDEX t1g ON t1 (g(767));
+CREATE INDEX t1h ON t1 (h(767));
+CREATE INDEX t1i ON t1 (i(767));
+CREATE INDEX t1j ON t1 (j(767));
+CREATE INDEX t1k ON t1 (k(767));
+CREATE INDEX t1l ON t1 (l(767));
+CREATE INDEX t1m ON t1 (m(767));
+CREATE INDEX t1n ON t1 (n(767));
+CREATE INDEX t1o ON t1 (o(767));
+CREATE INDEX t1p ON t1 (p(767));
+CREATE INDEX t1q ON t1 (q(767));
+CREATE INDEX t1r ON t1 (r(767));
+CREATE INDEX t1s ON t1 (s(767));
+CREATE INDEX t1t ON t1 (t(767));
+CREATE INDEX t1u ON t1 (u(767));
+ERROR HY000: Too big row
+CREATE INDEX t1ut ON t1 (u(767), t(767));
+ERROR HY000: Too big row
+CREATE INDEX t1st ON t1 (s(767), t(767));
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` blob,
+  `b` blob,
+  `c` blob,
+  `d` blob,
+  `e` blob,
+  `f` blob,
+  `g` blob,
+  `h` blob,
+  `i` blob,
+  `j` blob,
+  `k` blob,
+  `l` blob,
+  `m` blob,
+  `n` blob,
+  `o` blob,
+  `p` blob,
+  `q` blob,
+  `r` blob,
+  `s` blob,
+  `t` blob,
+  `u` blob,
+  KEY `t1a` (`a`(767)),
+  KEY `t1b` (`b`(767)),
+  KEY `t1c` (`c`(767)),
+  KEY `t1d` (`d`(767)),
+  KEY `t1e` (`e`(767)),
+  KEY `t1f` (`f`(767)),
+  KEY `t1g` (`g`(767)),
+  KEY `t1h` (`h`(767)),
+  KEY `t1i` (`i`(767)),
+  KEY `t1j` (`j`(767)),
+  KEY `t1k` (`k`(767)),
+  KEY `t1l` (`l`(767)),
+  KEY `t1m` (`m`(767)),
+  KEY `t1n` (`n`(767)),
+  KEY `t1o` (`o`(767)),
+  KEY `t1p` (`p`(767)),
+  KEY `t1q` (`q`(767)),
+  KEY `t1r` (`r`(767)),
+  KEY `t1s` (`s`(767)),
+  KEY `t1t` (`t`(767)),
+  KEY `t1st` (`s`(767),`t`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+CREATE INDEX t1u ON t1 (u(767));
+ERROR HY000: Too big row
+ALTER TABLE t1 ROW_FORMAT=compact;
+CREATE INDEX t1u ON t1 (u(767));
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` blob,
+  `b` blob,
+  `c` blob,
+  `d` blob,
+  `e` blob,
+  `f` blob,
+  `g` blob,
+  `h` blob,
+  `i` blob,
+  `j` blob,
+  `k` blob,
+  `l` blob,
+  `m` blob,
+  `n` blob,
+  `o` blob,
+  `p` blob,
+  `q` blob,
+  `r` blob,
+  `s` blob,
+  `t` blob,
+  `u` blob,
+  KEY `t1a` (`a`(767)),
+  KEY `t1b` (`b`(767)),
+  KEY `t1c` (`c`(767)),
+  KEY `t1d` (`d`(767)),
+  KEY `t1e` (`e`(767)),
+  KEY `t1f` (`f`(767)),
+  KEY `t1g` (`g`(767)),
+  KEY `t1h` (`h`(767)),
+  KEY `t1i` (`i`(767)),
+  KEY `t1j` (`j`(767)),
+  KEY `t1k` (`k`(767)),
+  KEY `t1l` (`l`(767)),
+  KEY `t1m` (`m`(767)),
+  KEY `t1n` (`n`(767)),
+  KEY `t1o` (`o`(767)),
+  KEY `t1p` (`p`(767)),
+  KEY `t1q` (`q`(767)),
+  KEY `t1r` (`r`(767)),
+  KEY `t1s` (`s`(767)),
+  KEY `t1t` (`t`(767)),
+  KEY `t1st` (`s`(767),`t`(767)),
+  KEY `t1u` (`u`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+DROP TABLE t1;
+set global innodb_file_per_table=on;
+set global innodb_file_format='Barracuda';
+CREATE TABLE t1_purge (
+A INT,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+CREATE TABLE t2_purge (
+A INT PRIMARY KEY,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB, I BLOB,
+J BLOB, K BLOB, L BLOB,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+CREATE TABLE t3_purge (
+A INT,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+CREATE TABLE t4_purge (
+A INT PRIMARY KEY,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
+J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+SELECT sleep(10);
+sleep(10)
+0
+drop table t1_purge, t2_purge, t3_purge, t4_purge;
+set global innodb_file_per_table=on;
+set global innodb_file_format='Barracuda';
+SET @r=REPEAT('a',500);
+CREATE TABLE t1(a INT,
+v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
+v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
+v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
+v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
+v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
+v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE INDEX idx1 ON t1(a,v1);
+INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE t1 SET a=1000;
+DELETE FROM t1;
+SELECT sleep(10);
+sleep(10)
+0
+DROP TABLE t1;

=== added file 'mysql-test/suite/innodb/r/innodb_4k.result'
--- a/mysql-test/suite/innodb/r/innodb_4k.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb_4k.result	revid:kevin.lewis@stripped
@@ -0,0 +1,251 @@
+SET default_storage_engine=InnoDB;
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# Test 1) Show the page size from Inofrmation Schema
+SELECT variable_value FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_page_size';
+variable_value
+4096
+# Test 2) With 4k pages, the number of buffer pool pages is different.
+SELECT variable_value FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
+variable_value
+2048
+# Test 3) With 4k pages, the root page numbers are different.
+#         Pulled from innodb-system-table-view.test
+SELECT NAME, TABLE_ID, PAGE_NO FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
+NAME	TABLE_ID	PAGE_NO
+ID_IND	11	801
+FOR_IND	11	802
+REF_IND	11	804
+ID_IND	12	805
+PRIMARY	13	807
+PRIMARY	14	810
+# Test 4) With 4k pages, the maximum row size is less than for
+#         larger pages;  Redundant: 1979, Compact: 1982.
+#         Compressed: 1982, Dynamic: 1982.
+#         Each row format has its own amount of overhead that
+#         varies depending on number of fields and other overhead.
+SET SESSION innodb_strict_mode = ON;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(127)
+) ROW_FORMAT=redundant;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(128)
+) ROW_FORMAT=redundant;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1979. You have to change some columns to TEXT or BLOBs
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(155)
+) ROW_FORMAT=compact;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(156)
+) ROW_FORMAT=compact;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. You have to change some columns to TEXT or BLOBs
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(78)
+) ROW_FORMAT=compressed;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(79)
+) ROW_FORMAT=compressed;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. You have to change some columns to TEXT or BLOBs
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(155)
+) ROW_FORMAT=dynamic;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(156)
+) ROW_FORMAT=dynamic;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. You have to change some columns to TEXT or BLOBs
+# Test 5) Make sure that KEY_BLOCK_SIZE=8 & =16 are rejected in
+#         strict mode and converted to 4 in non-strict mode.
+SET SESSION innodb_strict_mode = ON;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than INNODB_PAGE_SIZE(4096).
+Error	1005	Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE=8 cannot be larger than INNODB_PAGE_SIZE(4096).
+Error	1005	Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=4
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=2
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=1
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED
+DROP TABLE t1;
+SET SESSION innodb_strict_mode = OFF;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+Warnings:
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=16.
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=16.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=16
+DROP TABLE t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+Warnings:
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=8.
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=8.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=8
+DROP TABLE t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=4
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=2
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=1
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED
+DROP TABLE t1;
+# Test 6) Make sure that KEY_BLOCK_SIZE = 8 and 16
+# are both rejected when innodb_file_per_table=OFF
+SET SESSION innodb_strict_mode = ON;
+set global innodb_file_per_table = OFF;
+show variables like 'innodb_file_per_table';
+Variable_name	Value
+innodb_file_per_table	OFF
+create table t4 (id int primary key) engine = innodb key_block_size = 8;
+ERROR HY000: Can't create table 'test.t4' (errno: 1478)
+show warnings;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Warning	1478	InnoDB: KEY_BLOCK_SIZE=8 cannot be larger than INNODB_PAGE_SIZE(4096).
+Error	1005	Can't create table 'test.t4' (errno: 1478)
+create table t5 (id int primary key) engine = innodb key_block_size = 16;
+ERROR HY000: Can't create table 'test.t5' (errno: 1478)
+show warnings;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Warning	1478	InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than INNODB_PAGE_SIZE(4096).
+Error	1005	Can't create table 'test.t5' (errno: 1478)
+set global innodb_file_per_table = ON;
+set global innodb_file_format = `Antelope`;
+show variables like 'innodb_file%';
+Variable_name	Value
+innodb_file_format	Antelope
+innodb_file_format_check	ON
+innodb_file_format_max	Barracuda
+innodb_file_per_table	ON
+create table t4 (id int primary key) engine = innodb key_block_size = 8;
+ERROR HY000: Can't create table 'test.t4' (errno: 1478)
+show warnings;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Warning	1478	InnoDB: KEY_BLOCK_SIZE=8 cannot be larger than INNODB_PAGE_SIZE(4096).
+Error	1005	Can't create table 'test.t4' (errno: 1478)
+create table t5 (id int primary key) engine = innodb key_block_size = 16;
+ERROR HY000: Can't create table 'test.t5' (errno: 1478)
+show warnings;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Warning	1478	InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than INNODB_PAGE_SIZE(4096).
+Error	1005	Can't create table 'test.t5' (errno: 1478)
+SET GLOBAL innodb_file_format = `Barracuda`;
+# Test 7) This test shows a record too big error on 4k pages
+#         that does not happen on larger page sizes.
+CREATE TABLE t1(a BLOB,b BLOB,c BLOB,d BLOB,e BLOB,f BLOB,g BLOB,
+h BLOB,i BLOB,j BLOB,k BLOB,l BLOB,m BLOB,n BLOB,
+o BLOB,p BLOB,q BLOB,r BLOB,s BLOB,t BLOB,u BLOB)
+ENGINE=InnoDB ROW_FORMAT=dynamic;
+CREATE INDEX t1a ON t1 (a(767));
+CREATE INDEX t1b on t1 (b(767));
+CREATE INDEX t1c on t1 (c(767));
+CREATE INDEX t1d on t1 (d(767));
+CREATE INDEX t1e on t1 (e(767));
+ERROR HY000: Too big row
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` blob,
+  `b` blob,
+  `c` blob,
+  `d` blob,
+  `e` blob,
+  `f` blob,
+  `g` blob,
+  `h` blob,
+  `i` blob,
+  `j` blob,
+  `k` blob,
+  `l` blob,
+  `m` blob,
+  `n` blob,
+  `o` blob,
+  `p` blob,
+  `q` blob,
+  `r` blob,
+  `s` blob,
+  `t` blob,
+  `u` blob,
+  KEY `t1a` (`a`(767)),
+  KEY `t1b` (`b`(767)),
+  KEY `t1c` (`c`(767)),
+  KEY `t1d` (`d`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+DROP TABLE t1;

=== added file 'mysql-test/suite/innodb/r/innodb_8k.result'
--- a/mysql-test/suite/innodb/r/innodb_8k.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb_8k.result	revid:kevin.lewis@stripped
@@ -0,0 +1,273 @@
+SET default_storage_engine=InnoDB;
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# Test 1) Show the page size from Inofrmation Schema
+SELECT variable_value FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_page_size';
+variable_value
+8192
+# Test 2) With 8k pages, the number of buffer pool pages is different.
+SELECT variable_value FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
+variable_value
+1024
+# Test 3) With 8k pages, the root page numbers are different.
+#         Pulled from innodb-system-table-view.test
+SELECT NAME, TABLE_ID, PAGE_NO FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
+NAME	TABLE_ID	PAGE_NO
+ID_IND	11	466
+FOR_IND	11	467
+REF_IND	11	468
+ID_IND	12	469
+PRIMARY	13	472
+PRIMARY	14	474
+# Test 4) With 8k pages, the maximum row size is less than for
+#         larger pages;  Redundant: 4027, Compact: 4030.
+#         Compressed: 4030, Dynamic: 4030.
+#         Each row format has its own amount of overhead that
+#         varies depending on number of fields and other overhead.
+SET SESSION innodb_strict_mode = ON;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(155)
+) ROW_FORMAT=redundant;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(156)
+) ROW_FORMAT=redundant;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4027. You have to change some columns to TEXT or BLOBs
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(202)
+) ROW_FORMAT=compact;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(203)
+) ROW_FORMAT=compact;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. You have to change some columns to TEXT or BLOBs
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(105)
+) ROW_FORMAT=compressed;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(106)
+) ROW_FORMAT=compressed;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. You have to change some columns to TEXT or BLOBs
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(202)
+) ROW_FORMAT=dynamic;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(203)
+) ROW_FORMAT=dynamic;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. You have to change some columns to TEXT or BLOBs
+# Test 5) Make sure that KEY_BLOCK_SIZE=16 is rejected in
+#         strict mode and converted to 4 in non-strict mode.
+SET SESSION innodb_strict_mode = ON;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than INNODB_PAGE_SIZE(8192).
+Error	1005	Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=8
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=4
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=2
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=1
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED
+DROP TABLE t1;
+SET SESSION innodb_strict_mode = OFF;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+Warnings:
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=16.
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=16.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=16
+DROP TABLE t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=8
+DROP TABLE t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=4
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=2
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED KEY_BLOCK_SIZE=1
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level	Code	Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+t1	Compressed	row_format=COMPRESSED
+DROP TABLE t1;
+# Test 6) Make sure that KEY_BLOCK_SIZE = 8 and 16
+# are rejected when innodb_file_per_table=OFF
+SET SESSION innodb_strict_mode = ON;
+set global innodb_file_per_table = OFF;
+show variables like 'innodb_file_per_table';
+Variable_name	Value
+innodb_file_per_table	OFF
+create table t4 (id int primary key) engine = innodb key_block_size = 8;
+ERROR HY000: Can't create table 'test.t4' (errno: 1478)
+show warnings;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Error	1005	Can't create table 'test.t4' (errno: 1478)
+create table t5 (id int primary key) engine = innodb key_block_size = 16;
+ERROR HY000: Can't create table 'test.t5' (errno: 1478)
+show warnings;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Warning	1478	InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than INNODB_PAGE_SIZE(8192).
+Error	1005	Can't create table 'test.t5' (errno: 1478)
+set global innodb_file_per_table = ON;
+set global innodb_file_format = `Antelope`;
+show variables like 'innodb_file%';
+Variable_name	Value
+innodb_file_format	Antelope
+innodb_file_format_check	ON
+innodb_file_format_max	Barracuda
+innodb_file_per_table	ON
+create table t4 (id int primary key) engine = innodb key_block_size = 8;
+ERROR HY000: Can't create table 'test.t4' (errno: 1478)
+show warnings;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Error	1005	Can't create table 'test.t4' (errno: 1478)
+create table t5 (id int primary key) engine = innodb key_block_size = 16;
+ERROR HY000: Can't create table 'test.t5' (errno: 1478)
+show warnings;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Warning	1478	InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than INNODB_PAGE_SIZE(8192).
+Error	1005	Can't create table 'test.t5' (errno: 1478)
+SET GLOBAL innodb_file_format = `Barracuda`;
+# Test 7) This test shows a record too big error on 8k pages
+#         that does not happen on larger page sizes.
+CREATE TABLE t1(a BLOB,b BLOB,c BLOB,d BLOB,e BLOB,f BLOB,g BLOB,
+h BLOB,i BLOB,j BLOB,k BLOB,l BLOB,m BLOB,n BLOB,
+o BLOB,p BLOB,q BLOB,r BLOB,s BLOB,t BLOB,u BLOB)
+ENGINE=InnoDB ROW_FORMAT=dynamic;
+CREATE INDEX t1a ON t1 (a(767));
+CREATE INDEX t1b on t1 (b(767));
+CREATE INDEX t1c on t1 (c(767));
+CREATE INDEX t1d on t1 (d(767));
+CREATE INDEX t1e on t1 (e(767));
+CREATE INDEX t1f on t1 (f(767));
+CREATE INDEX t1g on t1 (g(767));
+CREATE INDEX t1h on t1 (h(767));
+CREATE INDEX t1i on t1 (i(767));
+CREATE INDEX t1j on t1 (j(767));
+ERROR HY000: Too big row
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` blob,
+  `b` blob,
+  `c` blob,
+  `d` blob,
+  `e` blob,
+  `f` blob,
+  `g` blob,
+  `h` blob,
+  `i` blob,
+  `j` blob,
+  `k` blob,
+  `l` blob,
+  `m` blob,
+  `n` blob,
+  `o` blob,
+  `p` blob,
+  `q` blob,
+  `r` blob,
+  `s` blob,
+  `t` blob,
+  `u` blob,
+  KEY `t1a` (`a`(767)),
+  KEY `t1b` (`b`(767)),
+  KEY `t1c` (`c`(767)),
+  KEY `t1d` (`d`(767)),
+  KEY `t1e` (`e`(767)),
+  KEY `t1f` (`f`(767)),
+  KEY `t1g` (`g`(767)),
+  KEY `t1h` (`h`(767)),
+  KEY `t1i` (`i`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+DROP TABLE t1;

=== modified file 'mysql-test/suite/innodb/r/innodb_buffer_pool_load.result' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/r/innodb_buffer_pool_load.result	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/r/innodb_buffer_pool_load.result	revid:kevin.lewis@stripped
@@ -8,7 +8,7 @@ COUNT(*)
 SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru
 WHERE table_name LIKE '%ib_bp_test';
 COUNT(*)
-329
+{checked_valid}
 SET GLOBAL innodb_buffer_pool_dump_now = ON;
 select count(*) from ib_bp_test where a = 1;
 count(*)
@@ -22,7 +22,7 @@ Buffer pool(s) load completed at TIMESTA
 SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru
 WHERE table_name LIKE '%ib_bp_test';
 COUNT(*)
-329
+{checked_valid}
 call mtr.add_suppression("InnoDB: Error parsing");
 SET GLOBAL innodb_buffer_pool_load_now = ON;
 DROP TABLE ib_bp_test;

=== modified file 'mysql-test/suite/innodb/r/innodb_bug53591.result' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/r/innodb_bug53591.result	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/r/innodb_bug53591.result	revid:kevin.lewis@stripped
@@ -8,7 +8,7 @@ ERROR HY000: Too big row
 SHOW WARNINGS;
 Level	Code	Message
 Error	139	Too big row
-Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is {checked_valid}. You have to change some columns to TEXT or BLOBs
 Error	1030	Got error 139 from storage engine
 DROP TABLE bug53591;
 SET GLOBAL innodb_file_format=Antelope;

=== modified file 'mysql-test/suite/innodb/r/innodb_index_large_prefix.result' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/r/innodb_index_large_prefix.result	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/r/innodb_index_large_prefix.result	revid:kevin.lewis@stripped
@@ -1,11 +1,16 @@
+SET default_storage_engine=InnoDB;
 set global innodb_file_format="Barracuda";
 set global innodb_file_per_table=1;
 set global innodb_large_prefix=1;
-create table worklog5743(a TEXT not null, primary key (a(1000)))
-ROW_FORMAT=DYNAMIC, engine = innodb;
+### Test 1 ###
+create table worklog5743(a TEXT not null, primary key (a(1000))) ROW_FORMAT=DYNAMIC;
+show warnings;
+Level	Code	Message
 insert into worklog5743 values(repeat("a", 20000));
 update worklog5743 set a = (repeat("b", 16000));
 create index idx on worklog5743(a(2000));
+show warnings;
+Level	Code	Message
 begin;
 update worklog5743 set a = (repeat("x", 17000));
 select @@session.tx_isolation;
@@ -26,9 +31,13 @@ a = repeat("x", 17000)
 1
 rollback;
 drop table worklog5743;
-create table worklog5743(a1 int, a2 TEXT not null)
-ROW_FORMAT=DYNAMIC, engine = innodb;
+### Test 2 ###
+create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC;
+show warnings;
+Level	Code	Message
 create index idx on worklog5743(a1, a2(2000));
+show warnings;
+Level	Code	Message
 insert into worklog5743 values(9, repeat("a", 10000));
 begin;
 update worklog5743 set a1 = 1000;
@@ -49,8 +58,8 @@ select a1, a2 = repeat("a", 10000) from 
 a1	a2 = repeat("a", 10000)
 rollback;
 drop table worklog5743;
-create table worklog5743(a1 int, a2 TEXT not null)
-ROW_FORMAT=DYNAMIC, engine = innodb;
+### Test 3 ###
+create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC;
 create index idx on worklog5743(a1, a2(50));
 insert into worklog5743 values(9, repeat("a", 10000));
 begin;
@@ -72,48 +81,366 @@ select a1, a2 = repeat("a", 10000) from 
 a1	a2 = repeat("a", 10000)
 rollback;
 drop table worklog5743;
-create table worklog5743_2(a1 int, a2 TEXT not null)
-ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
-create table worklog5743_4(a1 int, a2 TEXT not null)
-ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb;
-create index idx1 on worklog5743_2(a1, a2(942));
+### Test 4 ###
+create table worklog5743_1(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=1;
+create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2;
+create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4;
+create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8;
+create table worklog5743_16(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=16;
+set global innodb_large_prefix=0;
+create index idx1 on worklog5743_1(a2(4000));
 ERROR HY000: Too big row
-create index idx1 on worklog5743_2(a1, a2(940));
-create index idx1 on worklog5743_4(a1, a2(1966));
+show warnings;
+Level	Code	Message
+Warning	1071	Specified key was too long; max key length is 767 bytes
+Warning	1071	Specified key was too long; max key length is 767 bytes
+Error	139	Too big row
+Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+Error	1030	Got error 139 from storage engine
+set global innodb_large_prefix=1;
+create index idx2 on worklog5743_1(a2(4000));
+ERROR HY000: Too big row
+show warnings;
+Level	Code	Message
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Error	139	Too big row
+Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+Error	1030	Got error 139 from storage engine
+create index idx3 on worklog5743_1(a2(436));
+ERROR HY000: Too big row
+show warnings;
+Level	Code	Message
+Error	139	Too big row
+Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+Error	1030	Got error 139 from storage engine
+create index idx4 on worklog5743_1(a2(435));
+show warnings;
+Level	Code	Message
+create index idx5 on worklog5743_1(a1, a2(430));
+ERROR HY000: Too big row
+show warnings;
+Level	Code	Message
+Error	139	Too big row
+Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+Error	1030	Got error 139 from storage engine
+create index idx6 on worklog5743_1(a1, a2(429));
+show warnings;
+Level	Code	Message
+set global innodb_large_prefix=0;
+create index idx1 on worklog5743_2(a2(4000));
+Warnings:
+Warning	1071	Specified key was too long; max key length is 767 bytes
+Warning	1071	Specified key was too long; max key length is 767 bytes
+show warnings;
+Level	Code	Message
+Warning	1071	Specified key was too long; max key length is 767 bytes
+Warning	1071	Specified key was too long; max key length is 767 bytes
+set global innodb_large_prefix=1;
+create index idx2 on worklog5743_2(a2(4000));
+ERROR HY000: Too big row
+show warnings;
+Level	Code	Message
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Error	139	Too big row
+Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+Error	1030	Got error 139 from storage engine
+create index idx3 on worklog5743_2(a2(948));
+ERROR HY000: Too big row
+show warnings;
+Level	Code	Message
+Error	139	Too big row
+Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+Error	1030	Got error 139 from storage engine
+create index idx4 on worklog5743_2(a2(947));
+show warnings;
+Level	Code	Message
+create index idx5 on worklog5743_2(a1, a2(942));
+ERROR HY000: Too big row
+show warnings;
+Level	Code	Message
+Error	139	Too big row
+Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+Error	1030	Got error 139 from storage engine
+create index idx6 on worklog5743_2(a1, a2(941));
+show warnings;
+Level	Code	Message
+set global innodb_large_prefix=0;
+create index idx1 on worklog5743_4(a2(4000));
+Warnings:
+Warning	1071	Specified key was too long; max key length is 767 bytes
+Warning	1071	Specified key was too long; max key length is 767 bytes
+show warnings;
+Level	Code	Message
+Warning	1071	Specified key was too long; max key length is 767 bytes
+Warning	1071	Specified key was too long; max key length is 767 bytes
+set global innodb_large_prefix=1;
+create index idx2 on worklog5743_4(a2(4000));
 ERROR HY000: Too big row
-create index idx1 on worklog5743_4(a1, a2(1964));
+show warnings;
+Level	Code	Message
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Error	139	Too big row
+Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+Error	1030	Got error 139 from storage engine
+create index idx3 on worklog5743_4(a2(1972));
+ERROR HY000: Too big row
+show warnings;
+Level	Code	Message
+Error	139	Too big row
+Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+Error	1030	Got error 139 from storage engine
+create index idx4 on worklog5743_4(a2(1971));
+show warnings;
+Level	Code	Message
+create index idx5 on worklog5743_4(a1, a2(1966));
+ERROR HY000: Too big row
+show warnings;
+Level	Code	Message
+Error	139	Too big row
+Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+Error	1030	Got error 139 from storage engine
+create index idx6 on worklog5743_4(a1, a2(1965));
+show warnings;
+Level	Code	Message
+set global innodb_large_prefix=0;
+create index idx1 on worklog5743_8(a2(1000));
+Warnings:
+Warning	1071	Specified key was too long; max key length is 767 bytes
+Warning	1071	Specified key was too long; max key length is 767 bytes
+show warnings;
+Level	Code	Message
+Warning	1071	Specified key was too long; max key length is 767 bytes
+Warning	1071	Specified key was too long; max key length is 767 bytes
+set global innodb_large_prefix=1;
+create index idx2 on worklog5743_8(a2(3073));
+Warnings:
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+show warnings;
+Level	Code	Message
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+create index idx3 on worklog5743_8(a2(3072));
+show warnings;
+Level	Code	Message
+create index idx4 on worklog5743_8(a1, a2(3069));
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+show warnings;
+Level	Code	Message
+Error	1071	Specified key was too long; max key length is 3072 bytes
+create index idx5 on worklog5743_8(a1, a2(3068));
+show warnings;
+Level	Code	Message
+create index idx6 on worklog5743_8(a1, a2(2000), a3(1069));
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+show warnings;
+Level	Code	Message
+Error	1071	Specified key was too long; max key length is 3072 bytes
+create index idx7 on worklog5743_8(a1, a2(2000), a3(1068));
+show warnings;
+Level	Code	Message
+set global innodb_large_prefix=0;
+create index idx1 on worklog5743_16(a2(1000));
+Warnings:
+Warning	1071	Specified key was too long; max key length is 767 bytes
+Warning	1071	Specified key was too long; max key length is 767 bytes
+show warnings;
+Level	Code	Message
+Warning	1071	Specified key was too long; max key length is 767 bytes
+Warning	1071	Specified key was too long; max key length is 767 bytes
+set global innodb_large_prefix=1;
+create index idx2 on worklog5743_16(a2(3073));
+Warnings:
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+show warnings;
+Level	Code	Message
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+create index idx3 on worklog5743_16(a2(3072));
+show warnings;
+Level	Code	Message
+create index idx4 on worklog5743_16(a1, a2(3069));
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+show warnings;
+Level	Code	Message
+Error	1071	Specified key was too long; max key length is 3072 bytes
+create index idx5 on worklog5743_16(a1, a2(3068));
+show warnings;
+Level	Code	Message
+create index idx6 on worklog5743_16(a1, a2(2000), a3(1069));
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+show warnings;
+Level	Code	Message
+Error	1071	Specified key was too long; max key length is 3072 bytes
+create index idx7 on worklog5743_16(a1, a2(2000), a3(1068));
+show warnings;
+Level	Code	Message
+insert into worklog5743_1 values(9, repeat("a", 10000));
 insert into worklog5743_2 values(9, repeat("a", 10000));
 insert into worklog5743_4 values(9, repeat("a", 10000));
+insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000));
+insert into worklog5743_16 values(9, repeat("a", 10000), repeat("a", 10000));
+set global innodb_large_prefix=0;
+insert into worklog5743_1 values(2, repeat("b", 10000));
+insert into worklog5743_2 values(2, repeat("b", 10000));
+insert into worklog5743_4 values(2, repeat("b", 10000));
+insert into worklog5743_8 values(2, repeat("b", 10000), repeat("b", 10000));
+insert into worklog5743_16 values(2, repeat("b", 10000), repeat("b", 10000));
+set global innodb_large_prefix=1;
+select a1, left(a2, 20) from worklog5743_1;
+a1	left(a2, 20)
+9	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+select a1, left(a2, 20) from worklog5743_2;
+a1	left(a2, 20)
+9	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+select a1, left(a2, 20) from worklog5743_4;
+a1	left(a2, 20)
+9	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+select a1, left(a2, 20) from worklog5743_8;
+a1	left(a2, 20)
+9	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+select a1, left(a2, 20) from worklog5743_16;
+a1	left(a2, 20)
+9	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
 begin;
+update worklog5743_1 set a1 = 1000;
 update worklog5743_2 set a1 = 1000;
 update worklog5743_4 set a1 = 1000;
+update worklog5743_8 set a1 = 1000;
+update worklog5743_16 set a1 = 1000;
+select a1, left(a2, 20) from worklog5743_1;
+a1	left(a2, 20)
+1000	aaaaaaaaaaaaaaaaaaaa
+1000	bbbbbbbbbbbbbbbbbbbb
+select a1, left(a2, 20) from worklog5743_2;
+a1	left(a2, 20)
+1000	aaaaaaaaaaaaaaaaaaaa
+1000	bbbbbbbbbbbbbbbbbbbb
+select a1, left(a2, 20) from worklog5743_4;
+a1	left(a2, 20)
+1000	aaaaaaaaaaaaaaaaaaaa
+1000	bbbbbbbbbbbbbbbbbbbb
+select a1, left(a2, 20) from worklog5743_8;
+a1	left(a2, 20)
+1000	aaaaaaaaaaaaaaaaaaaa
+1000	bbbbbbbbbbbbbbbbbbbb
+select a1, left(a2, 20) from worklog5743_16;
+a1	left(a2, 20)
+1000	aaaaaaaaaaaaaaaaaaaa
+1000	bbbbbbbbbbbbbbbbbbbb
 select @@session.tx_isolation;
 @@session.tx_isolation
 REPEATABLE-READ
-explain select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
+explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	worklog5743_2	ref	idx1	idx1	5	const	1	
-select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
-a1	a2 = repeat("a", 10000)
-9	1
-select a1, a2 = repeat("a", 10000) from worklog5743_4 where a1 = 9;
-a1	a2 = repeat("a", 10000)
-9	1
+1	SIMPLE	worklog5743_1	ref	idx6	idx6	5	const	1	
+explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	worklog5743_2	ref	idx6	idx6	5	const	1	
+explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	worklog5743_4	ref	idx6	idx6	5	const	1	
+explain select a1, left(a2, 20) from worklog5743_8 where a1 = 9;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	worklog5743_8	ref	idx5,idx7	idx5	5	const	1	
+explain select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	worklog5743_16	ref	idx5,idx7	idx5	5	const	1	
+select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
+a1	left(a2, 20)
+9	aaaaaaaaaaaaaaaaaaaa
+select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
+a1	left(a2, 20)
+9	aaaaaaaaaaaaaaaaaaaa
+select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
+a1	left(a2, 20)
+9	aaaaaaaaaaaaaaaaaaaa
+select a1, left(a2, 20) from worklog5743_8 where a1 = 9;
+a1	left(a2, 20)
+9	aaaaaaaaaaaaaaaaaaaa
+select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
+a1	left(a2, 20)
+9	aaaaaaaaaaaaaaaaaaaa
 SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
 select @@session.tx_isolation;
 @@session.tx_isolation
 READ-UNCOMMITTED
-select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
-a1	a2 = repeat("a", 10000)
-select a1, a2 = repeat("a", 10000) from worklog5743_4 where a1 = 9;
-a1	a2 = repeat("a", 10000)
+select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
+a1	left(a2, 20)
+select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
+a1	left(a2, 20)
+select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
+a1	left(a2, 20)
+select a1, left(a2, 20) from worklog5743_8 where a1 = 9;
+a1	left(a2, 20)
+select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
+a1	left(a2, 20)
 rollback;
+drop table worklog5743_1;
 drop table worklog5743_2;
 drop table worklog5743_4;
-create table worklog5743(a1 int, a2 varchar(3000))
-ROW_FORMAT=DYNAMIC, engine = innodb;
-create index idx on worklog5743(a1, a2);
-insert into worklog5743 values(9, repeat("a", 3000));
+drop table worklog5743_8;
+drop table worklog5743_16;
+### Test 5 ###
+create table worklog5743(a1 int,
+a2 varchar(20000),
+a3 varchar(3073),
+a4 varchar(3072),
+a5 varchar(3069),
+a6 varchar(3068))
+ROW_FORMAT=DYNAMIC;
+create index idx1 on worklog5743(a2);
+Warnings:
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+create index idx2 on worklog5743(a3);
+Warnings:
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+create index idx3 on worklog5743(a4);
+show warnings;
+Level	Code	Message
+create index idx4 on worklog5743(a1, a2);
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+show warnings;
+Level	Code	Message
+Warning	1071	Specified key was too long; max key length is 3072 bytes
+Error	1071	Specified key was too long; max key length is 3072 bytes
+create index idx5 on worklog5743(a1, a5);
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+show warnings;
+Level	Code	Message
+Error	1071	Specified key was too long; max key length is 3072 bytes
+create index idx6 on worklog5743(a1, a6);
+show warnings;
+Level	Code	Message
+show create table worklog5743;
+Table	Create Table
+worklog5743	CREATE TABLE `worklog5743` (
+  `a1` int(11) DEFAULT NULL,
+  `a2` varchar(20000) DEFAULT NULL,
+  `a3` varchar(3073) DEFAULT NULL,
+  `a4` varchar(3072) DEFAULT NULL,
+  `a5` varchar(3069) DEFAULT NULL,
+  `a6` varchar(3068) DEFAULT NULL,
+  KEY `idx1` (`a2`(3072)),
+  KEY `idx2` (`a3`(3072)),
+  KEY `idx3` (`a4`),
+  KEY `idx6` (`a1`,`a6`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+insert into worklog5743 values(9,
+repeat("a", 20000), repeat("a", 3073),
+repeat("a", 3072), repeat("a", 3069),
+repeat("a", 3068));
 begin;
 update worklog5743 set a1 = 1000;
 select @@session.tx_isolation;
@@ -121,7 +448,7 @@ select @@session.tx_isolation;
 REPEATABLE-READ
 explain select a1 from worklog5743 where a1 = 9;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	worklog5743	ref	idx	idx	5	const	1	Using index
+1	SIMPLE	worklog5743	ref	idx6	idx6	5	const	1	Using index
 select a1 from worklog5743 where a1 = 9;
 a1
 9
@@ -133,13 +460,13 @@ select a1 from worklog5743 where a1 = 9;
 a1
 rollback;
 drop table worklog5743;
-create table worklog5743(a TEXT not null, primary key (a(1000)))
-engine = innodb;
+### Test 6 ###
+create table worklog5743(a TEXT not null, primary key (a(1000)));
 ERROR HY000: Index column size too large. The maximum column size is 767 bytes.
-create table worklog5743(a TEXT) engine = innodb;
-create index idx on worklog5743(a(1000));
+create table worklog5743(a TEXT);
+create index idx on worklog5743(a(768));
 ERROR HY000: Index column size too large. The maximum column size is 767 bytes.
-create index idx on worklog5743(a(725));
+create index idx on worklog5743(a(767));
 insert into worklog5743 values(repeat("a", 20000));
 begin;
 insert into worklog5743 values(repeat("b", 20000));
@@ -160,8 +487,9 @@ a = repeat("x", 25000)
 1
 rollback;
 drop table worklog5743;
-create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC, engine = innodb;
-create index idx on worklog5743(a(3073));
+### Test 7 ###
+create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC;
+create index idx1 on worklog5743(a(3073));
 Warnings:
 Warning	1071	Specified key was too long; max key length is 3072 bytes
 Warning	1071	Specified key was too long; max key length is 3072 bytes
@@ -170,11 +498,16 @@ show create table worklog5743;
 Table	Create Table
 worklog5743	CREATE TABLE `worklog5743` (
   `a` text NOT NULL,
-  KEY `idx` (`a`(3072)),
+  KEY `idx1` (`a`(3072)),
   KEY `idx2` (`a`(3072))
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
 drop table worklog5743;
-create table worklog5743(a TEXT not null) engine = innodb;
+create table worklog5743(a TEXT not null) ROW_FORMAT=REDUNDANT;
+create index idx on worklog5743(a(768));
+ERROR HY000: Index column size too large. The maximum column size is 767 bytes.
+create index idx2 on worklog5743(a(767));
+drop table worklog5743;
+create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT;
 create index idx on worklog5743(a(768));
 ERROR HY000: Index column size too large. The maximum column size is 767 bytes.
 create index idx2 on worklog5743(a(767));

=== modified file 'mysql-test/suite/innodb/r/innodb_mysql.result' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/r/innodb_mysql.result	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result	revid:kevin.lewis@stripped
@@ -2278,7 +2278,7 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t1	ref	i2	i2	8	const,const	1	Using where; Using filesort
 EXPLAIN SELECT * FROM t1 FORCE INDEX(PRIMARY) WHERE b=1 AND c=1 ORDER BY a;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	128	Using where
+1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	{checked}	Using where
 DROP TABLE t1;
 #
 # Bug #47963: Wrong results when index is used

=== modified file 'mysql-test/suite/innodb/t/innodb-create-options.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb-create-options.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb-create-options.test	revid:kevin.lewis@stripped
@@ -54,6 +54,9 @@
 #    ignore all non-zero KEY_BLOCK_SIZEs.
 #
 # See InnoDB documentation page "SQL Compression Syntax Warnings and Errors"
+# This test case does not try to create tables with KEY_BLOCK_SIZE > 4
+# since they are rejected for InnoDB page sizes of 8k and 16k.
+# See innodb_16k and innodb_8k for those tests.
 
 -- source include/have_innodb.inc
 SET default_storage_engine=InnoDB;
@@ -116,14 +119,14 @@ SHOW WARNINGS;
 --error ER_CANT_CREATE_TABLE
 CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
 SHOW WARNINGS;
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 ALTER TABLE t1 ADD COLUMN f1 INT;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 ALTER TABLE t1 ADD COLUMN f1 INT;
@@ -151,10 +154,10 @@ ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BL
 SHOW WARNINGS;
 --replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
 --error ER_CANT_CREATE_TABLE
-ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=8;
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
 --replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
 SHOW WARNINGS;
-ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
@@ -184,13 +187,13 @@ SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 --replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
 --error ER_CANT_CREATE_TABLE
-ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
 --replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
 SHOW WARNINGS;
 ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
-ALTER TABLE t1 KEY_BLOCK_SIZE=16;
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 DROP TABLE IF EXISTS t1;
@@ -263,7 +266,7 @@ CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEF
 SHOW WARNINGS;
 --replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
 --error ER_CANT_CREATE_TABLE
-ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
 --replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
 SHOW WARNINGS;
 --replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
@@ -298,7 +301,7 @@ SET GLOBAL innodb_file_format=Barracuda;
 SET GLOBAL innodb_file_per_table=OFF;
 DROP TABLE IF EXISTS t1;
 --error ER_CANT_CREATE_TABLE
-CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=16;
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 --error ER_CANT_CREATE_TABLE
 CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
@@ -401,14 +404,14 @@ CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYN
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 ALTER TABLE t1 ADD COLUMN f1 INT;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 ALTER TABLE t1 ADD COLUMN f1 INT;
@@ -434,12 +437,12 @@ SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 ( i INT );
-ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=8;
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 ( i INT );
-ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
@@ -468,14 +471,14 @@ SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
-ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=8;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=2;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 
 --echo # Test 13) StrictMode=OFF, CREATE with a valid KEY_BLOCK_SIZE
 --echo #          ALTER with each ROW_FORMAT
 DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=16;
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1;
 SHOW WARNINGS;
 SHOW CREATE TABLE t1;
 ALTER TABLE t1 ADD COLUMN f1 INT;
@@ -500,7 +503,8 @@ ALTER TABLE t1 ROW_FORMAT=COMPACT;
 SHOW WARNINGS;
 SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
 
---echo # Test 14) StrictMode=OFF, CREATE with an invalid KEY_BLOCK_SIZE, it defaults to 8
+--echo # Test 14) StrictMode=OFF, CREATE with an invalid KEY_BLOCK_SIZE,
+--echo # it defaults to half of the page size.
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=15;
 SHOW WARNINGS;

=== modified file 'mysql-test/suite/innodb/t/innodb-index.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb-index.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb-index.test	revid:kevin.lewis@stripped
@@ -3,68 +3,8 @@
 let $MYSQLD_DATADIR= `select @@datadir`;
 
 let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
-
 let $per_table=`select @@innodb_file_per_table`;
 let $format=`select @@innodb_file_format`;
-set global innodb_file_per_table=on;
-set global innodb_file_format='Barracuda';
-
-# Test an assertion failure on purge.
-CREATE TABLE t1_purge (
-A INT,
-B BLOB, C BLOB, D BLOB, E BLOB,
-F BLOB, G BLOB, H BLOB,
-PRIMARY KEY (B(767), C(767), D(767), E(767), A),
-INDEX (A)
-) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-
-INSERT INTO t1_purge VALUES (1,
-REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
-REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
-
-CREATE TABLE t2_purge (
-A INT PRIMARY KEY,
-B BLOB, C BLOB, D BLOB, E BLOB,
-F BLOB, G BLOB, H BLOB, I BLOB,
-J BLOB, K BLOB, L BLOB,
-INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-
-INSERT INTO t2_purge VALUES (1,
-REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
-REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
-REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
-
-CREATE TABLE t3_purge (
-A INT,
-B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
-F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
-PRIMARY KEY (B(767), C(767), D(767), E(767), A),
-INDEX (A)
-) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-
-INSERT INTO t3_purge SELECT * FROM t1_purge;
-
-CREATE TABLE t4_purge (
-A INT PRIMARY KEY,
-B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
-F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
-J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
-INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-
-INSERT INTO t4_purge SELECT * FROM t2_purge;
-
-# This would trigger the failure (Bug #12429576)
-# if purge gets a chance to run before DROP TABLE t1_purge, ....
-DELETE FROM t1_purge;
-DELETE FROM t2_purge;
-DELETE FROM t3_purge;
-DELETE FROM t4_purge;
-
-SELECT sleep(10);
-drop table t1_purge, t2_purge, t3_purge, t4_purge;
-
-eval set global innodb_file_per_table=$per_table;
-eval set global innodb_file_format=$format;
 
 create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
 insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
@@ -284,200 +224,6 @@ explain select * from t1;
 explain select * from t1 order by a;
 drop table t1;
 
-create table t2(d varchar(17) primary key) engine=innodb default charset=utf8;
-create table t3(a int primary key) engine=innodb;
-
-insert into t3 values(22),(44),(33),(55),(66);
-
-insert into t2 values ('jejdkrun87'),('adfd72nh9k'),
-('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
-
-create table t1(a int, b blob, c text, d text not null)
-engine=innodb default charset = utf8;
-
-# r2667 The following test is disabled because MySQL behavior changed.
-# r2667 The test was added with this comment:
-# r2667 
-# r2667 ------------------------------------------------------------------------
-# r2667 r1699 | marko | 2007-08-10 19:53:19 +0300 (Fri, 10 Aug 2007) | 5 lines
-# r2667 
-# r2667 branches/zip: Add changes that accidentally omitted from r1698:
-# r2667 
-# r2667 innodb-index.test, innodb-index.result: Add a test for creating
-# r2667 a PRIMARY KEY on a column that contains a NULL value.
-# r2667 ------------------------------------------------------------------------
-# r2667 
-# r2667 but in BZR-r2667:
-# r2667 http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1/revision/davi%40mysql.com-20080617141221-8yre8ys9j4uw3xx5?start_revid=joerg%40mysql.com-20080630105418-7qoe5ehomgrcdb89
-# r2667 MySQL changed the behavior to do full table copy when creating PRIMARY INDEX
-# r2667 on a non-NULL column instead of calling ::add_index() which would fail (and
-# r2667 this is what we were testing here). Before r2667 the code execution path was
-# r2667 like this (when adding PRIMARY INDEX on a non-NULL column with ALTER TABLE):
-# r2667 
-# r2667 mysql_alter_table()
-# r2667   compare_tables()  // would return ALTER_TABLE_INDEX_CHANGED
-# r2667   ::add_index()  // would fail with "primary index cannot contain NULL"
-# r2667 
-# r2667 after r2667 the code execution path is the following:
-# r2667 
-# r2667 mysql_alter_table()
-# r2667   compare_tables()  // returns ALTER_TABLE_DATA_CHANGED
-# r2667   full copy is done, without calling ::add_index()
-# r2667 
-# r2667 To enable, remove "# r2667: " below.
-# r2667 
-# r2667: insert into t1 values (null,null,null,'null');
-insert into t1
-select a,left(repeat(d,100*a),65535),repeat(d,20*a),d from t2,t3;
-drop table t2, t3;
-select count(*) from t1 where a=44;
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-# r2667: --error ER_PRIMARY_CANT_HAVE_NULL
-# r2667: alter table t1 add primary key (a), add key (b(20));
-# r2667: delete from t1 where d='null';
---error ER_DUP_ENTRY
-alter table t1 add primary key (a), add key (b(20));
-delete from t1 where a%2;
-check table t1;
-alter table t1 add primary key (a,b(255),c(255)), add key (b(767));
-select count(*) from t1 where a=44;
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-show create table t1;
-check table t1;
-explain select * from t1 where b like 'adfd%';
-
-# The following tests are disabled because of the introduced timeouts for
-# metadata locks at the MySQL level as part of the fix for
-# Bug#45225 Locking: hang if drop table with no timeout
-# The following commands now play with MySQL metadata locks instead of
-# InnoDB locks
-# start disabled45225_1
-##
-## Test locking
-##
-#
-#create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb;
-#insert into t2 select a,left(b,255) from t1;
-#drop table t1;
-#rename table t2 to t1;
-#
-#connect (a,localhost,root,,);
-#connect (b,localhost,root,,);
-#connection a;
-#set innodb_lock_wait_timeout=1;
-#begin;
-## Obtain an IX lock on the table
-#select a from t1 limit 1 for update;
-#connection b;
-#set innodb_lock_wait_timeout=1;
-## This would require an S lock on the table, conflicting with the IX lock.
-#--error ER_LOCK_WAIT_TIMEOUT
-#create index t1ba on t1 (b,a);
-#connection a;
-#commit;
-#begin;
-## Obtain an IS lock on the table
-#select a from t1 limit 1 lock in share mode;
-#connection b;
-## This will require an S lock on the table.  No conflict with the IS lock.
-#create index t1ba on t1 (b,a);
-## This would require an X lock on the table, conflicting with the IS lock.
-#--error ER_LOCK_WAIT_TIMEOUT
-#drop index t1ba on t1;
-#connection a;
-#commit;
-#explain select a from t1 order by b;
-#--send
-#select a,sleep(2+a/100) from t1 order by b limit 3;
-#
-## The following DROP INDEX will succeed, altough the SELECT above has
-## opened a read view.  However, during the execution of the SELECT,
-## MySQL should hold a table lock that should block the execution
-## of the DROP INDEX below.
-#
-#connection b;
-#select sleep(1);
-#drop index t1ba on t1;
-#
-## After the index was dropped, subsequent SELECTs will use the same
-## read view, but they should not be accessing the dropped index any more.
-#
-#connection a;
-#reap;
-#explain select a from t1 order by b;
-#select a from t1 order by b limit 3;
-#commit;
-#
-#connection default;
-#disconnect a;
-#disconnect b;
-#
-# end disabled45225_1
-drop table t1;
-
-set global innodb_file_per_table=on;
-set global innodb_file_format='Barracuda';
-# Test creating a table that could lead to undo log overflow.
-# In the undo log, we write a 768-byte prefix (REC_MAX_INDEX_COL_LEN)
-# of each externally stored column that appears as a column prefix in an index.
-# For this test case, it would suffice to write 1 byte, though.
-create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
-		i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob,
-		q blob,r blob,s blob,t blob,u blob)
-	engine=innodb row_format=dynamic;
-create index t1a on t1 (a(767));
-create index t1b on t1 (b(767));
-create index t1c on t1 (c(767));
-create index t1d on t1 (d(767));
-create index t1e on t1 (e(767));
-create index t1f on t1 (f(767));
-create index t1g on t1 (g(767));
-create index t1h on t1 (h(767));
-create index t1i on t1 (i(767));
-create index t1j on t1 (j(767));
-create index t1k on t1 (k(767));
-create index t1l on t1 (l(767));
-create index t1m on t1 (m(767));
-create index t1n on t1 (n(767));
-create index t1o on t1 (o(767));
-create index t1p on t1 (p(767));
-create index t1q on t1 (q(767));
-create index t1r on t1 (r(767));
-create index t1s on t1 (s(767));
-create index t1t on t1 (t(767));
---error 139
-create index t1u on t1 (u(767));
---error 139
-create index t1ut on t1 (u(767), t(767));
-create index t1st on t1 (s(767), t(767));
-show create table t1;
---error 139
-create index t1u on t1 (u(767));
-alter table t1 row_format=compact;
-create index t1u on t1 (u(767));
-
-drop table t1;
-
-# Bug#12637786
-SET @r=REPEAT('a',500);
-CREATE TABLE t1(a INT,
- v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
- v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
- v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
- v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
- v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
- v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
-) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-CREATE INDEX idx1 ON t1(a,v1);
-INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
-UPDATE t1 SET a=1000;
-DELETE FROM t1;
-# Let the purge thread clean up this file.
--- sleep 10
-DROP TABLE t1;
-
 eval set global innodb_file_per_table=$per_table;
 eval set global innodb_file_format=$format;
 eval set global innodb_file_format_max=$format;

=== modified file 'mysql-test/suite/innodb/t/innodb-system-table-view.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb-system-table-view.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb-system-table-view.test	revid:kevin.lewis@stripped
@@ -17,7 +17,8 @@
 --disable_query_log
 --eval SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE table_id NOT IN ($table_stats_id, $index_stats_id)
 
---eval SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE table_id NOT IN ($table_stats_id, $index_stats_id)
+# This has been moved to innodb_4k, innodb_8k & innodb_16k
+#--eval SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE table_id NOT IN ($table_stats_id, $index_stats_id)
 
 --eval SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS WHERE table_id NOT IN ($table_stats_id, $index_stats_id)
 --enable_query_log

=== modified file 'mysql-test/suite/innodb/t/innodb-zip.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb-zip.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb-zip.test	revid:kevin.lewis@stripped
@@ -88,11 +88,13 @@ drop table t1,t2;
 # The following should fail in non-strict mode too.
 # (The fix of Bug #50945 only affects REDUNDANT and COMPACT tables.)
 SET SESSION innodb_strict_mode = off;
+--replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid}
 --error ER_TOO_BIG_ROWSIZE
 CREATE TABLE t1(
 	c TEXT NOT NULL, d TEXT NOT NULL,
 	PRIMARY KEY (c(767),d(767)))
 ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
+--replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid}
 --error ER_TOO_BIG_ROWSIZE
 CREATE TABLE t1(
 	c TEXT NOT NULL, d TEXT NOT NULL,
@@ -103,6 +105,7 @@ CREATE TABLE t1(
 	PRIMARY KEY (c(767),d(767)))
 ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
 drop table t1;
+--replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid}
 --error ER_TOO_BIG_ROWSIZE
 CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
 ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
@@ -183,8 +186,10 @@ show warnings;
 create table t3 (id int primary key) engine = innodb key_block_size = 1;
 create table t4 (id int primary key) engine = innodb key_block_size = 2;
 create table t5 (id int primary key) engine = innodb key_block_size = 4;
-create table t6 (id int primary key) engine = innodb key_block_size = 8;
-create table t7 (id int primary key) engine = innodb key_block_size = 16;
+# These tests are now done in innodb_16k, innodb_8k and innodb_4k
+# where they get different result depending on page size
+# create table t6 (id int primary key) engine = innodb key_block_size = 8;
+# create table t7 (id int primary key) engine = innodb key_block_size = 16;
 
 #check various ROW_FORMAT values.
 create table t8 (id int primary key) engine = innodb row_format = compressed;
@@ -193,29 +198,29 @@ create table t10(id int primary key) eng
 create table t11(id int primary key) engine = innodb row_format = redundant;
 
 -- eval $query_i_s
-drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
+drop table t1, t3, t4, t5, t8, t9, t10, t11;
 
 #test different values of ROW_FORMAT with KEY_BLOCK_SIZE
 create table t1 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compressed;
+key_block_size = 4 row_format = compressed;
 
 --error ER_CANT_CREATE_TABLE
 create table t2 (id int primary key) engine = innodb
-key_block_size = 8 row_format = redundant;
+key_block_size = 4 row_format = redundant;
 show warnings;
 
 --error ER_CANT_CREATE_TABLE
 create table t3 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compact;
+key_block_size = 4 row_format = compact;
 show warnings;
 
 --error ER_CANT_CREATE_TABLE
 create table t4 (id int primary key) engine = innodb
-key_block_size = 8 row_format = dynamic;
+key_block_size = 4 row_format = dynamic;
 show warnings;
 
 create table t5 (id int primary key) engine = innodb
-key_block_size = 8 row_format = default;
+key_block_size = 4 row_format = default;
 
 -- eval $query_i_s
 drop table t1, t5;
@@ -250,12 +255,10 @@ show warnings;
 --error ER_CANT_CREATE_TABLE
 create table t3 (id int primary key) engine = innodb key_block_size = 4;
 show warnings;
---error ER_CANT_CREATE_TABLE
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-show warnings;
+
+# Tests for key_block_size = 8 and 16 were moved to innodb_16k, innodb_8k
+# and innodb_4k since they get different warnings with smaller page sizes.
+
 --error ER_CANT_CREATE_TABLE
 create table t6 (id int primary key) engine = innodb row_format = compressed;
 show warnings;
@@ -281,12 +284,10 @@ show warnings;
 --error ER_CANT_CREATE_TABLE
 create table t3 (id int primary key) engine = innodb key_block_size = 4;
 show warnings;
---error ER_CANT_CREATE_TABLE
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-show warnings;
+
+# Tests for key_block_size = 8 and 16 were moved to innodb_16k, innodb_8k
+# and innodb_4k since they get different warnings with smaller page sizes.
+
 --error ER_CANT_CREATE_TABLE
 create table t6 (id int primary key) engine = innodb row_format = compressed;
 show warnings;
@@ -314,7 +315,7 @@ create table normal_table (
 select @@innodb_file_format_max;
 create table zip_table (
   c1 int
-) engine = innodb key_block_size = 8;
+) engine = innodb key_block_size = 4;
 select @@innodb_file_format_max;
 set global innodb_file_format_max=`Antelope`;
 select @@innodb_file_format_max;

=== modified file 'mysql-test/suite/innodb/t/innodb.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb.test	revid:kevin.lewis@stripped
@@ -1315,8 +1315,9 @@ drop table t1;
 
 # Test for testable InnoDB status variables. This test
 # uses previous ones(pages_created, rows_deleted, ...).
---replace_result 512 511
+--replace_result 512 {checked_valid} 1024 {checked_valid} 2048 {checked_valid}
 SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
+--replace_result 4096 {checked_valid} 8192 {checked_valid} 16384 {checked_valid}
 SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
 SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
 SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
@@ -1554,16 +1555,16 @@ show create table t1;
 drop table t1, t2, t3, t4;
 
 # these should be refused
---error 1071
+--error ER_TOO_LONG_KEY
 create table t1 (col1 varchar(768) primary key)
  character set = latin1 engine = innodb;
---error 1071
+--error ER_TOO_LONG_KEY
 create table t2 (col1 varbinary(768) primary key)
  character set = latin1 engine = innodb;
---error 1071
+--error ER_TOO_LONG_KEY
 create table t3 (col1 text, primary key(col1(768)))
  character set = latin1 engine = innodb;
---error 1071
+--error ER_TOO_LONG_KEY
 create table t4 (col1 blob, primary key(col1(768)))
  character set = latin1 engine = innodb;
 
@@ -2384,6 +2385,7 @@ DROP TABLE t1,t2;
 # Bug #21101 (Prints wrong error message if max row size is too large)
 #
 set innodb_strict_mode=on;
+--replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid}
 --error 1118
 CREATE TABLE t1 (
 	c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),

=== added file 'mysql-test/suite/innodb/t/innodb_16k.test'
--- a/mysql-test/suite/innodb/t/innodb_16k.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb_16k.test	revid:kevin.lewis@stripped
@@ -0,0 +1,505 @@
+# Tests for setting innodb-page-size=16k; default value
+
+-- source include/have_innodb.inc
+-- source include/have_innodb_16k.inc
+SET default_storage_engine=InnoDB;
+
+--disable_query_log
+# These values can change during the test
+LET $innodb_file_format_orig = `select @@innodb_file_format`;
+LET $innodb_file_format_max_orig = `select @@innodb_file_format_max`;
+LET $innodb_file_per_table_orig = `select @@innodb_file_per_table`;
+LET $innodb_strict_mode_orig = `select @@session.innodb_strict_mode`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+--echo # Test 1) Show the page size from Inofrmation Schema
+SELECT variable_value FROM information_schema.global_status
+       WHERE LOWER(variable_name) = 'innodb_page_size';
+
+--echo # Test 2) With 4k pages, the number of buffer pool pages is different.
+SELECT variable_value FROM information_schema.global_status
+       WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
+
+--echo # Test 3) With 4k pages, the root page numbers are different.
+--echo #         Pulled from innodb-system-table-view.test
+SELECT NAME, TABLE_ID, PAGE_NO FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
+
+--echo # Test 4) With 4k pages, the maximum row size is less than for
+--echo #         larger pages;  Redundant: 8123, Compact: 8126.
+--echo #         Compressed: 8126, Dynamic: 8126.
+--echo #         Each row format has its own amount of overhead that
+--echo #         varies depending on number of fields and other overhead.
+
+SET SESSION innodb_strict_mode = ON;
+
+# Redundant table; 8011 bytes with 40 CHAR fields
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(200), c40 CHAR(211)
+) ROW_FORMAT=redundant;
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(200), c40 CHAR(212)
+) ROW_FORMAT=redundant;
+
+# Compact table; 8096 bytes with 40 CHAR fields
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(250), c40 CHAR(246)
+) ROW_FORMAT=compact;
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(250), c40 CHAR(247)
+) ROW_FORMAT=compact;
+
+# Compressed table; 7960 bytes with 40 CHAR fields
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(200), c40 CHAR(159)
+) ROW_FORMAT=compressed;
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(200), c40 CHAR(160)
+) ROW_FORMAT=compressed;
+
+# Dynamic table; 8096 bytes with 40 CHAR fields
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(250), c40 CHAR(246)
+) ROW_FORMAT=dynamic;
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200),
+c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200),
+c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200),
+c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200),
+c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(250), c40 CHAR(247)
+) ROW_FORMAT=dynamic;
+
+
+--echo # Test 5) Make sure that KEY_BLOCK_SIZE=16, 8, 4, 2 & 1
+--echo #         are all accepted.
+
+SET SESSION innodb_strict_mode = ON;
+
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE t1;
+
+SET SESSION innodb_strict_mode = OFF;
+
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE t1;
+
+
+--echo # Test 6) Make sure that KEY_BLOCK_SIZE = 8 and 16
+--echo # are all rejected when innodb_file_per_table=OFF
+# Moved from innodb-zip.test
+SET SESSION innodb_strict_mode = ON;
+set global innodb_file_per_table = OFF;
+show variables like 'innodb_file_per_table';
+--error ER_CANT_CREATE_TABLE
+create table t4 (id int primary key) engine = innodb key_block_size = 8;
+show warnings;
+--error ER_CANT_CREATE_TABLE
+create table t5 (id int primary key) engine = innodb key_block_size = 16;
+show warnings;
+set global innodb_file_per_table = ON;
+set global innodb_file_format = `Antelope`;
+show variables like 'innodb_file%';
+--error ER_CANT_CREATE_TABLE
+create table t4 (id int primary key) engine = innodb key_block_size = 8;
+show warnings;
+--error ER_CANT_CREATE_TABLE
+create table t5 (id int primary key) engine = innodb key_block_size = 16;
+show warnings;
+SET GLOBAL innodb_file_format = `Barracuda`;
+
+
+--echo # Test 7) This series of tests were moved from innodb-index to here
+--echo # because the second alter table t1 assumes a 16k page size.
+--echo # Moving the test allows the rest of innodb-index to be run on all
+--echo # page sizes.  The previously disabled portions of this test were
+--echo # moved as well.
+
+create table t2(d varchar(17) primary key) engine=innodb default charset=utf8;
+create table t3(a int primary key) engine=innodb;
+
+insert into t3 values(22),(44),(33),(55),(66);
+
+insert into t2 values ('jejdkrun87'),('adfd72nh9k'),
+('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
+
+create table t1(a int, b blob, c text, d text not null)
+engine=innodb default charset = utf8;
+
+# r2667 The following test is disabled because MySQL behavior changed.
+# r2667 The test was added with this comment:
+# r2667
+# r2667 ------------------------------------------------------------------------
+# r2667 r1699 | marko | 2007-08-10 19:53:19 +0300 (Fri, 10 Aug 2007) | 5 lines
+# r2667
+# r2667 branches/zip: Add changes that accidentally omitted from r1698:
+# r2667
+# r2667 innodb-index.test, innodb-index.result: Add a test for creating
+# r2667 a PRIMARY KEY on a column that contains a NULL value.
+# r2667 ------------------------------------------------------------------------
+# r2667
+# r2667 but in BZR-r2667:
+# r2667 http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1/revision/davi%40mysql.com-20080617141221-8yre8ys9j4uw3xx5?start_revid=joerg%40mysql.com-20080630105418-7qoe5ehomgrcdb89
+# r2667 MySQL changed the behavior to do full table copy when creating PRIMARY INDEX
+# r2667 on a non-NULL column instead of calling ::add_index() which would fail (and
+# r2667 this is what we were testing here). Before r2667 the code execution path was
+# r2667 like this (when adding PRIMARY INDEX on a non-NULL column with ALTER TABLE):
+# r2667
+# r2667 mysql_alter_table()
+# r2667   compare_tables()  // would return ALTER_TABLE_INDEX_CHANGED
+# r2667   ::add_index()  // would fail with "primary index cannot contain NULL"
+# r2667
+# r2667 after r2667 the code execution path is the following:
+# r2667
+# r2667 mysql_alter_table()
+# r2667   compare_tables()  // returns ALTER_TABLE_DATA_CHANGED
+# r2667   full copy is done, without calling ::add_index()
+# r2667
+# r2667 To enable, remove "# r2667: " below.
+# r2667
+# r2667: insert into t1 values (null,null,null,'null');
+insert into t1
+select a,left(repeat(d,100*a),65535),repeat(d,20*a),d from t2,t3;
+drop table t2, t3;
+select count(*) from t1 where a=44;
+select a,
+length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
+# r2667: --error ER_PRIMARY_CANT_HAVE_NULL
+# r2667: alter table t1 add primary key (a), add key (b(20));
+# r2667: delete from t1 where d='null';
+--error ER_DUP_ENTRY
+alter table t1 add primary key (a), add key (b(20));
+delete from t1 where a%2;
+check table t1;
+alter table t1 add primary key (a,b(255),c(255)), add key (b(767));
+select count(*) from t1 where a=44;
+select a,
+length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
+show create table t1;
+check table t1;
+explain select * from t1 where b like 'adfd%';
+
+# The following tests are disabled because of the introduced timeouts for
+# metadata locks at the MySQL level as part of the fix for
+# Bug#45225 Locking: hang if drop table with no timeout
+# The following commands now play with MySQL metadata locks instead of
+# InnoDB locks
+# start disabled45225_1
+##
+## Test locking
+##
+#
+#create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb;
+#insert into t2 select a,left(b,255) from t1;
+#drop table t1;
+#rename table t2 to t1;
+#
+#connect (a,localhost,root,,);
+#connect (b,localhost,root,,);
+#connection a;
+#set innodb_lock_wait_timeout=1;
+#begin;
+## Obtain an IX lock on the table
+#select a from t1 limit 1 for update;
+#connection b;
+#set innodb_lock_wait_timeout=1;
+## This would require an S lock on the table, conflicting with the IX lock.
+#--error ER_LOCK_WAIT_TIMEOUT
+#create index t1ba on t1 (b,a);
+#connection a;
+#commit;
+#begin;
+## Obtain an IS lock on the table
+#select a from t1 limit 1 lock in share mode;
+#connection b;
+## This will require an S lock on the table.  No conflict with the IS lock.
+#create index t1ba on t1 (b,a);
+## This would require an X lock on the table, conflicting with the IS lock.
+#--error ER_LOCK_WAIT_TIMEOUT
+#drop index t1ba on t1;
+#connection a;
+#commit;
+#explain select a from t1 order by b;
+#--send
+#select a,sleep(2+a/100) from t1 order by b limit 3;
+#
+## The following DROP INDEX will succeed, altough the SELECT above has
+## opened a read view.  However, during the execution of the SELECT,
+## MySQL should hold a table lock that should block the execution
+## of the DROP INDEX below.
+#
+#connection b;
+#select sleep(1);
+#drop index t1ba on t1;
+#
+## After the index was dropped, subsequent SELECTs will use the same
+## read view, but they should not be accessing the dropped index any more.
+#
+#connection a;
+#reap;
+#explain select a from t1 order by b;
+#select a from t1 order by b limit 3;
+#commit;
+#
+#connection default;
+#disconnect a;
+#disconnect b;
+#
+# end disabled45225_1
+drop table t1;
+
+
+--echo # Test 8) Test creating a table that could lead to undo log overflow.
+--echo # In the undo log, we write a 768-byte prefix (REC_MAX_INDEX_COL_LEN)
+--echo # of each externally stored column that appears as a column prefix in an index.
+--echo # For this test case, it would suffice to write 1 byte, though.
+--echo # This test was moved from mysql-index.test
+CREATE TABLE t1(a BLOB,b BLOB,c BLOB,d BLOB,e BLOB,f BLOB,g BLOB,h BLOB,
+		i BLOB,j BLOB,k BLOB,l BLOB,m BLOB,n BLOB,o BLOB,p BLOB,
+		q BLOB,r BLOB,s BLOB,t BLOB,u BLOB)
+		ROW_FORMAT=dynamic;
+CREATE INDEX t1a ON t1 (a(767));
+CREATE INDEX t1b ON t1 (b(767));
+CREATE INDEX t1c ON t1 (c(767));
+CREATE INDEX t1d ON t1 (d(767));
+CREATE INDEX t1e ON t1 (e(767));
+CREATE INDEX t1f ON t1 (f(767));
+CREATE INDEX t1g ON t1 (g(767));
+CREATE INDEX t1h ON t1 (h(767));
+CREATE INDEX t1i ON t1 (i(767));
+CREATE INDEX t1j ON t1 (j(767));
+CREATE INDEX t1k ON t1 (k(767));
+CREATE INDEX t1l ON t1 (l(767));
+CREATE INDEX t1m ON t1 (m(767));
+CREATE INDEX t1n ON t1 (n(767));
+CREATE INDEX t1o ON t1 (o(767));
+CREATE INDEX t1p ON t1 (p(767));
+CREATE INDEX t1q ON t1 (q(767));
+CREATE INDEX t1r ON t1 (r(767));
+CREATE INDEX t1s ON t1 (s(767));
+CREATE INDEX t1t ON t1 (t(767));
+--error 139
+CREATE INDEX t1u ON t1 (u(767));
+--error 139
+CREATE INDEX t1ut ON t1 (u(767), t(767));
+CREATE INDEX t1st ON t1 (s(767), t(767));
+SHOW CREATE TABLE t1;
+--error 139
+CREATE INDEX t1u ON t1 (u(767));
+ALTER TABLE t1 ROW_FORMAT=compact;
+CREATE INDEX t1u ON t1 (u(767));
+
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# Bug#12429576 - Bogus assertion in InnoDB that can fail when purging
+# a deleted record when keys have been defined on a prefix of an
+# off-page column.
+# This test is not in innodb_8k or innodb_4k since the bug is not about
+# page size.  It just executes code where the assertion was.
+
+set global innodb_file_per_table=on;
+set global innodb_file_format='Barracuda';
+
+# Test an assertion failure on purge.
+CREATE TABLE t1_purge (
+A INT,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+
+CREATE TABLE t2_purge (
+A INT PRIMARY KEY,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB, I BLOB,
+J BLOB, K BLOB, L BLOB,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+
+CREATE TABLE t3_purge (
+A INT,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+
+CREATE TABLE t4_purge (
+A INT PRIMARY KEY,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
+J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+
+# This would trigger the failure (Bug #12429576)
+# if purge gets a chance to run before DROP TABLE t1_purge, ....
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+
+SELECT sleep(10);
+drop table t1_purge, t2_purge, t3_purge, t4_purge;
+
+# Bug#12637786 - Assetion hit; ut_ad(dict_index_is_clust(index));
+# A secondary index tuple is found to be too long to fit into a page.
+# This test is not in innodb_8k or innodb_4k since the bug is not about
+# page size.  It just tests the condition that caused the assertion.
+set global innodb_file_per_table=on;
+set global innodb_file_format='Barracuda';
+SET @r=REPEAT('a',500);
+CREATE TABLE t1(a INT,
+ v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
+ v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
+ v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
+ v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
+ v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
+ v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE INDEX idx1 ON t1(a,v1);
+INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE t1 SET a=1000;
+DELETE FROM t1;
+# Let the purge thread clean up this file.
+SELECT sleep(10);
+DROP TABLE t1;
+
+# Cleanup
+--disable_query_log
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+EVAL SET GLOBAL innodb_file_format_max = $innodb_file_format_max_orig;
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET SESSION innodb_strict_mode = $innodb_strict_mode_orig;
+--enable_query_log
+

=== added file 'mysql-test/suite/innodb/t/innodb_4k.test'
--- a/mysql-test/suite/innodb/t/innodb_4k.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb_4k.test	revid:kevin.lewis@stripped
@@ -0,0 +1,205 @@
+# Tests for setting innodb-page-size=4k
+
+-- source include/have_innodb.inc
+-- source include/have_innodb_4k.inc
+SET default_storage_engine=InnoDB;
+
+--disable_query_log
+# These values can change during the test
+LET $innodb_file_format_orig = `select @@innodb_file_format`;
+LET $innodb_file_format_max_orig = `select @@innodb_file_format_max`;
+LET $innodb_file_per_table_orig = `select @@innodb_file_per_table`;
+LET $innodb_strict_mode_orig = `select @@session.innodb_strict_mode`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+--echo # Test 1) Show the page size from Inofrmation Schema
+SELECT variable_value FROM information_schema.global_status
+       WHERE LOWER(variable_name) = 'innodb_page_size';
+
+--echo # Test 2) With 4k pages, the number of buffer pool pages is different.
+SELECT variable_value FROM information_schema.global_status
+       WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
+
+--echo # Test 3) With 4k pages, the root page numbers are different.
+--echo #         Pulled from innodb-system-table-view.test
+SELECT NAME, TABLE_ID, PAGE_NO FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
+
+--echo # Test 4) With 4k pages, the maximum row size is less than for
+--echo #         larger pages;  Redundant: 1979, Compact: 1982.
+--echo #         Compressed: 1982, Dynamic: 1982.
+--echo #         Each row format has its own amount of overhead that
+--echo #         varies depending on number of fields and other overhead.
+
+SET SESSION innodb_strict_mode = ON;
+
+# Redundant table; 1927 bytes with 10 CHAR fields
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(127)
+) ROW_FORMAT=redundant;
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(128)
+) ROW_FORMAT=redundant;
+
+# Compact table; 1955 bytes with 10 CHAR fields
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(155)
+) ROW_FORMAT=compact;
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(156)
+) ROW_FORMAT=compact;
+
+# Compressed table; 1878 bytes with 10 CHAR fields
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(78)
+) ROW_FORMAT=compressed;
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(79)
+) ROW_FORMAT=compressed;
+
+# Dynamic table; 1955 bytes with 10 CHAR fields
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(155)
+) ROW_FORMAT=dynamic;
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(156)
+) ROW_FORMAT=dynamic;
+
+
+--echo # Test 5) Make sure that KEY_BLOCK_SIZE=8 & =16 are rejected in
+--echo #         strict mode and converted to 4 in non-strict mode.
+
+SET SESSION innodb_strict_mode = ON;
+
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE t1;
+
+SET SESSION innodb_strict_mode = OFF;
+
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE t1;
+
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE t1;
+
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE t1;
+
+
+--echo # Test 6) Make sure that KEY_BLOCK_SIZE = 8 and 16
+--echo # are both rejected when innodb_file_per_table=OFF
+# Moved from innodb-zip.test
+SET SESSION innodb_strict_mode = ON;
+set global innodb_file_per_table = OFF;
+show variables like 'innodb_file_per_table';
+--error ER_CANT_CREATE_TABLE
+create table t4 (id int primary key) engine = innodb key_block_size = 8;
+show warnings;
+--error ER_CANT_CREATE_TABLE
+create table t5 (id int primary key) engine = innodb key_block_size = 16;
+show warnings;
+set global innodb_file_per_table = ON;
+set global innodb_file_format = `Antelope`;
+show variables like 'innodb_file%';
+--error ER_CANT_CREATE_TABLE
+create table t4 (id int primary key) engine = innodb key_block_size = 8;
+show warnings;
+--error ER_CANT_CREATE_TABLE
+create table t5 (id int primary key) engine = innodb key_block_size = 16;
+show warnings;
+SET GLOBAL innodb_file_format = `Barracuda`;
+
+
+--echo # Test 7) This test shows a record too big error on 4k pages
+--echo #         that does not happen on larger page sizes.
+# Moved from innodb-index.test
+
+CREATE TABLE t1(a BLOB,b BLOB,c BLOB,d BLOB,e BLOB,f BLOB,g BLOB,
+                h BLOB,i BLOB,j BLOB,k BLOB,l BLOB,m BLOB,n BLOB,
+		o BLOB,p BLOB,q BLOB,r BLOB,s BLOB,t BLOB,u BLOB)
+ENGINE=InnoDB ROW_FORMAT=dynamic;
+CREATE INDEX t1a ON t1 (a(767));
+CREATE INDEX t1b on t1 (b(767));
+CREATE INDEX t1c on t1 (c(767));
+CREATE INDEX t1d on t1 (d(767));
+--error 139
+CREATE INDEX t1e on t1 (e(767));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# Cleanup
+--disable_query_log
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+EVAL SET GLOBAL innodb_file_format_max = $innodb_file_format_max_orig;
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET SESSION innodb_strict_mode = $innodb_strict_mode_orig;
+--enable_query_log
+

=== added file 'mysql-test/suite/innodb/t/innodb_8k.test'
--- a/mysql-test/suite/innodb/t/innodb_8k.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb_8k.test	revid:kevin.lewis@stripped
@@ -0,0 +1,227 @@
+# Tests for setting innodb-page-size=8k
+
+-- source include/have_innodb.inc
+-- source include/have_innodb_8k.inc
+SET default_storage_engine=InnoDB;
+
+--disable_query_log
+# These values can change during the test
+LET $innodb_file_format_orig = `select @@innodb_file_format`;
+LET $innodb_file_format_max_orig = `select @@innodb_file_format_max`;
+LET $innodb_file_per_table_orig = `select @@innodb_file_per_table`;
+LET $innodb_strict_mode_orig = `select @@session.innodb_strict_mode`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+--echo # Test 1) Show the page size from Inofrmation Schema
+SELECT variable_value FROM information_schema.global_status
+       WHERE LOWER(variable_name) = 'innodb_page_size';
+
+--echo # Test 2) With 8k pages, the number of buffer pool pages is different.
+SELECT variable_value FROM information_schema.global_status
+       WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
+
+--echo # Test 3) With 8k pages, the root page numbers are different.
+--echo #         Pulled from innodb-system-table-view.test
+SELECT NAME, TABLE_ID, PAGE_NO FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
+
+--echo # Test 4) With 8k pages, the maximum row size is less than for
+--echo #         larger pages;  Redundant: 4027, Compact: 4030.
+--echo #         Compressed: 4030, Dynamic: 4030.
+--echo #         Each row format has its own amount of overhead that
+--echo #         varies depending on number of fields and other overhead.
+
+SET SESSION innodb_strict_mode = ON;
+
+# Redundant table; 3955 bytes with 20 CHAR fields
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(155)
+) ROW_FORMAT=redundant;
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(156)
+) ROW_FORMAT=redundant;
+
+# Compact table; 4002 bytes with 20 CHAR fields
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(202)
+) ROW_FORMAT=compact;
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(203)
+) ROW_FORMAT=compact;
+
+# Compressed table; 3905 bytes with 20 CHAR fields
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(105)
+) ROW_FORMAT=compressed;
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(106)
+) ROW_FORMAT=compressed;
+
+# Dynamic table; 4002 bytes with 20 CHAR fields
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(202)
+) ROW_FORMAT=dynamic;
+DROP TABLE t1;
+--error ER_TOO_BIG_ROWSIZE
+CREATE TABLE t1 (
+c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200),
+c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200),
+c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200),
+c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(203)
+) ROW_FORMAT=dynamic;
+
+
+--echo # Test 5) Make sure that KEY_BLOCK_SIZE=16 is rejected in
+--echo #         strict mode and converted to 4 in non-strict mode.
+
+SET SESSION innodb_strict_mode = ON;
+
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE t1;
+
+SET SESSION innodb_strict_mode = OFF;
+
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE t1;
+
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE t1;
+
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS
+   FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE t1;
+
+
+--echo # Test 6) Make sure that KEY_BLOCK_SIZE = 8 and 16
+--echo # are rejected when innodb_file_per_table=OFF
+# Moved from innodb-zip.test
+SET SESSION innodb_strict_mode = ON;
+set global innodb_file_per_table = OFF;
+show variables like 'innodb_file_per_table';
+--error ER_CANT_CREATE_TABLE
+create table t4 (id int primary key) engine = innodb key_block_size = 8;
+show warnings;
+--error ER_CANT_CREATE_TABLE
+create table t5 (id int primary key) engine = innodb key_block_size = 16;
+show warnings;
+set global innodb_file_per_table = ON;
+set global innodb_file_format = `Antelope`;
+show variables like 'innodb_file%';
+--error ER_CANT_CREATE_TABLE
+create table t4 (id int primary key) engine = innodb key_block_size = 8;
+show warnings;
+--error ER_CANT_CREATE_TABLE
+create table t5 (id int primary key) engine = innodb key_block_size = 16;
+show warnings;
+SET GLOBAL innodb_file_format = `Barracuda`;
+
+
+--echo # Test 7) This test shows a record too big error on 8k pages
+--echo #         that does not happen on larger page sizes.
+# Moved from innodb-index.test
+
+CREATE TABLE t1(a BLOB,b BLOB,c BLOB,d BLOB,e BLOB,f BLOB,g BLOB,
+                h BLOB,i BLOB,j BLOB,k BLOB,l BLOB,m BLOB,n BLOB,
+		o BLOB,p BLOB,q BLOB,r BLOB,s BLOB,t BLOB,u BLOB)
+ENGINE=InnoDB ROW_FORMAT=dynamic;
+CREATE INDEX t1a ON t1 (a(767));
+CREATE INDEX t1b on t1 (b(767));
+CREATE INDEX t1c on t1 (c(767));
+CREATE INDEX t1d on t1 (d(767));
+CREATE INDEX t1e on t1 (e(767));
+CREATE INDEX t1f on t1 (f(767));
+CREATE INDEX t1g on t1 (g(767));
+CREATE INDEX t1h on t1 (h(767));
+CREATE INDEX t1i on t1 (i(767));
+--error 139
+CREATE INDEX t1j on t1 (j(767));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# Cleanup
+--disable_query_log
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+EVAL SET GLOBAL innodb_file_format_max = $innodb_file_format_max_orig;
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET SESSION innodb_strict_mode = $innodb_strict_mode_orig;
+--enable_query_log
+

=== modified file 'mysql-test/suite/innodb/t/innodb_buffer_pool_load.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb_buffer_pool_load.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_load.test	revid:kevin.lewis@stripped
@@ -36,6 +36,8 @@ while ($i)
 }
 -- enable_query_log
 
+# Accept 329 for 16k page size, 662 for 8k page size & 1392 for 4k page size
+-- replace_result 329 {checked_valid} 662 {checked_valid} 1392 {checked_valid}
 -- eval $check_cnt
 
 # Dump
@@ -83,6 +85,8 @@ SELECT variable_value
 FROM information_schema.global_status
 WHERE variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS';
 
+# Accept 329 for 16k page size, 662 for 8k page size & 1392 for 4k page size
+-- replace_result 329 {checked_valid} 662 {checked_valid} 1392 {checked_valid}
 -- eval $check_cnt
 
 # Add some total garbage to the dump file

=== modified file 'mysql-test/suite/innodb/t/innodb_bug36172.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb_bug36172.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb_bug36172.test	revid:kevin.lewis@stripped
@@ -4,6 +4,7 @@
 
 -- source include/not_embedded.inc
 -- source include/have_innodb.inc
+-- source include/have_innodb_16k.inc
 
 SET default_storage_engine=InnoDB;
 

=== modified file 'mysql-test/suite/innodb/t/innodb_bug53591.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb_bug53591.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb_bug53591.test	revid:kevin.lewis@stripped
@@ -13,6 +13,7 @@ CREATE TABLE bug53591(a text charset utf
 ENGINE=InnoDB KEY_BLOCK_SIZE=1;
 -- error 139
 ALTER TABLE bug53591 ADD PRIMARY KEY(a(220));
+-- replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid}
 SHOW WARNINGS;
 
 DROP TABLE bug53591;

=== modified file 'mysql-test/suite/innodb/t/innodb_bug60049.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb_bug60049.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb_bug60049.test	revid:kevin.lewis@stripped
@@ -4,6 +4,7 @@
 
 -- source include/not_embedded.inc
 -- source include/have_innodb.inc
+-- source include/have_innodb_16k.inc
 
 -- disable_query_log
 let $create1 = query_get_value(SHOW CREATE TABLE mysql.innodb_table_stats, Create Table, 1);

=== modified file 'mysql-test/suite/innodb/t/innodb_index_large_prefix.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb_index_large_prefix.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb_index_large_prefix.test	revid:kevin.lewis@stripped
@@ -1,6 +1,8 @@
 # Testcase for worklog #5743: Lift the limit of index key prefixes
 
 --source include/have_innodb.inc
+--source include/have_innodb_16k.inc
+SET default_storage_engine=InnoDB;
 
 let $innodb_file_format_orig=`select @@innodb_file_format`;
 let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
@@ -11,10 +13,11 @@ set global innodb_file_format="Barracuda
 set global innodb_file_per_table=1;
 set global innodb_large_prefix=1;
 
+-- echo ### Test 1 ###
 # Create a table of DYNAMIC format, with a primary index of 1000 bytes in
 # size
-create table worklog5743(a TEXT not null, primary key (a(1000)))
-ROW_FORMAT=DYNAMIC, engine = innodb;
+create table worklog5743(a TEXT not null, primary key (a(1000))) ROW_FORMAT=DYNAMIC;
+show warnings;
 
 # Do some insertion and update to excercise the external cache
 # code path
@@ -25,6 +28,7 @@ update worklog5743 set a = (repeat("b", 
 
 # Create a secondary index
 create index idx on worklog5743(a(2000));
+show warnings;
 
 # Start a few sessions to do selections on table being updated in default
 # session, so it would rebuild the previous version from undo log.
@@ -57,11 +61,12 @@ rollback;
 
 drop table worklog5743;
 
+-- echo ### Test 2 ###
 # Create a table with only a secondary index has large prefix column
-create table worklog5743(a1 int, a2 TEXT not null)
-ROW_FORMAT=DYNAMIC, engine = innodb;
-
+create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC;
+show warnings;
 create index idx on worklog5743(a1, a2(2000));
+show warnings;
 
 insert into worklog5743 values(9, repeat("a", 10000));
 
@@ -87,9 +92,9 @@ rollback;
 
 drop table worklog5743;
 
+-- echo ### Test 3 ###
 # Create a table with a secondary index has small (50 bytes) prefix column
-create table worklog5743(a1 int, a2 TEXT not null)
-ROW_FORMAT=DYNAMIC, engine = innodb;
+create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC;
 
 create index idx on worklog5743(a1, a2(50));
 
@@ -117,72 +122,219 @@ rollback;
 
 drop table worklog5743;
 
-# Create a table of ROW_FORMAT=COMPRESSED format
-create table worklog5743_2(a1 int, a2 TEXT not null)
-ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
-
-create table worklog5743_4(a1 int, a2 TEXT not null)
-ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb;
-
-# The maximum overall index record (not prefix) length for this table
-# is page_zip_empty_size() / 2, which is 960. "Too big row" error (
-# HA_ERR_TO_BIG_ROW) will be printed if this limit is exceeded.
-# Considering other fields and their overhead, the maximum length
-# for column a2 is 940 or 941 depending on the zlib version used and
-# compressBound() value used in page_zip_empty_size() (please refer
-# to Bug #47495 for more detail).
--- error 139
-create index idx1 on worklog5743_2(a1, a2(942));
-
-create index idx1 on worklog5743_2(a1, a2(940));
+-- echo ### Test 4 ###
+# Create compressed tables with each KEY_BLOCK_SIZE.
+create table worklog5743_1(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=1;
+create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2;
+create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4;
+create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8;
+create table worklog5743_16(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=16;
+
+# The maximum overall index record (not prefix) length of a
+# compressed table is dependent on innodb-page-size (IPS),
+# key_block_size (KBS) and the number of fields (NF).
+# "Too big row" error (HA_ERR_TO_BIG_ROW) will be returned if this
+# limit is exceeded.
+# See page_zip_empty_size() and Bug #47495 for more detail.
 
-# similarly, the maximum index record length for the table is
-# 1984. Considering other fields and their overhead, the
-# maximum length for column a2 is 1964 or 1965 (please refer
-# to Bug #47495 for more detail).
+# Test edge cases for indexes using key_block_size=1
+set global innodb_large_prefix=0;
 -- error 139
-create index idx1 on worklog5743_4(a1, a2(1966));
-
-create index idx1 on worklog5743_4(a1, a2(1964));
+create index idx1 on worklog5743_1(a2(4000));
+show warnings;
+set global innodb_large_prefix=1;
+-- error 139
+create index idx2 on worklog5743_1(a2(4000));
+show warnings;
+-- error 139
+create index idx3 on worklog5743_1(a2(436));
+show warnings;
+create index idx4 on worklog5743_1(a2(435));
+show warnings;
+-- error 139
+create index idx5 on worklog5743_1(a1, a2(430));
+show warnings;
+create index idx6 on worklog5743_1(a1, a2(429));
+show warnings;
+
+# Test edge cases for indexes using key_block_size=2
+set global innodb_large_prefix=0;
+create index idx1 on worklog5743_2(a2(4000));
+show warnings;
+set global innodb_large_prefix=1;
+-- error 139
+create index idx2 on worklog5743_2(a2(4000));
+show warnings;
+-- error 139
+create index idx3 on worklog5743_2(a2(948));
+show warnings;
+create index idx4 on worklog5743_2(a2(947));
+show warnings;
+-- error 139
+create index idx5 on worklog5743_2(a1, a2(942));
+show warnings;
+create index idx6 on worklog5743_2(a1, a2(941));
+show warnings;
+
+# Test edge cases for indexes using key_block_size=4
+set global innodb_large_prefix=0;
+create index idx1 on worklog5743_4(a2(4000));
+show warnings;
+set global innodb_large_prefix=1;
+-- error 139
+create index idx2 on worklog5743_4(a2(4000));
+show warnings;
+-- error 139
+create index idx3 on worklog5743_4(a2(1972));
+show warnings;
+create index idx4 on worklog5743_4(a2(1971));
+show warnings;
+-- error 139
+create index idx5 on worklog5743_4(a1, a2(1966));
+show warnings;
+create index idx6 on worklog5743_4(a1, a2(1965));
+show warnings;
+
+# Test edge cases for indexes using key_block_size=8
+set global innodb_large_prefix=0;
+create index idx1 on worklog5743_8(a2(1000));
+show warnings;
+set global innodb_large_prefix=1;
+create index idx2 on worklog5743_8(a2(3073));
+show warnings;
+create index idx3 on worklog5743_8(a2(3072));
+show warnings;
+-- error ER_TOO_LONG_KEY
+create index idx4 on worklog5743_8(a1, a2(3069));
+show warnings;
+create index idx5 on worklog5743_8(a1, a2(3068));
+show warnings;
+-- error ER_TOO_LONG_KEY
+create index idx6 on worklog5743_8(a1, a2(2000), a3(1069));
+show warnings;
+create index idx7 on worklog5743_8(a1, a2(2000), a3(1068));
+show warnings;
+
+# Test edge cases for indexes using key_block_size=16
+set global innodb_large_prefix=0;
+create index idx1 on worklog5743_16(a2(1000));
+show warnings;
+set global innodb_large_prefix=1;
+create index idx2 on worklog5743_16(a2(3073));
+show warnings;
+create index idx3 on worklog5743_16(a2(3072));
+show warnings;
+-- error ER_TOO_LONG_KEY
+create index idx4 on worklog5743_16(a1, a2(3069));
+show warnings;
+create index idx5 on worklog5743_16(a1, a2(3068));
+show warnings;
+-- error ER_TOO_LONG_KEY
+create index idx6 on worklog5743_16(a1, a2(2000), a3(1069));
+show warnings;
+create index idx7 on worklog5743_16(a1, a2(2000), a3(1068));
+show warnings;
 
+# Insert a large record into each of these tables.
+insert into worklog5743_1 values(9, repeat("a", 10000));
 insert into worklog5743_2 values(9, repeat("a", 10000));
 insert into worklog5743_4 values(9, repeat("a", 10000));
+insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000));
+insert into worklog5743_16 values(9, repeat("a", 10000), repeat("a", 10000));
+
+# Now if we change the global innodb_large_prefix back to 767,
+# updates to these indexes should still be allowed.
+set global innodb_large_prefix=0;
+insert into worklog5743_1 values(2, repeat("b", 10000));
+insert into worklog5743_2 values(2, repeat("b", 10000));
+insert into worklog5743_4 values(2, repeat("b", 10000));
+insert into worklog5743_8 values(2, repeat("b", 10000), repeat("b", 10000));
+insert into worklog5743_16 values(2, repeat("b", 10000), repeat("b", 10000));
+set global innodb_large_prefix=1;
+
+select a1, left(a2, 20) from worklog5743_1;
+select a1, left(a2, 20) from worklog5743_2;
+select a1, left(a2, 20) from worklog5743_4;
+select a1, left(a2, 20) from worklog5743_8;
+select a1, left(a2, 20) from worklog5743_16;
 
 begin;
 
+update worklog5743_1 set a1 = 1000;
 update worklog5743_2 set a1 = 1000;
 update worklog5743_4 set a1 = 1000;
+update worklog5743_8 set a1 = 1000;
+update worklog5743_16 set a1 = 1000;
+select a1, left(a2, 20) from worklog5743_1;
+select a1, left(a2, 20) from worklog5743_2;
+select a1, left(a2, 20) from worklog5743_4;
+select a1, left(a2, 20) from worklog5743_8;
+select a1, left(a2, 20) from worklog5743_16;
+
 
 # Do a select from another connection that would use the secondary index
 --connection con1
 select @@session.tx_isolation;
-explain select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
-select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
-select a1, a2 = repeat("a", 10000) from worklog5743_4 where a1 = 9;
+explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
+explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
+explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
+explain select a1, left(a2, 20) from worklog5743_8 where a1 = 9;
+explain select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
+select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
+select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
+select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
+select a1, left(a2, 20) from worklog5743_8 where a1 = 9;
+select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
 
 # Do read uncommitted in another session, it would show there is no
 # row with a1 = 9
 --connection con2
 SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
 select @@session.tx_isolation;
-select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
-select a1, a2 = repeat("a", 10000) from worklog5743_4 where a1 = 9;
+select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
+select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
+select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
+select a1, left(a2, 20) from worklog5743_8 where a1 = 9;
+select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
 
 --connection default
 rollback;
 
+drop table worklog5743_1;
 drop table worklog5743_2;
 drop table worklog5743_4;
+drop table worklog5743_8;
+drop table worklog5743_16;
 
-# Create a table with varchar column, and create index directly on this
-# large column (without prefix)
-create table worklog5743(a1 int, a2 varchar(3000))
-ROW_FORMAT=DYNAMIC, engine = innodb;
-
-# Create an index with large column without prefix
-create index idx on worklog5743(a1, a2);
+-- echo ### Test 5 ###
+# Create a table with large varchar columns and create indexes
+# directly on these large columns to show that prefix limit is
+# automatically applied and to show that limit.
+create table worklog5743(a1 int,
+	a2 varchar(20000),
+	a3 varchar(3073),
+	a4 varchar(3072),
+	a5 varchar(3069),
+	a6 varchar(3068))
+	ROW_FORMAT=DYNAMIC;
+create index idx1 on worklog5743(a2);
+create index idx2 on worklog5743(a3);
+create index idx3 on worklog5743(a4);
+show warnings;
+-- error ER_TOO_LONG_KEY
+create index idx4 on worklog5743(a1, a2);
+show warnings;
+-- error ER_TOO_LONG_KEY
+create index idx5 on worklog5743(a1, a5);
+show warnings;
+create index idx6 on worklog5743(a1, a6);
+show warnings;
+show create table worklog5743;
 
-insert into worklog5743 values(9, repeat("a", 3000));
+insert into worklog5743 values(9,
+	repeat("a", 20000), repeat("a", 3073),
+	repeat("a", 3072), repeat("a", 3069),
+	repeat("a", 3068));
 
 begin;
 
@@ -205,19 +357,19 @@ rollback;
 
 drop table worklog5743;
 
+-- echo ### Test 6 ###
 # Create a table with old format, and the limit is 768 bytes.
 -- error ER_INDEX_COLUMN_TOO_LONG
-create table worklog5743(a TEXT not null, primary key (a(1000)))
-engine = innodb;
+create table worklog5743(a TEXT not null, primary key (a(1000)));
 
-create table worklog5743(a TEXT) engine = innodb;
+create table worklog5743(a TEXT);
 
 # Excercise the column length check in ha_innobase::add_index()
 -- error ER_INDEX_COLUMN_TOO_LONG
-create index idx on worklog5743(a(1000));
+create index idx on worklog5743(a(768));
 
 # This should be successful
-create index idx on worklog5743(a(725));
+create index idx on worklog5743(a(767));
 
 # Perform some DMLs
 insert into worklog5743 values(repeat("a", 20000));
@@ -242,29 +394,32 @@ rollback;
 
 drop table worklog5743;
 
-# Some border line test on the column length.
+-- echo ### Test 7 ###
+# Some border line tests on the column length.
 # We have a limit of 3072 bytes for Barracuda table
-create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC, engine = innodb;
-
-# Length exceeds maximum supported key length, will auto-truncated to 3072
-create index idx on worklog5743(a(3073));
+create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC;
 
+# Length exceeds maximum supported key length
+# It will be auto-truncated to 3072
+create index idx1 on worklog5743(a(3073));
 create index idx2 on worklog5743(a(3072));
-
 show create table worklog5743;
-
 drop table worklog5743;
 
-# We have a limit of 767 bytes for Antelope table
-create table worklog5743(a TEXT not null) engine = innodb;
-
+# We have a limit of 767 bytes for Antelope tables
+create table worklog5743(a TEXT not null) ROW_FORMAT=REDUNDANT;
 -- error ER_INDEX_COLUMN_TOO_LONG
 create index idx on worklog5743(a(768));
-
 create index idx2 on worklog5743(a(767));
+drop table worklog5743;
 
+create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT;
+-- error ER_INDEX_COLUMN_TOO_LONG
+create index idx on worklog5743(a(768));
+create index idx2 on worklog5743(a(767));
 drop table worklog5743;
 
+
 eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
 eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
 eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;

=== modified file 'mysql-test/suite/innodb/t/innodb_mysql.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb_mysql.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb_mysql.test	revid:kevin.lewis@stripped
@@ -2,7 +2,7 @@
 #
 # Last update:
 # 2006-07-26 ML test refactored (MySQL 5.1)
-#               main testing code t/innodb_mysql.test -> include/mix1.inc              
+#               main testing code t/innodb_mysql.test -> include/mix1.inc
 #
 
 -- source include/have_innodb.inc
@@ -458,6 +458,9 @@ INSERT INTO t1 (b,c,d,e) SELECT RAND()*1
 INSERT INTO t1 (b,c,d,e) SELECT RAND()*10000, RAND()*10000, d, e FROM t1;
 EXPLAIN SELECT * FROM t1 WHERE b=1 AND c=1 ORDER BY a;
 EXPLAIN SELECT * FROM t1 FORCE INDEX(i2) WHERE b=1 and c=1 ORDER BY a;
+# With 4k pages, the 'rows' column in the output below is either 120 or 138,
+# not 128 as it is with 8k and 16k. Bug#12602606
+--replace_result 128 {checked} 120 {checked} 138 {checked}
 EXPLAIN SELECT * FROM t1 FORCE INDEX(PRIMARY) WHERE b=1 AND c=1 ORDER BY a;
 
 DROP TABLE t1;

=== modified file 'mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test	revid:kevin.lewis@stripped
@@ -13,8 +13,9 @@
 #                                                                    #
 ######################################################################
 
-
 --source include/have_innodb.inc
+--source include/have_innodb_16k.inc
+
 # Save innodb variables
 let $innodb_file_format_orig=`select @@innodb_file_format`;
 let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;

=== modified file 'mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test	revid:kevin.lewis@stripped
@@ -15,6 +15,7 @@
 # which is not there with embedded mode
 --source include/not_embedded.inc
 --source include/have_innodb.inc
+--source include/have_innodb_16k.inc
 # Save innodb variables
 let $innodb_file_format_orig=`select @@innodb_file_format`;
 let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;

=== modified file 'mysql-test/suite/innodb/t/innodb_trx_weight.test' (properties changed: -x to +x)
--- a/mysql-test/suite/innodb/t/innodb_trx_weight.test	revid:calvin.sun@stripped
+++ b/mysql-test/suite/innodb/t/innodb_trx_weight.test	revid:kevin.lewis@stripped
@@ -74,7 +74,7 @@ INSERT INTO t3 SELECT * FROM t3;
 -- let $con1_should_be_rolledback = 1
 -- source include/innodb_trx_weight.inc
 
--- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1), (1), (1), (1)
+-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1), (1)
 -- let $con1_extra_sql_present = 1
 -- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
 -- let $con2_extra_sql_present = 1

=== modified file 'mysql-test/suite/sys_vars/r/all_vars.result'
--- a/mysql-test/suite/sys_vars/r/all_vars.result	revid:calvin.sun@stripped
+++ b/mysql-test/suite/sys_vars/r/all_vars.result	revid:kevin.lewis@stripped
@@ -16,8 +16,6 @@ INNODB_ANALYZE_IS_PERSISTENT
 INNODB_ANALYZE_IS_PERSISTENT
 INNODB_FILE_FORMAT_MAX
 INNODB_FILE_FORMAT_MAX
-INNODB_LARGE_PREFIX
-INNODB_LARGE_PREFIX
 INNODB_MONITOR_DISABLE
 INNODB_MONITOR_DISABLE
 INNODB_MONITOR_ENABLE

=== added file 'mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result	revid:kevin.lewis@stripped
@@ -0,0 +1,92 @@
+SET @start_global_value = @@global.innodb_large_prefix;
+SELECT @start_global_value;
+@start_global_value
+0
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_large_prefix in (0, 1);
+@@global.innodb_large_prefix in (0, 1)
+1
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+0
+select @@session.innodb_large_prefix;
+ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable
+show global variables like 'innodb_large_prefix';
+Variable_name	Value
+innodb_large_prefix	OFF
+show session variables like 'innodb_large_prefix';
+Variable_name	Value
+innodb_large_prefix	OFF
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LARGE_PREFIX	OFF
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LARGE_PREFIX	OFF
+set global innodb_large_prefix='OFF';
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+0
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LARGE_PREFIX	OFF
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LARGE_PREFIX	OFF
+set @@global.innodb_large_prefix=1;
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+1
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LARGE_PREFIX	ON
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LARGE_PREFIX	ON
+set global innodb_large_prefix=0;
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+0
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LARGE_PREFIX	OFF
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LARGE_PREFIX	OFF
+set @@global.innodb_large_prefix='ON';
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+1
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LARGE_PREFIX	ON
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LARGE_PREFIX	ON
+set session innodb_large_prefix='OFF';
+ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_large_prefix='ON';
+ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_large_prefix=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix'
+set global innodb_large_prefix=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix'
+set global innodb_large_prefix=2;
+ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of '2'
+NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
+set global innodb_large_prefix=-3;
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+1
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LARGE_PREFIX	ON
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LARGE_PREFIX	ON
+set global innodb_large_prefix='AUTO';
+ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of 'AUTO'
+SET @@global.innodb_large_prefix = @start_global_value;
+SELECT @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+0

=== added file 'mysql-test/suite/sys_vars/r/innodb_page_size_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_page_size_basic.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/innodb_page_size_basic.result	revid:kevin.lewis@stripped
@@ -0,0 +1,8 @@
+SET @orig = @@global.innodb_page_size;
+SELECT @orig;
+@orig
+16384
+SET GLOBAL innodb_page_size = 4k;
+ERROR HY000: Variable 'innodb_page_size' is a read only variable
+SET GLOBAL innodb_page_size = 8k;
+ERROR HY000: Variable 'innodb_page_size' is a read only variable

=== added file 'mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test'
--- a/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test	revid:kevin.lewis@stripped
@@ -0,0 +1,70 @@
+#
+# INNODB_LARGE_PREFIX allows index key prefix of long columns to be
+# 3072 bytes instead of 767 bytes.
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_large_prefix;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_large_prefix in (0, 1);
+select @@global.innodb_large_prefix;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_large_prefix;
+show global variables like 'innodb_large_prefix';
+show session variables like 'innodb_large_prefix';
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+
+#
+# show that it's writable
+#
+set global innodb_large_prefix='OFF';
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+set @@global.innodb_large_prefix=1;
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+set global innodb_large_prefix=0;
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+set @@global.innodb_large_prefix='ON';
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+--error ER_GLOBAL_VARIABLE
+set session innodb_large_prefix='OFF';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_large_prefix='ON';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_large_prefix=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_large_prefix=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_large_prefix=2;
+--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
+set global innodb_large_prefix=-3;
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_large_prefix='AUTO';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_large_prefix = @start_global_value;
+SELECT @@global.innodb_large_prefix;

=== added file 'mysql-test/suite/sys_vars/t/innodb_page_size_basic.test'
--- a/mysql-test/suite/sys_vars/t/innodb_page_size_basic.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/innodb_page_size_basic.test	revid:kevin.lewis@stripped
@@ -0,0 +1,15 @@
+#
+# Basic test for innodb_page_size
+#
+
+-- source include/have_innodb.inc
+
+# Check the default value
+SET @orig = @@global.innodb_page_size;
+SELECT @orig;
+
+# Confirm that we can not change the value
+-- error 1238
+SET GLOBAL innodb_page_size = 4k;
+-- error 1238
+SET GLOBAL innodb_page_size = 8k;

=== modified file 'storage/innobase/buf/buf0buddy.c'
--- a/storage/innobase/buf/buf0buddy.c	revid:calvin.sun@stripped
+++ b/storage/innobase/buf/buf0buddy.c	revid:kevin.lewis@stripped
@@ -46,7 +46,9 @@ buf_buddy_get(
 {
 	ut_ad(ut_is_2pow(size));
 	ut_ad(size >= BUF_BUDDY_LOW);
-	ut_ad(size < BUF_BUDDY_HIGH);
+	ut_ad(BUF_BUDDY_LOW <= UNIV_ZIP_SIZE_MIN);
+	ut_ad(size < (ulint) BUF_BUDDY_HIGH);
+	ut_ad(BUF_BUDDY_HIGH == UNIV_PAGE_SIZE);
 	ut_ad(!ut_align_offset(page, size));
 
 	if (((ulint) page) & size) {

=== modified file 'storage/innobase/fil/fil0fil.c'
--- a/storage/innobase/fil/fil0fil.c	revid:calvin.sun@stripped
+++ b/storage/innobase/fil/fil0fil.c	revid:kevin.lewis@stripped
@@ -4356,8 +4356,12 @@ fil_io(
 	ut_ad(ut_is_2pow(zip_size));
 	ut_ad(buf);
 	ut_ad(len > 0);
-#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
-# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
+	ut_ad((1 << UNIV_PAGE_SIZE_SHIFT) == UNIV_PAGE_SIZE);
+#if (1 << UNIV_PAGE_SIZE_SHIFT_MAX) != UNIV_PAGE_SIZE_MAX
+# error "(1 << UNIV_PAGE_SIZE_SHIFT_MAX) != UNIV_PAGE_SIZE_MAX"
+#endif
+#if (1 << UNIV_PAGE_SIZE_SHIFT_MIN) != UNIV_PAGE_SIZE_MIN
+# error "(1 << UNIV_PAGE_SIZE_SHIFT_MIN) != UNIV_PAGE_SIZE_MIN"
 #endif
 	ut_ad(fil_validate_skip());
 #ifndef UNIV_HOTBACKUP

=== modified file 'storage/innobase/fsp/fsp0fsp.c'
--- a/storage/innobase/fsp/fsp0fsp.c	revid:calvin.sun@stripped
+++ b/storage/innobase/fsp/fsp0fsp.c	revid:kevin.lewis@stripped
@@ -228,6 +228,14 @@ the extent are free and which contain ol
 #define	XDES_SIZE							\
 	(XDES_BITMAP + UT_BITS_IN_BYTES(FSP_EXTENT_SIZE * XDES_BITS_PER_PAGE))
 
+/* File extent data structure size in bytes for MAX page size. */
+#define	XDES_SIZE_MAX							\
+	(XDES_BITMAP + UT_BITS_IN_BYTES(FSP_EXTENT_SIZE_MAX * XDES_BITS_PER_PAGE))
+
+/* File extent data structure size in bytes for MIN page size. */
+#define	XDES_SIZE_MIN							\
+	(XDES_BITMAP + UT_BITS_IN_BYTES(FSP_EXTENT_SIZE_MIN * XDES_BITS_PER_PAGE))
+
 /* Offset of the descriptor array on a descriptor page */
 #define	XDES_ARR_OFFSET		(FSP_HEADER_OFFSET + FSP_HEADER_SIZE)
 
@@ -652,15 +660,25 @@ xdes_calc_descriptor_page(
 	ulint	offset)		/*!< in: page offset */
 {
 #ifndef DOXYGEN /* Doxygen gets confused of these */
-# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET \
-		+ (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
+# if UNIV_PAGE_SIZE_MAX <= XDES_ARR_OFFSET				\
+			   + (UNIV_PAGE_SIZE_MAX / FSP_EXTENT_SIZE_MAX)	\
+			   * XDES_SIZE_MAX
 #  error
 # endif
-# if UNIV_ZIP_SIZE_MIN <= XDES_ARR_OFFSET \
-		+ (UNIV_ZIP_SIZE_MIN / FSP_EXTENT_SIZE) * XDES_SIZE
+# if UNIV_ZIP_SIZE_MIN <= XDES_ARR_OFFSET				\
+			  + (UNIV_ZIP_SIZE_MIN / FSP_EXTENT_SIZE_MIN)	\
+			  * XDES_SIZE_MIN
 #  error
 # endif
 #endif /* !DOXYGEN */
+
+	ut_ad(UNIV_PAGE_SIZE > XDES_ARR_OFFSET
+			     + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE)
+			     * XDES_SIZE);
+	ut_ad(UNIV_ZIP_SIZE_MIN > XDES_ARR_OFFSET
+				+ (UNIV_ZIP_SIZE_MIN / FSP_EXTENT_SIZE)
+				* XDES_SIZE);
+
 	ut_ad(ut_is_2pow(zip_size));
 
 	if (!zip_size) {
@@ -919,6 +937,16 @@ void
 fsp_init(void)
 /*==========*/
 {
+	/* FSP_EXTENT_SIZE must be a multiple of page & zip size */
+	ut_ad(0 == (UNIV_PAGE_SIZE % FSP_EXTENT_SIZE));
+
+#if UNIV_PAGE_SIZE_MAX % FSP_EXTENT_SIZE_MAX
+# error "UNIV_PAGE_SIZE_MAX % FSP_EXTENT_SIZE_MAX != 0"
+#endif
+#if UNIV_ZIP_SIZE_MIN % FSP_EXTENT_SIZE_MIN
+# error "UNIV_ZIP_SIZE_MIN % FSP_EXTENT_SIZE_MIN != 0"
+#endif
+
 	/* Does nothing at the moment */
 }
 
@@ -1412,13 +1440,6 @@ fsp_fill_free_list(
 							   mtr);
 		xdes_init(descr, mtr);
 
-#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
-# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
-#endif
-#if UNIV_ZIP_SIZE_MIN % FSP_EXTENT_SIZE
-# error "UNIV_ZIP_SIZE_MIN % FSP_EXTENT_SIZE != 0"
-#endif
-
 		if (UNIV_UNLIKELY(init_xdes)) {
 
 			/* The first page in the extent is a descriptor page

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	revid:calvin.sun@stripped
+++ b/storage/innobase/handler/ha_innodb.cc	revid:kevin.lewis@stripped
@@ -115,6 +115,7 @@ static const long AUTOINC_NO_LOCKING = 2
 
 static long innobase_mirrored_log_groups;
 static long innobase_log_files_in_group;
+static long innobase_page_size;
 static long innobase_log_buffer_size;
 static long innobase_additional_mem_pool_size;
 static long innobase_file_io_threads;
@@ -2634,6 +2635,39 @@ innobase_change_buffering_inited_ok:
 #ifdef UNIV_LOG_ARCHIVE
 	srv_log_archive_on = (ulint) innobase_log_archive;
 #endif /* UNIV_LOG_ARCHIVE */
+
+	if (innobase_page_size == UNIV_PAGE_SIZE_DEF) {
+		ut_ad(srv_page_size_shift == UNIV_PAGE_SIZE_SHIFT_DEF);
+		ut_ad(srv_page_size = UNIV_PAGE_SIZE_DEF);
+	} else {
+		ulint n;
+		for (n = UNIV_PAGE_SIZE_SHIFT_MIN;
+		     n <= UNIV_PAGE_SIZE_SHIFT_MAX;
+		     n++) {
+			if (innobase_page_size == (1 << n)) {
+				srv_page_size_shift = n;
+				srv_page_size = innobase_page_size ;
+				fprintf(stderr, "InnoDB: innodb-page-size"
+					" has been changed from the"
+					" default value %d to %lu.\n",
+					UNIV_PAGE_SIZE_DEF,
+					srv_page_size);
+				break;
+			}
+		}
+
+		if (n > UNIV_PAGE_SIZE_SHIFT_MAX) {
+			fprintf(stderr,
+				"InnoDB: Invalid page size=%ld.\n",
+				innobase_page_size);
+			fprintf(stderr,
+				"InnoDB: Using default page size=%lu.\n",
+				srv_page_size);
+			srv_page_size_shift = UNIV_PAGE_SIZE_SHIFT_DEF;
+			srv_page_size = UNIV_PAGE_SIZE_DEF;
+			innobase_page_size = UNIV_PAGE_SIZE_DEF;
+		}
+	}
 	srv_log_buffer_size = (ulint) innobase_log_buffer_size;
 
 	srv_buf_pool_size = (ulint) innobase_buffer_pool_size;
@@ -7066,6 +7100,7 @@ create_options_are_valid(
 	ibool	kbs_specified	= FALSE;
 	ibool	ret		= TRUE;
 	enum row_type	row_format	= form->s->row_type;
+	ulint	kbs_max;
 
 	ut_ad(thd != NULL);
 
@@ -7101,7 +7136,23 @@ create_options_are_valid(
 					ER_ILLEGAL_HA_CREATE_OPTION,
 					"InnoDB: KEY_BLOCK_SIZE requires"
 					" innodb_file_format > Antelope.");
-					ret = FALSE;
+				ret = FALSE;
+			}
+
+			/* UNIV_PAGE_SIZE can limit the maximun
+			KEY_BLOCK_SIZE.  Find the KBS associated with
+			the max allowed size. */
+			kbs_max = 1 << (DICT_TF_ZSSIZE_MAX - 1);
+			if (create_info->key_block_size > kbs_max) {
+				push_warning_printf(thd,
+					MYSQL_ERROR::WARN_LEVEL_WARN,
+					ER_ILLEGAL_HA_CREATE_OPTION,
+					"InnoDB: KEY_BLOCK_SIZE=%ld"
+					" cannot be larger than"
+					" INNODB_PAGE_SIZE(%ld).",
+					create_info->key_block_size,
+					UNIV_PAGE_SIZE);
+				ret = FALSE;
 			}
 			break;
 		default:
@@ -7320,6 +7371,7 @@ ha_innobase::create(
 		}
 	} else {
 		/* flags == 0 means no KEY_BLOCK_SIZE.*/
+		ut_ad(DICT_TF_ZSSIZE_MAX >= 1);
 		if (row_format == ROW_TYPE_COMPRESSED) {
 			/* ROW_FORMAT=COMPRESSED without
 			KEY_BLOCK_SIZE implies half the
@@ -7329,9 +7381,6 @@ ha_innobase::create(
 				| DICT_TF_COMPACT
 				| UNIV_FORMAT_B
 				<< DICT_TF_FORMAT_SHIFT;
-#if DICT_TF_ZSSIZE_MAX < 1
-# error "DICT_TF_ZSSIZE_MAX < 1"
-#endif
 		}
 	}
 
@@ -12419,6 +12468,12 @@ static MYSQL_SYSVAR_LONG(force_recovery,
   "Helps to save your data in case the disk image of the database becomes corrupt.",
   NULL, NULL, 0, 0, 6, 0);
 
+static MYSQL_SYSVAR_LONG(page_size, innobase_page_size,
+  PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
+  "Page size to use for all InnoDB tablespaces.",
+  NULL, NULL, UNIV_PAGE_SIZE_DEF,
+  UNIV_PAGE_SIZE_MIN, UNIV_PAGE_SIZE_MAX, 0);
+
 static MYSQL_SYSVAR_LONG(log_buffer_size, innobase_log_buffer_size,
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
   "The size of the buffer which InnoDB uses to write log to the log files on disk.",
@@ -12606,6 +12661,7 @@ static struct st_mysql_sys_var* innobase
   MYSQL_SYSVAR(log_arch_dir),
   MYSQL_SYSVAR(log_archive),
 #endif /* UNIV_LOG_ARCHIVE */
+  MYSQL_SYSVAR(page_size),
   MYSQL_SYSVAR(log_buffer_size),
   MYSQL_SYSVAR(log_file_size),
   MYSQL_SYSVAR(log_files_in_group),

=== modified file 'storage/innobase/handler/i_s.cc'
--- a/storage/innobase/handler/i_s.cc	revid:calvin.sun@stripped
+++ b/storage/innobase/handler/i_s.cc	revid:kevin.lewis@stripped
@@ -117,9 +117,9 @@ struct buffer_page_info_struct{
 					/*!< Compressed page size */
 	unsigned	page_state:BUF_PAGE_STATE_BITS; /*!< Page state */
 	unsigned	page_type:4;	/*!< Page type */
-	unsigned	num_recs:UNIV_PAGE_SIZE_SHIFT-2;
+	unsigned	num_recs:UNIV_PAGE_SIZE_SHIFT_MAX-2;
 					/*!< Number of records on Page */
-	unsigned	data_size:UNIV_PAGE_SIZE_SHIFT;
+	unsigned	data_size:UNIV_PAGE_SIZE_SHIFT_MAX;
 					/*!< Sum of the sizes of the records */
 	lsn_t		newest_mod;	/*!< Log sequence number of
 					the youngest modification */

=== modified file 'storage/innobase/include/buf0buf.h'
--- a/storage/innobase/include/buf0buf.h	revid:calvin.sun@stripped
+++ b/storage/innobase/include/buf0buf.h	revid:kevin.lewis@stripped
@@ -1771,7 +1771,7 @@ struct buf_pool_struct{
 	time_t		last_printout_time;
 					/*!< when buf_print_io was last time
 					called */
-	buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES + 1];
+	buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES_MAX + 1];
 					/*!< Statistics of buddy system,
 					indexed by block size */
 	buf_pool_stat_t	stat;		/*!< current statistics */
@@ -1869,17 +1869,14 @@ struct buf_pool_struct{
 	UT_LIST_BASE_NODE_T(buf_page_t)	zip_clean;
 					/*!< unmodified compressed pages */
 #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
-	UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES];
+	UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES_MAX];
 					/*!< buddy free lists */
 
 	buf_page_t*			watch;
 					/*!< Sentinel records for buffer
 					pool watches. Protected by
-				       	buf_pool->mutex. */
+					buf_pool->mutex. */
 
-#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
-# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
-#endif
 #if BUF_BUDDY_LOW > UNIV_ZIP_SIZE_MIN
 # error "BUF_BUDDY_LOW > UNIV_ZIP_SIZE_MIN"
 #endif

=== modified file 'storage/innobase/include/buf0types.h'
--- a/storage/innobase/include/buf0types.h	revid:calvin.sun@stripped
+++ b/storage/innobase/include/buf0types.h	revid:kevin.lewis@stripped
@@ -64,7 +64,10 @@ enum buf_io_fix {
 #define BUF_BUDDY_LOW		(1 << BUF_BUDDY_LOW_SHIFT)
 
 #define BUF_BUDDY_SIZES		(UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
-					/*!< number of buddy sizes */
+
+/** Maximum number of buddy sizes based on the max page size */
+#define BUF_BUDDY_SIZES_MAX	(UNIV_PAGE_SIZE_SHIFT_MAX	\
+				- BUF_BUDDY_LOW_SHIFT)
 
 /** twice the maximum block size of the buddy system;
 the underlying memory is aligned by this amount:

=== modified file 'storage/innobase/include/dict0mem.h'
--- a/storage/innobase/include/dict0mem.h	revid:calvin.sun@stripped
+++ b/storage/innobase/include/dict0mem.h	revid:kevin.lewis@stripped
@@ -74,7 +74,14 @@ and Dynamic, because they add features t
 /* @{ */
 #define DICT_TF_ZSSIZE_SHIFT		1
 #define DICT_TF_ZSSIZE_MASK		(15 << DICT_TF_ZSSIZE_SHIFT)
-#define DICT_TF_ZSSIZE_MAX (UNIV_PAGE_SIZE_SHIFT - UNIV_ZIP_SIZE_SHIFT_MIN + 1)
+
+/** Make sure that DICT_TF_ZSSIZE_MAX is never too big.  A zip page
+can not be larger than 16k but it should also not be larger than the
+UNIV_PAGE_SIZE.  This constant is the one used to prevent the zip
+page size from being declared too big on CREATE or ALTER. */
+#define DICT_TF_ZSSIZE_MAX (min(UNIV_PAGE_SIZE_SHIFT,		\
+				UNIV_ZIP_SIZE_SHIFT_MAX)	\
+			    - UNIV_ZIP_SIZE_SHIFT_MIN + 1)
 /* @} */
 
 /** File format */

=== modified file 'storage/innobase/include/fsp0types.h'
--- a/storage/innobase/include/fsp0types.h	revid:calvin.sun@stripped
+++ b/storage/innobase/include/fsp0types.h	revid:kevin.lewis@stripped
@@ -42,7 +42,13 @@ fseg_alloc_free_page) */
 /* @} */
 
 /** File space extent size (one megabyte) in pages */
-#define	FSP_EXTENT_SIZE		(1 << (20 - UNIV_PAGE_SIZE_SHIFT))
+#define	FSP_EXTENT_SIZE	((ulint) (1 << (20 - UNIV_PAGE_SIZE_SHIFT)))
+
+/** File space extent size (one megabyte) in pages for MAX page size */
+#define	FSP_EXTENT_SIZE_MAX	(1 << (20 - UNIV_PAGE_SIZE_SHIFT_MAX))
+
+/** File space extent size (one megabyte) in pages for MIN page size */
+#define	FSP_EXTENT_SIZE_MIN	(1 << (20 - UNIV_PAGE_SIZE_SHIFT_MIN))
 
 /** On a page of any file segment, data may be put starting from this
 offset */

=== modified file 'storage/innobase/include/sync0rw.ic'
--- a/storage/innobase/include/sync0rw.ic	revid:calvin.sun@stripped
+++ b/storage/innobase/include/sync0rw.ic	revid:kevin.lewis@stripped
@@ -461,8 +461,12 @@ rw_lock_x_lock_func_nowait(
 		there is an exclusive writer and this is the writer thread. */
 		lock->lock_word -= X_LOCK_DECR;
 
+		/* Recursive x-locks must be multiples of X_LOCK_DECR. */
 		ut_ad(((-lock->lock_word) % X_LOCK_DECR) == 0);
 
+		/* Watch for too many recursive locks */
+		ut_ad(lock->lock_word < 0);
+
 	} else {
 		/* Failure */
 		return(FALSE);

=== modified file 'storage/innobase/include/trx0sys.h'
--- a/storage/innobase/include/trx0sys.h	revid:calvin.sun@stripped
+++ b/storage/innobase/include/trx0sys.h	revid:kevin.lewis@stripped
@@ -570,8 +570,8 @@ We must remember this limit in order to 
 /** Contents of TRX_SYS_MYSQL_LOG_MAGIC_N_FLD */
 #define TRX_SYS_MYSQL_LOG_MAGIC_N	873422344
 
-#if UNIV_PAGE_SIZE < 4096
-# error "UNIV_PAGE_SIZE < 4096"
+#if UNIV_PAGE_SIZE_MIN < 4096
+# error "UNIV_PAGE_SIZE_MIN < 4096"
 #endif
 /** The offset of the MySQL replication info in the trx system header;
 this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */

=== modified file 'storage/innobase/include/univ.i'
--- a/storage/innobase/include/univ.i	revid:calvin.sun@stripped
+++ b/storage/innobase/include/univ.i	revid:kevin.lewis@stripped
@@ -336,10 +336,10 @@ including new BLOB treatment */
 #define UNIV_FORMAT_MAX		UNIV_FORMAT_B
 
 /** The 2-logarithm of UNIV_PAGE_SIZE: */
-#define UNIV_PAGE_SIZE_SHIFT	14
+#define UNIV_PAGE_SIZE_SHIFT		srv_page_size_shift
 
 /** The universal page size of the database */
-#define UNIV_PAGE_SIZE		(1 << UNIV_PAGE_SIZE_SHIFT)
+#define UNIV_PAGE_SIZE			srv_page_size
 
 /** log2 of smallest compressed page size (1<<10 == 1024 bytes) */
 #define UNIV_ZIP_SIZE_SHIFT_MIN	10
@@ -350,7 +350,22 @@ and 2 bits for flags. This limits the un
 Even though a 16k uncompressed page can theoretically be compressed
 into a larger compressed page, it is not a useful feature so we will
 limit both with this same constant. */
-#define UNIV_ZIP_SIZE_SHIFT_MAX	14
+#define UNIV_ZIP_SIZE_SHIFT_MAX		14
+
+/* Define the Min, Max, Default page sizes. */
+/** Minimum Page Size Shift (power of 2) */
+#define UNIV_PAGE_SIZE_SHIFT_MIN	12
+/** Maximum Page Size Shift (power of 2) */
+#define UNIV_PAGE_SIZE_SHIFT_MAX	14
+/** Default Page Size Shift (power of 2) */
+#define UNIV_PAGE_SIZE_SHIFT_DEF	14
+
+/** Minimum page size InnoDB currently supports. */
+#define UNIV_PAGE_SIZE_MIN	(1 << UNIV_PAGE_SIZE_SHIFT_MIN)
+/** Maximum page size InnoDB currently supports. */
+#define UNIV_PAGE_SIZE_MAX	(1 << UNIV_PAGE_SIZE_SHIFT_MAX)
+/** Default page size for InnoDB tablespaces. */
+#define UNIV_PAGE_SIZE_DEF	(1 << UNIV_PAGE_SIZE_SHIFT_DEF)
 
 /** Smallest compressed page size */
 #define UNIV_ZIP_SIZE_MIN	(1 << UNIV_ZIP_SIZE_SHIFT_MIN)
@@ -479,7 +494,7 @@ number indicate that a field contains a 
 stored part of the field in the tablespace. The length field then
 contains the sum of the following flag and the locally stored len. */
 
-#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)
+#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_MAX)
 
 /* Some macros to improve branch prediction and reduce cache misses */
 #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
@@ -582,4 +597,7 @@ typedef void* os_thread_ret_t;
 	UNIV_MEM_ALLOC(addr, size);			\
 } while (0)
 
+extern ulint	srv_page_size_shift;
+extern ulint	srv_page_size;
+
 #endif

=== modified file 'storage/innobase/row/row0merge.c'
--- a/storage/innobase/row/row0merge.c	revid:calvin.sun@stripped
+++ b/storage/innobase/row/row0merge.c	revid:kevin.lewis@stripped
@@ -97,7 +97,7 @@ This buffer is used for writing or readi
 row_merge_block_t.  Thus, it must be able to hold one merge record,
 whose maximum size is the same as the minimum size of
 row_merge_block_t. */
-typedef byte	mrec_buf_t[UNIV_PAGE_SIZE];
+typedef byte*	mrec_buf_t;	/* buffer size is UNIV_PAGE_SIZE */
 
 /** @brief Merge record in row_merge_block_t.
 
@@ -430,7 +430,7 @@ row_merge_dup_report(
 	row_merge_dup_t*	dup,	/*!< in/out: for reporting duplicates */
 	const dfield_t*		entry)	/*!< in: duplicate index entry */
 {
-	mrec_buf_t* 		buf;
+	mrec_buf_t 		buf;
 	const dtuple_t*		tuple;
 	dtuple_t		tuple_store;
 	const rec_t*		rec;
@@ -449,14 +449,14 @@ row_merge_dup_report(
 	/* Convert the tuple to a record and then to MySQL format. */
 	heap = mem_heap_create((1 + REC_OFFS_HEADER_SIZE + n_fields)
 			       * sizeof *offsets
-			       + sizeof *buf);
+			       + UNIV_PAGE_SIZE);
 
-	buf = mem_heap_alloc(heap, sizeof *buf);
+	buf = mem_heap_alloc(heap, UNIV_PAGE_SIZE);
 
 	tuple = dtuple_from_fields(&tuple_store, entry, n_fields);
 	n_ext = dict_index_is_clust(index) ? dtuple_get_n_ext(tuple) : 0;
 
-	rec = rec_convert_dtuple_to_rec(*buf, index, tuple, n_ext);
+	rec = rec_convert_dtuple_to_rec((byte*) buf, index, tuple, n_ext);
 	offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap);
 
 	innobase_rec_to_mysql(dup->table, rec, index, offsets);
@@ -640,16 +640,18 @@ mem_heap_t*
 row_merge_heap_create(
 /*==================*/
 	const dict_index_t*	index,		/*!< in: record descriptor */
-	mrec_buf_t**		buf,		/*!< out: 3 buffers */
+	mrec_buf_t		bufs[3],	/*!< out: 3 buffers */
 	ulint**			offsets1,	/*!< out: offsets */
 	ulint**			offsets2)	/*!< out: offsets */
 {
 	ulint		i	= 1 + REC_OFFS_HEADER_SIZE
 		+ dict_index_get_n_fields(index);
 	mem_heap_t*	heap	= mem_heap_create(2 * i * sizeof **offsets1
-						  + 3 * sizeof **buf);
+						  + 3 * UNIV_PAGE_SIZE);
 
-	*buf = mem_heap_alloc(heap, 3 * sizeof **buf);
+	bufs[0] = mem_heap_alloc(heap, UNIV_PAGE_SIZE);
+	bufs[1] = mem_heap_alloc(heap, UNIV_PAGE_SIZE);
+	bufs[2] = mem_heap_alloc(heap, UNIV_PAGE_SIZE);
 	*offsets1 = mem_heap_alloc(heap, i * sizeof **offsets1);
 	*offsets2 = mem_heap_alloc(heap, i * sizeof **offsets2);
 
@@ -769,7 +771,7 @@ const byte*
 row_merge_read_rec(
 /*===============*/
 	row_merge_block_t*	block,	/*!< in/out: file buffer */
-	mrec_buf_t*		buf,	/*!< in/out: secondary buffer */
+	mrec_buf_t		buf,	/*!< in/out: secondary buffer */
 	const byte*		b,	/*!< in: pointer to record */
 	const dict_index_t*	index,	/*!< in: index of the record */
 	int			fd,	/*!< in: file descriptor */
@@ -841,7 +843,7 @@ err_exit:
 
 		avail_size = block[1] - b;
 
-		memcpy(*buf, b, avail_size);
+		memcpy(buf, b, avail_size);
 
 		if (!row_merge_read(fd, ++(*foffs), block)) {
 
@@ -852,10 +854,10 @@ err_exit:
 		b = block[0];
 
 		/* Copy the record. */
-		memcpy(*buf + avail_size, b, extra_size - avail_size);
+		memcpy(buf + avail_size, b, extra_size - avail_size);
 		b += extra_size - avail_size;
 
-		*mrec = *buf + extra_size;
+		*mrec = buf + extra_size;
 
 		rec_init_offsets_comp_ordinary(*mrec, 0, index, offsets);
 
@@ -864,11 +866,11 @@ err_exit:
 		/* These overflows should be impossible given that
 		records are much smaller than either buffer, and
 		the record starts near the beginning of each buffer. */
-		ut_a(extra_size + data_size < sizeof *buf);
+		ut_a(extra_size + data_size < UNIV_PAGE_SIZE);
 		ut_a(b + data_size < block[1]);
 
 		/* Copy the data bytes. */
-		memcpy(*buf + extra_size, b, data_size);
+		memcpy(buf + extra_size, b, data_size);
 		b += data_size;
 
 		goto func_exit;
@@ -879,7 +881,7 @@ err_exit:
 	rec_init_offsets_comp_ordinary(*mrec, 0, index, offsets);
 
 	data_size = rec_offs_data_size(offsets);
-	ut_ad(extra_size + data_size < sizeof *buf);
+	ut_ad(extra_size + data_size < UNIV_PAGE_SIZE);
 
 	b += extra_size + data_size;
 
@@ -893,8 +895,8 @@ err_exit:
 
 	b -= extra_size + data_size;
 	avail_size = block[1] - b;
-	memcpy(*buf, b, avail_size);
-	*mrec = *buf + extra_size;
+	memcpy(buf, b, avail_size);
+	*mrec = buf + extra_size;
 #ifdef UNIV_DEBUG
 	/* We cannot invoke rec_offs_make_valid() here, because there
 	are no REC_N_NEW_EXTRA_BYTES between extra_size and data_size.
@@ -913,7 +915,7 @@ err_exit:
 	b = block[0];
 
 	/* Copy the rest of the record. */
-	memcpy(*buf + avail_size, b, extra_size + data_size - avail_size);
+	memcpy(buf + avail_size, b, extra_size + data_size - avail_size);
 	b += extra_size + data_size - avail_size;
 
 func_exit:
@@ -981,7 +983,7 @@ byte*
 row_merge_write_rec(
 /*================*/
 	row_merge_block_t*	block,	/*!< in/out: file buffer */
-	mrec_buf_t*		buf,	/*!< in/out: secondary buffer */
+	mrec_buf_t		buf,	/*!< in/out: secondary buffer */
 	byte*			b,	/*!< in: pointer to end of block */
 	int			fd,	/*!< in: file descriptor */
 	ulint*			foffs,	/*!< in/out: file offset */
@@ -998,8 +1000,10 @@ row_merge_write_rec(
 	ut_ad(b < block[1]);
 	ut_ad(mrec);
 	ut_ad(foffs);
-	ut_ad(mrec < block[0] || mrec > block[1]);
-	ut_ad(mrec < buf[0] || mrec > buf[1]);
+	ut_ad(mrec < block[0]		/* mrec is not in block[0] */
+	      || mrec > block[1]);
+	ut_ad(mrec < buf		/* mrec is not in buf */
+	      || mrec > buf + UNIV_PAGE_SIZE);
 
 	/* Normalize extra_size.  Value 0 signals "end of list". */
 	extra_size = rec_offs_extra_size(offsets) + 1;
@@ -1012,14 +1016,14 @@ row_merge_write_rec(
 		Copy it to the temporary buffer first. */
 		avail_size = block[1] - b;
 
-		row_merge_write_rec_low(buf[0],
+		row_merge_write_rec_low(buf,
 					extra_size, size, fd, *foffs,
 					mrec, offsets);
 
 		/* Copy the head of the temporary buffer, write
 		the completed block, and copy the tail of the
 		record to the head of the new block. */
-		memcpy(b, buf[0], avail_size);
+		memcpy(b, buf, avail_size);
 
 		if (!row_merge_write(fd, (*foffs)++, block)) {
 			return(NULL);
@@ -1029,7 +1033,7 @@ row_merge_write_rec(
 
 		/* Copy the rest. */
 		b = block[0];
-		memcpy(b, buf[0] + avail_size, size - avail_size);
+		memcpy(b, buf + avail_size, size - avail_size);
 		b += size - avail_size;
 	} else {
 		row_merge_write_rec_low(b, extra_size, size, fd, *foffs,
@@ -1208,7 +1212,7 @@ row_merge_read_clustered_index(
 		}
 	}
 
-	row_heap = mem_heap_create(sizeof(mrec_buf_t));
+	row_heap = mem_heap_create(UNIV_PAGE_SIZE);
 
 	/* Scan the clustered index. */
 	for (;;) {
@@ -1378,13 +1382,13 @@ func_exit:
 @param AT_END	statement to execute at end of input */
 #define ROW_MERGE_WRITE_GET_NEXT(N, AT_END)				\
 	do {								\
-		b2 = row_merge_write_rec(&block[2], &buf[2], b2,	\
+		b2 = row_merge_write_rec(&block[2], bufs[2], b2,	\
 					 of->fd, &of->offset,		\
 					 mrec##N, offsets##N);		\
 		if (UNIV_UNLIKELY(!b2 || ++of->n_rec > file->n_rec)) {	\
 			goto corrupt;					\
 		}							\
-		b##N = row_merge_read_rec(&block[N], &buf[N],		\
+		b##N = row_merge_read_rec(&block[N], bufs[N],		\
 					  b##N, index,			\
 					  file->fd, foffs##N,		\
 					  &mrec##N, offsets##N);	\
@@ -1418,7 +1422,7 @@ row_merge_blocks(
 {
 	mem_heap_t*	heap;	/*!< memory heap for offsets0, offsets1 */
 
-	mrec_buf_t*	buf;	/*!< buffer for handling
+	mrec_buf_t	bufs[3];	/*!< buffer for handling
 				split mrec in block[] */
 	const byte*	b0;	/*!< pointer to block[0] */
 	const byte*	b1;	/*!< pointer to block[1] */
@@ -1439,7 +1443,7 @@ row_merge_blocks(
 	}
 #endif /* UNIV_DEBUG */
 
-	heap = row_merge_heap_create(index, &buf, &offsets0, &offsets1);
+	heap = row_merge_heap_create(index, bufs, &offsets0, &offsets1);
 
 	/* Write a record and read the next record.  Split the output
 	file in two halves, which can be merged on the following pass. */
@@ -1455,9 +1459,9 @@ corrupt:
 	b1 = block[1];
 	b2 = block[2];
 
-	b0 = row_merge_read_rec(&block[0], &buf[0], b0, index, file->fd,
+	b0 = row_merge_read_rec(&block[0], bufs[0], b0, index, file->fd,
 				foffs0, &mrec0, offsets0);
-	b1 = row_merge_read_rec(&block[1], &buf[1], b1, index, file->fd,
+	b1 = row_merge_read_rec(&block[1], bufs[1], b1, index, file->fd,
 				foffs1, &mrec1, offsets1);
 	if (UNIV_UNLIKELY(!b0 && mrec0)
 	    || UNIV_UNLIKELY(!b1 && mrec1)) {
@@ -1527,7 +1531,7 @@ row_merge_blocks_copy(
 {
 	mem_heap_t*	heap;	/*!< memory heap for offsets0, offsets1 */
 
-	mrec_buf_t*	buf;	/*!< buffer for handling
+	mrec_buf_t	bufs[3];	/*!< buffer for handling
 				split mrec in block[] */
 	const byte*	b0;	/*!< pointer to block[0] */
 	byte*		b2;	/*!< pointer to block[2] */
@@ -1545,7 +1549,7 @@ row_merge_blocks_copy(
 	}
 #endif /* UNIV_DEBUG */
 
-	heap = row_merge_heap_create(index, &buf, &offsets0, &offsets1);
+	heap = row_merge_heap_create(index, bufs, &offsets0, &offsets1);
 
 	/* Write a record and read the next record.  Split the output
 	file in two halves, which can be merged on the following pass. */
@@ -1559,7 +1563,7 @@ corrupt:
 	b0 = block[0];
 	b2 = block[2];
 
-	b0 = row_merge_read_rec(&block[0], &buf[0], b0, index, file->fd,
+	b0 = row_merge_read_rec(&block[0], bufs[0], b0, index, file->fd,
 				foffs0, &mrec0, offsets0);
 	if (UNIV_UNLIKELY(!b0 && mrec0)) {
 
@@ -1818,7 +1822,7 @@ row_merge_insert_index_tuples(
 
 	trx->op_info = "inserting index entries";
 
-	graph_heap = mem_heap_create(500 + sizeof(mrec_buf_t));
+	graph_heap = mem_heap_create(500 + UNIV_PAGE_SIZE);
 	node = ins_node_create(INS_DIRECT, table, graph_heap);
 
 	thr = pars_complete_graph_for_exec(node, trx, graph_heap);
@@ -1840,7 +1844,7 @@ row_merge_insert_index_tuples(
 	if (!row_merge_read(fd, foffs, block)) {
 		error = DB_CORRUPTION;
 	} else {
-		mrec_buf_t*	buf = mem_heap_alloc(graph_heap, sizeof *buf);
+		mrec_buf_t	buf = mem_heap_alloc(graph_heap, UNIV_PAGE_SIZE);
 
 		for (;;) {
 			const mrec_t*	mrec;

=== modified file 'storage/innobase/srv/srv0srv.c'
--- a/storage/innobase/srv/srv0srv.c	revid:calvin.sun@stripped
+++ b/storage/innobase/srv/srv0srv.c	revid:kevin.lewis@stripped
@@ -167,6 +167,8 @@ UNIV_INTERN ib_uint64_t	srv_log_file_siz
 /* size in database pages */
 UNIV_INTERN ulint	srv_log_buffer_size	= ULINT_MAX;
 UNIV_INTERN ulong	srv_flush_log_at_trx_commit = 1;
+UNIV_INTERN ulint	srv_page_size		= UNIV_PAGE_SIZE_DEF;
+UNIV_INTERN ulint	srv_page_size_shift	= UNIV_PAGE_SIZE_SHIFT_DEF;
 
 /* Try to flush dirty pages so as to avoid IO bursts at
 the checkpoints. */

=== modified file 'storage/innobase/srv/srv0start.c'
--- a/storage/innobase/srv/srv0start.c	revid:calvin.sun@stripped
+++ b/storage/innobase/srv/srv0start.c	revid:kevin.lewis@stripped
@@ -1410,7 +1410,9 @@ innobase_start_or_create_for_mysql(void)
 
 	for (i = 0; i < srv_n_data_files; i++) {
 #ifndef __WIN__
-		if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
+		if (sizeof(off_t) < 5
+		    && srv_data_file_sizes[i]
+		    >= (1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
 			ut_print_timestamp(stderr);
 			fprintf(stderr,
 				" InnoDB: Error: file size must be < 4 GB"

=== modified file 'storage/innobase/trx/trx0sys.c'
--- a/storage/innobase/trx/trx0sys.c	revid:calvin.sun@stripped
+++ b/storage/innobase/trx/trx0sys.c	revid:kevin.lewis@stripped
@@ -213,6 +213,26 @@ trx_doublewrite_init(
 }
 
 /****************************************************************//**
+Calls buf_page_get() on the TRX_SYS_PAGE and returns a pointer to the
+doublewrite buffer within it.
+@return	pointer to the doublewrite buffer within the filespace header
+page. */
+UNIV_INLINE
+byte*
+trx_sys_doublewrite_get(
+/*====================*/
+	mtr_t*	mtr)	/*!< in: MTR to hold the page latch */
+{
+	buf_block_t*	block;
+
+	block = buf_page_get(TRX_SYS_SPACE, 0, TRX_SYS_PAGE_NO,
+			     RW_X_LATCH, mtr);
+	buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
+
+	return(buf_block_get_frame(block) + TRX_SYS_DOUBLEWRITE);
+}
+
+/****************************************************************//**
 Marks the trx sys header when we have successfully upgraded to the >= 4.1.x
 multiple tablespace format. */
 UNIV_INTERN
@@ -220,7 +240,6 @@ void
 trx_sys_mark_upgraded_to_multiple_tablespaces(void)
 /*===============================================*/
 {
-	buf_block_t*	block;
 	byte*		doublewrite;
 	mtr_t		mtr;
 
@@ -230,11 +249,7 @@ trx_sys_mark_upgraded_to_multiple_tables
 
 	mtr_start(&mtr);
 
-	block = buf_page_get(TRX_SYS_SPACE, 0, TRX_SYS_PAGE_NO,
-			     RW_X_LATCH, &mtr);
-	buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
-
-	doublewrite = buf_block_get_frame(block) + TRX_SYS_DOUBLEWRITE;
+	doublewrite = trx_sys_doublewrite_get(&mtr);
 
 	mlog_write_ulint(doublewrite + TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED,
 			 TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N,
@@ -255,7 +270,6 @@ void
 trx_sys_create_doublewrite_buf(void)
 /*================================*/
 {
-	buf_block_t*	block;
 	buf_block_t*	block2;
 #ifdef UNIV_SYNC_DEBUG
 	buf_block_t*	new_block;
@@ -277,11 +291,7 @@ start_again:
 	mtr_start(&mtr);
 	trx_doublewrite_buf_is_being_created = TRUE;
 
-	block = buf_page_get(TRX_SYS_SPACE, 0, TRX_SYS_PAGE_NO,
-			     RW_X_LATCH, &mtr);
-	buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
-
-	doublewrite = buf_block_get_frame(block) + TRX_SYS_DOUBLEWRITE;
+	doublewrite = trx_sys_doublewrite_get(&mtr);
 
 	if (mach_read_from_4(doublewrite + TRX_SYS_DOUBLEWRITE_MAGIC)
 	    == TRX_SYS_DOUBLEWRITE_MAGIC_N) {
@@ -332,8 +342,7 @@ start_again:
 			exit(1);
 		}
 
-		fseg_header = buf_block_get_frame(block)
-			+ TRX_SYS_DOUBLEWRITE + TRX_SYS_DOUBLEWRITE_FSEG;
+		fseg_header = doublewrite + TRX_SYS_DOUBLEWRITE_FSEG;
 		prev_page_no = 0;
 
 		for (i = 0; i < 2 * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE
@@ -379,6 +388,7 @@ start_again:
 						 + TRX_SYS_DOUBLEWRITE_REPEAT
 						 + TRX_SYS_DOUBLEWRITE_BLOCK1,
 						 page_no, MLOG_4BYTES, &mtr);
+
 			} else if (i == FSP_EXTENT_SIZE / 2
 				   + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) {
 				ut_a(page_no == 2 * FSP_EXTENT_SIZE);
@@ -389,10 +399,24 @@ start_again:
 						 + TRX_SYS_DOUBLEWRITE_REPEAT
 						 + TRX_SYS_DOUBLEWRITE_BLOCK2,
 						 page_no, MLOG_4BYTES, &mtr);
+
 			} else if (i > FSP_EXTENT_SIZE / 2) {
 				ut_a(page_no == prev_page_no + 1);
 			}
 
+			if (((i + 1) & 255) == 0) {
+				/* rw_locks can only be recursively x-locked
+				2048 times.  For 4k page size this loop will
+				lock the fsp header too many times. Since
+				this code is not done while any other threads
+				are active, restart the MTR occasionally. */
+				mtr_commit(&mtr);
+				mtr_start(&mtr);
+				doublewrite = trx_sys_doublewrite_get(&mtr);
+				fseg_header = doublewrite
+					      + TRX_SYS_DOUBLEWRITE_FSEG;
+			}
+
 			prev_page_no = page_no;
 		}
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (kevin.lewis:3255 to 3256) WL#5756kevin.lewis19 Jul