1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
#
# Start of 10.1 tests
#
#
# MDEV-19675 Wrong charset is chosen when opening a pre-4.1 table
#
# Test with a saved table from 3.23
SELECT @@character_set_database;
@@character_set_database
latin1
SET @@character_set_database="latin1";
SELECT COUNT(*) FROM t1;
ERROR HY000: Got error 190 "Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You may have retry " from storage engine MyISAM
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check Error Got error 190 "Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You may have retry " from storage engine MyISAM
test.t1 check error Corrupt
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair Error Got error 190 "Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You may have retry " from storage engine MyISAM
test.t1 repair error Corrupt
REPAIR TABLE t1 USE_FRM;
Table Op Msg_type Msg_text
test.t1 repair status OK
SELECT COUNT(*) FROM t1;
COUNT(*)
0
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`Host` char(60) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
`Db` char(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
`Select_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Insert_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Update_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Delete_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Create_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Drop_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Grant_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`References_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Index_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Alter_priv` enum('N','Y') NOT NULL DEFAULT 'N',
PRIMARY KEY (`Host`,`Db`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Host privileges; Merged with database privileges'
DROP TABLE t1;
SET @@character_set_database=DEFAULT;
# Now do the same, but doing 'ALTER DATABASE' to create the db.opt file,
# instead of setting variables directly.
# Emulate a pre-4.1 database without db.opt
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 */
USE db1;
SELECT @@character_set_database, 'taken from defaults' AS comment;
@@character_set_database comment
utf8mb3 taken from defaults
USE test;
ALTER DATABASE db1 DEFAULT CHARACTER SET latin1;
USE db1;
SELECT @@character_set_database, 'taken from db.opt' AS comment;
@@character_set_database comment
latin1 taken from db.opt
SELECT COUNT(*) FROM t1;
ERROR HY000: Got error 190 "Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You may have retry " from storage engine MyISAM
REPAIR TABLE t1 USE_FRM;
Table Op Msg_type Msg_text
db1.t1 repair status OK
SELECT COUNT(*) FROM t1;
COUNT(*)
0
CHECK TABLE t1;
Table Op Msg_type Msg_text
db1.t1 check status OK
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`Host` char(60) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
`Db` char(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
`Select_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Insert_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Update_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Delete_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Create_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Drop_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Grant_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`References_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Index_priv` enum('N','Y') NOT NULL DEFAULT 'N',
`Alter_priv` enum('N','Y') NOT NULL DEFAULT 'N',
PRIMARY KEY (`Host`,`Db`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Host privileges; Merged with database privileges'
DROP TABLE t1;
DROP DATABASE db1;
USE test;
#
# End of 10.1 tests
#
|