Commit 685f665b authored by marko's avatar marko

branches/zip: ha_innobase::add_index(): Translate DB_TOO_BIG_RECORD

via my_error().  Add a test case to innodb-index.test.
parent 8763d941
...@@ -720,10 +720,14 @@ error_handling: ...@@ -720,10 +720,14 @@ error_handling:
error = row_merge_drop_table(trx, innodb_table); error = row_merge_drop_table(trx, innodb_table);
goto convert_error; goto convert_error;
case DB_TOO_BIG_RECORD:
my_error(HA_ERR_TO_BIG_ROW, MYF(0));
goto error;
case DB_PRIMARY_KEY_IS_NULL: case DB_PRIMARY_KEY_IS_NULL:
my_error(ER_PRIMARY_CANT_HAVE_NULL, MYF(0)); my_error(ER_PRIMARY_CANT_HAVE_NULL, MYF(0));
/* fall through */ /* fall through */
case DB_DUPLICATE_KEY: case DB_DUPLICATE_KEY:
error:
prebuilt->trx->error_info = NULL; prebuilt->trx->error_info = NULL;
prebuilt->trx->error_key_num = trx->error_key_num; prebuilt->trx->error_key_num = trx->error_key_num;
/* fall through */ /* fall through */
......
...@@ -1031,6 +1031,8 @@ NULL NULL NULL null ...@@ -1031,6 +1031,8 @@ NULL NULL NULL null
alter table t1 add primary key (a), add key (b(20)); alter table t1 add primary key (a), add key (b(20));
ERROR 42000: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead ERROR 42000: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead
delete from t1 where d='null'; delete from t1 where d='null';
alter table t1 add primary key (a,b(255),c(255)), add key (b(255));
ERROR HY000: Too big row
alter table t1 add primary key (a), add key (b(20)); alter table t1 add primary key (a), add key (b(20));
select count(*) from t1 where a=44; select count(*) from t1 where a=44;
count(*) count(*)
......
...@@ -317,6 +317,8 @@ select a,length(b),length(c),d from t1; ...@@ -317,6 +317,8 @@ select a,length(b),length(c),d from t1;
--error ER_PRIMARY_CANT_HAVE_NULL --error ER_PRIMARY_CANT_HAVE_NULL
alter table t1 add primary key (a), add key (b(20)); alter table t1 add primary key (a), add key (b(20));
delete from t1 where d='null'; delete from t1 where d='null';
--error 139
alter table t1 add primary key (a,b(255),c(255)), add key (b(255));
alter table t1 add primary key (a), add key (b(20)); alter table t1 add primary key (a), add key (b(20));
select count(*) from t1 where a=44; select count(*) from t1 where a=44;
select a,b=repeat(d,100*a),c=repeat(d,20*a) from t1; select a,b=repeat(d,100*a),c=repeat(d,20*a) from t1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment