Bug #16389 mysqldump crashes
Submitted: 11 Jan 2006 21:47 Modified: 21 Feb 2006 2:47
Reporter: Wolfgang Fahl Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S1 (Critical)
Version:4.1.XX OS:Microsoft Windows (Windows XP)
Assigned to: Jim Winstead CPU Architecture:Any

[11 Jan 2006 21:47] Wolfgang Fahl
Description:
Testcase RQ013_AC001 of the GENEPI system fails with mysqldump crashing.
(Repeatable) - problem shows since Views are used in conjunction with Tables.
PROBLEM: backup failed with return-code: -1073741819

How to repeat:
CREATE/ALTER TABLE for GV1_User asked for ...
using ...'CREATE TABLE GV1_User (oid varchar(32) NOT NULL, id varchar(255) NOT NULL, password varchar(16), fullname varchar(255), administrator BOOL, email varchar(255), isFormsMaster BOOL, languageCode varchar(32), phone varchar(255), mobile varchar(255), fax varchar(255), myOrganization_id varchar(255), myUserRole_name varchar(255), PRIMARY KEY(id));'
done
CREATE VIEW for GV1_UserView asked for ...
using ...'CREATE VIEW GV1_UserView AS SELECT GV1_User.*, GV1_Organization.id, GV1_Organization.name, GV1_Organization.status, GV1_UserRole.name FROM GV1_User, GV1_Organization, GV1_UserRole WHERE GV1_User.myOrganization_id=GV1_Organization.id AND GV1_User.myUserRole_name=GV1_UserRole.name;'
 PROBLEM: CREATE VIEW GV1_UserView AS SELECT GV1_User.*, GV1_Organization.id, GV1_Organization.name, GV1_Organization.status, GV1_UserRole.name FROM GV1_User, GV1_Organization, GV1_UserRole WHERE GV1_User.myOrganization_id=GV1_Organization.id AND GV1_User.myUserRole_name=GV1_UserRole.name; failed: boolean
