Program fails to handle server side errors

Bug #1121481 reported by David Thomas
12
This bug affects 2 people
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.

Tags: patch
Revision history for this message
David Thomas (d-r-thomas) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

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.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dbf2mysql (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.