Details

    Description

      Foreign keys aren't supported by MyISAM (AFAIK) and the data is discarded after create table.
      It'd be nice if the relations data wasn't discarded such that GUI tools like phpMyAdmin can use the information.

      Attachments

        Issue Links

          Activity

            Won't it be confusing to show foreign keys that aren't enforced?

            I suppose SHOW CREATE TABLE can show them just as it shows unsupported table attributes — inside a comment. But then GUI tools won't be able to see them anyway.

            serg Sergei Golubchik added a comment - Won't it be confusing to show foreign keys that aren't enforced? I suppose SHOW CREATE TABLE can show them just as it shows unsupported table attributes — inside a comment. But then GUI tools won't be able to see them anyway.

            Maybe
            The goal is for phpMyAdmin to know the key references another table.

            Perhaps per-field meta-data would be a better way to store this.

            XTF Olaf van der Spek added a comment - Maybe The goal is for phpMyAdmin to know the key references another table. Perhaps per-field meta-data would be a better way to store this.

            I don't see any possible fix that could be done just on MariaDB side, without any changes to phpMyAdmin.

            And if phpMyAdmin has to be modified, then we do the fix with showing foreign keys in a comment. It'll be consistent with:

            MariaDB [test]> set sql_mode=IGNORE_BAD_TABLE_OPTIONS;
            Query OK, 0 rows affected (0.01 sec)
            MariaDB [test]> create table t1 (a int foobar=blabla) century=21;
            Query OK, 0 rows affected, 2 warnings (0.00 sec)
            MariaDB [test]> show create table t1\G
            *************************** 1. row ***************************
                   Table: t1
            Create Table: CREATE TABLE `t1` (
              `a` int(11) DEFAULT NULL `foobar`=blabla
            ) ENGINE=MyISAM DEFAULT CHARSET=latin1 `century`=21
            1 row in set (0.00 sec)
            MariaDB [test]> set sql_mode='';
            Query OK, 0 rows affected (0.01 sec)
            MariaDB [test]> show create table t1\G
            *************************** 1. row ***************************
                   Table: t1
            Create Table: CREATE TABLE `t1` (
              `a` int(11) DEFAULT NULL /* `foobar`=blabla */
            ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /* `century`=21 */
            1 row in set (0.00 sec)
            

            Note, how unsupported attributes are printed inside a comment when IGNORE_BAD_TABLE_OPTIONS is not set.

            serg Sergei Golubchik added a comment - I don't see any possible fix that could be done just on MariaDB side, without any changes to phpMyAdmin. And if phpMyAdmin has to be modified, then we do the fix with showing foreign keys in a comment. It'll be consistent with: MariaDB [test]> set sql_mode=IGNORE_BAD_TABLE_OPTIONS; Query OK, 0 rows affected (0.01 sec) MariaDB [test]> create table t1 (a int foobar=blabla) century=21; Query OK, 0 rows affected, 2 warnings (0.00 sec) MariaDB [test]> show create table t1\G *************************** 1. row *************************** Table : t1 Create Table : CREATE TABLE `t1` ( `a` int (11) DEFAULT NULL `foobar`=blabla ) ENGINE=MyISAM DEFAULT CHARSET=latin1 `century`=21 1 row in set (0.00 sec) MariaDB [test]> set sql_mode= '' ; Query OK, 0 rows affected (0.01 sec) MariaDB [test]> show create table t1\G *************************** 1. row *************************** Table : t1 Create Table : CREATE TABLE `t1` ( `a` int (11) DEFAULT NULL /* `foobar`=blabla */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /* `century`=21 */ 1 row in set (0.00 sec) Note, how unsupported attributes are printed inside a comment when IGNORE_BAD_TABLE_OPTIONS is not set.

            People

              Unassigned Unassigned
              XTF Olaf van der Spek
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.