mysql-query failed: 'DB Error: unknown error' Error -1: DB Error: unknown error native: CREATE VIEW GV1_UserView AS SELECT GV1_User.*, GV1_Organization.id, GV1_Organization.name, GV1_Organization.status, GV1_UserRole.name FROM GV1_User, GV1_Organization, GV1_UserRole WHERE GV1_User.myOrganization_id=GV1_Organization.id AND GV1_User.myUserRole_name=GV1_UserRole.name; [nativecode=1060 ** Duplicate column name 'id'][-1]
DROP TABLE GV1_Organization; asked for ...done
CREATE/ALTER TABLE for GV1_Organization asked for ...
using ...'CREATE TABLE GV1_Organization (oid varchar(32) NOT NULL, id varchar(255) NOT NULL, name varchar(255), unit varchar(255), address text, countrycode varchar(32), state varchar(255), city varchar(255), web varchar(255), status varchar(255), mainContact_id varchar(255), PRIMARY KEY(id));'
done
DROP VIEW GV1_OrganizationView; asked for ...done
CREATE VIEW for GV1_OrganizationView asked for ...
using ...'CREATE VIEW GV1_OrganizationView AS SELECT GV1_Organization.* FROM GV1_Organization;'
done
DROP TABLE GC1_GPIC; asked for ...done
CREATE/ALTER TABLE for GC1_GPIC asked for ...
using ...'CREATE TABLE GC1_GPIC (oid varchar(32) NOT NULL, code varchar(18) NOT NULL, isUsed BOOL, myCenter_id varchar(255), PRIMARY KEY(code));'
done
DROP VIEW GC1_GPICView; asked for ...done
CREATE VIEW for GC1_GPICView asked for ...
using ...'CREATE VIEW GC1_GPICView AS SELECT GC1_GPIC.*, GC1_Center.id, GC1_Center.name, GC1_Center.status FROM GC1_GPIC, GC1_Center WHERE GC1_GPIC.myCenter_id=GC1_Center.id;'
done
DROP TABLE GC1_PatientTumourTherapy; asked for ...done
CREATE/ALTER TABLE for GC1_PatientTumourTherapy asked for ...
using ...'CREATE TABLE GC1_PatientTumourTherapy (oid varchar(32) NOT NULL, GPIC varchar(18) NOT NULL, ageatstart numeric NOT NULL, gender ENUM ('f', 'm') NOT NULL, informed_consent ENUM ('ic_no', 'ic_yes', 'ic_limited') NOT NULL, date_ic DATE, myCenter_id varchar(255), myTumourSite_id varchar(255), therapy_protocol_id varchar(255), therapy_start DATE, fu_time numeric, activeFollowup BOOL, nextFollowup DATE, late_morbidity_G2 BOOL, late_morbidity_G3 BOOL, quality_dosimetry BOOL, quality_clinical_data BOOL, PRIMARY KEY(GPIC));'
done
DROP VIEW GC1_PatientTumourTherapyView; asked for ...done
CREATE VIEW for GC1_PatientTumourTherapyView asked for ...
using ...'CREATE VIEW GC1_PatientTumourTherapyView AS SELECT GC1_PatientTumourTherapy.*, GC1_Center.id, GC1_Center.name, GC1_Center.status FROM GC1_PatientTumourTherapy, GC1_Center WHERE GC1_PatientTumourTherapy.myCenter_id=GC1_Center.id;'
done
DROP TABLE GC1_TumourSite; asked for ...done
CREATE/ALTER TABLE for GC1_TumourSite asked for ...
using ...'CREATE TABLE GC1_TumourSite (oid varchar(32) NOT NULL, id varchar(40) NOT NULL, name varchar(255), PRIMARY KEY(id));'
done
DROP VIEW GC1_TumourSiteView; asked for ...done
CREATE VIEW for GC1_TumourSiteView asked for ...
using ...'CREATE VIEW GC1_TumourSiteView AS SELECT GC1_TumourSite.* FROM GC1_TumourSite;'
done
DROP TABLE GC1_Treatment; asked for ...done
CREATE/ALTER TABLE for GC1_Treatment asked for ...
using ...'CREATE TABLE GC1_Treatment (oid varchar(32) NOT NULL, id varchar(40) NOT NULL, ther_protarm varchar(255), shortDescription varchar(255), quality_dosimetry BOOL, quality_clinical_data BOOL, followup_Pattern varchar(255), protocol_id varchar(255), myTumourSite_id varchar(255), PRIMARY KEY(id));'
done
DROP VIEW GC1_TreatmentView; asked for ...done
CREATE VIEW for GC1_TreatmentView asked for ...
using ...'CREATE VIEW GC1_TreatmentView AS SELECT GC1_Treatment.* FROM GC1_Treatment;'
done
DROP TABLE GC1_TreatmentsPerCenter; asked for ...done
CREATE/ALTER TABLE for GC1_TreatmentsPerCenter asked for ...
using ...'CREATE TABLE GC1_TreatmentsPerCenter (oid varchar(32) NOT NULL, myCenters_id varchar(255), myTreatments_id varchar(255));'
done
DROP VIEW GC1_TreatmentsPerCenterView; asked for ...done
CREATE VIEW for GC1_TreatmentsPerCenterView asked for ...
using ...'CREATE VIEW GC1_TreatmentsPerCenterView AS SELECT GC1_TreatmentsPerCenter.*, GC1_Center.id, GC1_Center.name, GC1_Center.status FROM GC1_TreatmentsPerCenter, GC1_Center WHERE GC1_TreatmentsPerCenter.myCenters_id=GC1_Center.id;'
done
DROP TABLE GC1_FollowupSideeffect; asked for ...done
CREATE/ALTER TABLE for GC1_FollowupSideeffect asked for ...
using ...'CREATE TABLE GC1_FollowupSideeffect (oid varchar(32) NOT NULL, id varchar(255) NOT NULL, followup_date DATE NOT NULL, sideeff_G4andG5 BOOL, late_morbidity_G3 BOOL, late_morbidity_G2 BOOL, sideeff_RT_related ENUM ('unrelated', 'unlikely', 'possible', 'probable', 'definitely', 'unclear'), myPatient_GPIC varchar(255), PRIMARY KEY(id));'
done
DROP VIEW GC1_FollowupSideeffectView; asked for ...done
CREATE VIEW for GC1_FollowupSideeffectView asked for ...
using ...'CREATE VIEW GC1_FollowupSideeffectView AS SELECT GC1_FollowupSideeffect.* FROM GC1_FollowupSideeffect;'
done
DROP TABLE GC1_Material; asked for ...done
CREATE/ALTER TABLE for GC1_Material asked for ...
using ...'CREATE TABLE GC1_Material (oid varchar(32) NOT NULL, id varchar(255) NOT NULL, material_type varchar(32), cell_line BOOL, collection_date DATE, last_shipping_date DATE, qa_procedure BOOL, number_of_samples numeric, loc_sample_id varchar(255), myPatient_GPIC varchar(255), PRIMARY KEY(id));'
done
CREATE VIEW for GC1_MaterialView asked for ...
using ...'CREATE VIEW GC1_MaterialView AS SELECT GC1_Material.*, GC1_Center.id, GC1_Center.name, GC1_Center.status FROM GC1_Material, GC1_Center WHERE GC1_Material.loc_sample_id=GC1_Center.id;'
 PROBLEM: CREATE VIEW GC1_MaterialView AS SELECT GC1_Material.*, GC1_Center.id, GC1_Center.name, GC1_Center.status FROM GC1_Material, GC1_Center WHERE GC1_Material.loc_sample_id=GC1_Center.id; failed: boolean
