Merge branch '10.2' into 10.3

This commit is contained in:
Oleksandr Byelkin 2019-10-31 10:58:06 +01:00
commit 55b2281a5d
107 changed files with 2597 additions and 1355 deletions

View file

@ -225,11 +225,8 @@ typedef struct _db_code_state_ {
const char *file; /* Name of current user file */
struct _db_stack_frame_ *framep; /* Pointer to current frame */
struct settings *stack; /* debugging settings */
const char *jmpfunc; /* Remember current function for setjmp */
const char *jmpfile; /* Remember current file for setjmp */
int lineno; /* Current debugger output line number */
uint level; /* Current function nesting level */
int jmplevel; /* Remember nesting level at setjmp() */
/*
* The following variables are used to hold the state information

View file

@ -131,8 +131,6 @@ max_binlog_size = 100M
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
default_storage_engine = InnoDB
# you can't just change log file size, requires special procedure
#innodb_log_file_size = 50M
innodb_buffer_pool_size = 256M
innodb_log_buffer_size = 8M
innodb_file_per_table = 1

View file

@ -101,7 +101,7 @@ extern struct wsrep_service_st {
enum wsrep_conflict_state (*wsrep_thd_get_conflict_state_func)(MYSQL_THD);
my_bool (*wsrep_thd_is_BF_func)(MYSQL_THD , my_bool);
my_bool (*wsrep_thd_is_wsrep_func)(MYSQL_THD thd);
char * (*wsrep_thd_query_func)(THD *thd);
const char * (*wsrep_thd_query_func)(THD *thd);
enum wsrep_query_state (*wsrep_thd_query_state_func)(THD *thd);
const char * (*wsrep_thd_query_state_str_func)(THD *thd);
int (*wsrep_thd_retry_counter_func)(THD *thd);
@ -186,7 +186,7 @@ extern long wsrep_protocol_version;
bool wsrep_consistency_check(THD *thd);
bool wsrep_prepare_key(const unsigned char* cache_key, size_t cache_key_len, const unsigned char* row_id, size_t row_id_len, struct wsrep_buf* key, size_t* key_len);
char *wsrep_thd_query(THD *thd);
const char *wsrep_thd_query(THD *thd);
const char *wsrep_thd_conflict_state_str(THD *thd);
const char *wsrep_thd_exec_mode_str(THD *thd);
const char *wsrep_thd_query_state_str(THD *thd);

@ -1 +1 @@
Subproject commit c6403c4c847d94ed6b40d3fd128e729271867e75
Subproject commit 980f2dbea6586091333057bb2994b18747466942

View file

@ -202,7 +202,6 @@ main.function_defaults_innodb
main.gcc296
main.get_diagnostics
main.gis
main.gis2
main.gis-alter_table_online
main.gis-precise
main.gis-rt-precise

View file

@ -875,6 +875,49 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# Bug #29723340: MYSQL SERVER CRASH AFTER SQL QUERY WITH DATA ?AST
#
create table t1(a int);
insert ignore t1 values("1e-214748364");
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
insert ignore t1 values("1e-2147483648");
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
insert ignore t1 values("1e-21474836480");
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
insert ignore t1 values("1e+214748364");
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
insert ignore t1 values("1e+2147483647");
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
insert ignore t1 values("1e+21474836470");
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
set global max_allowed_packet= cast(2*1024*1024*1024+1024 as unsigned);
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '2147484672'
connect foo,localhost,root;
set @a=2147483647;
insert ignore t1 values (concat('1', repeat('0', @a+18), 'e-', @a-1, '0'));
Warnings:
Warning 1301 Result of repeat() was larger than max_allowed_packet (1073741824) - truncated
disconnect foo;
connection default;
set global max_allowed_packet=default;
select * from t1;
a
0
0
0
2147483647
2147483647
2147483647
NULL
drop table t1;
#
# End of 5.5 tests
#
#

View file

@ -627,6 +627,31 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
--echo # Bug #29723340: MYSQL SERVER CRASH AFTER SQL QUERY WITH DATA ?AST
--echo #
create table t1(a int);
insert ignore t1 values("1e-214748364");
insert ignore t1 values("1e-2147483648");
insert ignore t1 values("1e-21474836480");
insert ignore t1 values("1e+214748364");
insert ignore t1 values("1e+2147483647");
insert ignore t1 values("1e+21474836470");
# if max max_allowed_packet will ever be increased beyond 2GB, this could
# break again:
set global max_allowed_packet= cast(2*1024*1024*1024+1024 as unsigned);
connect foo,localhost,root;
set @a=2147483647;
insert ignore t1 values (concat('1', repeat('0', @a+18), 'e-', @a-1, '0'));
disconnect foo;
connection default;
set global max_allowed_packet=default;
select * from t1;
drop table t1;
--echo #
--echo # End of 5.5 tests
--echo #

View file

@ -244,3 +244,82 @@ connection user1;
disconnect user1;
connection default;
set global sql_mode=default;
create user foo@localhost;
grant select on test.* to foo@localhost;
create procedure rootonly() select 1;
create sql security definer view v1d as select current_user(),user from information_schema.processlist;
create sql security invoker view v1i as select current_user(),user from information_schema.processlist;
create sql security definer view v2d as select table_name from information_schema.tables where table_schema='mysql' and table_name like '%user%';
create sql security invoker view v2i as select table_name from information_schema.tables where table_schema='mysql' and table_name like '%user%';
create sql security definer view v3d as select schema_name from information_schema.schemata where schema_name like '%mysql%';
create sql security invoker view v3i as select schema_name from information_schema.schemata where schema_name like '%mysql%';
create sql security definer view v4d as select routine_name from information_schema.routines where routine_schema='test';
create sql security invoker view v4i as select routine_name from information_schema.routines where routine_schema='test';
create sql security definer view v5d as select view_definition > '' from information_schema.views where table_name='v1d';
create sql security invoker view v5i as select view_definition > '' from information_schema.views where table_name='v1d';
connect foo,localhost,foo;
select * from v1d;
current_user() user
root@localhost root
root@localhost root
select * from v1i;
current_user() user
foo@localhost foo
select * from v2d;
table_name
user
select * from v2i;
table_name
select * from v3d;
schema_name
mysql
select * from v3i;
schema_name
select * from v4d;
routine_name
rootonly
select * from v4i;
routine_name
select * from v5d;
view_definition > ''
1
select * from v5i;
view_definition > ''
0
connection default;
select * from v1d;
current_user() user
root@localhost foo
root@localhost root
select * from v1i;
current_user() user
root@localhost foo
root@localhost root
select * from v2d;
table_name
user
select * from v2i;
table_name
user
select * from v3d;
schema_name
mysql
select * from v3i;
schema_name
mysql
select * from v4d;
routine_name
rootonly
select * from v4i;
routine_name
rootonly
select * from v5d;
view_definition > ''
1
select * from v5i;
view_definition > ''
1
disconnect foo;
drop view v1d, v1i, v2d, v2i, v3d, v3i, v4d, v4i, v5d, v5i;
drop user foo@localhost;
drop procedure rootonly;

View file

@ -255,3 +255,47 @@ disconnect user1;
connection default;
set global sql_mode=default;
#
# MDEV-20549 SQL SECURITY DEFINER does not work for INFORMATION_SCHEMA tables
#
create user foo@localhost;
grant select on test.* to foo@localhost;
create procedure rootonly() select 1;
create sql security definer view v1d as select current_user(),user from information_schema.processlist;
create sql security invoker view v1i as select current_user(),user from information_schema.processlist;
create sql security definer view v2d as select table_name from information_schema.tables where table_schema='mysql' and table_name like '%user%';
create sql security invoker view v2i as select table_name from information_schema.tables where table_schema='mysql' and table_name like '%user%';
create sql security definer view v3d as select schema_name from information_schema.schemata where schema_name like '%mysql%';
create sql security invoker view v3i as select schema_name from information_schema.schemata where schema_name like '%mysql%';
create sql security definer view v4d as select routine_name from information_schema.routines where routine_schema='test';
create sql security invoker view v4i as select routine_name from information_schema.routines where routine_schema='test';
create sql security definer view v5d as select view_definition > '' from information_schema.views where table_name='v1d';
create sql security invoker view v5i as select view_definition > '' from information_schema.views where table_name='v1d';
connect foo,localhost,foo;
select * from v1d;
select * from v1i;
select * from v2d;
select * from v2i;
select * from v3d;
select * from v3i;
select * from v4d;
select * from v4i;
select * from v5d;
select * from v5i;
connection default;
select * from v1d;
select * from v1i;
select * from v2d;
select * from v2i;
select * from v3d;
select * from v3i;
select * from v4d;
select * from v4i;
select * from v5d;
select * from v5i;
disconnect foo;
drop view v1d, v1i, v2d, v2i, v3d, v3i, v4d, v4i, v5d, v5i;
drop user foo@localhost;
drop procedure rootonly;

View file

@ -23,8 +23,9 @@ select command, time < 5 from information_schema.processlist where id != connect
command time < 5
Sleep 1
disconnect con1;
set debug_sync='reset';
connection default;
set debug_sync='reset';
End of 5.5 tests
#
# 10.1 tests
#

View file

@ -49,10 +49,10 @@ SET DEBUG_SYNC = 'now WAIT_FOR query_done';
select command, time < 5 from information_schema.processlist where id != connection_id();
disconnect con1;
connection default;
set debug_sync='reset';
connection default;
--echo End of 5.5 tests
--echo #
--echo # 10.1 tests

View file

@ -0,0 +1,12 @@
#
# MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes
#
connect con1,localhost,root,,;
connection con1;
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync';
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
FOUND 1 /sleep \(30\)/ in MDEV-20466.text
disconnect con1;
SET DEBUG_SYNC = 'RESET';
End of 5.5 tests

View file

@ -0,0 +1,34 @@
source include/have_debug.inc;
source include/have_debug_sync.inc;
source include/not_embedded.inc;
--echo #
--echo # MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes
--echo #
connect (con1,localhost,root,,);
connection con1;
let $q= `select CONCAT("SELECT user FROM mysql.user WHERE user ='some", CHAR(0), "' or sleep (30)")`;
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync';
--disable_query_log
--send_eval $q;
--enable_query_log
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
exec $MYSQL test -e "SHOW PROCESSLIST" > $MYSQLTEST_VARDIR/tmp/MDEV-20466.text;
let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/MDEV-20466.text;
let SEARCH_PATTERN=sleep \(30\);
source include/search_pattern_in_file.inc;
remove_file $MYSQLTEST_VARDIR/tmp/MDEV-20466.text;
disconnect con1;
SET DEBUG_SYNC = 'RESET';
--echo End of 5.5 tests

View file

@ -3259,6 +3259,32 @@ create table t1 (a1 varchar(25));
create table t2 (a2 varchar(25)) ;
insert into t1 select 'xxx' from dual where 'xxx' in (select a2 from t2);
drop table t1,t2;
#
# MDEV-13172: Wrong result / SELECT ... WHERE EXISTS ... (with UNIQUE Key)
#
CREATE TABLE `t1` (
`Id` int(11) NOT NULL,
PRIMARY KEY (`Id`)
);
INSERT INTO `t1` (`Id`) VALUES (1);
CREATE TABLE `t2` (
`t1_Id` int(11) NOT NULL DEFAULT 0,
`col1` int(11) DEFAULT NULL,
UNIQUE KEY `col1` (`col1`)
);
INSERT INTO `t2` (`t1_Id`, `col1`) VALUES (1, NULL), (1, NULL);
SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
Id
1
explain extended
SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 MATERIALIZED t2 ref col1 col1 5 const 1 100.00 Using index condition; Using where
Warnings:
Note 1003 select 1 AS `Id` from (`test`.`t2`) where `test`.`t2`.`t1_Id` = 1 and `test`.`t2`.`col1` is null
DROP TABLE t1, t2;
# End of 5.5 test
#
# MDEV-20109: Optimizer ignores distinct key created for materialized

View file

@ -2940,6 +2940,32 @@ insert into t1 select 'xxx' from dual where 'xxx' in (select a2 from t2);
drop table t1,t2;
--echo #
--echo # MDEV-13172: Wrong result / SELECT ... WHERE EXISTS ... (with UNIQUE Key)
--echo #
CREATE TABLE `t1` (
`Id` int(11) NOT NULL,
PRIMARY KEY (`Id`)
);
INSERT INTO `t1` (`Id`) VALUES (1);
CREATE TABLE `t2` (
`t1_Id` int(11) NOT NULL DEFAULT 0,
`col1` int(11) DEFAULT NULL,
UNIQUE KEY `col1` (`col1`)
);
INSERT INTO `t2` (`t1_Id`, `col1`) VALUES (1, NULL), (1, NULL);
SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
explain extended
SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
DROP TABLE t1, t2;
--echo # End of 5.5 test
--echo #

View file

@ -3270,6 +3270,32 @@ create table t1 (a1 varchar(25));
create table t2 (a2 varchar(25)) ;
insert into t1 select 'xxx' from dual where 'xxx' in (select a2 from t2);
drop table t1,t2;
#
# MDEV-13172: Wrong result / SELECT ... WHERE EXISTS ... (with UNIQUE Key)
#
CREATE TABLE `t1` (
`Id` int(11) NOT NULL,
PRIMARY KEY (`Id`)
);
INSERT INTO `t1` (`Id`) VALUES (1);
CREATE TABLE `t2` (
`t1_Id` int(11) NOT NULL DEFAULT 0,
`col1` int(11) DEFAULT NULL,
UNIQUE KEY `col1` (`col1`)
);
INSERT INTO `t2` (`t1_Id`, `col1`) VALUES (1, NULL), (1, NULL);
SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
Id
1
explain extended
SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 MATERIALIZED t2 ref col1 col1 5 const 1 100.00 Using index condition; Using where
Warnings:
Note 1003 select 1 AS `Id` from (`test`.`t2`) where `test`.`t2`.`t1_Id` = 1 and `test`.`t2`.`col1` is null
DROP TABLE t1, t2;
# End of 5.5 test
#
# MDEV-20109: Optimizer ignores distinct key created for materialized

View file

@ -337,7 +337,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'information_schema';
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
CREATE VIEW db_datadict.v2 AS
CREATE SQL SECURITY INVOKER VIEW db_datadict.v2 AS
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
FROM information_schema.tables WHERE table_schema = 'db_datadict';
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE

View file

@ -281,8 +281,9 @@ WHERE table_schema = 'information_schema';
# 2. This user (testuser1) is also able to GRANT the SELECT privilege
# on this VIEW to another user (testuser2).
# 3. The other user (testuser2) must be able to SELECT on this VIEW
# but gets a different result set than testuser1.
CREATE VIEW db_datadict.v2 AS
# but gets a different result set than testuser1, if the view
# has SQL SECURITY INVOKER.
CREATE SQL SECURITY INVOKER VIEW db_datadict.v2 AS
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
FROM information_schema.tables WHERE table_schema = 'db_datadict';
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE

View file

@ -3,23 +3,32 @@ CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)) ;
INSERT INTO p VALUES (1, 0);
INSERT INTO p VALUES (2, 0);
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
DELETE FROM p WHERE f1 = 1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
INSERT INTO c VALUES (1, 1);
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_2;
SELECT * FROM p;
f1 f2
1 0
@ -29,6 +38,7 @@ f1 p_id
1 1
DROP TABLE c;
DROP TABLE p;
connection node_1;
CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
f2 INTEGER,
@ -36,22 +46,30 @@ CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)) ;
INSERT INTO p VALUES (1, 0);
INSERT INTO p VALUES (2, 0);
INSERT INTO c VALUES (1, 1, 0);
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE p SET f2 = 1 WHERE f1 = 1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
UPDATE c SET f2 = 1 WHERE f1 = 1;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
connection node_2;
SELECT * FROM p;
f1 f2
1 1
@ -61,28 +79,37 @@ f1 p_id f2
1 1 1
DROP TABLE c;
DROP TABLE p;
connection node_1;
CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)) ;
INSERT INTO p VALUES (1, 0);
INSERT INTO p VALUES (2, 0);
INSERT INTO c VALUES (1, 1);
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE p SET f2 = 1 WHERE f1 = 1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
DELETE FROM c WHERE f1 = 1;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
connection node_2;
SELECT * FROM p;
f1 f2
1 1
@ -95,23 +122,31 @@ CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER UNIQUE KEY) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f2)) ;
INSERT INTO p VALUES (1, 0);
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE p SET f2 = 1 WHERE f1 = 1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
INSERT INTO c VALUES (1, 0);;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_2;
SELECT * FROM p;
f1 f2
1 0
@ -127,23 +162,31 @@ ON DELETE CASCADE) ;
INSERT INTO p VALUES (1, 0);
INSERT INTO p VALUES (2, 0);
INSERT INTO c VALUES (1, 1, 0);
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
DELETE FROM p WHERE f1 = 1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
UPDATE c SET f2 = 1 WHERE f1 = 1;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_2;
SELECT * FROM p;
f1 f2
1 0

View file

@ -30,7 +30,7 @@ SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_2;
SELECT * FROM p;
f1 f2
@ -70,7 +70,7 @@ SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_2;
SELECT * FROM p;
f1 f2
@ -112,7 +112,7 @@ SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_2;
SELECT * FROM p;
f1 f2
@ -145,7 +145,7 @@ SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_2;
SELECT * FROM p;
f1 f2

View file

@ -1,10 +1,14 @@
connection node_2;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options="gmcast.isolate=2";
connection node_1;
SET SESSION wsrep_sync_wait = 0;
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
SET SESSION wsrep_sync_wait = default;
SET GLOBAL wsrep_provider_options="pc.bootstrap=1";
connection node_2;
SET SESSION wsrep_on=0;
connection node_2;
CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2.");

View file

@ -1,24 +1,35 @@
connection node_1;
connection node_2;
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
connection node_2;
SET GLOBAL wsrep_cluster_address='';
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
SET SESSION wsrep_sync_wait=0;
SET GLOBAL wsrep_provider_options = 'dbug=d,gcs_core_after_frag_send';
connection node_1;
SET SESSION wsrep_retry_autocommit=0;
INSERT INTO t1 VALUES (1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_2;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
INSERT INTO t1 VALUES (2, "bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
connection node_1a;
SET GLOBAL wsrep_provider_options = 'signal=gcs_core_after_frag_send';
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
ERROR 40001: Deadlock: wsrep aborted transaction
INSERT INTO t1 VALUES (3, "cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
SELECT * FROM t1;
f1 f2
2 bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3 cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
connection node_2;
SELECT * FROM t1;
f1 f2
2 bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3 cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
connection node_1;
DROP TABLE t1;

View file

@ -1,26 +1,36 @@
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1;
CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER) ENGINE=INNODB;
INSERT INTO p VALUES (1, 0);
INSERT INTO p VALUES (2, 0);
INSERT INTO c VALUES (1, 1);
INSERT INTO c VALUES (2, 2);
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE p SET f1 = f1 + 100;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
ALTER TABLE c ADD FOREIGN KEY (p_id) REFERENCES p(f1);
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_2;
SELECT * FROM p;
f1 f2
1 0
@ -31,6 +41,7 @@ f1 p_id
2 2
DROP TABLE c;
DROP TABLE p;
connection node_1;
CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id1 INTEGER, p_id2 INTEGER) ENGINE=INNODB;
@ -38,23 +49,31 @@ INSERT INTO p1 VALUES (1, 0), (2, 0);
INSERT INTO p2 VALUES (1, 0), (2, 0);
INSERT INTO c VALUES (1, 1, 1);
INSERT INTO c VALUES (2, 2, 2);
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE p1 SET f1 = f1 + 100;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
ALTER TABLE c ADD FOREIGN KEY (p_id1) REFERENCES p1(f1), ADD FOREIGN KEY (p_id2) REFERENCES p2(f1);
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_2;
SELECT * FROM p1;
f1 f2
1 0
@ -70,6 +89,7 @@ f1 p_id1 p_id2
DROP TABLE c;
DROP TABLE p1;
DROP TABLE p2;
connection node_1;
CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id1 INTEGER, p_id2 INTEGER) ENGINE=INNODB;
@ -77,23 +97,31 @@ INSERT INTO p1 VALUES (1, 0), (2, 0);
INSERT INTO p2 VALUES (1, 0), (2, 0);
INSERT INTO c VALUES (1, 1, 1);
INSERT INTO c VALUES (2, 2, 2);
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE p2 SET f1 = f1 + 100;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
ALTER TABLE c ADD FOREIGN KEY (p_id1) REFERENCES p1(f1), ADD FOREIGN KEY (p_id2) REFERENCES p2(f1);
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_2;
SELECT * FROM p1;
f1 f2
1 0

View file

@ -0,0 +1,304 @@
select plugin_name,plugin_status as 'Must be ACTIVE' from information_schema.plugins where plugin_name like 'inno%' and plugin_status!='ACTIVE';
plugin_name Must be ACTIVE
create user select_only@localhost;
grant select on *.* to select_only@localhost;
connect select_only,localhost,select_only;
connection default;
create sql security invoker view i_buffer_page as select * from information_schema.innodb_buffer_page;
create sql security definer view d_buffer_page as select * from information_schema.innodb_buffer_page;
create sql security invoker view i_buffer_page_lru as select * from information_schema.innodb_buffer_page_lru;
create sql security definer view d_buffer_page_lru as select * from information_schema.innodb_buffer_page_lru;
create sql security invoker view i_buffer_pool_stats as select * from information_schema.innodb_buffer_pool_stats;
create sql security definer view d_buffer_pool_stats as select * from information_schema.innodb_buffer_pool_stats;
create sql security invoker view i_cmp as select * from information_schema.innodb_cmp;
create sql security definer view d_cmp as select * from information_schema.innodb_cmp;
create sql security invoker view i_cmp_per_index as select * from information_schema.innodb_cmp_per_index;
create sql security definer view d_cmp_per_index as select * from information_schema.innodb_cmp_per_index;
create sql security invoker view i_cmp_per_index_reset as select * from information_schema.innodb_cmp_per_index_reset;
create sql security definer view d_cmp_per_index_reset as select * from information_schema.innodb_cmp_per_index_reset;
create sql security invoker view i_cmp_reset as select * from information_schema.innodb_cmp_reset;
create sql security definer view d_cmp_reset as select * from information_schema.innodb_cmp_reset;
create sql security invoker view i_cmpmem as select * from information_schema.innodb_cmpmem;
create sql security definer view d_cmpmem as select * from information_schema.innodb_cmpmem;
create sql security invoker view i_cmpmem_reset as select * from information_schema.innodb_cmpmem_reset;
create sql security definer view d_cmpmem_reset as select * from information_schema.innodb_cmpmem_reset;
create sql security invoker view i_ft_being_deleted as select * from information_schema.innodb_ft_being_deleted;
create sql security definer view d_ft_being_deleted as select * from information_schema.innodb_ft_being_deleted;
create sql security invoker view i_ft_config as select * from information_schema.innodb_ft_config;
create sql security definer view d_ft_config as select * from information_schema.innodb_ft_config;
create sql security invoker view i_ft_default_stopword as select * from information_schema.innodb_ft_default_stopword;
create sql security definer view d_ft_default_stopword as select * from information_schema.innodb_ft_default_stopword;
create sql security invoker view i_ft_deleted as select * from information_schema.innodb_ft_deleted;
create sql security definer view d_ft_deleted as select * from information_schema.innodb_ft_deleted;
create sql security invoker view i_ft_index_cache as select * from information_schema.innodb_ft_index_cache;
create sql security definer view d_ft_index_cache as select * from information_schema.innodb_ft_index_cache;
create sql security invoker view i_ft_index_table as select * from information_schema.innodb_ft_index_table;
create sql security definer view d_ft_index_table as select * from information_schema.innodb_ft_index_table;
create sql security invoker view i_lock_waits as select * from information_schema.innodb_lock_waits;
create sql security definer view d_lock_waits as select * from information_schema.innodb_lock_waits;
create sql security invoker view i_locks as select * from information_schema.innodb_locks;
create sql security definer view d_locks as select * from information_schema.innodb_locks;
create sql security invoker view i_metrics as select * from information_schema.innodb_metrics;
create sql security definer view d_metrics as select * from information_schema.innodb_metrics;
create sql security invoker view i_mutexes as select * from information_schema.innodb_mutexes;
create sql security definer view d_mutexes as select * from information_schema.innodb_mutexes;
create sql security invoker view i_sys_columns as select * from information_schema.innodb_sys_columns;
create sql security definer view d_sys_columns as select * from information_schema.innodb_sys_columns;
create sql security invoker view i_sys_datafiles as select * from information_schema.innodb_sys_datafiles;
create sql security definer view d_sys_datafiles as select * from information_schema.innodb_sys_datafiles;
create sql security invoker view i_sys_fields as select * from information_schema.innodb_sys_fields;
create sql security definer view d_sys_fields as select * from information_schema.innodb_sys_fields;
create sql security invoker view i_sys_foreign as select * from information_schema.innodb_sys_foreign;
create sql security definer view d_sys_foreign as select * from information_schema.innodb_sys_foreign;
create sql security invoker view i_sys_foreign_cols as select * from information_schema.innodb_sys_foreign_cols;
create sql security definer view d_sys_foreign_cols as select * from information_schema.innodb_sys_foreign_cols;
create sql security invoker view i_sys_indexes as select * from information_schema.innodb_sys_indexes;
create sql security definer view d_sys_indexes as select * from information_schema.innodb_sys_indexes;
create sql security invoker view i_sys_semaphore_waits as select * from information_schema.innodb_sys_semaphore_waits;
create sql security definer view d_sys_semaphore_waits as select * from information_schema.innodb_sys_semaphore_waits;
create sql security invoker view i_sys_tables as select * from information_schema.innodb_sys_tables;
create sql security definer view d_sys_tables as select * from information_schema.innodb_sys_tables;
create sql security invoker view i_sys_tablespaces as select * from information_schema.innodb_sys_tablespaces;
create sql security definer view d_sys_tablespaces as select * from information_schema.innodb_sys_tablespaces;
create sql security invoker view i_sys_tablestats as select * from information_schema.innodb_sys_tablestats;
create sql security definer view d_sys_tablestats as select * from information_schema.innodb_sys_tablestats;
create sql security invoker view i_sys_virtual as select * from information_schema.innodb_sys_virtual;
create sql security definer view d_sys_virtual as select * from information_schema.innodb_sys_virtual;
create sql security invoker view i_tablespaces_encryption as select * from information_schema.innodb_tablespaces_encryption;
create sql security definer view d_tablespaces_encryption as select * from information_schema.innodb_tablespaces_encryption;
create sql security invoker view i_tablespaces_scrubbing as select * from information_schema.innodb_tablespaces_scrubbing;
create sql security definer view d_tablespaces_scrubbing as select * from information_schema.innodb_tablespaces_scrubbing;
create sql security invoker view i_trx as select * from information_schema.innodb_trx;
create sql security definer view d_trx as select * from information_schema.innodb_trx;
connection select_only;
select count(*) > -1 from information_schema.innodb_buffer_page;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_buffer_page;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_buffer_page;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_buffer_page_lru;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_buffer_page_lru;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_buffer_page_lru;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_buffer_pool_stats;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_buffer_pool_stats;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_buffer_pool_stats;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_cmp;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_cmp;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_cmp;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_cmp_per_index;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_cmp_per_index;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_cmp_per_index;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_cmp_per_index_reset;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_cmp_per_index_reset;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_cmp_per_index_reset;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_cmp_reset;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_cmp_reset;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_cmp_reset;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_cmpmem;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_cmpmem;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_cmpmem;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_cmpmem_reset;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_cmpmem_reset;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_cmpmem_reset;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_ft_being_deleted;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_ft_being_deleted;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_ft_being_deleted;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_ft_config;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_ft_config;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_ft_config;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_ft_default_stopword;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_ft_deleted;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_ft_deleted;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_ft_deleted;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_ft_index_cache;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_ft_index_cache;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_ft_index_cache;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_ft_index_table;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_ft_index_table;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_ft_index_table;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_lock_waits;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_lock_waits;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_lock_waits;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_locks;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_locks;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_locks;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_metrics;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_metrics;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_metrics;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_mutexes;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_mutexes;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_mutexes;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_columns;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_columns;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_sys_columns;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_datafiles;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_datafiles;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_sys_datafiles;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_fields;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_fields;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_sys_fields;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_foreign;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_foreign;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_sys_foreign;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_foreign_cols;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_foreign_cols;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_sys_foreign_cols;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_indexes;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_indexes;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_sys_indexes;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_semaphore_waits;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_semaphore_waits;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_sys_semaphore_waits;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_tables;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_tables;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_sys_tables;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_tablespaces;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_tablespaces;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_sys_tablespaces;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_tablestats;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_tablestats;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_sys_tablestats;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_virtual;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_virtual;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_sys_virtual;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_tablespaces_encryption;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
select count(*) > -1 from i_tablespaces_encryption;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
select count(*) > -1 from d_tablespaces_encryption;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_tablespaces_scrubbing;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
select count(*) > -1 from i_tablespaces_scrubbing;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
select count(*) > -1 from d_tablespaces_scrubbing;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_trx;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_trx;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_trx;
count(*) > -1
1
connection default;
drop database test;
create database test;
drop user select_only@localhost;

View file

@ -567,7 +567,7 @@ Variable_name Value
auto_increment_increment 65535
auto_increment_offset 65535
INSERT INTO t1 VALUES (NULL),(NULL);
ERROR HY000: Failed to read auto-increment value from storage engine
ERROR 22003: Out of range value for column 'c1' at row 1
SELECT * FROM t1;
c1
1
@ -677,7 +677,7 @@ SELECT a,b FROM t;
a b
1 S1
3 S2
4 S2
5 S2
disconnect con1;
connection default;
# Client 1: Insert a record with auto_increment_increment=1
@ -688,14 +688,14 @@ t CREATE TABLE `t` (
`a` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`b` varchar(200) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
INSERT INTO t(b) VALUES('S1');
SELECT a,b FROM t;
a b
1 S1
3 S2
4 S2
5 S1
5 S2
6 S1
DROP TABLE t;
# Autoincrement behaviour with mixed insert.
CREATE TABLE t(
@ -733,22 +733,22 @@ t CREATE TABLE `t` (
`a` tinyint(4) NOT NULL AUTO_INCREMENT,
`b` varchar(200) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=latin1
INSERT INTO t(b) VALUES('S4');
SELECT * FROM t;
a b
1 S0
11 S1
22 S3
23 S4
28 S2
31 S3
32 S4
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` tinyint(4) NOT NULL AUTO_INCREMENT,
`b` varchar(200) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=latin1
DROP TABLE t;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=5;
DROP TABLE IF EXISTS t1;
@ -789,7 +789,7 @@ t2 CREATE TABLE `t2` (
`n` int(10) unsigned NOT NULL,
`o` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`m`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
SHOW CREATE TABLE t1;
Table Create Table
@ -1472,13 +1472,13 @@ SELECT * FROM t;
i
1
301
351
601
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`i` int(11) NOT NULL AUTO_INCREMENT,
KEY `i` (`i`)
) ENGINE=InnoDB AUTO_INCREMENT=401 DEFAULT CHARSET=latin1
) ENGINE=InnoDB AUTO_INCREMENT=651 DEFAULT CHARSET=latin1
DROP TABLE t;
SET auto_increment_increment = DEFAULT;
#

View file

@ -1,22 +1,15 @@
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
SET @saved_include_delete_marked = @@GLOBAL.innodb_stats_include_delete_marked;
SET GLOBAL innodb_stats_include_delete_marked = ON;
SET @saved_traditional = @@GLOBAL.innodb_stats_traditional;
SET GLOBAL innodb_stats_traditional=false;
SET @saved_modified_counter = @@GLOBAL.innodb_stats_modified_counter;
SET GLOBAL innodb_stats_modified_counter=1;
CREATE TABLE t0 (id SERIAL, val INT UNSIGNED NOT NULL, KEY(val))
CREATE TABLE t1 (id SERIAL, val INT UNSIGNED NOT NULL, KEY(val))
ENGINE=INNODB STATS_PERSISTENT=1,STATS_AUTO_RECALC=1;
CREATE TABLE t1 LIKE t0;
CREATE TABLE t2 LIKE t0;
INSERT INTO t0 (val) VALUES (4);
INSERT INTO t0 (val) SELECT 4 FROM t0;
INSERT INTO t0 (val) SELECT 4 FROM t0;
INSERT INTO t0 (val) SELECT 4 FROM t0;
INSERT INTO t0 (val) SELECT 4 FROM t0;
INSERT INTO t1 SELECT * FROM t0;
SELECT COUNT(*) FROM t1;
COUNT(*)
16
CREATE TABLE t2 LIKE t1;
INSERT INTO t1 (val) SELECT 4 FROM seq_1_to_16;
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
@ -48,7 +41,7 @@ COUNT(*)
0
connection default;
BEGIN;
INSERT INTO t2 SELECT * FROM t0;
INSERT INTO t2 (val) SELECT 4 FROM seq_1_to_16;
# The INSERT will show up before COMMIT.
EXPLAIN SELECT * FROM t2 WHERE val=4;
id select_type table type possible_keys key key_len ref rows Extra
@ -65,17 +58,14 @@ connection con1;
EXPLAIN SELECT * FROM t2 WHERE val=4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref val val 4 const 1 Using index
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
InnoDB 0 transactions not purged
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
# After COMMIT and purge, the DELETE must show up.
EXPLAIN SELECT * FROM t1 WHERE val=4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref val val 4 const 1 Using index
SET GLOBAL innodb_stats_include_delete_marked = OFF;
BEGIN;
INSERT INTO t1 SELECT * FROM t0;
INSERT INTO t1 (val) SELECT 4 FROM seq_1_to_16;
EXPLAIN SELECT * FROM t1 WHERE val=4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref val val 4 const 16 Using index
@ -84,7 +74,7 @@ EXPLAIN SELECT * FROM t1 WHERE val=4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref val val 4 const 1 Using index
BEGIN;
INSERT INTO t1 SELECT * FROM t0;
INSERT INTO t1 (val) SELECT 4 FROM seq_1_to_16;
COMMIT;
EXPLAIN SELECT * FROM t1 WHERE val=4;
id select_type table type possible_keys key key_len ref rows Extra
@ -110,7 +100,8 @@ COUNT(*)
16
disconnect con1;
connection default;
DROP TABLE t0,t1,t2;
DROP TABLE t1,t2;
SET GLOBAL innodb_stats_include_delete_marked = @saved_include_delete_marked;
SET GLOBAL innodb_stats_traditional = @saved_traditional;
SET GLOBAL innodb_stats_modified_counter = @saved_modified_counter;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;

View file

@ -0,0 +1,15 @@
rename table mysql.table_stats to mysql.table_stats_save;
flush tables;
set use_stat_tables= PREFERABLY;
create table t1 (a int) engine=InnoDB;
start transaction;
insert t1 values (1);
insert t1 values (2);
commit;
select * from t1;
a
1
2
drop table t1;
rename table mysql.table_stats_save to mysql.table_stats;
flush tables;

View file

@ -43,7 +43,7 @@ INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
INSERT INTO t1 SELECT 0,b,c FROM t1;
--let $restart_parameters= --innodb-force-recovery=6
--let $restart_parameters= --innodb-force-recovery=6 --innodb-change-buffer-dump
--source include/restart_mysqld.inc
--replace_regex /contains \d+ entries/contains #### entries/

View file

@ -0,0 +1,33 @@
--enable-plugin-innodb-trx
--enable-plugin-innodb-locks
--enable-plugin-innodb-lock-waits
--enable-plugin-innodb-cmp
--enable-plugin-innodb-cmp-reset
--enable-plugin-innodb-cmpmem
--enable-plugin-innodb-cmpmem-reset
--enable-plugin-innodb-cmp-per-index
--enable-plugin-innodb-cmp-per-index-reset
--enable-plugin-innodb-buffer-page
--enable-plugin-innodb-buffer-page-lru
--enable-plugin-innodb-buffer-pool-stats
--enable-plugin-innodb-metrics
--enable-plugin-innodb-ft-default-stopword
--enable-plugin-innodb-ft-deleted
--enable-plugin-innodb-ft-being-deleted
--enable-plugin-innodb-ft-config
--enable-plugin-innodb-ft-index-cache
--enable-plugin-innodb-ft-index-table
--enable-plugin-innodb-sys-tables
--enable-plugin-innodb-sys-tablestats
--enable-plugin-innodb-sys-indexes
--enable-plugin-innodb-sys-columns
--enable-plugin-innodb-sys-fields
--enable-plugin-innodb-sys-foreign
--enable-plugin-innodb-sys-foreign-cols
--enable-plugin-innodb-sys-tablespaces
--enable-plugin-innodb-sys-datafiles
--enable-plugin-innodb-sys-virtual
--enable-plugin-innodb-mutexes
--enable-plugin-innodb-sys-semaphore-waits
--enable-plugin-innodb-tablespaces-encryption
--enable-plugin-innodb-tablespaces-scrubbing

View file

@ -0,0 +1,311 @@
source include/have_innodb.inc;
source include/not_embedded.inc;
# make sure we've enabled everything:
select plugin_name,plugin_status as 'Must be ACTIVE' from information_schema.plugins where plugin_name like 'inno%' and plugin_status!='ACTIVE';
create user select_only@localhost;
grant select on *.* to select_only@localhost;
connect select_only,localhost,select_only;
connection default;
create sql security invoker view i_buffer_page as select * from information_schema.innodb_buffer_page;
create sql security definer view d_buffer_page as select * from information_schema.innodb_buffer_page;
create sql security invoker view i_buffer_page_lru as select * from information_schema.innodb_buffer_page_lru;
create sql security definer view d_buffer_page_lru as select * from information_schema.innodb_buffer_page_lru;
create sql security invoker view i_buffer_pool_stats as select * from information_schema.innodb_buffer_pool_stats;
create sql security definer view d_buffer_pool_stats as select * from information_schema.innodb_buffer_pool_stats;
create sql security invoker view i_cmp as select * from information_schema.innodb_cmp;
create sql security definer view d_cmp as select * from information_schema.innodb_cmp;
create sql security invoker view i_cmp_per_index as select * from information_schema.innodb_cmp_per_index;
create sql security definer view d_cmp_per_index as select * from information_schema.innodb_cmp_per_index;
create sql security invoker view i_cmp_per_index_reset as select * from information_schema.innodb_cmp_per_index_reset;
create sql security definer view d_cmp_per_index_reset as select * from information_schema.innodb_cmp_per_index_reset;
create sql security invoker view i_cmp_reset as select * from information_schema.innodb_cmp_reset;
create sql security definer view d_cmp_reset as select * from information_schema.innodb_cmp_reset;
create sql security invoker view i_cmpmem as select * from information_schema.innodb_cmpmem;
create sql security definer view d_cmpmem as select * from information_schema.innodb_cmpmem;
create sql security invoker view i_cmpmem_reset as select * from information_schema.innodb_cmpmem_reset;
create sql security definer view d_cmpmem_reset as select * from information_schema.innodb_cmpmem_reset;
create sql security invoker view i_ft_being_deleted as select * from information_schema.innodb_ft_being_deleted;
create sql security definer view d_ft_being_deleted as select * from information_schema.innodb_ft_being_deleted;
create sql security invoker view i_ft_config as select * from information_schema.innodb_ft_config;
create sql security definer view d_ft_config as select * from information_schema.innodb_ft_config;
create sql security invoker view i_ft_default_stopword as select * from information_schema.innodb_ft_default_stopword;
create sql security definer view d_ft_default_stopword as select * from information_schema.innodb_ft_default_stopword;
create sql security invoker view i_ft_deleted as select * from information_schema.innodb_ft_deleted;
create sql security definer view d_ft_deleted as select * from information_schema.innodb_ft_deleted;
create sql security invoker view i_ft_index_cache as select * from information_schema.innodb_ft_index_cache;
create sql security definer view d_ft_index_cache as select * from information_schema.innodb_ft_index_cache;
create sql security invoker view i_ft_index_table as select * from information_schema.innodb_ft_index_table;
create sql security definer view d_ft_index_table as select * from information_schema.innodb_ft_index_table;
create sql security invoker view i_lock_waits as select * from information_schema.innodb_lock_waits;
create sql security definer view d_lock_waits as select * from information_schema.innodb_lock_waits;
create sql security invoker view i_locks as select * from information_schema.innodb_locks;
create sql security definer view d_locks as select * from information_schema.innodb_locks;
create sql security invoker view i_metrics as select * from information_schema.innodb_metrics;
create sql security definer view d_metrics as select * from information_schema.innodb_metrics;
create sql security invoker view i_mutexes as select * from information_schema.innodb_mutexes;
create sql security definer view d_mutexes as select * from information_schema.innodb_mutexes;
create sql security invoker view i_sys_columns as select * from information_schema.innodb_sys_columns;
create sql security definer view d_sys_columns as select * from information_schema.innodb_sys_columns;
create sql security invoker view i_sys_datafiles as select * from information_schema.innodb_sys_datafiles;
create sql security definer view d_sys_datafiles as select * from information_schema.innodb_sys_datafiles;
create sql security invoker view i_sys_fields as select * from information_schema.innodb_sys_fields;
create sql security definer view d_sys_fields as select * from information_schema.innodb_sys_fields;
create sql security invoker view i_sys_foreign as select * from information_schema.innodb_sys_foreign;
create sql security definer view d_sys_foreign as select * from information_schema.innodb_sys_foreign;
create sql security invoker view i_sys_foreign_cols as select * from information_schema.innodb_sys_foreign_cols;
create sql security definer view d_sys_foreign_cols as select * from information_schema.innodb_sys_foreign_cols;
create sql security invoker view i_sys_indexes as select * from information_schema.innodb_sys_indexes;
create sql security definer view d_sys_indexes as select * from information_schema.innodb_sys_indexes;
create sql security invoker view i_sys_semaphore_waits as select * from information_schema.innodb_sys_semaphore_waits;
create sql security definer view d_sys_semaphore_waits as select * from information_schema.innodb_sys_semaphore_waits;
create sql security invoker view i_sys_tables as select * from information_schema.innodb_sys_tables;
create sql security definer view d_sys_tables as select * from information_schema.innodb_sys_tables;
create sql security invoker view i_sys_tablespaces as select * from information_schema.innodb_sys_tablespaces;
create sql security definer view d_sys_tablespaces as select * from information_schema.innodb_sys_tablespaces;
create sql security invoker view i_sys_tablestats as select * from information_schema.innodb_sys_tablestats;
create sql security definer view d_sys_tablestats as select * from information_schema.innodb_sys_tablestats;
create sql security invoker view i_sys_virtual as select * from information_schema.innodb_sys_virtual;
create sql security definer view d_sys_virtual as select * from information_schema.innodb_sys_virtual;
create sql security invoker view i_tablespaces_encryption as select * from information_schema.innodb_tablespaces_encryption;
create sql security definer view d_tablespaces_encryption as select * from information_schema.innodb_tablespaces_encryption;
create sql security invoker view i_tablespaces_scrubbing as select * from information_schema.innodb_tablespaces_scrubbing;
create sql security definer view d_tablespaces_scrubbing as select * from information_schema.innodb_tablespaces_scrubbing;
create sql security invoker view i_trx as select * from information_schema.innodb_trx;
create sql security definer view d_trx as select * from information_schema.innodb_trx;
connection select_only;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_buffer_page;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_buffer_page;
select count(*) > -1 from d_buffer_page;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_buffer_page_lru;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_buffer_page_lru;
select count(*) > -1 from d_buffer_page_lru;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_buffer_pool_stats;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_buffer_pool_stats;
select count(*) > -1 from d_buffer_pool_stats;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_cmp;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_cmp;
select count(*) > -1 from d_cmp;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_cmp_per_index;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_cmp_per_index;
select count(*) > -1 from d_cmp_per_index;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_cmp_per_index_reset;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_cmp_per_index_reset;
select count(*) > -1 from d_cmp_per_index_reset;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_cmp_reset;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_cmp_reset;
select count(*) > -1 from d_cmp_reset;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_cmpmem;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_cmpmem;
select count(*) > -1 from d_cmpmem;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_cmpmem_reset;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_cmpmem_reset;
select count(*) > -1 from d_cmpmem_reset;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_ft_being_deleted;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_ft_being_deleted;
select count(*) > -1 from d_ft_being_deleted;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_ft_config;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_ft_config;
select count(*) > -1 from d_ft_config;
# non-privileged table
select count(*) > -1 from information_schema.innodb_ft_default_stopword;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_ft_deleted;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_ft_deleted;
select count(*) > -1 from d_ft_deleted;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_ft_index_cache;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_ft_index_cache;
select count(*) > -1 from d_ft_index_cache;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_ft_index_table;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_ft_index_table;
select count(*) > -1 from d_ft_index_table;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_lock_waits;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_lock_waits;
select count(*) > -1 from d_lock_waits;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_locks;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_locks;
select count(*) > -1 from d_locks;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_metrics;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_metrics;
select count(*) > -1 from d_metrics;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_mutexes;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_mutexes;
select count(*) > -1 from d_mutexes;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_columns;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_sys_columns;
select count(*) > -1 from d_sys_columns;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_datafiles;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_sys_datafiles;
select count(*) > -1 from d_sys_datafiles;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_fields;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_sys_fields;
select count(*) > -1 from d_sys_fields;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_foreign;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_sys_foreign;
select count(*) > -1 from d_sys_foreign;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_foreign_cols;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_sys_foreign_cols;
select count(*) > -1 from d_sys_foreign_cols;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_indexes;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_sys_indexes;
select count(*) > -1 from d_sys_indexes;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_semaphore_waits;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_sys_semaphore_waits;
select count(*) > -1 from d_sys_semaphore_waits;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_tables;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_sys_tables;
select count(*) > -1 from d_sys_tables;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_tablespaces;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_sys_tablespaces;
select count(*) > -1 from d_sys_tablespaces;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_tablestats;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_sys_tablestats;
select count(*) > -1 from d_sys_tablestats;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_virtual;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_sys_virtual;
select count(*) > -1 from d_sys_virtual;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_tablespaces_encryption;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_tablespaces_encryption;
select count(*) > -1 from d_tablespaces_encryption;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_tablespaces_scrubbing;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_tablespaces_scrubbing;
select count(*) > -1 from d_tablespaces_scrubbing;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_trx;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_trx;
select count(*) > -1 from d_trx;
connection default;
drop database test;
create database test;
drop user select_only@localhost;

View file

@ -349,7 +349,7 @@ INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
SHOW VARIABLES LIKE "auto_inc%";
--error 1467
--error HA_ERR_AUTOINC_ERANGE
INSERT INTO t1 VALUES (NULL),(NULL);
SELECT * FROM t1;
DROP TABLE t1;

View file

@ -1,6 +1,8 @@
--source include/have_innodb.inc
--source include/big_test.inc
--source include/have_sequence.inc
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
SET @saved_include_delete_marked = @@GLOBAL.innodb_stats_include_delete_marked;
SET GLOBAL innodb_stats_include_delete_marked = ON;
SET @saved_traditional = @@GLOBAL.innodb_stats_traditional;
@ -8,19 +10,11 @@ SET GLOBAL innodb_stats_traditional=false;
SET @saved_modified_counter = @@GLOBAL.innodb_stats_modified_counter;
SET GLOBAL innodb_stats_modified_counter=1;
CREATE TABLE t0 (id SERIAL, val INT UNSIGNED NOT NULL, KEY(val))
CREATE TABLE t1 (id SERIAL, val INT UNSIGNED NOT NULL, KEY(val))
ENGINE=INNODB STATS_PERSISTENT=1,STATS_AUTO_RECALC=1;
CREATE TABLE t1 LIKE t0;
CREATE TABLE t2 LIKE t0;
CREATE TABLE t2 LIKE t1;
INSERT INTO t0 (val) VALUES (4);
INSERT INTO t0 (val) SELECT 4 FROM t0;
INSERT INTO t0 (val) SELECT 4 FROM t0;
INSERT INTO t0 (val) SELECT 4 FROM t0;
INSERT INTO t0 (val) SELECT 4 FROM t0;
INSERT INTO t1 SELECT * FROM t0;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 (val) SELECT 4 FROM seq_1_to_16;
ANALYZE TABLE t1;
connect(con1, localhost, root,,);
@ -46,7 +40,7 @@ SELECT COUNT(*) FROM t1;
connection default;
BEGIN;
INSERT INTO t2 SELECT * FROM t0;
INSERT INTO t2 (val) SELECT 4 FROM seq_1_to_16;
--echo # The INSERT will show up before COMMIT.
EXPLAIN SELECT * FROM t2 WHERE val=4;
@ -57,21 +51,18 @@ SELECT COUNT(*) FROM t2;
connection con1;
EXPLAIN SELECT * FROM t2 WHERE val=4;
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
--source include/wait_all_purged.inc
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
--echo # After COMMIT and purge, the DELETE must show up.
EXPLAIN SELECT * FROM t1 WHERE val=4;
SET GLOBAL innodb_stats_include_delete_marked = OFF;
BEGIN;
INSERT INTO t1 SELECT * FROM t0;
INSERT INTO t1 (val) SELECT 4 FROM seq_1_to_16;
EXPLAIN SELECT * FROM t1 WHERE val=4;
ROLLBACK;
EXPLAIN SELECT * FROM t1 WHERE val=4;
BEGIN;
INSERT INTO t1 SELECT * FROM t0;
INSERT INTO t1 (val) SELECT 4 FROM seq_1_to_16;
COMMIT;
EXPLAIN SELECT * FROM t1 WHERE val=4;
BEGIN;
@ -89,7 +80,8 @@ disconnect con1;
connection default;
DROP TABLE t0,t1,t2;
DROP TABLE t1,t2;
SET GLOBAL innodb_stats_include_delete_marked = @saved_include_delete_marked;
SET GLOBAL innodb_stats_traditional = @saved_traditional;
SET GLOBAL innodb_stats_modified_counter = @saved_modified_counter;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;

View file

@ -0,0 +1,17 @@
source include/have_innodb.inc;
#
# MDEV-20354 All but last insert ignored in InnoDB tables when table locked
#
rename table mysql.table_stats to mysql.table_stats_save;
flush tables;
set use_stat_tables= PREFERABLY;
create table t1 (a int) engine=InnoDB;
start transaction;
insert t1 values (1);
insert t1 values (2);
commit;
select * from t1;
drop table t1;
rename table mysql.table_stats_save to mysql.table_stats;
flush tables;

View file

@ -41,9 +41,11 @@ INSERT INTO articles (title,body) VALUES
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
connect dml, localhost, root,,;
BEGIN;
INSERT INTO articles (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...');
connection default;
# Make durable the AUTO_INCREMENT in the above incomplete transaction.
connect flush_redo_log,localhost,root,,;
SET GLOBAL innodb_flush_log_at_trx_commit=1;
@ -52,6 +54,7 @@ DELETE FROM articles LIMIT 1;
ROLLBACK;
disconnect flush_redo_log;
connection default;
disconnect dml;
INSERT INTO articles (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...');
SELECT * FROM articles
@ -79,9 +82,39 @@ INSERT INTO articles VALUES
(4, 11, '1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
(5, 6, 'MySQL vs. YourSQL','In the following database comparison ...'),
(7, 4, 'MySQL Security','When configured properly, MySQL ...');
connect dml, localhost, root,,;
BEGIN;
INSERT INTO articles VALUES
(100, 200, 'MySQL Tutorial','DBMS stands for DataBase ...');
connect dml2, localhost, root,,;
#
# MDEV-19073 FTS row mismatch after crash recovery
#
CREATE TABLE mdev19073(id SERIAL, title VARCHAR(200), body TEXT,
FULLTEXT(title,body)) ENGINE=InnoDB;
INSERT INTO mdev19073 (title, body) VALUES
('MySQL Tutorial', 'DBMS stands for Database...');
CREATE FULLTEXT INDEX idx ON mdev19073(title, body);
CREATE TABLE mdev19073_2 LIKE mdev19073;
INSERT INTO mdev19073_2 (title, body) VALUES
('MySQL Tutorial', 'DBMS stands for Database...');
INSERT INTO mdev19073 (title, body) VALUES
('MariaDB Tutorial', 'DB means Database ...');
INSERT INTO mdev19073_2 (title, body) VALUES
('MariaDB Tutorial', 'DB means Database ...');
SELECT * FROM mdev19073 WHERE MATCH (title, body)
AGAINST ('Database' IN NATURAL LANGUAGE MODE);
id title body
1 MySQL Tutorial DBMS stands for Database...
2 MariaDB Tutorial DB means Database ...
SELECT * FROM mdev19073_2 WHERE MATCH (title, body)
AGAINST ('Database' IN NATURAL LANGUAGE MODE);
id title body
1 MySQL Tutorial DBMS stands for Database...
2 MariaDB Tutorial DB means Database ...
connection default;
disconnect dml;
disconnect dml2;
INSERT INTO articles VALUES (8, 12, 'MySQL Tutorial','DBMS stands for DataBase ...');
SELECT * FROM articles WHERE MATCH (title, body)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
@ -90,3 +123,14 @@ id FTS_DOC_ID title body
1 10 MySQL Tutorial DBMS stands for DataBase ...
8 12 MySQL Tutorial DBMS stands for DataBase ...
DROP TABLE articles;
SELECT * FROM mdev19073 WHERE MATCH (title, body)
AGAINST ('Database' IN NATURAL LANGUAGE MODE);
id title body
1 MySQL Tutorial DBMS stands for Database...
2 MariaDB Tutorial DB means Database ...
SELECT * FROM mdev19073_2 WHERE MATCH (title, body)
AGAINST ('Database' IN NATURAL LANGUAGE MODE);
id title body
1 MySQL Tutorial DBMS stands for Database...
2 MariaDB Tutorial DB means Database ...
DROP TABLE mdev19073, mdev19073_2;

View file

@ -6,6 +6,7 @@
--source include/have_innodb.inc
# The embedded server tests do not support restarting.
--source include/not_embedded.inc
--source include/maybe_debug.inc
FLUSH TABLES;
# Following are test for crash recovery on FTS index, the first scenario
@ -73,10 +74,12 @@ INSERT INTO articles (title,body) VALUES
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
connect(dml, localhost, root,,);
BEGIN;
INSERT INTO articles (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...');
connection default;
--echo # Make durable the AUTO_INCREMENT in the above incomplete transaction.
--connect (flush_redo_log,localhost,root,,)
@ -89,6 +92,8 @@ ROLLBACK;
--source include/restart_mysqld.inc
disconnect dml;
# This insert will re-initialize the Doc ID counter, it should not crash
INSERT INTO articles (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...');
@ -121,6 +126,7 @@ INSERT INTO articles VALUES
(5, 6, 'MySQL vs. YourSQL','In the following database comparison ...'),
(7, 4, 'MySQL Security','When configured properly, MySQL ...');
connect(dml, localhost, root,,);
BEGIN;
# Below we do not depend on the durability of the AUTO_INCREMENT sequence,
@ -128,7 +134,49 @@ BEGIN;
INSERT INTO articles VALUES
(100, 200, 'MySQL Tutorial','DBMS stands for DataBase ...');
connect(dml2, localhost, root,,);
--echo #
--echo # MDEV-19073 FTS row mismatch after crash recovery
--echo #
CREATE TABLE mdev19073(id SERIAL, title VARCHAR(200), body TEXT,
FULLTEXT(title,body)) ENGINE=InnoDB;
INSERT INTO mdev19073 (title, body) VALUES
('MySQL Tutorial', 'DBMS stands for Database...');
CREATE FULLTEXT INDEX idx ON mdev19073(title, body);
CREATE TABLE mdev19073_2 LIKE mdev19073;
if ($have_debug)
{
--disable_query_log
SET @saved_dbug = @@debug_dbug;
SET DEBUG_DBUG = '+d,fts_instrument_sync_debug';
--enable_query_log
}
INSERT INTO mdev19073_2 (title, body) VALUES
('MySQL Tutorial', 'DBMS stands for Database...');
if ($have_debug)
{
--disable_query_log
SET DEBUG_DBUG = @saved_dbug;
--enable_query_log
}
INSERT INTO mdev19073 (title, body) VALUES
('MariaDB Tutorial', 'DB means Database ...');
INSERT INTO mdev19073_2 (title, body) VALUES
('MariaDB Tutorial', 'DB means Database ...');
# Should return 2 rows
SELECT * FROM mdev19073 WHERE MATCH (title, body)
AGAINST ('Database' IN NATURAL LANGUAGE MODE);
SELECT * FROM mdev19073_2 WHERE MATCH (title, body)
AGAINST ('Database' IN NATURAL LANGUAGE MODE);
connection default;
--source include/restart_mysqld.inc
disconnect dml;
disconnect dml2;
# This would re-initialize the FTS index and do the re-tokenization
# of above records
@ -138,3 +186,10 @@ SELECT * FROM articles WHERE MATCH (title, body)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
DROP TABLE articles;
# Should return 2 rows
SELECT * FROM mdev19073 WHERE MATCH (title, body)
AGAINST ('Database' IN NATURAL LANGUAGE MODE);
SELECT * FROM mdev19073_2 WHERE MATCH (title, body)
AGAINST ('Database' IN NATURAL LANGUAGE MODE);
DROP TABLE mdev19073, mdev19073_2;

View file

@ -333,6 +333,18 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_CHANGE_BUFFER_DUMP
SESSION_VALUE NULL
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Dump the change buffer at startup.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_CHANGE_BUFFER_MAX_SIZE
SESSION_VALUE NULL
DEFAULT_VALUE 25

View file

@ -269,3 +269,18 @@ index(col_char,vcol_blob(64))
insert ignore into t1 (pk) values (1),(2);
update t1 set col_char = 'foo' where pk = 1;
drop table t1;
create table t1 (
id int not null primary key,
a varchar(200),
b varchar(200),
c int,
va char(200) generated always as (ucase(a)) virtual,
vb char(200) generated always as (ucase(b)) virtual,
key (c,va,vb)
) engine=innodb;
insert t1 (id,a,c) select seq,seq,seq from seq_1_to_330;
select IF(@@innodb_sort_buffer_size < count(*)*200, 'GOOD', 'WRONG SIZE') from t1;
IF(@@innodb_sort_buffer_size < count(*)*200, 'GOOD', 'WRONG SIZE')
GOOD
alter table t1 drop column va;
drop table t1;

View file

@ -0,0 +1 @@
--innodb-sort-buffer-size=64k

View file

@ -117,3 +117,21 @@ create table t1 (
insert ignore into t1 (pk) values (1),(2);
update t1 set col_char = 'foo' where pk = 1;
drop table t1;
#
# MDEV-20799 DROP Virtual Column crashes MariaDB
#
--source include/have_sequence.inc
create table t1 (
id int not null primary key,
a varchar(200),
b varchar(200),
c int,
va char(200) generated always as (ucase(a)) virtual,
vb char(200) generated always as (ucase(b)) virtual,
key (c,va,vb)
) engine=innodb;
insert t1 (id,a,c) select seq,seq,seq from seq_1_to_330;
select IF(@@innodb_sort_buffer_size < count(*)*200, 'GOOD', 'WRONG SIZE') from t1;
alter table t1 drop column va;
drop table t1;

View file

@ -26,7 +26,7 @@ use Fcntl;
BEGIN {
# ****************************
# static information...
$VERSION = "2.06, 20 Dec 2000";
$VERSION = "2.10, 13 Sep 2019";
$0 =~ m%/([^/]+)$%o;
$script = $1;
$script = 'MySQLAccess' unless $script;

View file

@ -2609,9 +2609,17 @@ bool find_eq_ref_candidate(TABLE *table, table_map sj_inner_tables)
{
do /* For all equalities on all key parts */
{
/* Check if this is "t.keypart = expr(outer_tables) */
/*
Check if this is "t.keypart = expr(outer_tables)
Don't allow variants that can produce duplicates:
- Dont allow "ref or null"
- the keyuse (that is, the operation) must be null-rejecting,
unless the other expression is non-NULLable.
*/
if (!(keyuse->used_tables & sj_inner_tables) &&
!(keyuse->optimize & KEY_OPTIMIZE_REF_OR_NULL))
!(keyuse->optimize & KEY_OPTIMIZE_REF_OR_NULL) &&
(keyuse->null_rejecting || !keyuse->val->maybe_null))
{
bound_parts |= 1 << keyuse->keypart;
}

View file

@ -1620,12 +1620,16 @@ public:
/**
@class Sub_statement_state
@brief Used to save context when executing a function or trigger
operations on stat tables aren't technically a sub-statement, but they are
similar in a sense that they cannot change the transaction status.
*/
/* Defines used for Sub_statement_state::in_sub_stmt */
#define SUB_STMT_TRIGGER 1
#define SUB_STMT_FUNCTION 2
#define SUB_STMT_STAT_TABLES 4
class Sub_statement_state
@ -6545,6 +6549,22 @@ class Sql_mode_save
sql_mode_t old_mode; // SQL mode saved at construction time.
};
class Switch_to_definer_security_ctx
{
public:
Switch_to_definer_security_ctx(THD *thd, TABLE_LIST *table) :
m_thd(thd), m_sctx(thd->security_ctx)
{
if (table->security_ctx)
thd->security_ctx= table->security_ctx;
}
~Switch_to_definer_security_ctx() { m_thd->security_ctx = m_sctx; }
private:
THD *m_thd;
Security_context *m_sctx;
};
/**
This class resembles the SQL Standard schema qualified object name:

View file

@ -6685,11 +6685,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
bool check_single_table_access(THD *thd, ulong privilege,
TABLE_LIST *all_tables, bool no_errors)
{
Security_context * backup_ctx= thd->security_ctx;
/* we need to switch to the saved context (if any) */
if (all_tables->security_ctx)
thd->security_ctx= all_tables->security_ctx;
Switch_to_definer_security_ctx backup_sctx(thd, all_tables);
const char *db_name;
if ((all_tables->view || all_tables->field_translation) &&
@ -6702,20 +6698,15 @@ bool check_single_table_access(THD *thd, ulong privilege,
&all_tables->grant.privilege,
&all_tables->grant.m_internal,
0, no_errors))
goto deny;
return 1;
/* Show only 1 table for check_grant */
if (!(all_tables->belong_to_view &&
(thd->lex->sql_command == SQLCOM_SHOW_FIELDS)) &&
check_grant(thd, privilege, all_tables, FALSE, 1, no_errors))
goto deny;
return 1;
thd->security_ctx= backup_ctx;
return 0;
deny:
thd->security_ctx= backup_ctx;
return 1;
}
/**
@ -6890,7 +6881,6 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
{
TABLE_LIST *org_tables= tables;
TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table();
Security_context *sctx= thd->security_ctx, *backup_ctx= thd->security_ctx;
uint i= 0;
/*
The check that first_not_own_table is not reached is for the case when
@ -6902,12 +6892,9 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
{
TABLE_LIST *const table_ref= tables->correspondent_table ?
tables->correspondent_table : tables;
Switch_to_definer_security_ctx backup_ctx(thd, table_ref);
ulong want_access= requirements;
if (table_ref->security_ctx)
sctx= table_ref->security_ctx;
else
sctx= backup_ctx;
/*
Register access for view underlying table.
@ -6918,7 +6905,7 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
if (table_ref->schema_table_reformed)
{
if (check_show_access(thd, table_ref))
goto deny;
return 1;
continue;
}
@ -6928,8 +6915,6 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
if (table_ref->is_anonymous_derived_table())
continue;
thd->security_ctx= sctx;
if (table_ref->sequence)
{
/* We want to have either SELECT or INSERT rights to sequences depending
@ -6943,15 +6928,11 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
&table_ref->grant.privilege,
&table_ref->grant.m_internal,
0, no_errors))
goto deny;
return 1;
}
thd->security_ctx= backup_ctx;
return check_grant(thd,requirements,org_tables,
any_combination_of_privileges_will_do,
number, no_errors);
deny:
thd->security_ctx= backup_ctx;
return TRUE;
}

View file

@ -2946,8 +2946,12 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
else
protocol->store_null();
protocol->store(thd_info->state_info, system_charset_info);
protocol->store(thd_info->query_string.str(),
thd_info->query_string.charset());
if (thd_info->query_string.length())
protocol->store(thd_info->query_string.str(),
thd_info->query_string.length(),
thd_info->query_string.charset());
else
protocol->store_null();
if (!thd->variables.old_mode &&
!(thd->variables.old_behavior & OLD_MODE_NO_PROGRESS_INFO))
protocol->store(thd_info->progress, 3, &store_buffer);
@ -8273,8 +8277,7 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
item->maybe_null= (fields_info->field_flags & MY_I_S_MAYBE_NULL);
field_count++;
}
TMP_TABLE_PARAM *tmp_table_param =
(TMP_TABLE_PARAM*) (thd->alloc(sizeof(TMP_TABLE_PARAM)));
TMP_TABLE_PARAM *tmp_table_param = new (thd->mem_root) TMP_TABLE_PARAM;
tmp_table_param->init();
tmp_table_param->table_charset= cs;
tmp_table_param->field_count= field_count;
@ -8853,6 +8856,7 @@ bool get_schema_tables_result(JOIN *join,
cond= tab->cache_select->cond;
}
Switch_to_definer_security_ctx backup_ctx(thd, table_list);
if (table_list->schema_table->fill_table(thd, table_list, cond))
{
result= 1;

View file

@ -254,10 +254,8 @@ index_stat_def= {INDEX_STAT_N_FIELDS, index_stat_fields, 4, index_stat_pk_col};
Open all statistical tables and lock them
*/
static
inline int open_stat_tables(THD *thd, TABLE_LIST *tables,
Open_tables_backup *backup,
bool for_write)
static int open_stat_tables(THD *thd, TABLE_LIST *tables,
Open_tables_backup *backup, bool for_write)
{
int rc;
@ -265,12 +263,14 @@ inline int open_stat_tables(THD *thd, TABLE_LIST *tables,
thd->push_internal_handler(&deh);
init_table_list_for_stat_tables(tables, for_write);
init_mdl_requests(tables);
thd->in_sub_stmt|= SUB_STMT_STAT_TABLES;
rc= open_system_tables_for_read(thd, tables, backup);
thd->in_sub_stmt&= ~SUB_STMT_STAT_TABLES;
thd->pop_internal_handler();
/* If the number of tables changes, we should revise the check below. */
DBUG_ASSERT(STATISTICS_TABLES == 3);
compile_time_assert(STATISTICS_TABLES == 3);
if (!rc &&
(stat_table_intact.check(tables[TABLE_STAT].table, &table_stat_def) ||
@ -3270,10 +3270,7 @@ int read_statistics_for_tables(THD *thd, TABLE_LIST *tables)
DBUG_RETURN(0);
if (open_stat_tables(thd, stat_tables, &open_tables_backup, FALSE))
{
thd->clear_error();
DBUG_RETURN(1);
}
for (TABLE_LIST *tl= tables; tl; tl= tl->next_global)
{

View file

@ -110,8 +110,8 @@ enum wsrep_conflict_state wsrep_thd_get_conflict_state(THD *)
my_bool wsrep_thd_is_wsrep(THD *)
{ return 0; }
char *wsrep_thd_query(THD *)
{ return 0; }
const char *wsrep_thd_query(THD *)
{ return "NULL"; }
enum wsrep_query_state wsrep_thd_query_state(THD *)
{ return QUERY_IDLE; }

View file

@ -1596,25 +1596,6 @@ static bool wsrep_can_run_in_toi(THD *thd, const char *db, const char *table,
}
}
static const char* wsrep_get_query_or_msg(const THD* thd)
{
switch(thd->lex->sql_command)
{
case SQLCOM_CREATE_USER:
return "CREATE USER";
case SQLCOM_GRANT:
return "GRANT";
case SQLCOM_REVOKE:
return "REVOKE";
case SQLCOM_SET_OPTION:
if (thd->lex->definer)
return "SET PASSWORD";
/* fallthrough */
default:
return thd->query();
}
}
/*
returns:
0: statement was replicated as TOI
@ -1638,7 +1619,7 @@ static int wsrep_TOI_begin(THD *thd, const char *db_, const char *table_,
}
WSREP_DEBUG("TO BEGIN: %lld, %d : %s", (long long)wsrep_thd_trx_seqno(thd),
thd->wsrep_exec_mode, wsrep_get_query_or_msg(thd));
thd->wsrep_exec_mode, wsrep_thd_query(thd));
switch (thd->lex->sql_command)
{
@ -1718,13 +1699,13 @@ static void wsrep_TOI_end(THD *thd) {
wsrep_to_isolation--;
WSREP_DEBUG("TO END: %lld, %d: %s", (long long)wsrep_thd_trx_seqno(thd),
thd->wsrep_exec_mode, wsrep_get_query_or_msg(thd));
thd->wsrep_exec_mode, wsrep_thd_query(thd));
wsrep_set_SE_checkpoint(thd->wsrep_trx_meta.gtid.uuid,
thd->wsrep_trx_meta.gtid.seqno);
WSREP_DEBUG("TO END: %lld, update seqno",
(long long)wsrep_thd_trx_seqno(thd));
if (WSREP_OK == (ret = wsrep->to_execute_end(wsrep, thd->thread_id))) {
WSREP_DEBUG("TO END: %lld", (long long)wsrep_thd_trx_seqno(thd));
}
@ -2663,9 +2644,28 @@ extern "C" query_id_t wsrep_thd_query_id(THD *thd)
}
char *wsrep_thd_query(THD *thd)
const char *wsrep_thd_query(THD *thd)
{
return (thd) ? thd->query() : NULL;
if (thd)
{
switch(thd->lex->sql_command)
{
case SQLCOM_CREATE_USER:
return "CREATE USER";
case SQLCOM_GRANT:
return "GRANT";
case SQLCOM_REVOKE:
return "REVOKE";
case SQLCOM_SET_OPTION:
if (thd->lex->definer)
return "SET PASSWORD";
/* fallthrough */
default:
if (thd->query())
return thd->query();
}
}
return "NULL";
}

View file

@ -324,7 +324,12 @@ IF(CONNECT_WITH_REST)
# INCLUDE_DIRECTORIES(${CPPRESTSDK_INCLUDE_DIR})
# If needed edit next line to set the path to libcpprest.so
SET(REST_LIBRARY -lcpprest)
# MESSAGE (STATUS ${REST_LIBRARY})
MESSAGE (STATUS ${REST_LIBRARY})
ELSE(NOT UNIX)
# Next line sets debug compile mode matching cpprest_2_10d.dll
# when it was binary installed (can be change later in Visual Studio)
# Comment it out if not needed depending on your cpprestsdk installation.
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
ENDIF(UNIX)
IF(REST_LIBRARY)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp restget.cpp tabrest.h)

