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

Not quite correct error message upon CHECK with FK violation due to wrong engine

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Trivial
    • Resolution: Unresolved
    • N/A
    • 11.8
    • Admin statements
    • None

    Description

      --source include/have_innodb.inc
       
      set foreign_key_checks=0;
      create or replace table t2 (b int, foreign key (b) references t1(a)) engine=InnoDB;
      set foreign_key_checks=1;
      create or replace table t1 (pk int primary key, a int, key(a)) engine=MyISAM;
      check table t2 extended;
      drop table t1, t2;
      

      bb-11.8-check-table ceb64ee4d1d5af7ab608bbfd35de88510cce82ea

      check table t2 extended;
      Table	Op	Msg_type	Msg_text
      test.t2	check	Warning	No suitable key found for foreign key t2_ibfk_1 in table test.t1
      test.t2	check	error	Corrupt
      

      It is probably easily justifiable from the implementation point of view, but from a user perspective it's wrong – the key is actually fine in the referenced table, it's everything else (the engine, that is) that's wrong.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.