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

User is case insensitive in INFORMATION_SCHEMA.VIEWS

    XMLWordPrintable

Details

    Description

      I run this MTR test:

      CREATE USER foo;
      CREATE USER FOO;
      GRANT SELECT ON test.* TO foo;
      GRANT SELECT ON test.* TO FOO;
       
      CREATE DEFINER=foo SQL SECURITY INVOKER VIEW v1 AS SELECT 1 AS c1;
       
      --connect (FOO, localhost, FOO, , test)
      --connection FOO
       
      SELECT CURRENT_USER;
      --vertical_results
      --query_vertical SELECT * FROM INFORMATION_SCHEMA.VIEWS
      --horizontal_results
       
      --disconnect FOO
      --connection default
       
      DROP VIEW v1;
      DROP USER foo;
      DROP USER FOO;
      

      It produces the following outout:

      ...
      SELECT CURRENT_USER;
      CURRENT_USER
      FOO@%
      SELECT * FROM INFORMATION_SCHEMA.VIEWS;
      TABLE_CATALOG	def
      TABLE_SCHEMA	test
      TABLE_NAME	v1
      VIEW_DEFINITION	select 1 AS `c1`
      CHECK_OPTION	NONE
      IS_UPDATABLE	NO
      DEFINER	foo@%
      SECURITY_TYPE	INVOKER
      CHARACTER_SET_CLIENT	latin1
      COLLATION_CONNECTION	latin1_swedish_ci
      ...
      

      Notice, the colum VIEW_DEFINITION is not empty, which is wrong:

      • The view belongs to user 'foo' (with all lower case letters)
      • The user querying I_S.VIEW is 'FOO' (with all upper case letters) - it's a different user!

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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