Commit 3ad01d00 authored by Sergei Golubchik's avatar Sergei Golubchik

error messages: name the storage engine explicitly,

instead of "used storage engine" and similar changes.
parent ffbd15eb
......@@ -415,7 +415,7 @@ alter table t1 drop key a;
drop table t1;
CREATE TABLE T12207(a int) ENGINE=MYISAM;
ALTER TABLE T12207 DISCARD TABLESPACE;
ERROR HY000: Table storage engine for 'T12207' doesn't have this option
ERROR HY000: Storage engine MyISAM of the table `test`.`T12207` doesn't have this option
DROP TABLE T12207;
create table t1 (a text) character set koi8r;
insert into t1 values (_koi8r'');
......
......@@ -2,5 +2,5 @@ drop table if exists t1,t2;
CREATE TABLE t1 (a INT, INDEX(a)) engine=innodb;
ALTER TABLE t1 RENAME TO t2, DISABLE KEYS;
Warnings:
Note 1031 Table storage engine for 't1' doesn't have this option
Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option
DROP TABLE t2;
......@@ -31,9 +31,9 @@ Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
create table t1 (b char(0) not null, index(b));
ERROR 42000: The used storage engine can't index column 'b'
ERROR 42000: The storage engine MyISAM can't index column `b`
create table t1 (a int not null,b text) engine=heap;
ERROR 42000: The used table type doesn't support BLOB/TEXT columns
ERROR 42000: Storage engine MEMORY doesn't support BLOB/TEXT columns
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
......
......@@ -18,10 +18,10 @@ SET DEBUG_SYNC='now SIGNAL table_altered';
# Complete optimization
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize error Got error -1 "Internal error < 0 (Not system error)" from storage engine
test.t1 optimize error Got error -1 "Internal error < 0 (Not system error)" from storage engine MEMORY
test.t1 optimize status Operation failed
Warnings:
Error 1030 Got error -1 "Internal error < 0 (Not system error)" from storage engine
Error 1030 Got error -1 "Internal error < 0 (Not system error)" from storage engine MEMORY
DROP TABLE t1;
SET DEBUG_SYNC='RESET';
#
......
......@@ -251,7 +251,7 @@ alter table mysql.slow_log engine=NonExistentEngine;
Warnings:
Warning 1286 Unknown storage engine 'NonExistentEngine'
alter table mysql.slow_log engine=memory;
ERROR HY000: This storage engine cannot be used for log tables
ERROR HY000: Storage engine MEMORY cannot be used for log tables
set storage_engine= @save_storage_engine;
drop table mysql.slow_log;
drop table mysql.general_log;
......
......@@ -2257,7 +2257,7 @@ CREATE TABLE m1(a int)engine=merge union=(t1,t2,t3,t4,t5,t6,t7);
SELECT 1 FROM m1;
1
HANDLER m1 OPEN;
ERROR HY000: Table storage engine for 'm1' doesn't have this option
ERROR HY000: Storage engine MRG_MyISAM of the table `test`.`m1` doesn't have this option
DROP TABLE m1,t1,t2,t3,t4,t5,t6,t7;
SELECT 1 FROM m1;
ERROR 42S02: Table 'test.m1' doesn't exist
......@@ -3552,7 +3552,7 @@ CREATE TABLE t2 (c1 int);
CREATE TABLE t3 (c1 int) ENGINE = MERGE UNION (t1,t2);
START TRANSACTION;
HANDLER t3 OPEN;
ERROR HY000: Table storage engine for 't3' doesn't have this option
ERROR HY000: Storage engine MRG_MyISAM of the table `test`.`t3` doesn't have this option
DROP TABLE t1, t2, t3;
# Connection default.
# Disconnecting con1, all mdl_tickets must have been released.
......
......@@ -618,7 +618,7 @@ t1 1 a 1 a A 1000 NULL NULL YES BTREE
alter table t1 engine=heap;
alter table t1 disable keys;
Warnings:
Note 1031 Table storage engine for 't1' doesn't have this option
Note 1031 Storage engine MEMORY of the table `test`.`t1` doesn't have this option
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 a 1 a NULL 500 NULL NULL YES HASH
......
......@@ -67,7 +67,7 @@ LOCK TABLE t1 WRITE;
# ALTER fails because COMPRESSED/KEY_BLOCK_SIZE
# are incompatible with innodb_file_per_table = OFF;
ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
ERROR HY000: Got error 140 "Wrong create options" from storage engine
ERROR HY000: Got error 140 "Wrong create options" from storage engine InnoDB
t1#P#p0.ibd
t1.frm
t1.par
......
......@@ -94,4 +94,4 @@ PARTITION p1 DATA DIRECTORY = '/not/existent/p1Data',
PARTITION p2 DATA DIRECTORY = '/not/existent/p2Data',
PARTITION p3 DATA DIRECTORY = '/not/existent/p3Data'
);
Got one of the listed errors
ERROR HY000: Can't create/write to file '/not/existent/p0Data/example#P#p0.MYD' (Errcode: 2 "No such file or directory")
......@@ -6257,7 +6257,7 @@ auto fld1 companynr fld3 fld4 fld5 fld6
3 011402 37 Romans scholastics jarring
4 011403 37 intercepted audiology tinily
DELETE FROM t2;
ERROR HY000: Table storage engine for 't2' doesn't have this option
ERROR HY000: Storage engine ARCHIVE of the table `test`.`t2` doesn't have this option
SELECT * FROM t2;
auto fld1 companynr fld3 fld4 fld5 fld6
1 000001 00 Omaha teethe neat
......@@ -8689,7 +8689,7 @@ auto fld1 companynr fld3 fld4 fld5 fld6
3 011402 37 Romans scholastics jarring
4 011403 37 intercepted audiology tinily
TRUNCATE TABLE t2;
ERROR HY000: Table storage engine for 't2' doesn't have this option
ERROR HY000: Storage engine ARCHIVE of the table `test`.`t2` doesn't have this option
SELECT * FROM t2;
auto fld1 companynr fld3 fld4 fld5 fld6
1 000001 00 Omaha teethe neat
......@@ -12754,7 +12754,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=ARCHIVE;
INSERT INTO t1 VALUES (1);
TRUNCATE TABLE t1;
ERROR HY000: Table storage engine for 't1' doesn't have this option
ERROR HY000: Storage engine ARCHIVE of the table `test`.`t1` doesn't have this option
DROP TABLE t1;
#
# BUG#46565 - repair of partition fail for archive engine
......
......@@ -49,7 +49,7 @@ t2.frm
#
flush tables;
truncate table t1;
ERROR HY000: Table storage engine for 't1' doesn't have this option
ERROR HY000: Storage engine ARCHIVE of the table `test`.`t1` doesn't have this option
t1.ARZ
t1.frm
t2.ARZ
......
......@@ -30,6 +30,7 @@ partition by list (a)
(partition p0 values in (1), partition p1 values in (2));
insert into t1 values (1), (2);
create index inx on t1 (a);
ERROR HY000: Can't create table `db99`.`#sql-temporary` (errno: 1 "Operation not permitted")
alter table t1 add partition (partition p2 values in (3));
alter table t1 drop partition p2;
use test;
......
......@@ -47,7 +47,8 @@ engine=archive
partition by list (a)
(partition p0 values in (1), partition p1 values in (2));
insert into t1 values (1), (2);
--error 0, ER_CANT_CREATE_TABLE
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
create index inx on t1 (a);
alter table t1 add partition (partition p2 values in (3));
alter table t1 drop partition p2;
......
......@@ -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")
Error 1005 Can't create table `test`.`t1` (errno: 138 "Unsupported extension used for table")
create table t1 (c1 tinyblob not null) engine=csv;
insert into t1 values("This");
update t1 set c1="That" where c1="This";
......
......@@ -20,13 +20,13 @@ id name
1 foo
2 bar
DELETE FROM federated.t1 WHERE id = 1;
ERROR HY000: Got error 10000 'Error on remote system: 1031: Table storage engine for 'archive_table' doesn't have this option' from FEDERATED
ERROR HY000: Got error 10000 'Error on remote system: 1031: Storage engine ARCHIVE of the table `federated`.`archive_table` doesn'' from FEDERATED
SELECT * FROM federated.t1;
id name
1 foo
2 bar
UPDATE federated.t1 SET name='baz' WHERE id = 1;
ERROR HY000: Got error 10000 'Error on remote system: 1031: Table storage engine for 'archive_table' doesn't have this option' from FEDERATED
ERROR HY000: Got error 10000 'Error on remote system: 1031: Storage engine ARCHIVE of the table `federated`.`archive_table` doesn'' from FEDERATED
SELECT * FROM federated.t1;
id name
1 foo
......
......@@ -1508,7 +1508,7 @@ id name
1 Monty
2 David
ALTER TABLE federated.alter_me MODIFY COLUMN id int(16) NOT NULL;
ERROR HY000: Table storage engine for 'alter_me' doesn't have this option
ERROR HY000: Storage engine FEDERATED of the table `federated`.`alter_me` doesn't have this option
SELECT * FROM federated.alter_me;
id name
1 Monty
......
......@@ -586,7 +586,7 @@ Note 1051 Unknown table 't1'
create table t1 (a int not null) ENGINE=csv;
--> client 2
handler t1 open;
ERROR HY000: Table storage engine for 't1' doesn't have this option
ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option
--> client 1
drop table t1;
create table t1 (a int);
......
......@@ -586,7 +586,7 @@ Note 1051 Unknown table 't1'
create table t1 (a int not null) ENGINE=csv;
--> client 2
handler t1 open;
ERROR HY000: Table storage engine for 't1' doesn't have this option
ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option
--> client 1
drop table t1;
create table t1 (a int);
......@@ -1728,9 +1728,9 @@ a b
4 40
5 50
HANDLER t1 READ a FIRST;
ERROR HY000: Table storage engine for 't1' doesn't have this option
ERROR HY000: Storage engine MEMORY of the table `test`.`t1` doesn't have this option
HANDLER t1 READ a LAST;
ERROR HY000: Table storage engine for 't1' doesn't have this option
ERROR HY000: Storage engine MEMORY of the table `test`.`t1` doesn't have this option
HANDLER t1 READ b FIRST LIMIT 2;
a b
1 10
......@@ -1781,11 +1781,11 @@ create table t1 (f1 integer not null, key (f1)) engine=Memory;
insert into t1 values (1);
HANDLER t1 OPEN;
HANDLER t1 READ f1 NEXT;
ERROR HY000: Table storage engine for 't1' doesn't have this option
ERROR HY000: Storage engine MEMORY of the table `test`.`t1` doesn't have this option
HANDLER t1 READ f1 NEXT;
ERROR HY000: Table storage engine for 't1' doesn't have this option
ERROR HY000: Storage engine MEMORY of the table `test`.`t1` doesn't have this option
HANDLER t1 READ f1 NEXT;
ERROR HY000: Table storage engine for 't1' doesn't have this option
ERROR HY000: Storage engine MEMORY of the table `test`.`t1` doesn't have this option
HANDLER t1 CLOSE;
DROP TABLE t1;
End of 5.3 tests
......@@ -587,7 +587,7 @@ Note 1051 Unknown table 't1'
create table t1 (a int not null) ENGINE=csv;
--> client 2
handler t1 open;
ERROR HY000: Table storage engine for 't1' doesn't have this option
ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option
--> client 1
drop table t1;
create table t1 (a int);
......
......@@ -269,7 +269,7 @@ handler t1 open;
lock table t1 write;
alter table t1 engine=csv;
handler t1 read a next;
ERROR HY000: Table storage engine for 't1' doesn't have this option
ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option
handler t1 close;
unlock tables;
drop table t1;
......
......@@ -586,7 +586,7 @@ Note 1051 Unknown table 't1'
create table t1 (a int not null) ENGINE=csv;
--> client 2
handler t1 open;
ERROR HY000: Table storage engine for 't1' doesn't have this option
ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option
--> client 1
drop table t1;
create table t1 (a int);
......
......@@ -545,7 +545,7 @@ t4 CREATE TABLE `t4` (
CONSTRAINT `dc` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
alter table t3 add constraint dc foreign key (a) references t1(a);
ERROR HY000: Can't create table '#sql-temporary' (errno: 121 "Duplicate key on write or update")
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 121 "Duplicate key on write or update")
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
......@@ -1146,17 +1146,17 @@ PRIMARY KEY (c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1);
ERROR HY000: Can't create table '#sql-temporary' (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
ERROR HY000: Can't create table '#sql-temporary' (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
ERROR HY000: Can't create table '#sql-temporary' (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
ALTER TABLE t1 MODIFY COLUMN c2 BIGINT(12) NOT NULL;
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
ERROR HY000: Can't create table '#sql-temporary' (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
SHOW CREATE TABLE t1;
......
This diff is collapsed.
......@@ -1600,7 +1600,7 @@ concat(a, b)
drop table t1;
CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
ERROR HY000: The used table type doesn't support FULLTEXT indexes
ERROR HY000: The storage engine InnoDB doesn't support FULLTEXT indexes
DROP TABLE t1;
CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (1),(2),(3);
......@@ -2525,13 +2525,13 @@ drop table t1;
set foreign_key_checks=0;
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
ERROR HY000: Can't create table 'test.t1' (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
set foreign_key_checks=1;
drop table t2;
set foreign_key_checks=0;
create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
ERROR HY000: Can't create table 'test.t2' (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
set foreign_key_checks=1;
drop table t1;
set foreign_key_checks=0;
......
......@@ -15,7 +15,7 @@ select count(*) from information_schema.processlist;
count(*)
33
CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB;
ERROR HY000: Can't create table 'mysqltest.testtable' (errno: 177 "Too many active concurrent transactions")
ERROR HY000: Can't create table `mysqltest`.`testtable` (errno: 177 "Too many active concurrent transactions")
select count(*) from information_schema.processlist;
count(*)
33
......
......@@ -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)")
Error 1005 Can't create table `test`.`bug46000` (errno: -1 "Internal error < 0 (Not system error)")
create table bug46000(id int) engine=innodb;
create index GEN_CLUST_INDEX on bug46000(id);
ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX'
......
......@@ -598,4 +598,4 @@ create table t1 (a int not null, b linestring not null, unique key b (b(12)));
create unique index a on t1(a);
drop table t1;
create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
ERROR HY000: The used table type doesn't support SPATIAL indexes
ERROR HY000: The storage engine InnoDB doesn't support SPATIAL indexes
......@@ -96,10 +96,10 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
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'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
......@@ -141,25 +141,25 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
--echo # 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 );
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=8;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
SHOW WARNINGS;
......@@ -173,26 +173,26 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 KEY_BLOCK_SIZE=2;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
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'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 KEY_BLOCK_SIZE=4;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
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'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 KEY_BLOCK_SIZE=8;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
SHOW WARNINGS;
......@@ -213,20 +213,20 @@ CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=2;
SHOW CREATE TABLE t1;
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW CREATE TABLE t1;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ROW_FORMAT=COMPACT;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
SHOW WARNINGS;
......@@ -276,29 +276,29 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT;
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 KEY_BLOCK_SIZE=8;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
SET GLOBAL innodb_file_format=Barracuda;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
SET GLOBAL innodb_file_format=Antelope;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ADD COLUMN f1 INT;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
......@@ -337,20 +337,20 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT;
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 KEY_BLOCK_SIZE=1;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
ALTER TABLE t1 ROW_FORMAT=COMPACT;
SHOW WARNINGS;
......@@ -365,10 +365,10 @@ SET GLOBAL innodb_file_per_table=ON;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
SET GLOBAL innodb_file_per_table=OFF;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ADD COLUMN f1 INT;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
SHOW WARNINGS;
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
......
......@@ -250,7 +250,7 @@ insert into t2 values (1,1,1,1,1);
commit;
alter table t4 add constraint dc foreign key (a) references t1(a);
show create table t4;
--replace_regex /'test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
# a foreign key 'test/dc' already exists
--error ER_CANT_CREATE_TABLE
alter table t3 add constraint dc foreign key (a) references t1(a);
......@@ -620,20 +620,20 @@ CREATE TABLE t2(
PRIMARY KEY (c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1);
--replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
--replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
ALTER TABLE t1 MODIFY COLUMN c2 BIGINT(12) NOT NULL;
--replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
......
......@@ -653,7 +653,7 @@ t1 1 a 1 a A 1000 NULL NULL YES BTREE
alter table t1 engine=heap;
alter table t1 disable keys;
Warnings:
Note 1031 Table storage engine for 't1' doesn't have this option
Note 1031 Storage engine MEMORY of the table `test`.`t1` doesn't have this option
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 a 1 a NULL 500 NULL NULL YES HASH
......
......@@ -359,7 +359,7 @@ NULL NULL
0 NULL
0 0
alter table t1 add column d char(0) not null, add key (d);
ERROR 42000: The used storage engine can't index column 'd'
ERROR 42000: The storage engine Aria can't index column `d`
drop table t1;
CREATE TABLE t1 (a bit(3));
insert into t1 values (NULL),(0),(1),(2),(3),(4),(5),(6),(7);
......
......@@ -43,7 +43,7 @@ SET autocommit=0;
SET innodb_fake_changes=1;
BEGIN;
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
ERROR HY000: Can't create table 'test.t2' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t2` (errno: 131 "Command not supported by database")
DROP TABLE t1;
ERROR 42S02: Unknown table 't1'
TRUNCATE TABLE t1;
......
......@@ -6,9 +6,9 @@ AND EVENT_NAME IN
WHERE NAME LIKE "wait/synch/%")
LIMIT 1;
create table test.t1(a int) engine=performance_schema;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.events_waits_current;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table performance_schema.t1(a int);
ERROR 42000: CREATE command denied to user 'root'@'localhost' for table 't1'
drop table if exists test.ghost;
......
......@@ -152,13 +152,13 @@ before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.setup_instruments;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.events_waits_current;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.file_instances;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
insert into performance_schema.setup_instruments
set name="foo";
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'setup_instruments'
......@@ -250,13 +250,13 @@ before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.setup_instruments;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.events_waits_current;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.file_instances;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
insert into performance_schema.setup_instruments
set name="foo";
ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'setup_instruments'
......@@ -348,13 +348,13 @@ before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.setup_instruments;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.events_waits_current;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.file_instances;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
insert into performance_schema.setup_instruments
set name="foo";
ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'setup_instruments'
......@@ -446,13 +446,13 @@ before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.setup_instruments;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.events_waits_current;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
create table test.t1 like performance_schema.file_instances;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
insert into performance_schema.setup_instruments
set name="foo";
ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'setup_instruments'
......
......@@ -199,7 +199,7 @@ DROP TABLE example;
--rmdir $MYSQLTEST_VARDIR/p2Index
--rmdir $MYSQLTEST_VARDIR/p3Index
--error ER_CANT_CREATE_TABLE,1
--error 1
CREATE TABLE `example` (
`ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
`DESCRIPTION` varchar(30) NOT NULL,
......
......@@ -132,7 +132,7 @@ int writefrm(const char *path, const char *db, const char *table,
if (my_errno == ENOENT)
my_error(ER_BAD_DB_ERROR, MYF(0), db);
else
my_error(ER_CANT_CREATE_TABLE, MYF(0), table, my_errno);
my_error(ER_CANT_CREATE_TABLE, MYF(0), db, table, my_errno);
}
else
{
......
......@@ -1138,7 +1138,8 @@ int ha_prepare(THD *thd)
else
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
ER_GET_ERRNO, ER(ER_GET_ERRNO),
HA_ERR_WRONG_COMMAND,
ha_resolve_storage_engine_name(ht));
}
}
......@@ -2004,7 +2005,7 @@ int ha_savepoint(THD *thd, SAVEPOINT *sv)
}
if ((err= ht->savepoint_set(ht, thd, (uchar *)(sv+1)+ht->savepoint_offset)))
{ // cannot happen
my_error(ER_GET_ERRNO, MYF(0), err);
my_error(ER_GET_ERRNO, MYF(0), err, hton_name(ht)->str);
error=1;
}
status_var_increment(thd->status_var.ha_savepoint_count);
......@@ -2035,7 +2036,7 @@ int ha_release_savepoint(THD *thd, SAVEPOINT *sv)
if ((err= ht->savepoint_release(ht, thd,
(uchar *)(sv+1) + ht->savepoint_offset)))
{ // cannot happen
my_error(ER_GET_ERRNO, MYF(0), err);
my_error(ER_GET_ERRNO, MYF(0), err, hton_name(ht)->str);
error=1;
}
}
......@@ -2971,7 +2972,7 @@ void handler::print_error(int error, myf errflag)
DBUG_ENTER("handler::print_error");
DBUG_PRINT("enter",("error: %d",error));
int textno=ER_GET_ERRNO;
int textno= -1; // impossible value
switch (error) {
case EACCES:
textno=ER_OPEN_AS_READONLY;
......@@ -3100,7 +3101,9 @@ void handler::print_error(int error, myf errflag)
textno=ER_OUT_OF_RESOURCES;
break;
case HA_ERR_WRONG_COMMAND:
textno=ER_ILLEGAL_HA;
my_error(ER_ILLEGAL_HA, MYF(0), table_type(), table_share->db.str,
table_share->table_name.str);
DBUG_VOID_RETURN;
break;
case HA_ERR_OLD_FILE:
textno=ER_OLD_KEYFILE;
......@@ -3219,10 +3222,11 @@ void handler::print_error(int error, myf errflag)
}
}
else
my_error(ER_GET_ERRNO,errflag,error);
my_error(ER_GET_ERRNO, errflag, error, table_type());
DBUG_VOID_RETURN;
}
}
DBUG_ASSERT(textno > 0);
if (fatal_error)
{
/* Ensure this becomes a true error */
......@@ -4181,10 +4185,8 @@ int ha_create_table(THD *thd, const char *path,
(void) closefrm(&table, 0);
if (error)
{
strxmov(name_buff, db, ".", table_name, NullS);
my_error(ER_CANT_CREATE_TABLE, MYF(ME_BELL+ME_WAITTANG), name_buff, error);
}
my_error(ER_CANT_CREATE_TABLE, MYF(0), db, table_name, error);
err:
free_table_share(&share);
DBUG_RETURN(error != 0);
......@@ -4326,7 +4328,7 @@ static my_bool discover_handlerton(THD *thd, plugin_ref plugin,
if (error)
{
DBUG_ASSERT(share->error); // MUST be always set for get_cached_table_share to work
my_error(ER_GET_ERRNO, MYF(0), error);
my_error(ER_GET_ERRNO, MYF(0), error, plugin_name(plugin)->str);
share->db_plugin= 0;
}
else
......@@ -5116,7 +5118,7 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat)
if (!result && !thd->is_error())
my_eof(thd);
else if (!thd->is_error())
my_error(ER_GET_ERRNO, MYF(0), errno);
my_error(ER_GET_ERRNO, MYF(0), errno, hton_name(db_type)->str);
return result;
}
......
......@@ -6143,7 +6143,7 @@ bool Item_func_match::fix_fields(THD *thd, Item **ref)
table=((Item_field *)item)->field->table;
if (!(table->file->ha_table_flags() & HA_CAN_FULLTEXT))
{
my_error(ER_TABLE_CANT_HANDLE_FT, MYF(0));
my_error(ER_TABLE_CANT_HANDLE_FT, MYF(0), table->file->table_type());
return 1;
}
table->fulltext_searched=1;
......
......@@ -93,7 +93,7 @@ extern HASH open_cache;
static int lock_external(THD *thd, TABLE **table,uint count);
static int unlock_external(THD *thd, TABLE **table,uint count);
static void print_lock_error(int error, const char *);
static void print_lock_error(int error, TABLE *);
/* Map the return value of thr_lock to an error from errmsg.txt */
static int thr_lock_errno_to_mysql[]=
......@@ -358,7 +358,7 @@ static int lock_external(THD *thd, TABLE **tables, uint count)
if ((error=(*tables)->file->ha_external_lock(thd,lock_type)))
{
print_lock_error(error, (*tables)->file->table_type());
print_lock_error(error, *tables);
while (--i)
{
tables--;
......@@ -673,7 +673,7 @@ static int unlock_external(THD *thd, TABLE **table,uint count)
if ((error=(*table)->file->ha_external_lock(thd, F_UNLCK)))
{
error_code=error;
print_lock_error(error_code, (*table)->file->table_type());
print_lock_error(error_code, *table);
}
}
table++;
......@@ -895,7 +895,7 @@ bool lock_object_name(THD *thd, MDL_key::enum_mdl_namespace mdl_type,
}
static void print_lock_error(int error, const char *table)
static void print_lock_error(int error, TABLE *table)
{
int textno;
DBUG_ENTER("print_lock_error");
......@@ -911,17 +911,15 @@ static void print_lock_error(int error, const char *table)
textno=ER_LOCK_DEADLOCK;
break;
case HA_ERR_WRONG_COMMAND:
textno=ER_ILLEGAL_HA;
break;
my_error(ER_ILLEGAL_HA, MYF(0), table->file->table_type(),
table->s->db.str, table->s->table_name.str);
DBUG_VOID_RETURN;
default:
textno=ER_CANT_LOCK;
break;
}
if ( textno == ER_ILLEGAL_HA )
my_error(textno, MYF(ME_BELL+ME_OLDWIN+ME_WAITTANG), table);
else
my_error(textno, MYF(ME_BELL+ME_OLDWIN+ME_WAITTANG), error);
my_error(textno, MYF(0), error);
DBUG_VOID_RETURN;
}
......
This diff is collapsed.
......@@ -304,7 +304,8 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, SQL_HANDLER *reopen)
/* There can be only one table in '*tables'. */
if (! (table->file->ha_table_flags() & HA_CAN_SQL_HANDLER))
{
my_error(ER_ILLEGAL_HA, MYF(0), tables->alias);
my_error(ER_ILLEGAL_HA, MYF(0), table->file->table_type(),
table->s->db.str, table->s->table_name.str);
goto err;
}
......@@ -901,7 +902,8 @@ retry:
break;
}
default:
my_message(ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA), MYF(0));
my_error(ER_ILLEGAL_HA, MYF(0), table->file->table_type(),
table->s->db.str, table->s->table_name.str);
goto err;
}
......
......@@ -1764,7 +1764,7 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv)
mysql_mutex_unlock(&LOCK_plugin);
}
if (error > 0)
sql_print_error(ER(ER_GET_ERRNO), my_errno);
sql_print_error(ER(ER_GET_ERRNO), my_errno, table->file->table_type());
end_read_record(&read_record_info);
table->m_needs_reopen= TRUE; // Force close to free memory
close_mysql_tables(new_thd);
......
......@@ -963,7 +963,7 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry)
plugin_ref plugin= ha_resolve_by_name(thd, &handler_name);
if (!plugin)
{
my_error(ER_ILLEGAL_HA, MYF(0), ddl_log_entry->handler_name);
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), ddl_log_entry->handler_name);
goto error;
}
hton= plugin_data(plugin, handlerton*);
......@@ -3255,15 +3255,13 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
if (auto_increment &&
(file->ha_table_flags() & HA_NO_AUTO_INCREMENT))
{
my_message(ER_TABLE_CANT_HANDLE_AUTO_INCREMENT,
ER(ER_TABLE_CANT_HANDLE_AUTO_INCREMENT), MYF(0));
my_error(ER_TABLE_CANT_HANDLE_AUTO_INCREMENT, MYF(0), file->table_type());
DBUG_RETURN(TRUE);
}
if (blob_columns && (file->ha_table_flags() & HA_NO_BLOBS))
{
my_message(ER_TABLE_CANT_HANDLE_BLOB, ER(ER_TABLE_CANT_HANDLE_BLOB),
MYF(0));
my_error(ER_TABLE_CANT_HANDLE_BLOB, MYF(0), file->table_type());
DBUG_RETURN(TRUE);
}
......@@ -3439,8 +3437,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
{
if (!(file->ha_table_flags() & HA_CAN_FULLTEXT))
{
my_message(ER_TABLE_CANT_HANDLE_FT, ER(ER_TABLE_CANT_HANDLE_FT),
MYF(0));
my_error(ER_TABLE_CANT_HANDLE_FT, MYF(0), file->table_type());
DBUG_RETURN(TRUE);
}
}
......@@ -3457,8 +3454,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
{
if (!(file->ha_table_flags() & HA_CAN_RTREEKEYS))
{
my_message(ER_TABLE_CANT_HANDLE_SPKEYS, ER(ER_TABLE_CANT_HANDLE_SPKEYS),
MYF(0));
my_error(ER_TABLE_CANT_HANDLE_SPKEYS, MYF(0), file->table_type());
DBUG_RETURN(TRUE);
}
if (key_info->key_parts != 1)
......@@ -3573,7 +3569,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
{
if (!(file->ha_table_flags() & HA_CAN_INDEX_BLOBS))
{
my_error(ER_BLOB_USED_AS_KEY, MYF(0), column->field_name.str);
my_error(ER_BLOB_USED_AS_KEY, MYF(0), column->field_name.str,
file->table_type());
DBUG_RETURN(TRUE);
}
if (f_is_geom(sql_field->pack_flag) && sql_field->geom_type ==
......@@ -3695,7 +3692,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
}
else if (length == 0 && (sql_field->flags & NOT_NULL_FLAG))
{
my_error(ER_WRONG_KEY_COLUMN, MYF(0), column->field_name.str);
my_error(ER_WRONG_KEY_COLUMN, MYF(0), file->table_type(),
column->field_name.str);
DBUG_RETURN(TRUE);
}
if (length > file->max_key_part_length() && key->type != Key::FULLTEXT)
......@@ -4394,7 +4392,7 @@ bool mysql_create_table_no_lock(THD *thd,
if (!hton->discover_table_structure)
{
my_error(ER_ILLEGAL_HA, MYF(0), table_name);
my_error(ER_ILLEGAL_HA, MYF(0), hton_name(hton)->str, db, table_name);
goto err;
}
......@@ -4414,7 +4412,7 @@ bool mysql_create_table_no_lock(THD *thd,
if (ha_err)
{
my_error(ER_GET_ERRNO, MYF(0), ha_err);
my_error(ER_GET_ERRNO, MYF(0), ha_err, hton_name(hton)->str);
goto err;
}
}
......@@ -5417,6 +5415,7 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled,
switch (keys_onoff) {
case ENABLE:
DEBUG_SYNC(table->in_use, "alter_table_enable_indexes");
error= table->file->ha_enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
break;
case LEAVE_AS_IS:
......@@ -5431,7 +5430,8 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled,
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
table->s->table_name.str);
table->file->table_type(),
table->s->db.str, table->s->table_name.str);
error= 0;
} else if (error)
table->file->print_error(error, MYF(0));
......@@ -6051,7 +6051,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
(!create_info->db_type || /* unknown engine */
!(create_info->db_type->flags & HTON_SUPPORT_LOG_TABLES)))
{
my_error(ER_UNSUPORTED_LOG_ENGINE, MYF(0));
my_error(ER_UNSUPORTED_LOG_ENGINE, MYF(0),
hton_name(create_info->db_type)->str);
DBUG_RETURN(TRUE);
}
......@@ -6267,11 +6268,19 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
DBUG_PRINT("info", ("old type: %s new type: %s",
ha_resolve_storage_engine_name(old_db_type),
ha_resolve_storage_engine_name(new_db_type)));
if (ha_check_storage_engine_flag(old_db_type, HTON_ALTER_NOT_SUPPORTED) ||
ha_check_storage_engine_flag(new_db_type, HTON_ALTER_NOT_SUPPORTED))
if (ha_check_storage_engine_flag(old_db_type, HTON_ALTER_NOT_SUPPORTED))
{
DBUG_PRINT("info", ("doesn't support alter"));
my_error(ER_ILLEGAL_HA, MYF(0), hton_name(old_db_type)->str,
db, table_name);
goto err;
}
if (ha_check_storage_engine_flag(new_db_type, HTON_ALTER_NOT_SUPPORTED))
{
DBUG_PRINT("info", ("doesn't support alter"));
my_error(ER_ILLEGAL_HA, MYF(0), table_name);
my_error(ER_ILLEGAL_HA, MYF(0), hton_name(new_db_type)->str,
new_db, new_name);
goto err;
}
......@@ -6279,35 +6288,13 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
if (!(alter_info->flags & ~(ALTER_RENAME | ALTER_KEYS_ONOFF)) &&
!table->s->tmp_table) // no need to touch frm
{
switch (alter_info->keys_onoff) {
case LEAVE_AS_IS:
break;
case ENABLE:
if (wait_while_table_is_used(thd, table, extra_func,
TDC_RT_REMOVE_NOT_OWN_AND_MARK_NOT_USABLE))
goto err;
DEBUG_SYNC(thd,"alter_table_enable_indexes");
error= table->file->ha_enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
table->s->allow_access_to_protected_table();
break;
case DISABLE:
if (alter_info->keys_onoff != LEAVE_AS_IS)
{
if (wait_while_table_is_used(thd, table, extra_func,
TDC_RT_REMOVE_NOT_OWN_AND_MARK_NOT_USABLE))
goto err;
error=table->file->ha_disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
error= alter_table_manage_keys(table, 0, alter_info->keys_onoff);
table->s->allow_access_to_protected_table();
break;
default:
DBUG_ASSERT(FALSE);
error= 0;
break;
}
if (error == HA_ERR_WRONG_COMMAND)
{
error= 0;
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
table->alias.c_ptr());
}
if (!error && (new_name != table_name || new_db != db))
......@@ -6365,7 +6352,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
error= 0;
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
table->alias.c_ptr());
table->file->table_type(),
table->s->db.str, table->s->table_name.str);
}
if (!error)
......
......@@ -311,6 +311,7 @@ innobase_check_index_keys(
}
my_error(ER_WRONG_KEY_COLUMN, MYF(0),
field->table->file->table_type(),
field->field_name);
return(ER_WRONG_KEY_COLUMN);
}
......@@ -325,6 +326,7 @@ innobase_check_index_keys(
}
my_error(ER_WRONG_KEY_COLUMN, MYF(0),
field->table->file->table_type(),
key_part1.field->field_name);
return(ER_WRONG_KEY_COLUMN);
}
......
......@@ -1196,7 +1196,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
}
else if (length == 0)
{
my_error(ER_WRONG_KEY_COLUMN, MYF(0), column->field_name);
my_error(ER_WRONG_KEY_COLUMN, MYF(0), file->table_type(),
column->field_name);
DBUG_RETURN(TRUE);
}
if (length > file->max_key_part_length() && key->type != Key::FULLTEXT)
......
......@@ -39,7 +39,7 @@ ERROR 42S02: Table 'test.seq_' doesn't exist
show create table se;
ERROR 42S02: Table 'test.se' doesn't exist
show create table seq_1_to_15_step_0;
ERROR HY000: Got error 140 "Wrong create options" from storage engine
ERROR HY000: Got error 140 "Wrong create options" from storage engine SEQUENCE
select * from seq_1_to_15_step_2;
seq
1
......
......@@ -3424,7 +3424,8 @@ int ha_sphinx::create ( const char * name, TABLE * table, HA_CREATE_INFO * )
// report and bail
if ( sError[0] )
{
my_error ( ER_CANT_CREATE_TABLE, MYF(0), sError, -1 );
my_error ( ER_CANT_CREATE_TABLE, MYF(0),
table->s->db.str, table->s->table_name, sError );
SPH_RET(-1);
}
......
......@@ -4,7 +4,7 @@ test_sql_discovery_statement
test_sql_discovery_write_frm ON
set sql_quote_show_create=0;
create table t1 (a int) engine=test_sql_discovery;
ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database")
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database")
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
set @@test_sql_discovery_statement='t1:foobar bwa-ha-ha';
......@@ -16,7 +16,7 @@ show warnings;
Level Code Message
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'foobar bwa-ha-ha' at line 1
Error 1146 Table 'test.t1' doesn't exist
Error 1030 Got error 130 "Incorrect file format" from storage engine
Error 1030 Got error 130 "Incorrect file format" from storage engine TEST_SQL_DISCOVERY
set @@test_sql_discovery_statement='t1:select 1';
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
......@@ -24,7 +24,7 @@ show warnings;
Level Code Message
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'select 1'
Error 1146 Table 'test.t1' doesn't exist
Error 1030 Got error 130 "Incorrect file format" from storage engine
Error 1030 Got error 130 "Incorrect file format" from storage engine TEST_SQL_DISCOVERY
set @@test_sql_discovery_statement='t1:create table t1 (a int primary key) partition by hash(id) partitions 2';
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
......@@ -32,7 +32,7 @@ show warnings;
Level Code Message
Error 1290 The MariaDB server is running with the --skip-partition option so it cannot execute this statement
Error 1146 Table 'test.t1' doesn't exist
Error 1030 Got error 130 "Incorrect file format" from storage engine
Error 1030 Got error 130 "Incorrect file format" from storage engine TEST_SQL_DISCOVERY
set @@test_sql_discovery_statement='t1:create table t1 (a int) union=(t3,t4)';
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
......@@ -40,7 +40,7 @@ show warnings;
Level Code Message
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int) union=(t3,t4)'
Error 1146 Table 'test.t1' doesn't exist
Error 1030 Got error 130 "Incorrect file format" from storage engine
Error 1030 Got error 130 "Incorrect file format" from storage engine TEST_SQL_DISCOVERY
set @@test_sql_discovery_statement='t1:create table t1 like t2';
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
......@@ -48,7 +48,7 @@ show warnings;
Level Code Message
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 like t2'
Error 1146 Table 'test.t1' doesn't exist
Error 1030 Got error 130 "Incorrect file format" from storage engine
Error 1030 Got error 130 "Incorrect file format" from storage engine TEST_SQL_DISCOVERY
set @@test_sql_discovery_statement='t1:create table t1 select * from t2';
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
......@@ -56,7 +56,7 @@ show warnings;
Level Code Message
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 select * from t2'
Error 1146 Table 'test.t1' doesn't exist
Error 1030 Got error 130 "Incorrect file format" from storage engine
Error 1030 Got error 130 "Incorrect file format" from storage engine TEST_SQL_DISCOVERY
set @@test_sql_discovery_statement='t1:create table t1 (a int) index directory="/tmp"';
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
......@@ -64,7 +64,7 @@ show warnings;
Level Code Message
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int) index directory="/tmp"'
Error 1146 Table 'test.t1' doesn't exist
Error 1030 Got error 130 "Incorrect file format" from storage engine
Error 1030 Got error 130 "Incorrect file format" from storage engine TEST_SQL_DISCOVERY
set @@test_sql_discovery_statement='t1:create table t1 (a int) data directory="/tmp"';
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
......@@ -72,7 +72,7 @@ show warnings;
Level Code Message
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int) data directory="/tmp"'
Error 1146 Table 'test.t1' doesn't exist
Error 1030 Got error 130 "Incorrect file format" from storage engine
Error 1030 Got error 130 "Incorrect file format" from storage engine TEST_SQL_DISCOVERY
set @@test_sql_discovery_statement='t1:create table t1 (a int) engine=myisam';
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
......@@ -80,7 +80,7 @@ show warnings;
Level Code Message
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table t1 (a int) engine=myisam'
Error 1146 Table 'test.t1' doesn't exist
Error 1030 Got error 130 "Incorrect file format" from storage engine
Error 1030 Got error 130 "Incorrect file format" from storage engine TEST_SQL_DISCOVERY
set @@test_sql_discovery_statement='t1:create temporary table t1 (a int)';
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
......@@ -88,7 +88,7 @@ show warnings;
Level Code Message
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create temporary table t1 (a int)'
Error 1146 Table 'test.t1' doesn't exist
Error 1030 Got error 130 "Incorrect file format" from storage engine
Error 1030 Got error 130 "Incorrect file format" from storage engine TEST_SQL_DISCOVERY
set @@test_sql_discovery_statement='t1:create table if not exists t1 (a int)';
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
......@@ -96,7 +96,7 @@ show warnings;
Level Code Message
Error 1939 Engine TEST_SQL_DISCOVERY failed to discover table `test`.`t1` with 'create table if not exists t1 (a int)'
Error 1146 Table 'test.t1' doesn't exist
Error 1030 Got error 130 "Incorrect file format" from storage engine
Error 1030 Got error 130 "Incorrect file format" from storage engine TEST_SQL_DISCOVERY
set @@test_sql_discovery_statement='t1:create table t1 (a int)';
select * from t1;
a
......
......@@ -312,6 +312,7 @@ innobase_check_index_keys(
}
my_error(ER_WRONG_KEY_COLUMN, MYF(0),
field->table->file->table_type(),
field->field_name);
return(ER_WRONG_KEY_COLUMN);
}
......@@ -326,6 +327,7 @@ innobase_check_index_keys(
}
my_error(ER_WRONG_KEY_COLUMN, MYF(0),
field->table->file->table_type(),
key_part1.field->field_name);
return(ER_WRONG_KEY_COLUMN);
}
......
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