mysql-query failed: 'DB Error: unknown error' Error -1: DB Error: unknown error native: CREATE VIEW GC1_MaterialView AS SELECT GC1_Material.*, GC1_Center.id, GC1_Center.name, GC1_Center.status FROM GC1_Material, GC1_Center WHERE GC1_Material.loc_sample_id=GC1_Center.id; [nativecode=1060 ** Duplicate column name 'id'][-1]
DROP TABLE genepiv1_offstudyform; asked for ...done
CREATE/ALTER TABLE for genepiv1_offstudyform asked for ...
using ...'CREATE TABLE genepiv1_offstudyform (oid varchar(32) NOT NULL, myPatient_GPIC varchar(255) NOT NULL, offstudy_date DATE NOT NULL, why_offstudy varchar(32) NOT NULL, cause_of_death varchar(32), PRIMARY KEY(myPatient_GPIC));'
done
DROP VIEW genepiv1_offstudyformView; asked for ...done
CREATE VIEW for genepiv1_offstudyformView asked for ...
using ...'CREATE VIEW genepiv1_offstudyformView AS SELECT genepiv1_offstudyform.* FROM genepiv1_offstudyform;'
done
 Database Backup
Trying Backup to C:\temp/testdb-2006-01-11_22_44_27.sql
with mysqldump --quick --add-locks --no-create-db --lock-tables --no-create-info --complete-insert --extended-insert=false --host=localhost --user=test --password=**passhidden** testdb > C:\temp/testdb-2006-01-11_22_44_27.sql
 PROBLEM: backup failed with return-code: -1073741819

Suggested fix:
show a proper error message if something is wrong, but don't crash
[11 Jan 2006 22:59] Miguel Solorzano
Are you able for to create a backup script with MySQL Administrator and
provide it? If yes I will create the database and then test with mysqldump
like you reported.

Thanks in advance.
[12 Jan 2006 8:25] Wolfgang Fahl
A script with the DDL commands issued before the crash

Attachment: mysqlbug6.sql (text/x-delimtext), 8.67 KiB.

[12 Jan 2006 8:28] Wolfgang Fahl
As it looks the problem is not with 5.0.18 but with 4.1

I had a wrong mysql.home configuration:
File php.ini:
; mysql home directory
mysql.home=c:/Programme/MySQL/MySQL Server 4.1/

This way I was using mySQL 5.0 as the database server listening on port 3306 but was using the mysqldump facility of Version 4.1
mysql  Ver 14.7 Distrib 4.1.14, for Win32 (ia32)

May be the 4.1 mysqldump facility should know when it's connecting to an incompatible server and not crash in such a case ..
[30 Jan 2006 11:49] Miguel Solorzano
I was able to repeat with mysqldump 4.1.XX crashing when tries to dump
a view created with 5.0.XX server.
[1 Feb 2006 20:28] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/2024
[14 Feb 2006 15:17] Magnus BlÄudd
Patch approved, already in 5.0
[15 Feb 2006 17:13] Jim Winstead
Fixed in 4.1.19.
[21 Feb 2006 2:47] Paul Dubois
Noted in 4.1.19 changelog.

          <command>mysqldump</command> tried to dump data from a view.
          (In MySQL 4.1, this applies when connecting to a server from
          MySQL 5.0 or higher.) (Bug #16389)