View file

@ -16,7 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
/***********************************************************************/
/* Author Olivier BERTRAND bertrandop@gmail.com 2004-2017 */
/* Author Olivier BERTRAND bertrandop@gmail.com 2004-2019 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@ -389,6 +389,9 @@ RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool reset, bool mrr)
try {
for (colp = tdbp->GetColumns(); rc == RC_OK && colp;
colp = colp->GetNext()) {
xtrc(2, "Going to read column %s of table %s\n",
colp->GetName(), tdbp->GetName());
if (reset)
colp->Reset();

View file

@ -4501,34 +4501,13 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, const char *dbn, bool
case TAB_DIR:
case TAB_ZIP:
case TAB_OEM:
#ifdef NO_EMBEDDED_ACCESS_CHECKS
return false;
#endif
/*
Check FILE_ACL
If table or table->mdl_ticket is NULL - it's a DLL, e.g. CREATE TABLE.
if the table has an MDL_EXCLUSIVE lock - it's a DDL too, e.g. the
insert step of CREATE ... SELECT.
Otherwise it's a DML, the table was normally opened, locked,
privilege were already checked, and table->grant.privilege is set.
With SQL SECURITY DEFINER, table->grant.privilege has definer's privileges.
Unless we're in prelocking mode, in this case table->grant.privilege
is only checked in start_stmt(), not in external_lock().
*/
if (!table || !table->mdl_ticket || table->mdl_ticket->get_type() == MDL_EXCLUSIVE)
return check_access(thd, FILE_ACL, db, NULL, NULL, 0, 0);
if ((!quick && thd->lex->requires_prelocking()) || table->grant.privilege & FILE_ACL)
return false;
status_var_increment(thd->status_var.access_denied_errors);
my_error(access_denied_error_code(thd->password), MYF(0),
thd->security_ctx->priv_user, thd->security_ctx->priv_host,
(thd->password ? ER(ER_YES) : ER(ER_NO)));
return true;
if (table && table->pos_in_table_list) // if SELECT
{
Switch_to_definer_security_ctx backup_ctx(thd, table->pos_in_table_list);
return check_global_access(thd, FILE_ACL);
}
else
return check_global_access(thd, FILE_ACL);
case TAB_ODBC:
case TAB_JDBC:
case TAB_MONGO:

