Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-22302

JSON_TABLE: Column privilege is insufficient for query with json_table

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            holyfoot Alexey Botchkov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            holyfoot Alexey Botchkov made changes -
            issue.field.resolutiondate 2020-04-27 14:06:32.0 2020-04-27 14:06:32.306
            holyfoot Alexey Botchkov made changes -
            Fix Version/s N/A [ 14700 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 107398 ] MariaDB v4 [ 157645 ]

            People

              holyfoot Alexey Botchkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.