Bug 976266 - schema.sql prevents user creation via sql script
schema.sql prevents user creation via sql script
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: koji (Show other bugs)
18
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Dennis Gilmore
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-20 04:58 EDT by Salim Badakhchani
Modified: 2016-04-18 02:04 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-20 12:00:04 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Working schema.sql file (29.47 KB, text/x-sql)
2013-06-20 04:58 EDT, Salim Badakhchani
no flags Details

  None (edit)
Description Salim Badakhchani 2013-06-20 04:58:16 EDT
Created attachment 763329 [details]
Working schema.sql file

Description of problem:  

Strange issue arises with the schema.sql that is shipped with this release.  I used a simple script to create koji users during the installation process which is now broken.  When I diff the working file with the broken file only the order of some sql statements are different but its enough to break the creation of users.  

The diffs:

[root@localhost kojak]# diff schema.sql /usr/share/doc/koji-1.8.0/docs/schema.sql 
736a737,744
> -- tracks the contents of an image
> CREATE TABLE image_listing (
> 	image_id INTEGER NOT NULL REFERENCES image_archives(archive_id),
> 	rpm_id INTEGER NOT NULL REFERENCES rpminfo(id),
> 	UNIQUE (image_id, rpm_id)
> ) WITHOUT OIDS;
> CREATE INDEX image_listing_rpms on image_listing(rpm_id);
> 
748,755d755
< 
< -- tracks the contents of an image
< CREATE TABLE image_listing (
< 	image_id INTEGER NOT NULL REFERENCES image_archives(archive_id),
< 	rpm_id INTEGER NOT NULL REFERENCES rpminfo(id),
< 	UNIQUE (image_id, rpm_id)
< ) WITHOUT OIDS;
< CREATE INDEX image_listing_rpms on image_listing(rpm_id);


The script I use to create the users...

insert into users (name, status, usertype) values ('koji', 0, 0);
insert into user_perms (user_id, perm_id, creator_id) values (1, 1, 1);
insert into users (name, status, usertype) values ('kojiadmin', 0, 0);
insert into user_perms (user_id, perm_id, creator_id) values (2, 1, 1);
\q


Version-Release number of selected component (if applicable):
koji-1.8.0-1.fc18.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create the database and apply schema.sql
2. Attempt to create the users
3.

Actual results:
ROLLBACK
+ su -l koji -c 'psql koji koji < /tmp/users.sql'
ERROR:  relation "users" does not exist
LINE 1: insert into users (name, status, usertype) values ('koji', 0...
                    ^
ERROR:  relation "user_perms" does not exist
LINE 1: insert into user_perms (user_id, perm_id, creator_id) values...
                    ^
ERROR:  relation "users" does not exist
LINE 1: insert into users (name, status, usertype) values ('kojiadmi...
                    ^
ERROR:  relation "user_perms" does not exist
LINE 1: insert into user_perms (user_id, perm_id, creator_id) values...
                    ^
+ systemctl restart postgresql.service


Expected results:

+ su -l koji -c 'psql koji koji < /tmp/users.sql'
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1

Additional info:
Comment 1 Salim Badakhchani 2013-06-20 05:44:53 EDT
I just diffed my working copy with the latest version of the one in https://git.fedorahosted.org/cgit/koji/ and they are identical.  I guess these files have not been pushed out yet as part of the packages made available for general download?
Comment 2 Mike Bonnet 2013-06-20 12:00:04 EDT
Yes, this has been fixed upstream and will be pushed out with the next release.

Note You need to log in before you can comment on or make changes to this bug.