Bug 275164 - Missing newline in MySQL codegenerator results in output being partially commented out on some models (trivial).
Summary: Missing newline in MySQL codegenerator results in output being partially comm...
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-07 23:14 UTC by Nikita Skovoroda
Modified: 2013-11-06 17:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.0
Sentry Crash Report:


Attachments
test file (open with umbrello, do a codegen) (18.58 KB, application/octet-stream)
2011-06-07 23:14 UTC, Nikita Skovoroda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Skovoroda 2011-06-07 23:14:45 UTC
Created attachment 60764 [details]
test file (open with umbrello, do a codegen)

Version:           unspecified (using Devel) 
OS:                Linux

http://websvn.kde.org/trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/sql/mysqlwriter.cpp?view=markup

160	    sql<<m_endl;
161	    sql<<"-- CHECK Constraints are not supported in Mysql ( as of version 5.x )";
162	    sql<<m_endl;
163	    sql<<"-- But it'll parse the statements without error ";
164	
165	    // call base class
166	    SQLWriter::printCheckConstraints( sql, constrList );

There should be a newline somewhere on lines 163/164.
Else, part of line 166 output could be commented out by line 163, as it does not always begin with a newline.

Reproducible: Always

Steps to Reproduce:
Download attached *.xmi file, open it, do a codegeneration (MySQL).
Look at the end of object2.sql. 

Actual Results:  
-- CHECK Constraints are not supported in Mysql ( as of version 5.x )
-- But it'll parse the statements without error ALTER TABLE object2 ADD CONSTRAINT object2_object1 FOREIGN KEY (parent) REFERENCES object1 (id);

Expected Results:  
-- CHECK Constraints are not supported in Mysql ( as of version 5.x )
-- But it'll parse the statements without error
ALTER TABLE object2 ADD CONSTRAINT object2_object1 FOREIGN KEY (parent) REFERENCES object1 (id);

This is not a good usecase, but i think that this should be fixed anyway.
Comment 1 Nikita Skovoroda 2012-05-22 15:33:24 UTC
Can someone please fix that? It's trivial.
Comment 2 Oliver Kellogg 2012-05-22 17:37:13 UTC
Yup.
Comment 3 Oliver Kellogg 2012-05-22 19:51:05 UTC
SVN commit 1296156 by okellogg:

MySQLWriter::printCheckConstraints():
Write missing m_endl to QTextStream before calling base method.



 M  +2 -0      ChangeLog  
 M  +1 -0      umbrello/codegenerators/sql/mysqlwriter.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1296156
Comment 4 Nikita Skovoroda 2012-05-22 19:57:34 UTC
Thanks!
Comment 5 Ralf Habacker 2013-11-06 17:15:59 UTC
apply fixed bug from 4.9.0 changelog