Commit 27fbb637 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-5544 Custom errors (generated from storage engine) not getting returned by mariadb

parent a9c22c18
......@@ -5379,7 +5379,7 @@ ERROR 42000: The storage engine for the table doesn't support nullable columns
SHOW WARNINGS;
Level Code Message
Error 1178 The storage engine for the table doesn't support nullable columns
Error 1005 Can't create table `test`.`t1` (errno: 138 "Unsupported extension used for table")
Warning 1112 Table 't1' uses an extension that doesn't exist in this MariaDB version
create table t1 (c1 tinyblob not null) engine=csv;
insert into t1 values("This");
update t1 set c1="That" where c1="This";
......
......@@ -6,7 +6,7 @@ SHOW WARNINGS;
Level Code Message
Error 1 server name: 'non_existing' doesn't exist!
Error 1 Can't create/write to file 'non_existing' (Errcode: 14 "Bad address")
Error 1005 Can't create table `test`.`t1` (errno: 1 "Operation not permitted")
Warning 1030 Got error 1 "Operation not permitted" from storage engine FEDERATED
create table t1 (a int);
create table fed (a int) engine=Federated CONNECTION='mysql://root@127.0.0.1:MASTER_PORT/test/t1';
drop table t1;
......
......@@ -15,6 +15,7 @@ SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: invalid ROW_FORMAT specifier.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
......@@ -63,18 +64,21 @@ SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
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: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
SHOW WARNINGS;
Level Code Message
......@@ -255,6 +259,7 @@ SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
# Test 7) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and
# and a valid non-zero KEY_BLOCK_SIZE are rejected with Antelope
# and that they can be set to default values during strict mode.
......@@ -268,18 +273,21 @@ SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT;
SHOW WARNINGS;
Level Code Message
......@@ -352,18 +360,21 @@ SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT;
SHOW WARNINGS;
Level Code Message
......
......@@ -185,6 +185,7 @@ show warnings;
Level Code Message
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
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;
......@@ -212,6 +213,7 @@ show warnings;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t3 (id int primary key) engine = innodb
key_block_size = 4 row_format = compact;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t3` (errno: 140 "Wrong create options")
......@@ -219,6 +221,7 @@ show warnings;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t3` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t4 (id int primary key) engine = innodb
key_block_size = 4 row_format = dynamic;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t4` (errno: 140 "Wrong create options")
......@@ -226,6 +229,7 @@ show warnings;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t4` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t5 (id int primary key) engine = innodb
key_block_size = 4 row_format = default;
SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
......@@ -241,6 +245,7 @@ Level Code Message
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = compact;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
......@@ -249,6 +254,7 @@ Level Code Message
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = dynamic;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
......@@ -257,6 +263,7 @@ Level Code Message
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
table_schema table_name row_format data_length index_length
set global innodb_file_per_table = off;
......@@ -266,30 +273,35 @@ show warnings;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t2 (id int primary key) engine = innodb key_block_size = 2;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
show warnings;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t3 (id int primary key) engine = innodb key_block_size = 4;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t3` (errno: 140 "Wrong create options")
show warnings;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t3` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t6 (id int primary key) engine = innodb row_format = compressed;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t6` (errno: 140 "Wrong create options")
show warnings;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t6` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t7 (id int primary key) engine = innodb row_format = dynamic;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t7` (errno: 140 "Wrong create options")
show warnings;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t7` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
......@@ -305,30 +317,35 @@ show warnings;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t2 (id int primary key) engine = innodb key_block_size = 2;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
show warnings;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t3 (id int primary key) engine = innodb key_block_size = 4;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t3` (errno: 140 "Wrong create options")
show warnings;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t3` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t6 (id int primary key) engine = innodb row_format = compressed;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t6` (errno: 140 "Wrong create options")
show warnings;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t6` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t7 (id int primary key) engine = innodb row_format = dynamic;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t7` (errno: 140 "Wrong create options")
show warnings;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Error 1005 Can't create table `mysqltest_innodb_zip`.`t7` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
......
......@@ -6,7 +6,7 @@ show warnings;
Level Code Message
Warning 1280 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
Error 1280 Incorrect index name 'GEN_CLUST_INDEX'
Error 1005 Can't create table `test`.`bug46000` (errno: -1 "Internal error < 0 (Not system error)")
Warning 1030 Got error -1 "Internal error < 0 (Not system error)" from storage engine InnoDB
create table bug46000(id int) engine=innodb;
create index GEN_CLUST_INDEX on bug46000(id);
ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX'
......
......@@ -22,6 +22,7 @@ Level Code Message
Warning 1478 InnoDB: DATA DIRECTORY requires innodb_file_per_table.
Warning 1478 InnoDB: INDEX DIRECTORY is not supported
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
Error 6 Error on delete of 'MYSQLD_DATADIR/test/t1.par' (Errcode: 2 "No such file or directory")
#
# InnoDB is different from MyISAM in that it uses a text file
......
......@@ -4597,14 +4597,16 @@ int ha_create_table(THD *thd, const char *path,
error= table.file->ha_create(name, &table, create_info);
(void) closefrm(&table, 0);
if (error)
{
my_error(ER_CANT_CREATE_TABLE, MYF(0), db, table_name, error);
if (!thd->is_error())
my_error(ER_CANT_CREATE_TABLE, MYF(0), db, table_name, error);
table.file->print_error(error, MYF(ME_JUST_WARNING));
PSI_CALL_drop_table_share(temp_table, share.db.str, share.db.length,
share.table_name.str, share.table_name.length);
}
(void) closefrm(&table, 0);
err:
free_table_share(&share);
......
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