dspnyc / c5-db-migration

Automatically exported from code.google.com/p/c5-db-migration
0 stars 0 forks source link

Bug in ScriptRunner #45

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi there,

thanks for this great framework. It helped us a lot in our daily business.

I think I have found two little bugs:

What steps will reproduce the problem?
1. import a migration that contains an SQL insert statement with a varchar 
whose content spans multiple lines. E.g.

DELIMITER //

INSERT INTO foo
(content)
VALUES
('Hello World, this is sample content
   * first item
   * second item
   * third item')

//

DELIMITER ;

What is the expected output? What do you see instead?

The newlines and spaces to be inserted in the database as given in the insert 
statement

What version of the product are you using? On what operating system?

0.9.9-m5

Please provide any additional information below.

In line 112 in the class ScriptRunner the value of the variable 'line' is 
appended. This value been modified in line 74. The result is that any leading 
spaces in the content string are lost.

In line 113 a space is appended to the command buffer instead of the newline 
character. The result is that any newlines in the content string are lost.

Remembering the original line before trimming it and inserting the original 
line in line 112 would solve the problem with the spaces. Replacing line 113 
with 'command.append(System.getProperty("line.separator"));' would solve the 
newline problem.

Regards,
Thomas

Original issue reported on code.google.com by thomas.w...@googlemail.com on 9 Feb 2011 at 9:02