Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 632478 - Can't add foreign key
Summary: Can't add foreign key
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-30 07:32 UTC by Pál Csányi
Modified: 2017-10-01 19:26 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
This is the database in which I want to create the foreign key. (Engine.db,20.00 KB, application/x-sqlite3)
2017-09-30 07:32 UTC, Pál Csányi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pál Csányi 2017-09-30 07:32:09 UTC
Created attachment 497190 [details]
This is the database in which I want to create the foreign key.

I have installed on amd6 hardware the 
sqlitestudio version 3.1.1 with 
USE flags (cli cups -tcl -test LINGUAS="-de -es -fr -it -pl -pt_BR -ru -sk -zh_CN"

When I want to add a foreign key in SQLiteStudio at the and of process, when want to Commit changes, I get always the error message:
[09:28:22] Could not commit table structure. Error message: unknown column "&subtypename" in foreign key definition

One can see that "&" character at the beginning of the foreign key name. It is automatically added every time when trying to create a new foreign key.

This is a bug, I think.

Bellow is the SQL code for creating the foreign key:
PRAGMA foreign_keys = 0;

CREATE TABLE sqlitestudio_temp_table AS SELECT *
                                          FROM Subtypes;

DROP TABLE Subtypes;

CREATE TABLE Subtypes (
    subtypename TEXT PRIMARY KEY
                     UNIQUE,
    description TEXT,
    FOREIGN KEY (
        [&subtypename]
    )
    REFERENCES Types (type_name) ON DELETE CASCADE
                                 ON UPDATE CASCADE
);

INSERT INTO Subtypes (
                         subtypename,
                         description
                     )
                     SELECT subtypename,
                            description
                       FROM sqlitestudio_temp_table;

DROP TABLE sqlitestudio_temp_table;

PRAGMA foreign_keys = 1;
Comment 1 Jonas Stein gentoo-dev 2017-10-01 19:26:35 UTC
It is sad to read that you have problems with the software. The situation seems to be a bit more complicate and requires some analysis.
We can not help you efficiently via bug tracker. The bug tracker aims rather on specific problems in .ebuilds and less on individual systems. 

I have had very good experience on the gentoo IRC [1] with questions like this. Of course there are also forums and mailing lists [2,3].
I hope you understand, that I will close the bug here therefore and wish you good luck on one of the mentioned channels [4].
Please reopen the ticket in order to provide an indication for an specific error in an ebuild or any gentoo related product.

[1] https://www.gentoo.org/get-involved/irc-channels/
[2] https://forums.gentoo.org/
[3] https://www.gentoo.org/get-involved/mailing-lists/all-lists.html
[4] https://www.gentoo.org/support/