Program fails to handle server side errors
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dbf2mysql (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
dbf2mysql version 1.14a-3.1build1 as packaged on lucid run against MySQL 5.x database does not report server side errors to the user.
Noted that source code for 1.14a-3.1build2 on precise does not differ (only change is update to changelog regarding linking against updated library).
Steps to reproduce problem:
1. Take any available dbf file which has a field which is unique within the records (candidate key)
2. Use dbf2mysql to import the table into a database
3. Use mysql client alter the table to make the identified candidate key into a primary key
ALTER TABLE test CREATE CONSTRAINT PRIMARY KEY (key)
4. Use dbf2mysql with -vvv to re-import the same file
Actual behaviour:
Program claims to be inserting records, but no additional records will be inserted
Expected behaviour:
Program should report Unique constraint violation for every record processed
Error arises because code assumes that mysql_query returns 0 for OK and -1 for error; according to documentation it returns 0 for OK and non-zero for error.
The attachment "10_error_ handler. dpatch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.
[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]