View file

@ -194,7 +194,7 @@ static void PROFILE_Save( FILE *file, PROFILESECTION *section )
}
for (key = section->key; key; key = key->next)
if (key->name[0]) {
if (key->name && key->name[0]) {
fprintf(file, "%s", SVP(key->name));
if (key->value)

View file

@ -1196,9 +1196,14 @@ int JDBConn::GetResultSize(PCSZ sql, PCOL colp)
if ((rc = ExecuteQuery(sql)) != RC_OK)
return -1;
if ((rc = Fetch()) > 0)
SetColumnValue(1, NULL, colp->GetValue());
else
if ((rc = Fetch()) > 0) {
try {
SetColumnValue(1, NULL, colp->GetValue());
} catch (...) {
return -4;
} // end catch
} else
return -2;
if ((rc = Fetch()) != 0)

View file

@ -15,7 +15,7 @@ fname VARCHAR(256) NOT NULL,
ftype CHAR(4) NOT NULL,
size DOUBLE(12,0) NOT NULL flag=5
) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*.*';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -34,19 +34,19 @@ SELECT user();
user()
user@localhost
SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO t1 VALUES ();
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1 WHERE path='xxx';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET path='yyy' WHERE path='xxx';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@ -58,13 +58,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (1,1,1,1);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET path=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
disconnect user;
connection default;
SELECT user();
@ -111,7 +111,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=BIN FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -123,23 +123,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@ -151,13 +151,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -173,7 +173,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;
@ -216,7 +216,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -228,23 +228,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@ -256,13 +256,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -278,7 +278,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;
@ -321,7 +321,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -333,23 +333,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@ -361,13 +361,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -383,7 +383,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;
@ -426,7 +426,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -438,23 +438,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@ -466,13 +466,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -488,7 +488,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;
@ -531,7 +531,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=VEC MAX_ROWS=100 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -543,23 +543,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@ -571,13 +571,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -593,7 +593,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;

View file

@ -21,12 +21,12 @@ SELECT * FROM v1_definer;
a
10
SELECT * FROM v1_baddefiner;
ERROR 28000: Access denied for user 'root'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connect user,localhost,user,,;
SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM v1_invoker;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM v1_definer;
a
10
@ -44,9 +44,9 @@ UPDATE v1_invoker SET a=12;
UPDATE v1_definer SET a=13;
connection user;
UPDATE t1 SET a=21;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker SET a=22;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_definer SET a=23;
connection default;
DROP VIEW v1_invoker, v1_definer;
@ -62,9 +62,9 @@ INSERT INTO v1_invoker VALUES (12);
INSERT INTO v1_definer VALUES (13);
connection user;
INSERT INTO t1 VALUES (21);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_invoker VALUES (22);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_definer VALUES (23);
connection default;
DROP VIEW v1_invoker, v1_definer;
@ -83,9 +83,9 @@ REPLACE INTO v1_definer VALUES (13);
ERROR 42000: CONNECT Unsupported command
connection user;
REPLACE INTO t1 VALUES (21);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO v1_invoker VALUES (22);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO v1_definer VALUES (23);
ERROR 42000: CONNECT Unsupported command
connection default;
@ -102,9 +102,9 @@ DELETE FROM v1_invoker WHERE a=12;
DELETE FROM v1_definer WHERE a=13;
connection user;
DELETE FROM t1 WHERE a=21;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1_invoker WHERE a=22;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1_definer WHERE a=23;
connection default;
DROP VIEW v1_invoker, v1_definer;
@ -120,9 +120,9 @@ LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_invoker;
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_definer;
connection user;
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_invoker;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_definer;
connection default;
DROP VIEW v1_invoker, v1_definer;
@ -135,7 +135,7 @@ TRUNCATE TABLE t1;
INSERT INTO t1 VALUES (11);
connection user;
TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_DROP_TABLE
@ -144,7 +144,7 @@ CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
connection user;
DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_DROP_VIEW
@ -165,7 +165,7 @@ DROP TABLE t1;
# Testing SQLCOM_CREATE_TABLE
connection user;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
# Testing SQLCOM_LOCK_TABLES
connection default;
@ -187,13 +187,13 @@ LOCK TABLE v1_definer WRITE;
UNLOCK TABLES;
connection user;
LOCK TABLE t1 READ;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
LOCK TABLE t1 WRITE;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
LOCK TABLE v1_invoker READ;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
LOCK TABLE v1_invoker WRITE;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
LOCK TABLE v1_definer READ;
UNLOCK TABLES;
LOCK TABLE v1_definer WRITE;
@ -264,93 +264,93 @@ UPDATE v2_definer a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
connection user;
UPDATE t1 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t2 a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t3 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t3 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t3 a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE t3 a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t3 a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE t3 a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t3 a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v1_invoker a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_invoker a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_definer a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_definer a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_definer a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v1_definer a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_definer a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v1_definer a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_invoker a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_invoker a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_invoker a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_invoker a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_invoker a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_invoker a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_invoker a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_definer a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_definer a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_definer a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_definer a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v2_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
connection default;
DROP VIEW v1_invoker, v1_definer, v2_invoker, v2_definer;
@ -418,93 +418,93 @@ DELETE a1 FROM v2_definer a1,v2_invoker a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v2_definer a2 WHERE a1.a=a2.a;
connection user;
DELETE a1 FROM t1 a1,t1 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t1 a1,t2 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t1 a1,t3 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t1 a1,v1_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t1 a1,v1_definer a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t1 a1,v2_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t1 a1,v2_definer a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,t1 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,t2 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,t3 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,v1_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,v1_definer a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,v2_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t2 a1,v2_definer a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t3 a1,t1 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t3 a1,t2 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t3 a1,t3 a2 WHERE a1.a=a2.a;
DELETE a1 FROM t3 a1,v1_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t3 a1,v1_definer a2 WHERE a1.a=a2.a;
DELETE a1 FROM t3 a1,v2_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM t3 a1,v2_definer a2 WHERE a1.a=a2.a;
DELETE a1 FROM v1_invoker a1,t1 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_invoker a1,t2 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_invoker a1,t3 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_invoker a1,v1_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_invoker a1,v1_definer a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_invoker a1,v2_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_invoker a1,v2_definer a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_definer a1,t1 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_definer a1,t2 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_definer a1,t3 a2 WHERE a1.a=a2.a;
DELETE a1 FROM v1_definer a1,v1_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_definer a1,v1_definer a2 WHERE a1.a=a2.a;
DELETE a1 FROM v1_definer a1,v2_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v1_definer a1,v2_definer a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_invoker a1,t1 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_invoker a1,t2 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_invoker a1,t3 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_invoker a1,v1_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_invoker a1,v1_definer a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_invoker a1,v2_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_invoker a1,v2_definer a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_definer a1,t1 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_definer a1,t2 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_definer a1,t3 a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v1_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_definer a1,v1_definer a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v2_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE a1 FROM v2_definer a1,v2_definer a2 WHERE a1.a=a2.a;
connection default;
DROP VIEW v1_invoker, v1_definer, v2_invoker, v2_definer;
@ -521,9 +521,9 @@ CREATE VIEW v2 AS SELECT * FROM v1_definer;
DROP VIEW v2;
connection user;
CREATE VIEW v2 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v2 AS SELECT * FROM v1_invoker;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v2 AS SELECT * FROM v1_definer;
DROP VIEW v2;
connection default;
@ -546,21 +546,21 @@ INSERT INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
INSERT INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
connection user;
INSERT INTO t1 SELECT * FROM t1 WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO t1 SELECT * FROM v1_invoker WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO t1 SELECT * FROM v1_definer WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_invoker SELECT * FROM t1 WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_invoker SELECT * FROM v1_invoker WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_invoker SELECT * FROM v1_definer WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_definer SELECT * FROM t1 WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
connection default;
DROP VIEW v1_invoker, v1_definer;
@ -591,17 +591,17 @@ REPLACE INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
ERROR 42000: CONNECT Unsupported command
connection user;
REPLACE INTO t1 SELECT * FROM t1 WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO t1 SELECT * FROM v1_invoker WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO t1 SELECT * FROM v1_definer WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO v1_invoker SELECT * FROM t1 WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO v1_invoker SELECT * FROM v1_invoker WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO v1_invoker SELECT * FROM v1_definer WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
REPLACE INTO v1_definer SELECT * FROM t1 WHERE a=20;
ERROR 42000: CONNECT Unsupported command
REPLACE INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
@ -624,7 +624,7 @@ t2 CREATE TABLE `t2` (
RENAME TABLE t2 TO t1;
connection user;
RENAME TABLE t1 TO t2;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (for ALTER..RENAME)
@ -640,7 +640,7 @@ t2 CREATE TABLE `t2` (
ALTER TABLE t2 RENAME TO t1;
connection user;
ALTER TABLE t1 RENAME TO t2;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (changing ENGINE to non-CONNECT)
@ -653,7 +653,7 @@ CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
connection user;
ALTER TABLE t1 ENGINE=MyISAM;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (changing ENGINE to CONNECT)
@ -669,7 +669,7 @@ CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (10);
connection user;
ALTER TABLE t1 ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_OPTIMIZE
@ -682,7 +682,7 @@ test.t1 optimize status OK
connection user;
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize Error Access denied for user 'user'@'localhost' (using password: NO)
test.t1 optimize Error Access denied; you need (at least one of) the FILE privilege(s) for this operation
test.t1 optimize Error Got error 122 'This operation requires the FILE privilege' from CONNECT
test.t1 optimize error Corrupt
connection default;
@ -696,7 +696,7 @@ Warnings:
Warning 1105 This is an outward table, table data were not modified.
connection user;
ALTER TABLE t1 ADD c INT;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (removing columns)
@ -708,7 +708,7 @@ Warnings:
Warning 1105 This is an outward table, table data were not modified.
connection user;
ALTER TABLE t1 DROP c;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (adding keys)
@ -718,7 +718,7 @@ INSERT INTO t1 VALUES (10,10);
ALTER TABLE t1 ADD KEY(a);
connection user;
ALTER TABLE t1 ADD KEY(b);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (removing keys)
@ -728,7 +728,7 @@ INSERT INTO t1 VALUES (10,10);
ALTER TABLE t1 DROP KEY a;
connection user;
ALTER TABLE t1 DROP KEY b;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing SQLCOM_CREATE_INDEX and SQLCOM_DROP_INDEX
@ -740,9 +740,9 @@ DROP INDEX a ON t1;
CREATE INDEX a ON t1 (a);
connection user;
CREATE INDEX b ON t1 (b);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP INDEX a ON t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
# Testing stored procedures
@ -757,10 +757,10 @@ DROP TABLE t1;
CALL p_invoker();
DROP TABLE t1;
CALL p_baddefiner();
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection user;
CALL p_invoker();
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CALL p_definer();
connection default;
DROP TABLE t1;

View file

@ -34,7 +34,7 @@ sec val
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -46,21 +46,21 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES ('sec2','val2');
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET val='val11';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@ -72,13 +72,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES ('sec3','val3');
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET val='val11';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
disconnect user;
connection default;
DROP VIEW v1;

View file

@ -11,7 +11,7 @@ SELECT user();
user()
user@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL OPTION_LIST='host=localhost,user=root1,port=PORT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -29,19 +29,19 @@ SELECT user();
user()
user@localhost
SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO t1 VALUES ('xxx');
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1 WHERE a='xxx';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a='yyy' WHERE a='xxx';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@ -53,13 +53,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
disconnect user;
connection default;
SELECT user();

View file

@ -35,7 +35,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2,rownode=row' FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -47,23 +47,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@ -75,13 +75,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -97,7 +97,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;

View file

@ -33,7 +33,7 @@ a
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=domdoc,rownode=row' FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -45,23 +45,23 @@ SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES (10);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
@ -73,13 +73,13 @@ SELECT user();
user()
user@localhost
SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
SELECT user();
user()
@ -95,7 +95,7 @@ SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
connection default;
DROP TABLE t1;
disconnect user;

View file

@ -25,7 +25,7 @@ DROP TABLE t1;
# Making sure DROP erased the data file
--error 1
--remove_file $MYSQLD_DATADIR/test/t1.$FILE_EXT
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT $TABLE_OPTIONS FILE_NAME='t1.EXT'
--connection default
SELECT user();
@ -33,23 +33,23 @@ SELECT user();
INSERT INTO t1 VALUES (10);
--connection user
SELECT user();
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES (10);
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 FILE_NAME='t2.EXT';
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DROP TABLE t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE
--connection default
@ -57,13 +57,13 @@ SELECT user();
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
--connection user
SELECT user();
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES (2);
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1 SET a=123;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1;
--connection default
SELECT user();
@ -74,7 +74,7 @@ DROP TABLE t1;
INSERT INTO t1 VALUES (10);
--connection user
SELECT user();
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 FILE_NAME='t1.EXT';
--connection default
DROP TABLE t1;

View file

@ -11,7 +11,7 @@ REVOKE FILE ON *.* FROM user@localhost;
--connect(user,localhost,user,,)
--connection user
SELECT user();
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE TABLE t1 (
path VARCHAR(256) NOT NULL flag=1,
fname VARCHAR(256) NOT NULL,
@ -32,19 +32,19 @@ SELECT fname, ftype, size FROM t1 WHERE size>0 AND ftype!='.opt';
--connection user
SELECT user();
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES ();
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1 WHERE path='xxx';
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET path='yyy' WHERE path='xxx';
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE
@ -53,13 +53,13 @@ SELECT user();
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
--connection user
SELECT user();
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES (1,1,1,1);
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1 SET path=123;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1;
--disconnect user

View file

@ -23,13 +23,13 @@ CREATE DEFINER=user@localhost SQL SECURITY DEFINER VIEW v1_baddefiner AS SELECT
SELECT * FROM t1;
SELECT * FROM v1_invoker;
SELECT * FROM v1_definer;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1_baddefiner;
--connect(user,localhost,user,,)
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1_invoker;
SELECT * FROM v1_definer;
--connection default
@ -47,9 +47,9 @@ UPDATE t1 SET a=11;
UPDATE v1_invoker SET a=12;
UPDATE v1_definer SET a=13;
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET a=21;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker SET a=22;
UPDATE v1_definer SET a=23;
--connection default
@ -67,9 +67,9 @@ INSERT INTO t1 VALUES (11);
INSERT INTO v1_invoker VALUES (12);
INSERT INTO v1_definer VALUES (13);
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES (21);
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1_invoker VALUES (22);
INSERT INTO v1_definer VALUES (23);
--connection default
@ -79,7 +79,7 @@ DROP TABLE t1;
--echo # Testing SQLCOM_REPLACE
# REPLACE is not supported by ConnectSE, so we're testing the difference
# between ER_ACCESS_DENIED_ERROR vs ER_NOT_ALLOWED_COMMAND
# between ER_SPECIFIC_ACCESS_DENIED_ERROR vs ER_NOT_ALLOWED_COMMAND
--connection default
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
@ -92,9 +92,9 @@ REPLACE INTO v1_invoker VALUES (12);
--error ER_NOT_ALLOWED_COMMAND
REPLACE INTO v1_definer VALUES (13);
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO t1 VALUES (21);
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO v1_invoker VALUES (22);
--error ER_NOT_ALLOWED_COMMAND
REPLACE INTO v1_definer VALUES (23);
@ -113,9 +113,9 @@ DELETE FROM t1 WHERE a=11;
DELETE FROM v1_invoker WHERE a=12;
DELETE FROM v1_definer WHERE a=13;
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1 WHERE a=21;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1_invoker WHERE a=22;
DELETE FROM v1_definer WHERE a=23;
--connection default
@ -137,10 +137,10 @@ CREATE SQL SECURITY DEFINER VIEW v1_definer AS SELECT * FROM t1;
--eval LOAD DATA LOCAL INFILE '$MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_definer
--connection user
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
--eval LOAD DATA LOCAL INFILE '$MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE t1
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
--eval LOAD DATA LOCAL INFILE '$MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_invoker
--replace_result $MTR_SUITE_DIR MTR_SUITE_DIR
--eval LOAD DATA LOCAL INFILE '$MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_definer
@ -156,7 +156,7 @@ INSERT INTO t1 VALUES (10);
TRUNCATE TABLE t1;
INSERT INTO t1 VALUES (11);
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1;
--connection default
DROP TABLE t1;
@ -168,7 +168,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DROP TABLE t1;
--connection default
DROP TABLE t1;
@ -193,7 +193,7 @@ DROP TABLE t1;
--echo # Testing SQLCOM_CREATE_TABLE
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
--connection default
@ -216,13 +216,13 @@ UNLOCK TABLES;
LOCK TABLE v1_definer WRITE;
UNLOCK TABLES;
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
LOCK TABLE t1 READ;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
LOCK TABLE t1 WRITE;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
LOCK TABLE v1_invoker READ;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
LOCK TABLE v1_invoker WRITE;
LOCK TABLE v1_definer READ;
UNLOCK TABLES;
@ -299,108 +299,108 @@ UPDATE v2_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
--connection user
# All queries with t1 should fail
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
# All queries with t2 should fail
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t2 a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
# t3 does not need FILE_ALC
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t3 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t3 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
# This is OK:
UPDATE t3 a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t3 a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
# This is OK:
UPDATE t3 a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t3 a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
# This is OK:
UPDATE t3 a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
# All queries with v1_invoker should fail
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_invoker a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
# v1_definer does not need FILE_ACL from the invoker
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_definer a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_definer a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v1_definer a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_definer a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v1_definer a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1_definer a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v1_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
# All queries with v2_invoker should fail
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_invoker a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
# v2_definer does not need FILE_ACL from the invoker
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_definer a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_definer a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,t3 a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_definer a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v2_definer a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
@ -476,108 +476,108 @@ DELETE a1 FROM v2_definer a1,v2_definer a2 WHERE a1.a=a2.a;
--connection user
# All queries with t1 should fail
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,t1 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,t2 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,t3 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,v1_invoker a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,v1_definer a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,v2_invoker a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t1 a1,v2_definer a2 WHERE a1.a=a2.a;
# All queries with t2 should fail
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,t1 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,t2 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,t3 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,v1_invoker a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,v1_definer a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,v2_invoker a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t2 a1,v2_definer a2 WHERE a1.a=a2.a;
# t3 does not need FILE_ALC
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t3 a1,t1 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t3 a1,t2 a2 WHERE a1.a=a2.a;
# This is OK:
DELETE a1 FROM t3 a1,t3 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t3 a1,v1_invoker a2 WHERE a1.a=a2.a;
# This is OK:
DELETE a1 FROM t3 a1,v1_definer a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM t3 a1,v2_invoker a2 WHERE a1.a=a2.a;
# This is OK:
DELETE a1 FROM t3 a1,v2_definer a2 WHERE a1.a=a2.a;
# All queries with v1_invoker should fail
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,t1 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,t2 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,t3 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,v1_invoker a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,v1_definer a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,v2_invoker a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_invoker a1,v2_definer a2 WHERE a1.a=a2.a;
# v1_definer does not need FILE_ACL from the invoker
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_definer a1,t1 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_definer a1,t2 a2 WHERE a1.a=a2.a;
DELETE a1 FROM v1_definer a1,t3 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_definer a1,v1_invoker a2 WHERE a1.a=a2.a;
DELETE a1 FROM v1_definer a1,v1_definer a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v1_definer a1,v2_invoker a2 WHERE a1.a=a2.a;
DELETE a1 FROM v1_definer a1,v2_definer a2 WHERE a1.a=a2.a;
# All queries with v2_invoker should fail
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,t1 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,t2 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,t3 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,v1_invoker a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,v1_definer a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,v2_invoker a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_invoker a1,v2_definer a2 WHERE a1.a=a2.a;
# v2_definer does not need FILE_ACL from the invoker
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_definer a1,t1 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_definer a1,t2 a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,t3 a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_definer a1,v1_invoker a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v1_definer a2 WHERE a1.a=a2.a;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE a1 FROM v2_definer a1,v2_invoker a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v2_definer a2 WHERE a1.a=a2.a;
@ -598,9 +598,9 @@ DROP VIEW v2;
CREATE VIEW v2 AS SELECT * FROM v1_definer;
DROP VIEW v2;
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v2 AS SELECT * FROM t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v2 AS SELECT * FROM v1_invoker;
CREATE VIEW v2 AS SELECT * FROM v1_definer;
DROP VIEW v2;
@ -625,21 +625,21 @@ INSERT INTO v1_definer SELECT * FROM t1 WHERE a=20;
INSERT INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
INSERT INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 SELECT * FROM t1 WHERE a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 SELECT * FROM v1_invoker WHERE a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 SELECT * FROM v1_definer WHERE a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1_invoker SELECT * FROM t1 WHERE a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1_invoker SELECT * FROM v1_invoker WHERE a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1_invoker SELECT * FROM v1_definer WHERE a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1_definer SELECT * FROM t1 WHERE a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
# This is OK:
INSERT INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
@ -650,7 +650,7 @@ DROP TABLE t1;
--echo # Testing SQLCOM_REPLACE_SELECT
# REPLACE is not supported by CONNECT
# so we're testing ER_NOT_ALLOWED_COMMAND vs ER_ACCESS_DENIED_ERROR here
# so we're testing ER_NOT_ALLOWED_COMMAND vs ER_SPECIFIC_ACCESS_DENIED_ERROR here
--connection default
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
@ -676,17 +676,17 @@ REPLACE INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
REPLACE INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO t1 SELECT * FROM t1 WHERE a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO t1 SELECT * FROM v1_invoker WHERE a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO t1 SELECT * FROM v1_definer WHERE a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO v1_invoker SELECT * FROM t1 WHERE a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO v1_invoker SELECT * FROM v1_invoker WHERE a=20;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
REPLACE INTO v1_invoker SELECT * FROM v1_definer WHERE a=20;
--error ER_NOT_ALLOWED_COMMAND
REPLACE INTO v1_definer SELECT * FROM t1 WHERE a=20;
@ -708,7 +708,7 @@ SHOW CREATE TABLE t2;
RENAME TABLE t2 TO t1;
--connection user
# TODO: Perhaps FILE_ACL is needed for RENAME. Discuss with Oliver.
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
RENAME TABLE t1 TO t2;
--connection default
DROP TABLE t1;
@ -723,7 +723,7 @@ SHOW CREATE TABLE t2;
ALTER TABLE t2 RENAME TO t1;
--connection user
# TODO: Perhaps FILE_ACL is not needed for ALTER..RENAME. Discuss with Olivier.
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 RENAME TO t2;
--connection default
DROP TABLE t1;
@ -739,7 +739,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 ENGINE=MyISAM;
--connection default
DROP TABLE t1;
@ -756,7 +756,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (10);
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
--connection default
DROP TABLE t1;
@ -779,7 +779,7 @@ CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
ALTER TABLE t1 ADD b INT;
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 ADD c INT;
--connection default
DROP TABLE t1;
@ -791,7 +791,7 @@ CREATE TABLE t1 (a INT,b INT,c INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.
INSERT INTO t1 VALUES (10,10,10);
ALTER TABLE t1 DROP b;
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 DROP c;
--connection default
DROP TABLE t1;
@ -803,7 +803,7 @@ CREATE TABLE t1 (a INT NOT NULL,b INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=fix FI
INSERT INTO t1 VALUES (10,10);
ALTER TABLE t1 ADD KEY(a);
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 ADD KEY(b);
--connection default
DROP TABLE t1;
@ -816,7 +816,7 @@ CREATE TABLE t1 (a INT NOT NULL,b INT NOT NULL, KEY a(a), KEY b(b)) ENGINE=CONNE
INSERT INTO t1 VALUES (10,10);
ALTER TABLE t1 DROP KEY a;
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 DROP KEY b;
--connection default
DROP TABLE t1;
@ -831,9 +831,9 @@ CREATE INDEX a ON t1 (a);
DROP INDEX a ON t1;
CREATE INDEX a ON t1 (a);
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE INDEX b ON t1 (b);
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DROP INDEX a ON t1;
--connection default
DROP TABLE t1;
@ -852,11 +852,11 @@ CALL p_definer();
DROP TABLE t1;
CALL p_invoker();
DROP TABLE t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CALL p_baddefiner();
--connection user
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CALL p_invoker();
CALL p_definer();

View file

@ -29,7 +29,7 @@ DROP TABLE t1;
# Making sure DROP erased the data file
--error 1
--remove_file $MYSQLD_DATADIR/test/t1.ini
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
--connection default
SELECT user();
@ -37,21 +37,21 @@ CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CON
INSERT INTO t1 VALUES ('sec1','val1');
--connection user
SELECT user();
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES ('sec2','val2');
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET val='val11';
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DROP TABLE t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE
--connection default
@ -59,13 +59,13 @@ SELECT user();
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
--connection user
SELECT user();
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES ('sec3','val3');
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1 SET val='val11';
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1;
--disconnect user
--connection default

View file

@ -27,7 +27,7 @@ set sql_mode=default;
--connection user
SELECT user();
--replace_result $PORT PORT
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL OPTION_LIST='host=localhost,user=root1,port=$PORT'
--connection default
SELECT user();
@ -38,19 +38,19 @@ INSERT INTO t1remote VALUES (10),(20),(30);
SELECT * FROM t1;
--connection user
SELECT user();
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES ('xxx');
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1 WHERE a='xxx';
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET a='yyy' WHERE a='xxx';
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE
@ -59,13 +59,13 @@ SELECT user();
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
--connection user
SELECT user();
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES (2);
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1 SET a=123;
--error ER_ACCESS_DENIED_ERROR
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1;
--disconnect user

View file

@ -1,33 +0,0 @@
/***********************************************************************/
/* Definitions needed by the included files. */
/***********************************************************************/
#if !defined(MY_GLOBAL_H)
#define MY_GLOBAL_H
typedef unsigned int uint;
typedef unsigned int uint32;
typedef unsigned short ushort;
typedef unsigned long ulong;
typedef unsigned long DWORD;
typedef char *LPSTR;
typedef const char *LPCSTR;
typedef int BOOL;
#if defined(_WINDOWS)
typedef void *HANDLE;
#else
typedef int HANDLE;
#endif
typedef char *PSZ;
typedef const char *PCSZ;
typedef unsigned char BYTE;
typedef unsigned char uchar;
typedef long long longlong;
typedef unsigned long long ulonglong;
typedef char my_bool;
struct charset_info_st {};
typedef const charset_info_st CHARSET_INFO;
#define FALSE 0
#define TRUE 1
#define Item char
#define MY_MAX(a,b) ((a>b)?(a):(b))
#define MY_MIN(a,b) ((a<b)?(a):(b))
#endif // MY_GLOBAL_H

View file

@ -605,8 +605,10 @@ bool TDBODBC::OpenDB(PGLOBAL g)
Cnp->InitValue(g);
if ((n = Ocp->GetResultSize(Query->GetStr(), Cnp)) < 0) {
strcpy(g->Message, "Cannot get result size");
return true;
char* msg = PlugDup(g, g->Message);
sprintf(g->Message, "Get result size: %s (rc=%d)", msg, n);
return true;
} else if (n) {
Ocp->m_Rows = n;

View file

@ -206,6 +206,7 @@ void VALBLK::ChkIndx(int n)
{
if (n < 0 || n >= Nval) {
PGLOBAL& g = Global;
xtrc(1, "ChkIndx: n=%d Nval=%d\n", n, Nval);
strcpy(g->Message, MSG(BAD_VALBLK_INDX));
throw Type;
} // endif n
@ -216,7 +217,8 @@ void VALBLK::ChkTyp(PVAL v)
{
if (Check && (Type != v->GetType() || Unsigned != v->IsUnsigned())) {
PGLOBAL& g = Global;
strcpy(g->Message, MSG(VALTYPE_NOMATCH));
xtrc(1, "ChkTyp: Type=%d valType=%d\n", Type, v->GetType());
strcpy(g->Message, MSG(VALTYPE_NOMATCH));
throw Type;
} // endif Type

File diff suppressed because it is too large Load diff

View file

@ -430,6 +430,10 @@ int ha_heap::reset_auto_increment(ulonglong value)
int ha_heap::external_lock(THD *thd, int lock_type)
{
#ifndef DBUG_OFF
if (lock_type == F_UNLCK && file->s->changed && heap_check_heap(file, 0))
return HA_ERR_CRASHED;
#endif
return 0; // No external locking
}

View file

@ -35,12 +35,6 @@ int hp_close(register HP_INFO *info)
{
int error=0;
DBUG_ENTER("hp_close");
#ifndef DBUG_OFF
if (info->s->changed && heap_check_heap(info,0))
{
error=my_errno=HA_ERR_CRASHED;
}
#endif
info->s->changed=0;
if (info->open_list.data)
heap_open_list=list_delete(heap_open_list,&info->open_list);

View file

@ -0,0 +1,11 @@
UseTab: Always
TabWidth: 8
IndentWidth: 8
ContinuationIndentWidth: 8
BreakBeforeBinaryOperators: All
PointerAlignment: Left
BreakBeforeBraces: Custom
ColumnLimit: 79
BraceWrapping:
AfterFunction: true
AccessModifierOffset: -8

View file

@ -43,8 +43,7 @@ Created 4/24/1996 Heikki Tuuri
#include "rem0cmp.h"
#include "srv0start.h"
#include "srv0srv.h"
#include <stack>
#include <set>
#include "fts0opt.h"
/** Following are the InnoDB system tables. The positions in
this array are referenced by enum dict_system_table_id. */
@ -3088,8 +3087,12 @@ func_exit:
FTS */
fts_optimize_remove_table(table);
fts_free(table);
} else {
} else if (fts_optimize_wq) {
fts_optimize_add_table(table);
} else {
/* fts_optimize_thread is not started yet.
So make the table as non-evictable from cache. */
dict_table_move_from_lru_to_non_lru(table);
}
}

View file

@ -2685,6 +2685,10 @@ retry:
}
if (read_only) {
/* InnoDB stores actual synced_doc_id value + 1 in
FTS_CONFIG table. Reduce the value by 1 while reading
after startup. */
if (*doc_id) *doc_id -= 1;
goto func_exit;
}
@ -5366,11 +5370,11 @@ fts_t::fts_t(
const dict_table_t* table,
mem_heap_t* heap)
:
in_queue(0), added_synced(0), dict_locked(0),
added_synced(0), dict_locked(0),
bg_threads(0),
add_wq(NULL),
cache(NULL),
doc_col(ULINT_UNDEFINED),
doc_col(ULINT_UNDEFINED), in_queue(false),
fts_heap(heap)
{
ut_a(table->fts == NULL);

View file

@ -35,9 +35,10 @@ Completed 2011/7/10 Sunny and Jimmy Yang
#include "srv0start.h"
#include "ut0list.h"
#include "zlib.h"
#include "fts0opt.h"
/** The FTS optimize thread's work queue. */
static ib_wqueue_t* fts_optimize_wq;
ib_wqueue_t* fts_optimize_wq;
/** The FTS vector to store fts_slot_t */
static ib_vector_t* fts_slots;
@ -168,8 +169,8 @@ struct fts_encode_t {
/** We use this information to determine when to start the optimize
cycle for a table. */
struct fts_slot_t {
/** table identifier, or 0 if the slot is empty */
table_id_t table_id;
/** table, or NULL if the slot is unused */
dict_table_t* table;
/** whether this slot is being processed */
bool running;
@ -2391,14 +2392,7 @@ fts_optimize_table_bk(
return(DB_SUCCESS);
}
dict_table_t* table = dict_table_open_on_id(
slot->table_id, FALSE, DICT_TABLE_OP_NORMAL);
if (!table) {
slot->last_run = now;
return DB_SUCCESS;
}
dict_table_t* table = slot->table;
dberr_t error;
if (fil_table_accessible(table)
@ -2418,8 +2412,6 @@ fts_optimize_table_bk(
error = DB_SUCCESS;
}
dict_table_close(table, FALSE, FALSE);
return(error);
}
/*********************************************************************//**
@ -2564,11 +2556,13 @@ void fts_optimize_add_table(dict_table_t* table)
msg = fts_optimize_create_msg(FTS_MSG_ADD_TABLE, table);
ib_wqueue_add(fts_optimize_wq, msg, msg->heap);
mutex_enter(&fts_optimize_wq->mutex);
ib_wqueue_add(fts_optimize_wq, msg, msg->heap, true);
mutex_enter(&table->fts->bg_threads_mutex);
table->fts->in_queue = true;
mutex_exit(&table->fts->bg_threads_mutex);
mutex_exit(&fts_optimize_wq->mutex);
}
/**********************************************************************//**
@ -2595,12 +2589,10 @@ fts_optimize_remove_table(
return;
}
fts_t* fts = table->fts;
mutex_enter(&fts->bg_threads_mutex);
bool is_in_optimize_queue = fts->in_queue;
mutex_exit(&fts->bg_threads_mutex);
mutex_enter(&fts_optimize_wq->mutex);
if (!is_in_optimize_queue) {
if (!table->fts->in_queue) {
mutex_exit(&fts_optimize_wq->mutex);
return;
}
@ -2616,15 +2608,17 @@ fts_optimize_remove_table(
remove->event = event;
msg->ptr = remove;
ib_wqueue_add(fts_optimize_wq, msg, msg->heap);
ib_wqueue_add(fts_optimize_wq, msg, msg->heap, true);
mutex_exit(&fts_optimize_wq->mutex);
os_event_wait(event);
os_event_destroy(event);
mutex_enter(&fts->bg_threads_mutex);
fts->in_queue = false;
mutex_exit(&fts->bg_threads_mutex);
ut_d(mutex_enter(&fts_optimize_wq->mutex));
ut_ad(!table->fts->in_queue);
ut_d(mutex_exit(&fts_optimize_wq->mutex));
}
/** Send sync fts cache for the table.
@ -2633,9 +2627,6 @@ void
fts_optimize_request_sync_table(
dict_table_t* table)
{
fts_msg_t* msg;
table_id_t* table_id;
/* if the optimize system not yet initialized, return */
if (!fts_optimize_wq) {
return;
@ -2648,39 +2639,36 @@ fts_optimize_request_sync_table(
return;
}
msg = fts_optimize_create_msg(FTS_MSG_SYNC_TABLE, NULL);
fts_msg_t* msg = fts_optimize_create_msg(FTS_MSG_SYNC_TABLE, table);
table_id = static_cast<table_id_t*>(
mem_heap_alloc(msg->heap, sizeof(table_id_t)));
*table_id = table->id;
msg->ptr = table_id;
mutex_enter(&fts_optimize_wq->mutex);
ib_wqueue_add(fts_optimize_wq, msg, msg->heap);
ib_wqueue_add(fts_optimize_wq, msg, msg->heap, true);
mutex_enter(&table->fts->bg_threads_mutex);
table->fts->in_queue = true;
mutex_exit(&table->fts->bg_threads_mutex);
mutex_exit(&fts_optimize_wq->mutex);
}
/** Add a table to fts_slots if it doesn't already exist. */
static bool fts_optimize_new_table(dict_table_t* table)
{
ut_ad(table);
ulint i;
fts_slot_t* slot;
fts_slot_t* empty = NULL;
const table_id_t table_id = table->id;
ut_ad(table_id);
/* Search for duplicates, also find a free slot if one exists. */
for (i = 0; i < ib_vector_size(fts_slots); ++i) {
slot = static_cast<fts_slot_t*>(ib_vector_get(fts_slots, i));
if (!slot->table_id) {
if (!slot->table) {
empty = slot;
} else if (slot->table_id == table_id) {
} else if (slot->table == table) {
/* Already exists in our optimize queue. */
return(FALSE);
return false;
}
}
@ -2689,36 +2677,35 @@ static bool fts_optimize_new_table(dict_table_t* table)
memset(slot, 0x0, sizeof(*slot));
slot->table_id = table->id;
slot->running = false;
return(TRUE);
slot->table = table;
return true;
}
/** Remove a table from fts_slots if it exists.
@param[in,out] table table to be removed from fts_slots */
static bool fts_optimize_del_table(const dict_table_t* table)
{
const table_id_t table_id = table->id;
ut_ad(table_id);
ut_ad(table);
for (ulint i = 0; i < ib_vector_size(fts_slots); ++i) {
fts_slot_t* slot;
slot = static_cast<fts_slot_t*>(ib_vector_get(fts_slots, i));
if (slot->table_id == table_id) {
if (slot->table == table) {
if (fts_enable_diag_print) {
ib::info() << "FTS Optimize Removing table "
<< table->name;
}
slot->table_id = 0;
return(TRUE);
mutex_enter(&fts_optimize_wq->mutex);
slot->table->fts->in_queue = false;
mutex_exit(&fts_optimize_wq->mutex);
slot->table = NULL;
return true;
}
}
return(FALSE);
return false;
}
/**********************************************************************//**
@ -2732,7 +2719,7 @@ static ulint fts_optimize_how_many()
for (ulint i = 0; i < ib_vector_size(fts_slots); ++i) {
const fts_slot_t* slot = static_cast<const fts_slot_t*>(
ib_vector_get_const(fts_slots, i));
if (slot->table_id == 0) {
if (!slot->table) {
continue;
}
@ -2768,22 +2755,14 @@ static bool fts_is_sync_needed()
const fts_slot_t* slot = static_cast<const fts_slot_t*>(
ib_vector_get_const(fts_slots, i));
if (slot->table_id == 0) {
if (!slot->table) {
continue;
}
dict_table_t* table = dict_table_open_on_id(
slot->table_id, FALSE, DICT_TABLE_OP_NORMAL);
if (!table) {
continue;
if (slot->table->fts && slot->table->fts->cache) {
total_memory += slot->table->fts->cache->total_size;
}
if (table->fts && table->fts->cache) {
total_memory += table->fts->cache->total_size;
}
dict_table_close(table, FALSE, FALSE);
if (total_memory > fts_max_total_cache_size) {
return(true);
}
@ -2793,22 +2772,14 @@ static bool fts_is_sync_needed()
}
/** Sync fts cache of a table
@param[in] table_id table id */
static void fts_optimize_sync_table(table_id_t table_id)
@param[in,out] table table to be synced */
static void fts_optimize_sync_table(dict_table_t* table)
{
if (dict_table_t* table = dict_table_open_on_id(
table_id, FALSE, DICT_TABLE_OP_NORMAL)) {
if (fil_table_accessible(table)
&& table->fts && table->fts->cache) {
fts_sync_table(table, false);
}
DBUG_EXECUTE_IF(
"ib_optimize_wq_hang",
os_thread_sleep(6000000););
dict_table_close(table, FALSE, FALSE);
if (table->fts && table->fts->cache && fil_table_accessible(table)) {
fts_sync_table(table, false);
}
DBUG_EXECUTE_IF("ib_optimize_wq_hang", os_thread_sleep(6000000););
}
/**********************************************************************//**
@ -2847,7 +2818,7 @@ DECLARE_THREAD(fts_optimize_thread)(
ib_vector_get(fts_slots, current));
/* Handle the case of empty slots. */
if (slot->table_id) {
if (slot->table) {
slot->running = true;
fts_optimize_table_bk(slot);
}
@ -2906,7 +2877,7 @@ DECLARE_THREAD(fts_optimize_thread)(
os_thread_sleep(300000););
fts_optimize_sync_table(
*static_cast<table_id_t*>(msg->ptr));
static_cast<dict_table_t*>(msg->ptr));
break;
default:
@ -2925,8 +2896,8 @@ DECLARE_THREAD(fts_optimize_thread)(
fts_slot_t* slot = static_cast<fts_slot_t*>(
ib_vector_get(fts_slots, i));
if (table_id_t table_id = slot->table_id) {
fts_optimize_sync_table(table_id);
if (slot->table) {
fts_optimize_sync_table(slot->table);
}
}
}
@ -2954,7 +2925,6 @@ fts_optimize_init(void)
{
mem_heap_t* heap;
ib_alloc_t* heap_alloc;
dict_table_t* table;
ut_ad(!srv_read_only_mode);
@ -2970,31 +2940,25 @@ fts_optimize_init(void)
heap_alloc = ib_heap_allocator_create(heap);
fts_slots = ib_vector_create(heap_alloc, sizeof(fts_slot_t), 4);
/* Add fts tables to the fts_slots vector which were skipped during restart */
std::vector<dict_table_t*> table_vector;
std::vector<dict_table_t*>::iterator it;
/* Add fts tables to fts_slots which could be skipped
during dict_load_table_one() because fts_optimize_thread
wasn't even started. */
mutex_enter(&dict_sys->mutex);
for (table = UT_LIST_GET_FIRST(dict_sys->table_LRU);
table != NULL;
table = UT_LIST_GET_NEXT(table_LRU, table)) {
if (table->fts &&
dict_table_has_fts_index(table)) {
if (fts_optimize_new_table(table)){
table_vector.push_back(table);
}
for (dict_table_t* table = UT_LIST_GET_FIRST(dict_sys->table_LRU);
table != NULL;
table = UT_LIST_GET_NEXT(table_LRU, table)) {
if (!table->fts || !dict_table_has_fts_index(table)) {
continue;
}
}
/* It is better to call dict_table_prevent_eviction()
outside the above loop because it operates on
dict_sys->table_LRU list.*/
for (it=table_vector.begin();it!=table_vector.end();++it) {
dict_table_prevent_eviction(*it);
/* fts_optimize_thread is not started yet. So there is no
need to acquire fts_optimize_wq->mutex for adding the fts
table to the fts slots. */
ut_ad(!table->can_be_evicted);
fts_optimize_new_table(table);
table->fts->in_queue = true;
}
mutex_exit(&dict_sys->mutex);
table_vector.clear();
fts_opt_shutdown_event = os_event_create(0);
last_check_sync_time = time(NULL);

View file

@ -2587,11 +2587,10 @@ innobase_next_autoinc(
if (next_value == 0) {
ulonglong next;
if (current >= offset) {
if (current > offset) {
next = (current - offset) / step;
} else {
next = 0;
block -= step;
next = (offset - current) / step;
}
ut_a(max_value > next);
@ -16539,7 +16538,7 @@ ha_innobase::get_auto_increment(
if (increment > 1 && thd_sql_command(m_user_thd) != SQLCOM_ALTER_TABLE
&& autoinc < col_max_value) {
ulonglong prev_auto_inc = autoinc;
ulonglong prev_auto_inc = autoinc;
autoinc = ((autoinc - 1) + increment - offset)/ increment;
@ -16593,27 +16592,6 @@ ha_innobase::get_auto_increment(
current = *first_value;
if (m_prebuilt->autoinc_increment != increment) {
WSREP_DEBUG("autoinc decrease: %llu -> %llu\n"
"THD: %ld, current: %llu, autoinc: %llu",
m_prebuilt->autoinc_increment,
increment,
thd_get_thread_id(m_user_thd),
current, autoinc);
if (!wsrep_on(m_user_thd)) {
current = autoinc
- m_prebuilt->autoinc_increment;
current = innobase_next_autoinc(
current, 1, increment, offset, col_max_value);
}
dict_table_autoinc_initialize(
m_prebuilt->table, current);
*first_value = current;
}
/* Compute the last value in the interval */
next_value = innobase_next_autoinc(
current, *nb_reserved_values, increment, offset,
@ -19777,6 +19755,11 @@ static MYSQL_SYSVAR_ENUM(stats_method, srv_innodb_stats_method,
NULL, NULL, SRV_STATS_NULLS_EQUAL, &innodb_stats_method_typelib);
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
static MYSQL_SYSVAR_BOOL(change_buffer_dump, ibuf_dump,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Dump the change buffer at startup.",
NULL, NULL, FALSE);
static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug,
PLUGIN_VAR_RQCMDARG,
"Debug flags for InnoDB change buffering (0=none, 1=try to buffer)",
@ -20260,6 +20243,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(change_buffering),
MYSQL_SYSVAR(change_buffer_max_size),
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
MYSQL_SYSVAR(change_buffer_dump),
MYSQL_SYSVAR(change_buffering_debug),
MYSQL_SYSVAR(disable_background_merge),
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */

View file

@ -185,6 +185,8 @@ access order rules. */
ulong innodb_change_buffering;
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
/** Dump the change buffer at startup */
my_bool ibuf_dump;
/** Flag to control insert buffer debugging. */
uint ibuf_debug;
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
@ -506,6 +508,25 @@ ibuf_init_at_db_start(void)
#endif /* BTR_CUR_ADAPT */
ibuf->index->page = FSP_IBUF_TREE_ROOT_PAGE_NO;
ut_d(ibuf->index->cached = TRUE);
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
if (!ibuf_dump) {
return error;
}
ib::info() << "Dumping the change buffer";
ibuf_mtr_start(&mtr);
btr_pcur_t pcur;
if (DB_SUCCESS == btr_pcur_open_at_index_side(
true, ibuf->index, BTR_SEARCH_LEAF, &pcur,
true, 0, &mtr)) {
while (btr_pcur_move_to_next_user_rec(&pcur, &mtr)) {
rec_print_old(stderr, btr_pcur_get_rec(&pcur));
}
}
ibuf_mtr_commit(&mtr);
ib::info() << "Dumped the change buffer";
#endif
return (error);
}

View file

@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2017, MariaDB Corporation.
Copyright (c) 2013, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -142,6 +142,8 @@ struct table_name_t
};
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
/** Dump the change buffer at startup */
extern my_bool ibuf_dump;
/** Flag to control insert buffer debugging. */
extern uint ibuf_debug;
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */

View file

@ -320,9 +320,6 @@ public:
/** Mutex protecting bg_threads* and fts_add_wq. */
ib_mutex_t bg_threads_mutex;
/** Whether the table was added to fts_optimize_wq();
protected by bg_threads_mutex */
unsigned in_queue:1;
/** Whether the ADDED table record sync-ed after
crash recovery; protected by bg_threads_mutex */
unsigned added_synced:1;
@ -348,6 +345,10 @@ public:
/** Vector of FTS indexes, this is mainly for caching purposes. */
ib_vector_t* indexes;
/** Whether the table exists in fts_optimize_wq;
protected by fts_optimize_wq mutex */
bool in_queue;
/** Heap for fts_t allocation. */
mem_heap_t* fts_heap;
};

View file

@ -25,6 +25,9 @@ Created 2011-02-15 Jimmy Yang
#ifndef INNODB_FTS0OPT_H
#define INNODB_FTS0OPT_H
/** The FTS optimize thread's work queue. */
extern ib_wqueue_t* fts_optimize_wq;
/********************************************************************
Callback function to fetch the rows in an FTS INDEX record. */
ibool

View file

@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -83,29 +84,6 @@ UNIV_INLINE
int
ut_strcmp(const char* str1, const char* str2);
/**********************************************************************//**
Copies up to size - 1 characters from the NUL-terminated string src to
dst, NUL-terminating the result. Returns strlen(src), so truncation
occurred if the return value >= size.
@return strlen(src) */
ulint
ut_strlcpy(
/*=======*/
char* dst, /*!< in: destination buffer */
const char* src, /*!< in: source buffer */
ulint size); /*!< in: size of destination buffer */
/**********************************************************************//**
Like ut_strlcpy, but if src doesn't fit in dst completely, copies the last
(size - 1) bytes of src, not the first.
@return strlen(src) */
ulint
ut_strlcpy_rev(
/*===========*/
char* dst, /*!< in: destination buffer */
const char* src, /*!< in: source buffer */
ulint size); /*!< in: size of destination buffer */
/********************************************************************
Concatenate 3 strings.*/
char*

View file

@ -38,7 +38,18 @@ processing.
// Forward declaration
struct ib_list_t;
struct ib_wqueue_t;
/** Work queue */
struct ib_wqueue_t
{
/** Mutex protecting everything */
ib_mutex_t mutex;
/** Work item list */
ib_list_t* items;
/** event we use to signal additions to list;
os_event_set() and os_event_reset() are protected by the mutex */
os_event_t event;
};
/****************************************************************//**
Create a new work queue.
@ -54,15 +65,14 @@ ib_wqueue_free(
/*===========*/
ib_wqueue_t* wq); /*!< in: work queue */
/****************************************************************//**
Add a work item to the queue. */
/** Add a work item to the queue.
@param[in,out] wq work queue
@param[in] item work item
@param[in,out] heap memory heap to use for allocating list node
@param[in] wq_locked work queue mutex locked */
void
ib_wqueue_add(
/*==========*/
ib_wqueue_t* wq, /*!< in: work queue */
void* item, /*!< in: work item */
mem_heap_t* heap); /*!< in: memory heap to use for
allocating the list node */
ib_wqueue_add(ib_wqueue_t* wq, void* item, mem_heap_t* heap,
bool wq_locked = false);
/** Check if queue is empty.
@param wq wait queue
@ -101,5 +111,4 @@ ib_wqueue_len(
/*==========*/
ib_wqueue_t* wq); /*<! in: work queue */
#endif /* IB_WORK_QUEUE_H */

View file

@ -228,6 +228,17 @@ mem_heap_validate(
ut_ad(size == heap->total_size);
}
/** Copy the tail of a string.
@param[in,out] dst destination buffer
@param[in] src string whose tail to copy
@param[in] size size of dst buffer, in bytes, including NUL terminator
@return strlen(src) */
static void ut_strlcpy_rev(char* dst, const char* src, ulint size)
{
size_t src_size = strlen(src), n = std::min(src_size, size - 1);
memcpy(dst, src + src_size - n, n + 1);
}
#endif /* UNIV_DEBUG */
/***************************************************************//**

View file

@ -4695,19 +4695,23 @@ os_file_get_status_win32(
CloseHandle(fh);
}
}
stat_info->block_size = 0;
/* What follows, is calculation of FS block size, which is not important
(it is just shown in I_S innodb tables). The error to calculate it will be ignored.*/
char volname[MAX_PATH];
BOOL result = GetVolumePathName(path, volname, MAX_PATH);
static bool warned_once = false;
if (!result) {
ib::error()
<< "os_file_get_status_win32: "
<< "Failed to get the volume path name for: "
<< path
<< "- OS error number " << GetLastError();
return(DB_FAIL);
if (!warned_once) {
ib::warn()
<< "os_file_get_status_win32: "
<< "Failed to get the volume path name for: "
<< path
<< "- OS error number " << GetLastError();
warned_once = true;
}
return(DB_SUCCESS);
}
DWORD sectorsPerCluster;
@ -4723,15 +4727,15 @@ os_file_get_status_win32(
&totalNumberOfClusters);
if (!result) {
ib::error()
<< "GetDiskFreeSpace(" << volname << ",...) "
<< "failed "
<< "- OS error number " << GetLastError();
return(DB_FAIL);
if (!warned_once) {
ib::warn()
<< "GetDiskFreeSpace(" << volname << ",...) "
<< "failed "
<< "- OS error number " << GetLastError();
warned_once = true;
}
return(DB_SUCCESS);
}
stat_info->block_size = bytesPerSector * sectorsPerCluster;
} else {
stat_info->type = OS_FILE_TYPE_UNKNOWN;

View file

@ -2697,7 +2697,7 @@ write_buffers:
buf, fts_index, old_table,
new_table, psort_info, row, ext,
&doc_id, conv_heap,
&err, &v_heap, table, trx)))) {
&err, &v_heap, eval_table, trx)))) {
/* An empty buffer should have enough
room for at least one record. */
ut_error;

View file

@ -2477,17 +2477,27 @@ row_upd_sec_index_entry(
case DB_NO_REFERENCED_ROW:
err = DB_SUCCESS;
break;
case DB_LOCK_WAIT:
if (wsrep_debug) {
ib::warn() << "WSREP: sec index FK lock wait"
<< " index " << index->name
<< " table " << index->table->name
<< " query " << wsrep_thd_query(trx->mysql_thd);
}
break;
case DB_DEADLOCK:
if (wsrep_debug) {
ib::warn() << "WSREP: sec index FK check fail for deadlock"
<< " index " << index->name
<< " table " << index->table->name;
<< " table " << index->table->name
<< " query " << wsrep_thd_query(trx->mysql_thd);
}
break;
default:
ib::error() << "WSREP: referenced FK check fail: " << ut_strerr(err)
<< " index " << index->name
<< " table " << index->table->name;
<< " table " << index->table->name
<< " query " << wsrep_thd_query(trx->mysql_thd);
break;
}

View file

@ -79,7 +79,8 @@ trx_set_detailed_error(
trx_t* trx, /*!< in: transaction struct */
const char* msg) /*!< in: detailed error message */
{
ut_strlcpy(trx->detailed_error, msg, MAX_DETAILED_ERROR_LEN);
strncpy(trx->detailed_error, msg, MAX_DETAILED_ERROR_LEN - 1);
trx->detailed_error[MAX_DETAILED_ERROR_LEN - 1] = '\0';
}
/*************************************************************//**

View file

@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -24,55 +25,6 @@ Created 5/11/1994 Heikki Tuuri
*************************************************************************/
#include "ut0mem.h"
#include "os0thread.h"
#include "srv0srv.h"
#include <stdlib.h>
/**********************************************************************//**
Copies up to size - 1 characters from the NUL-terminated string src to
dst, NUL-terminating the result. Returns strlen(src), so truncation
occurred if the return value >= size.
@return strlen(src) */
ulint
ut_strlcpy(
/*=======*/
char* dst, /*!< in: destination buffer */
const char* src, /*!< in: source buffer */
ulint size) /*!< in: size of destination buffer */
{
ulint src_size = strlen(src);
if (size != 0) {
ulint n = ut_min(src_size, size - 1);
memcpy(dst, src, n);
dst[n] = '\0';
}
return(src_size);
}
/**********************************************************************//**
Like ut_strlcpy, but if src doesn't fit in dst completely, copies the last
(size - 1) bytes of src, not the first.
@return strlen(src) */
ulint
ut_strlcpy_rev(
/*===========*/
char* dst, /*!< in: destination buffer */
const char* src, /*!< in: source buffer */
ulint size) /*!< in: size of destination buffer */
{
ulint src_size = strlen(src);
if (size != 0) {
ulint n = ut_min(src_size, size - 1);
memcpy(dst, src + src_size - n, n + 1);
}
return(src_size);
}
/********************************************************************
Concatenate 3 strings.*/

View file

@ -28,15 +28,6 @@ A work queue
Created 4/26/2006 Osku Salerma
************************************************************************/
/* Work queue. */
struct ib_wqueue_t {
ib_mutex_t mutex; /*!< mutex protecting everything */
ib_list_t* items; /*!< work item list */
os_event_t event; /*!< event we use to signal additions to list;
os_event_set() and os_event_reset() are
protected by ib_wqueue_t::mutex */
};
/****************************************************************//**
Create a new work queue.
@return work queue */
@ -72,22 +63,24 @@ ib_wqueue_free(
ut_free(wq);
}
/****************************************************************//**
Add a work item to the queue. */
/** Add a work item to the queue.
@param[in,out] wq work queue
@param[in] item work item
@param[in,out] heap memory heap to use for allocating list node
@param[in] wq_locked work queue mutex locked */
void
ib_wqueue_add(
/*==========*/
ib_wqueue_t* wq, /*!< in: work queue */
void* item, /*!< in: work item */
mem_heap_t* heap) /*!< in: memory heap to use for allocating the
list node */
ib_wqueue_add(ib_wqueue_t* wq, void* item, mem_heap_t* heap, bool wq_locked)
{
mutex_enter(&wq->mutex);
if (!wq_locked) {
mutex_enter(&wq->mutex);
}
ib_list_add_last(wq->items, item, heap);
os_event_set(wq->event);
mutex_exit(&wq->mutex);
if (!wq_locked) {
mutex_exit(&wq->mutex);
}
}
/****************************************************************//**

View file

@ -90,6 +90,7 @@ CONFIGURE_FILE(tokudb.cnf.in tokudb.cnf @ONLY)
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-shadow")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-vla" DEBUG)
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-implicit-fallthrough")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-cpp" DEBUG)
############################################
MARK_AS_ADVANCED(BUILDNAME)

View file

@ -1,39 +1,5 @@
include(ExternalProject)
if (CMAKE_PROJECT_NAME STREQUAL TokuDB)
## add jemalloc with an external project
set(JEMALLOC_SOURCE_DIR "${TokuDB_SOURCE_DIR}/third_party/jemalloc" CACHE FILEPATH "Where to find jemalloc sources.")
if (EXISTS "${JEMALLOC_SOURCE_DIR}/configure")
set(jemalloc_configure_opts "CC=${CMAKE_C_COMPILER}" "--with-jemalloc-prefix=" "--with-private-namespace=tokudb_jemalloc_internal_" "--enable-cc-silence")
option(JEMALLOC_DEBUG "Build jemalloc with --enable-debug." OFF)
if (JEMALLOC_DEBUG)
list(APPEND jemalloc_configure_opts --enable-debug)
endif ()
ExternalProject_Add(build_jemalloc
PREFIX jemalloc
SOURCE_DIR "${JEMALLOC_SOURCE_DIR}"
CONFIGURE_COMMAND
"${JEMALLOC_SOURCE_DIR}/configure" ${jemalloc_configure_opts}
"--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc"
)
add_library(jemalloc STATIC IMPORTED GLOBAL)
set_target_properties(jemalloc PROPERTIES IMPORTED_LOCATION
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc/lib/libjemalloc_pic.a")
add_dependencies(jemalloc build_jemalloc)
add_library(jemalloc_nopic STATIC IMPORTED GLOBAL)
set_target_properties(jemalloc_nopic PROPERTIES IMPORTED_LOCATION
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc/lib/libjemalloc.a")
add_dependencies(jemalloc_nopic build_jemalloc)
# detect when we are being built as a subproject
if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING)
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc/lib" DESTINATION .
COMPONENT tokukv_libs_extra)
endif ()
endif ()
endif ()
## add lzma with an external project
set(xz_configure_opts --with-pic --enable-static)
if (APPLE)

View file

@ -26,7 +26,7 @@ if [ ! -d build ] ; then
-D RUN_LONG_TESTS=ON \
-D TOKUDB_DATA=$tokudbdir/../tokudb.data \
..
ninja build_jemalloc build_lzma build_snappy
ninja build_lzma build_snappy
popd
fi

View file

@ -25,7 +25,7 @@ if [ ! -d build ] ; then
-D RUN_LONG_TESTS=ON \
-D TOKUDB_DATA=$tokudbdir/../tokudb.data \
..
ninja build_jemalloc build_lzma build_snappy
ninja build_lzma build_snappy
popd
fi

View file

@ -25,7 +25,7 @@ if [ ! -d build ] ; then
-D RUN_LONG_TESTS=ON \
-D TOKUDB_DATA=$tokudbdir/../tokudb.data \
..
ninja build_jemalloc build_lzma build_snappy
ninja build_lzma build_snappy
popd
fi

View file

@ -1077,7 +1077,8 @@ static inline int tokudb_generate_row(DB* dest_db,
}
buff = (uchar *)dest_key->data;
assert_always(buff != NULL && max_key_len > 0);
assert_always(buff != nullptr);
assert_always(max_key_len > 0);
} else {
assert_unreachable();
}

View file

@ -387,7 +387,8 @@ inline void TOKUDB_SHARE::init_cardinality_counts(
assert_debug(_mutex.is_owned_by_me());
// can not change number of keys live
assert_always(_rec_per_key == NULL && _rec_per_keys == 0);
assert_always(_rec_per_key == nullptr);
assert_always(_rec_per_keys == 0);
_rec_per_keys = rec_per_keys;
_rec_per_key = rec_per_key;
}

View file

@ -957,9 +957,8 @@ static inline int tokudb_compare_two_hidden_keys(
const void* saved_key_data,
const uint32_t saved_key_size
) {
assert_always(
(new_key_size >= TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH) &&
(saved_key_size >= TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH));
assert_always(new_key_size >= TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH);
assert_always(saved_key_size >= TOKUDB_HIDDEN_PRIMARY_KEY_LENGTH);
ulonglong a = hpk_char_to_num((uchar *) new_key_data);
ulonglong b = hpk_char_to_num((uchar *) saved_key_data);
return a < b ? -1 : (a > b ? 1 : 0);
@ -2537,7 +2536,8 @@ static uint32_t create_toku_secondary_key_pack_descriptor (
bool is_col_in_pk = false;
if (bitmap_is_set(&kc_info->key_filters[pk_index],field_index)) {
assert_always(!has_hpk && prim_key != NULL);
assert_always(!has_hpk);
assert_always(prim_key != nullptr);
is_col_in_pk = true;
}
else {

View file

@ -54,16 +54,20 @@ static void test_int8() {
assert(over);
else if (m < -max)
assert(over);
else
assert(!over && n == m);
else {
assert(!over);
assert(n == m);
}
n = int_sub(x, y, 8, &over);
m = x - y;
if (m > max-1)
assert(over);
else if (m < -max)
assert(over);
else
assert(!over && n == m);
else {
assert(!over);
asset(n == m);
}
}
}
}
@ -82,16 +86,20 @@ static void test_int16() {
assert(over);
else if (m < -max)
assert(over);
else
assert(!over && n == m);
else {
assert(!over);
assert(n == m);
}
n = int_sub(x, y, 16, &over);
m = x - y;
if (m > max-1)
assert(over);
else if (m < -max)
assert(over);
else
assert(!over && n == m);
else {
assert(!over);
assert(n == m);
}
}
}
}
@ -104,20 +112,42 @@ static void test_int24() {
s = int_add(1, (1ULL<<23)-1, 24, &over); assert(over);
s = int_add((1ULL<<23)-1, 1, 24, &over); assert(over);
s = int_sub(-1, (1ULL<<23), 24, &over); assert(!over && s == (1ULL<<23)-1);
s = int_sub(-1, (1ULL<<23), 24, &over);
assert(!over);
assert(s == (1ULL<<23)-1);
s = int_sub((1ULL<<23), 1, 24, &over); assert(over);
s = int_add(0, 0, 24, &over); assert(!over && s == 0);
s = int_sub(0, 0, 24, &over); assert(!over && s == 0);
s = int_add(0, -1, 24, &over); assert(!over && s == -1);
s = int_sub(0, 1, 24, &over); assert(!over && s == -1);
s = int_add(0, (1ULL<<23), 24, &over); assert(!over && (s & ((1ULL<<24)-1)) == (1ULL<<23));
s = int_sub(0, (1ULL<<23)-1, 24, &over); assert(!over && (s & ((1ULL<<24)-1)) == (1ULL<<23)+1);
s = int_add(0, 0, 24, &over);
assert(!over);
assert(s == 0);
s = int_sub(0, 0, 24, &over);
assert(!over);
assert(s == 0);
s = int_add(0, -1, 24, &over);
assert(!over);
assert(s == -1);
s = int_sub(0, 1, 24, &over);
assert(!over);
assert(s == -1);
s = int_add(0, (1ULL<<23), 24, &over);
assert(!over);
assert((s & ((1ULL<<24)-1)) == (1ULL<<23));
s = int_sub(0, (1ULL<<23)-1, 24, &over);
assert(!over);
assert((s & ((1ULL<<24)-1)) == (1ULL<<23)+1);
s = int_add(-1, 0, 24, &over); assert(!over && s == -1);
s = int_add(-1, 1, 24, &over); assert(!over && s == 0);
s = int_sub(-1, -1, 24, &over); assert(!over && s == 0);
s = int_sub(-1, (1ULL<<23)-1, 24, &over); assert(!over && (s & ((1ULL<<24)-1)) == (1ULL<<23));
s = int_add(-1, 0, 24, &over);
assert(!over);
assert(s == -1);
s = int_add(-1, 1, 24, &over);
assert(!over);
assert(s == 0);
s = int_sub(-1, -1, 24, &over);
assert(!over);
assert(s == 0);
s = int_sub(-1, (1ULL<<23)-1, 24, &over);
assert(!over);
assert((s & ((1ULL<<24)-1)) == (1ULL<<23));
}
static void test_int32() {
@ -128,20 +158,42 @@ static void test_int32() {
s = int_add(1, (1ULL<<31)-1, 32, &over); assert(over);
s = int_add((1ULL<<31)-1, 1, 32, &over); assert(over);
s = int_sub(-1, (1ULL<<31), 32, &over); assert(s == (1ULL<<31)-1 && !over);
s = int_sub(-1, (1ULL<<31), 32, &over);
assert(s == (1ULL<<31)-1);
assert(!over);
s = int_sub((1ULL<<31), 1, 32, &over); assert(over);
s = int_add(0, 0, 32, &over); assert(s == 0 && !over);
s = int_sub(0, 0, 32, &over); assert(s == 0 && !over);
s = int_add(0, -1, 32, &over); assert(s == -1 && !over);
s = int_sub(0, 1, 32, &over); assert(s == -1 && !over);
s = int_add(0, (1ULL<<31), 32, &over); assert((s & ((1ULL<<32)-1)) == (1ULL<<31) && !over);
s = int_sub(0, (1ULL<<31)-1, 32, &over); assert((s & ((1ULL<<32)-1)) == (1ULL<<31)+1 && !over);
s = int_add(0, 0, 32, &over);
assert(s == 0);
assert(!over);
s = int_sub(0, 0, 32, &over);
assert(s == 0);
assert(!over);
s = int_add(0, -1, 32, &over);
assert(s == -1);
assert(!over);
s = int_sub(0, 1, 32, &over);
assert(s == -1);
assert(!over);
s = int_add(0, (1ULL<<31), 32, &over);
assert((s & ((1ULL<<32)-1)) == (1ULL<<31));
assert(!over);
s = int_sub(0, (1ULL<<31)-1, 32, &over);
assert((s & ((1ULL<<32)-1)) == (1ULL<<31)+1);
assert(!over);
s = int_add(-1, 0, 32, &over); assert(s == -1 && !over);
s = int_add(-1, 1, 32, &over); assert(s == 0 && !over);
s = int_sub(-1, -1, 32, &over); assert(s == 0 && !over);
s = int_sub(-1, (1ULL<<31)-1, 32, &over); assert((s & ((1ULL<<32)-1)) == (1ULL<<31) && !over);
s = int_add(-1, 0, 32, &over);
assert(s == -1);
assert(!over);
s = int_add(-1, 1, 32, &over);
assert(s == 0);
assert(!over);
s = int_sub(-1, -1, 32, &over);
assert(s == 0);
assert(!over);
s = int_sub(-1, (1ULL<<31)-1, 32, &over);
assert((s & ((1ULL<<32)-1)) == (1ULL<<31));
assert(!over);
}
static void test_int64() {
@ -152,20 +204,42 @@ static void test_int64() {
s = int_add(1, (1ULL<<63)-1, 64, &over); assert(over);
s = int_add((1ULL<<63)-1, 1, 64, &over); assert(over);
s = int_sub(-1, (1ULL<<63), 64, &over); assert(s == (1ULL<<63)-1 && !over);
s = int_sub(-1, (1ULL<<63), 64, &over);
assert(s == (1ULL<<63)-1);
assert(!over);
s = int_sub((1ULL<<63), 1, 64, &over); assert(over);
s = int_add(0, 0, 64, &over); assert(s == 0 && !over);
s = int_sub(0, 0, 64, &over); assert(s == 0 && !over);
s = int_add(0, -1, 64, &over); assert(s == -1 && !over);
s = int_sub(0, 1, 64, &over); assert(s == -1 && !over);
s = int_add(0, (1ULL<<63), 64, &over); assert(s == (int64_t)(1ULL<<63) && !over);
s = int_sub(0, (1ULL<<63)-1, 64, &over); assert(s == (int64_t)((1ULL<<63)+1) && !over);
s = int_add(0, 0, 64, &over);
assert(s == 0);
assert(!over);
s = int_sub(0, 0, 64, &over);
assert(s == 0);
assert(!over);
s = int_add(0, -1, 64, &over);
assert(s == -1);
assert(!over);
s = int_sub(0, 1, 64, &over);
assert(s == -1);
assert(!over);
s = int_add(0, (1ULL<<63), 64, &over);
assert(s == (int64_t)(1ULL<<63));
assert(!over);
s = int_sub(0, (1ULL<<63)-1, 64, &over);
assert(s == (int64_t)((1ULL<<63)+1));
assert(!over);
s = int_add(-1, 0, 64, &over); assert(s == -1 && !over);
s = int_add(-1, 1, 64, &over); assert(s == 0 && !over);
s = int_sub(-1, -1, 64, &over); assert(s == 0 && !over);
s = int_sub(-1, (1ULL<<63)-1, 64, &over); assert(s == (int64_t)(1ULL<<63) && !over);
s = int_add(-1, 0, 64, &over);
assert(s == -1);
assert(!over);
s = int_add(-1, 1, 64, &over);
assert(s == 0);
assert(!over);
s = int_sub(-1, -1, 64, &over);
assert(s == 0);
assert(!over);
s = int_sub(-1, (1ULL<<63)-1, 64, &over);
assert(s == (int64_t)(1ULL<<63));
assert(!over);
}
static void test_int_sign(uint length_bits) {

View file

@ -51,14 +51,18 @@ static void test_uint8() {
m = x + y;
if (m > (1ULL<<8)-1)
assert(over);
else
assert(!over && n == (m % 256));
else {
assert(!over);
assert(n == (m % 256));
}
n = uint_sub(x, y, 8, &over);
m = x - y;
if (m > x)
assert(over);
else
assert(!over && n == (m % 256));
else {
assert(!over);
assert(n == (m % 256));
}
}
}
}
@ -75,14 +79,18 @@ static void test_uint16() {
m = x + y;
if (m > (1ULL<<16)-1)
assert(over);
else
assert(!over && n == (m % (1ULL<<16)));
else {
assert(!over);
assert(n == (m % (1ULL<<16)));
}
n = uint_sub(x, y, 16, &over);
m = x - y;
if (m > x)
assert(over);
else
assert(!over && n == (m % (1ULL<<16)));
else {
assert(!over);
assert(n == (m % (1ULL<<16)));
}
}
}
}
@ -95,13 +103,23 @@ static void test_uint24() {
s = uint_add((1ULL<<24)-1, (1ULL<<24)-1, 24, &over); assert(over);
s = uint_add((1ULL<<24)-1, 1, 24, &over); assert(over);
s = uint_add((1ULL<<24)-1, 0, 24, &over); assert(!over && s == (1ULL<<24)-1);
s = uint_add(0, 1, 24, &over); assert(!over && s == 1);
s = uint_add(0, 0, 24, &over); assert(!over && s == 0);
s = uint_sub(0, 0, 24, &over); assert(!over && s == 0);
s = uint_add((1ULL<<24)-1, 0, 24, &over);
assert(!over);
assert(s == (1ULL<<24)-1);
s = uint_add(0, 1, 24, &over);
assert(!over);
assert(s == 1);
s = uint_add(0, 0, 24, &over);
assert(!over);
assert(s == 0);
s = uint_sub(0, 0, 24, &over);
assert(!over);
assert(s == 0);
s = uint_sub(0, 1, 24, &over); assert(over);
s = uint_sub(0, (1ULL<<24)-1, 24, &over); assert(over);
s = uint_sub((1ULL<<24)-1, (1ULL<<24)-1, 24, &over); assert(!over && s == 0);
s = uint_sub((1ULL<<24)-1, (1ULL<<24)-1, 24, &over);
assert(!over);
assert(s == 0);
}
static void test_uint32() {
@ -112,13 +130,23 @@ static void test_uint32() {
s = uint_add((1ULL<<32)-1, (1ULL<<32)-1, 32, &over); assert(over);
s = uint_add((1ULL<<32)-1, 1, 32, &over); assert(over);
s = uint_add((1ULL<<32)-1, 0, 32, &over); assert(!over && s == (1ULL<<32)-1);
s = uint_add(0, 1, 32, &over); assert(!over && s == 1);
s = uint_add(0, 0, 32, &over); assert(!over && s == 0);
s = uint_sub(0, 0, 32, &over); assert(!over && s == 0);
s = uint_add((1ULL<<32)-1, 0, 32, &over);
assert(!over);
assert(s == (1ULL<<32)-1);
s = uint_add(0, 1, 32, &over);
assert(!over);
assert(s == 1);
s = uint_add(0, 0, 32, &over);
assert(!over);
assert(s == 0);
s = uint_sub(0, 0, 32, &over);
assert(!over);
assert(s == 0);
s = uint_sub(0, 1, 32, &over); assert(over);
s = uint_sub(0, (1ULL<<32)-1, 32, &over); assert(over);
s = uint_sub((1ULL<<32)-1, (1ULL<<32)-1, 32, &over); assert(!over && s == 0);
s = uint_sub((1ULL<<32)-1, (1ULL<<32)-1, 32, &over);
assert(!over);
assert(s == 0);
}
static void test_uint64() {
@ -129,13 +157,23 @@ static void test_uint64() {
s = uint_add(~0ULL, ~0ULL, 64, &over); assert(over);
s = uint_add(~0ULL, 1, 64, &over); assert(over);
s = uint_add(~0ULL, 0, 64, &over); assert(!over && s == ~0ULL);
s = uint_add(0, 1, 64, &over); assert(!over && s == 1);
s = uint_add(0, 0, 64, &over); assert(!over && s == 0);
s = uint_sub(0, 0, 64, &over); assert(!over && s == 0);
s = uint_add(~0ULL, 0, 64, &over);
assert(!over);
assert(s == ~0ULL);
s = uint_add(0, 1, 64, &over);
assert(!over);
assert(s == 1);
s = uint_add(0, 0, 64, &over);
assert(!over);
assert(s == 0);
s = uint_sub(0, 0, 64, &over);
assert(!over);
assert(s == 0);
s = uint_sub(0, 1, 64, &over); assert(over);
s = uint_sub(0, ~0ULL, 64, &over); assert(over);
s = uint_sub(~0ULL, ~0ULL, 64, &over); assert(!over && s == 0);
s = uint_sub(~0ULL, ~0ULL, 64, &over);
assert(!over);
assert(s == 0);
}
int main() {

View file

@ -27,7 +27,6 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
#include <stdint.h>
#include <inttypes.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/types.h>
#include <tokudb_math.h>

View file

@ -32,9 +32,13 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
static void test_null() {
tokudb::buffer b;
assert(b.data() == NULL && b.size() == 0 && b.limit() == 0);
assert(b.data() == nullptr);
assert(b.size() == 0);
assert(b.limit() == 0);
b.append(NULL, 0);
assert(b.data() == NULL && b.size() == 0 && b.limit() == 0);
assert(b.data() == nullptr);
assert(b.size() == 0);
assert(b.limit() == 0);
}
static void append_az(tokudb::buffer &b) {
@ -132,7 +136,8 @@ static void test_replace_grow() {
}
for (size_t i = 0; i < a.size()/2; i++) {
unsigned char *cp = (unsigned char *) a.data() + 2*i;
assert(cp[0] == 'a'+i && cp[1] == 'a'+i);
assert(cp[0] == 'a'+i);
assert(cp[1] == 'a'+i);
}
}

View file

@ -27,7 +27,6 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
#include <stdint.h>
#include <inttypes.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/types.h>
#include <tokudb_math.h>

Some files were not shown because too many files have changed in this diff Show more