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

CREATE TEMPORARY TABLES privilege is insufficient for SHOW COLUMNS

Details

    Description

      CREATE TEMPORARY TABLES privilege is supposed to allow all actions with temporary tables created by the session.
      However, while it also allows to run SHOW COLUMNS on such tables, it's not sufficient to get a result, it remains empty.
      Oddly, SHOW INDEX works.

      create database db;
      create user foo@localhost;
      grant create temporary tables on db.* to foo@localhost;
       
      --connect (con1,localhost,foo,,db)
      create temporary table tmp (a int, key(a));
      show create table tmp;
      show columns in tmp;
      show index in tmp;
       
      # Cleanup
      --disconnect con1
      --connection default
      drop database db;
      drop user foo@localhost;
      

      bb-10.9-anel 32274c3e8a4

      show columns in tmp;
      Field	Type	Null	Key	Default	Extra
      show index in tmp;
      Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment	Ignored
      tmp	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE			NO
      

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            anel Anel Husakovic made changes -
            Assignee Anel Husakovic [ anel ] Vicențiu Ciorbaru [ cvicentiu ]
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.7 [ 24805 ]
            Fix Version/s 10.8 [ 26121 ]
            Fix Version/s 10.9 [ 26905 ]
            Affects Version/s 10.2 [ 14601 ]
            Affects Version/s 10.3 [ 22126 ]
            Affects Version/s 10.4 [ 22408 ]
            Affects Version/s 10.5 [ 23123 ]
            Affects Version/s 10.6 [ 24028 ]
            Affects Version/s 10.7 [ 24805 ]
            Affects Version/s 10.8 [ 26121 ]
            Affects Version/s N/A [ 14700 ]
            Priority Critical [ 2 ] Major [ 3 ]
            elenst Elena Stepanova made changes -
            anel Anel Husakovic made changes -
            Assignee Vicențiu Ciorbaru [ cvicentiu ] Anel Husakovic [ anel ]
            anel Anel Husakovic made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            anel Anel Husakovic made changes -
            anel Anel Husakovic made changes -
            Assignee Anel Husakovic [ anel ] Vicențiu Ciorbaru [ cvicentiu ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            anel Anel Husakovic made changes -
            cvicentiu Vicențiu Ciorbaru made changes -
            Description {{CREATE TEMPORARY TABLES}} privilege is supposed to allow all actions with temporary tables created by the session.
            However, while it also allows to _run_ {{SHOW COLUNNS}} on such tables, it's not sufficient to get a result, it remains empty.
            Oddly, {{SHOW INDEX}} works.

            {code:sql}
            create database db;
            create user foo@localhost;
            grant create temporary tables on db.* to foo@localhost;

            --connect (con1,localhost,foo,,db)
            create temporary table tmp (a int, key(a));
            show create table tmp;
            show columns in tmp;
            show index in tmp;

            # Cleanup
            --disconnect con1
            --connection default
            drop database db;
            drop user foo@localhost;
            {code}

            {code:sql|title=bb-10.9-anel 32274c3e8a4}
            show columns in tmp;
            Field Type Null Key Default Extra
            show index in tmp;
            Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
            tmp 1 a 1 a A NULL NULL NULL YES BTREE NO
            {code}

            {{CREATE TEMPORARY TABLES}} privilege is supposed to allow all actions with temporary tables created by the session.
            However, while it also allows to _run_ {{SHOW COLUMNS}} on such tables, it's not sufficient to get a result, it remains empty.
            Oddly, {{SHOW INDEX}} works.

            {code:sql}
            create database db;
            create user foo@localhost;
            grant create temporary tables on db.* to foo@localhost;

            --connect (con1,localhost,foo,,db)
            create temporary table tmp (a int, key(a));
            show create table tmp;
            show columns in tmp;
            show index in tmp;

            # Cleanup
            --disconnect con1
            --connection default
            drop database db;
            drop user foo@localhost;
            {code}

            {code:sql|title=bb-10.9-anel 32274c3e8a4}
            show columns in tmp;
            Field Type Null Key Default Extra
            show index in tmp;
            Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
            tmp 1 a 1 a A NULL NULL NULL YES BTREE NO
            {code}

            cvicentiu Vicențiu Ciorbaru made changes -
            Assignee Vicențiu Ciorbaru [ cvicentiu ] Anel Husakovic [ anel ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            anel Anel Husakovic made changes -
            anel Anel Husakovic made changes -
            anel Anel Husakovic made changes -
            Assignee Anel Husakovic [ anel ] Vicențiu Ciorbaru [ cvicentiu ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            anel Anel Husakovic made changes -
            cvicentiu Vicențiu Ciorbaru made changes -
            Assignee Vicențiu Ciorbaru [ cvicentiu ] Anel Husakovic [ anel ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            cvicentiu Vicențiu Ciorbaru made changes -
            Fix Version/s 10.3.37 [ 28404 ]
            Fix Version/s 10.4.27 [ 28405 ]
            Fix Version/s 10.5.18 [ 28421 ]
            Fix Version/s 10.6.11 [ 28441 ]
            Fix Version/s 10.7.7 [ 28442 ]
            Fix Version/s 10.8.6 [ 28443 ]
            Fix Version/s 10.9.4 [ 28444 ]
            Fix Version/s 10.10.2 [ 28410 ]
            Fix Version/s 10.11.1 [ 28454 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.7 [ 24805 ]
            Fix Version/s 10.8 [ 26121 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]

            People

              anel Anel Husakovic
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.