• Query OK, 0 rows affected, 1 warning (0.063 sec)

    From Jerry Stuckle@21:1/5 to All on Sat Dec 7 12:13:51 2019
    On 12/7/2019 11:49 AM, ^Bart wrote:
    I don't understand which is this warning :\

    CREATE TABLE subfoodgroups
    (
    subfoodgroup_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    name VARCHAR(30) NOT NULL,
    language_id SMALLINT(5) UNSIGNED NOT NULL,
    foodgroup_id INT(10) UNSIGNED NOT NULL,
    rawmaterial ENUM ("Yes","No"),
    PRIMARY KEY (subfoodgroup_id),
    INDEX (language_id),
    FOREIGN KEY (language_id) REFERENCES languages (language_id),
    INDEX (language_id),
    FOREIGN KEY (foodgroup_id) REFERENCES foodgroups (foodgroup_id)
    )
    ENGINE=INNODB;

    ^Bart

    What was the warning?


    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    jstucklex@attglobal.net
    ==================

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lew Pitcher@21:1/5 to Jerry Stuckle on Sat Dec 7 12:36:39 2019
    Jerry Stuckle wrote:

    On 12/7/2019 11:49 AM, ^Bart wrote:
    I don't understand which is this warning :\

    CREATE TABLE subfoodgroups
    (
    subfoodgroup_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    name VARCHAR(30) NOT NULL,
    language_id SMALLINT(5) UNSIGNED NOT NULL,
    foodgroup_id INT(10) UNSIGNED NOT NULL,
    rawmaterial ENUM ("Yes","No"),
    PRIMARY KEY (subfoodgroup_id),
    INDEX (language_id),
    FOREIGN KEY (language_id) REFERENCES languages (language_id),
    INDEX (language_id),
    FOREIGN KEY (foodgroup_id) REFERENCES foodgroups (foodgroup_id)
    )
    ENGINE=INNODB;

    ^Bart

    What was the warning?

    Agreed.

    FWIW, ERROR_CANNOT_REPRODUCE

    mysql> create table languages
    -> (
    -> language_id smallint(5) unsigned not null auto_increment primary key
    -> ) engine=innodb;
    Query OK, 0 rows affected (0.00 sec)

    mysql> create table foodgroups
    -> (
    -> foodgroup_id int(10) unsigned not null auto_increment primary key
    -> ) engine=innodb;
    Query OK, 0 rows affected (0.01 sec)

    mysql> CREATE TABLE subfoodgroups
    -> (
    -> subfoodgroup_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    -> name VARCHAR(30) NOT NULL,
    -> language_id SMALLINT(5) UNSIGNED NOT NULL,
    -> foodgroup_id INT(10) UNSIGNED NOT NULL,
    -> rawmaterial ENUM ("Yes","No"),
    -> PRIMARY KEY (subfoodgroup_id),
    -> INDEX (language_id),
    -> FOREIGN KEY (language_id) REFERENCES languages (language_id),
    -> INDEX (language_id),
    -> FOREIGN KEY (foodgroup_id) REFERENCES foodgroups (foodgroup_id)
    -> )
    -> ENGINE=INNODB;
    Query OK, 0 rows affected (0.02 sec)

    mysql> explain subfoodgroups; +-----------------+----------------------+------+-----+---------+----------------+
    | Field | Type | Null | Key | Default | Extra |
    +-----------------+----------------------+------+-----+---------+----------------+
    | subfoodgroup_id | int(10) unsigned | NO | PRI | NULL | auto_increment |
    | name | varchar(30) | NO | | NULL | |
    | language_id | smallint(5) unsigned | NO | MUL | NULL | |
    | foodgroup_id | int(10) unsigned | NO | MUL | NULL | |
    | rawmaterial | enum('Yes','No') | YES | | NULL | |
    +-----------------+----------------------+------+-----+---------+----------------+
    5 rows in set (0.00 sec)

    mysql>




    --
    Lew Pitcher
    "In Skills, We Trust"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J.O. Aho@21:1/5 to All on Sat Dec 7 21:33:57 2019
    On 07/12/2019 17.49, ^Bart wrote:
    I don't understand which is this warning :\

    CREATE TABLE subfoodgroups
    (
    subfoodgroup_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    name VARCHAR(30) NOT NULL,
    language_id SMALLINT(5) UNSIGNED NOT NULL,
    foodgroup_id INT(10) UNSIGNED NOT NULL,
    rawmaterial ENUM ("Yes","No"),
    PRIMARY KEY (subfoodgroup_id),
    INDEX (language_id),
    FOREIGN KEY (language_id) REFERENCES languages (language_id),
    INDEX (language_id),
    FOREIGN KEY (foodgroup_id) REFERENCES foodgroups (foodgroup_id)
    )
    ENGINE=INNODB;

    ^Bart

    You get a warning when your string is longer than 30 characters long,
    don't forget that UTF characters may take 2 or more in your table.

    --

    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ^Bart@21:1/5 to All on Sat Dec 7 17:49:34 2019
    I don't understand which is this warning :\

    CREATE TABLE subfoodgroups
    (
    subfoodgroup_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    name VARCHAR(30) NOT NULL,
    language_id SMALLINT(5) UNSIGNED NOT NULL,
    foodgroup_id INT(10) UNSIGNED NOT NULL,
    rawmaterial ENUM ("Yes","No"),
    PRIMARY KEY (subfoodgroup_id),
    INDEX (language_id),
    FOREIGN KEY (language_id) REFERENCES languages (language_id),
    INDEX (language_id),
    FOREIGN KEY (foodgroup_id) REFERENCES foodgroups (foodgroup_id)
    )
    ENGINE=INNODB;

    ^Bart

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)