File: grant4_myisam.result

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (57 lines) | stat: -rw-r--r-- 2,834 bytes parent folder | download
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
#
# Additional coverage for refactoring which is made as part
# of fix for bug #27480 "Extend CREATE TEMPORARY TABLES privilege
# to allow temp table operations".
# 
# Check that for statements like CHECK/REPAIR and OPTIMIZE TABLE
# privileges for all tables involved are checked before processing
# any tables. Doing otherwise, i.e. checking privileges for table
# right before processing it might result in lost results for tables
# which were processed by the time when table for which privileges
# are insufficient are discovered.
#
call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:");
call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*mysqltest_u1 Checking table");
drop database if exists mysqltest_db1;
create database mysqltest_db1;
# Create tables which we are going to CHECK/REPAIR.
create table mysqltest_db1.t1 (a int, key(a)) engine=myisam;
create table mysqltest_db1.t2 (b int);
insert into mysqltest_db1.t1 values (1), (2);
insert into mysqltest_db1.t2 values (1);
# Create user which will try to do this.
create user mysqltest_u1@localhost;
grant insert, select on mysqltest_db1.t1 to mysqltest_u1@localhost;
# Corrupt t1 by replacing t1.MYI with a corrupt + unclosed one created
# by doing: 'create table t1 (a int key(a))'
#           head -c1024 t1.MYI > corrupt_t1.MYI 
flush table mysqltest_db1.t1;
# Switching to connection 'con1'.
check table mysqltest_db1.t1;
Table	Op	Msg_type	Msg_text
mysqltest_db1.t1	check	warning	1 client is using or hasn't closed the table properly
mysqltest_db1.t1	check	error	Size of indexfile is: 1024        Should be: 2048
mysqltest_db1.t1	check	warning	Size of datafile is: 14       Should be: 7
mysqltest_db1.t1	check	error	Corrupt
# The below statement should fail before repairing t1.
# Otherwise info about such repair will be missing from its result-set.
repair table mysqltest_db1.t1, mysqltest_db1.t2;
ERROR 42000: SELECT, INSERT command denied to user 'mysqltest_u1'@'localhost' for table 't2'
# The same is true for CHECK TABLE statement.
check table mysqltest_db1.t1, mysqltest_db1.t2;
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't2'
check table mysqltest_db1.t1;
Table	Op	Msg_type	Msg_text
mysqltest_db1.t1	check	warning	Table is marked as crashed
mysqltest_db1.t1	check	warning	1 client is using or hasn't closed the table properly
mysqltest_db1.t1	check	error	Size of indexfile is: 1024        Should be: 2048
mysqltest_db1.t1	check	warning	Size of datafile is: 14       Should be: 7
mysqltest_db1.t1	check	error	Corrupt
repair table mysqltest_db1.t1;
Table	Op	Msg_type	Msg_text
mysqltest_db1.t1	repair	warning	Number of rows changed from 1 to 2
mysqltest_db1.t1	repair	status	OK
# Clean-up.
# Switching to connection 'default'.
drop database mysqltest_db1;
drop user mysqltest_u1@localhost;