Closed Bug 358698 Opened 19 years ago Closed 18 years ago

postgreSQL: Cannot create "New Environment"

Categories

(Testopia :: Environments, defect)

x86
Linux
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jonaliz55, Assigned: LpSolit)

References

Details

(Whiteboard: [blocker will fix])

User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; .NET CLR 1.0.3705; Googlebot; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 1.0.3705; Googlebot) Build Identifier: Software error: DBD::Pg::db do failed: ERROR: null value in column "environment_id" violates not-null constraint [for Statement "INSERT INTO test_environments (environment_id, product_id, name, isactive) VALUES (?,?,?,?)"] at Bugzilla/Testopia/Environment.pm line 449 Bugzilla::Testopia::Environment::store_environment_name('Bugzilla::Testopia::Environment=HASH(0x9c082f0)', 'jk_new_environment', 5) called at /var/www/html/bugzilla/tr_new_environment.cgi line 57 Reproducible: Always Steps to Reproduce: 1.Select "New Environment" option 2.Enter a name 3.Select "Create" Actual Results: As in Details Section
DB is postgreSQL.
Any updates on this?!
Severity: major → critical
This one confuses me. Do you see this error when entering a test plan or tesst case? Here is the field defined in the Schema.pm along with that of a bug. environment_id => {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1} bug_id => {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1} Here are the descriptions in the MySQL database. | Field | Type | Null | Key | Default | Extra | | environment_id | int(10) unsigned | NO | PRI | NULL | auto_increment | | bug_id | mediumint(9) | NO | PRI | NULL | auto_increment | Here is the actual insert statement: $dbh->do("INSERT INTO test_environments ($columns) VALUES (?,?,?,?)", undef, (undef,$product_id,$name,1)); Max, can you see any obvious problems?
Well, what's $columns? If the first column is environment_id, you can't insert a NULL into that field. If you want it to use its auto_increment value, you just have to not include it in the list of columns at all.
I see it when creating a New Environment. (In reply to comment #3) > This one confuses me. Do you see this error when entering a test plan or tesst > case? > Here is the field defined in the Schema.pm along with that of a bug. > environment_id => {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1} > bug_id => {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, > PRIMARYKEY => 1} > Here are the descriptions in the MySQL database. > | Field | Type | Null | Key | Default | Extra | > | environment_id | int(10) unsigned | NO | PRI | NULL | auto_increment | > | bug_id | mediumint(9) | NO | PRI | NULL | auto_increment | > Here is the actual insert statement: > $dbh->do("INSERT INTO test_environments ($columns) > VALUES (?,?,?,?)", undef, > (undef,$product_id,$name,1)); > Max, can you see any obvious problems?
Summary: Cannot create "New Environment" → postgreSQL: Cannot create "New Environment"
Version: unspecified → 1.1
Assignee: ghendricks → nobody
This will be fixed by bug 379529.
Assignee: nobody → LpSolit
Depends on: 379529
Whiteboard: [blocker will fix]
Target Milestone: --- → 1.3
The blocker has been checked in.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.