FR#12-1QYI7IR Closed Comments
- +Defect Description:
When db is extracted with BCP file type, scripts containing "\n" are wrongly imported on local db
- +Defect Root Cause:
The reason is because characters following the Escape Charactor (backslash by default) in the SQL statements
are recognized and interpreted as special characters by the database server when importing data.
For example, the combination \n will be reconized as newline characters(\x0d in hexadecimal ASCII codes).
The fix is to add the escape charactor(\) before each backslash in the SQL statement when new records are inserted into table S_RT_SVC_SCRPT.
For example, if there is a combination \n in the SQL, then it will be replaced by \\n.
Thus, \\ will be take as a single \ because the first \ is escaped when run this SQL is excuted.
As the following charactor n keep its literal meaning. So, we got \n correctly in the database server.
Part 1: Hack the UTLOdbcExecDirectDDL() when data is being imported into table S_RT_SVC_SCRPT.
Part 2: Replacing every backslash with two backslashes except in these strings – "\\x0d", "\\x0a" and "\\x09",
because the backslash in these 3 strings of the .bcp file is translated not the original backslash.
So, firstly duplicating every single \, and then eliminating the additional \ in these strings.
- +Test Case
//Comments: This is the first case to test \a\b\f\n\r\t\v\\.
var Audible="\a Audible bell";
var Backspace="\b Backspace";
var Form="\f Form feed";
var Newline="\n Newline";
var Carriage="\r Carriage return";
var Tab="\t Tab";
var Vertical="\v Vertical tab";
var Backslash="\\ Backslash character";
var dummy="This \a is \b a \f mixed \t escape \\ string \r\n";
Comments: This is the second case to test \’ Single quote \" Double quote ### Octal number (example: ’33’ is the escape haracter) \x## Hex number (example: ‘\x1B’ is the escape character) Null character (example: ” is the null character) \u#### Unicode number (example: ‘\u001B’ is the escape character).
var Single="\’ Single quote";
var Double="\" Double quote";
var Backslash="Backslash \\ character";
var Octal="Octal number (example: 33 is the escape character)";
var Hex="Hex number (example: \x1B is the escape character)";
var NullCharacter="Null character (example: is the null character)";
var UnicodeNumber="Unicode number (example: \u001B is the escape character)";
/* Business Service Scripts — Name: Case_Three Program Language: eScript
Comments: This is the third case to test both ‘ single quotes and ` back quotes string type.
var Singlequote=’\’ Single quote\n’;
var Doublequote=’\" Double quote\n’;
var filePath=`This is a file path c:\notebook, quoted by back quotes`;
* This fix will also solve scripts containing "\\" are wrongly imported on local db as "\".
* The standalone loadtable.exe utility have the same issue. It will be fixed after a FR fired.
- + File Fixed:
- + Attachments: