| 1 |
source include/not_embedded.inc; |
| 2 |
|
| 3 |
# |
| 4 |
# MDEV-22302 JSON_TABLE: Column privilege is insufficient for query with json_table |
| 5 |
# |
| 6 |
|
| 7 |
create database db; |
| 8 |
use db; |
| 9 |
create table t (a text); |
| 10 |
insert into t values ('{"foo":"bar"}'); |
| 11 |
create user u@localhost; |
| 12 |
grant select (a) on db.t to u@localhost; |
| 13 |
|
| 14 |
--connect (con1,localhost,u,,db) |
| 15 |
select a from t; |
| 16 |
select * from t, json_table(t.a, '$' columns(f varchar(20) path '$.foo')) as jt; |
| 17 |
|
| 18 |
# |
| 19 |
# MDEV-25141 JSON_TABLE: SELECT into outfile bypasses file privilege check |
| 20 |
# |
| 21 |
--error ER_SPECIFIC_ACCESS_DENIED_ERROR |
| 22 |
select * into outfile 'f' from json_table('[]', '$' columns(x for ordinality)) q; |
| 23 |
|
| 24 |
connection default; |
| 25 |
disconnect con1; |
| 26 |
|
| 27 |
drop user u@localhost; |
| 28 |
drop database db; |
| 29 |
|
| 30 |
use test; |