drop database if exists db;
|
drop user if exists u@localhost;
|
create database db;
|
use db;
|
create table t (a text);
|
insert into t values ('{"foo":"bar"}');
|
create user u@localhost;
|
grant select (a) on db.t to u@localhost;
|
|
--connect (con1,localhost,u,,db)
|
select a from t;
|
select * from t, json_table(t.a, '$' columns(f varchar(20) path '$.foo')) as jt;
|
bb-10.5-hf 6dfb3fab2
|
MariaDB [db]> select * from t, json_table(t.a, '$' columns(f varchar(20) path '$.foo')) as jt;
|
ERROR 1142 (42000): SELECT command denied to user 'u'@'localhost' for table 'jt'
|
It works on MySQL 8.0.19.