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

inconsistent behavior on error during index creation in CSV table

    XMLWordPrintable

Details

    Description

      For table below I wanted to simulate an error during index file creation (e.g. permission issue). So folder with name ../t/qq1.dnx was created.

      MariaDB [test]> show create table test2\G
      *************************** 1. row ***************************
             Table: test2
      Create Table: CREATE TABLE `test2` (
        `num` int(11) NOT NULL,
        `name` varchar(255) DEFAULT NULL
      ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `file_name`='../t/qq1' `sep_char`=';'
      1 row in set (0.00 sec)
      
      

      Problem 1: engine doesn't report an error, only warning:

      MariaDB [test]> alter table test2 add index(num);
      Query OK, 0 rows affected, 1 warning (0.00 sec)
      Records: 0  Duplicates: 0  Warnings: 1
       
      MariaDB [test]> show warnings;
      +---------+------+----------------------------------------------------------------------------------------------------------------------------+
      | Level   | Code | Message                                                                                                                    |
      +---------+------+----------------------------------------------------------------------------------------------------------------------------+
      | Warning | 1105 | Open error 21 in mode wb on /home/alice/dt/./test/../t/qq1.dnx: Is a directory |
      +---------+------+----------------------------------------------------------------------------------------------------------------------------+
      
      

      Problem 2: Engine pretends that index exists (while no index file was created):

      MariaDB [test]> show create table test2\G
      *************************** 1. row ***************************
             Table: test2
      Create Table: CREATE TABLE `test2` (
        `num` int(11) NOT NULL,
        `name` varchar(255) DEFAULT NULL,
        KEY `num` (`num`)
      ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `file_name`='../t/qq1' `sep_char`=';'
      1 row in set (0.00 sec)
      
      

      Not sure if this is expected behavior

      Attachments

        Activity

          People

            bertrandop Olivier Bertrand
            alice Alice Sherepa
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.