1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into engine-api

This commit is contained in:
jsteemann 2017-03-09 16:06:53 +01:00
commit b51839dae7
4 changed files with 23 additions and 19 deletions

View File

@ -1,6 +1,8 @@
devel
-----
* fixed issue #2367
* added "bindVars" to attributes of currently running and slow queries
* added "jsonl" as input file type for arangoimp

View File

@ -576,7 +576,9 @@ void ImportHelper::addField(char const* field, size_t fieldLength, size_t row,
} else {
if (IsInteger(field, fieldLength) || IsDecimal(field, fieldLength)) {
// numeric value. don't convert
_lineBuffer.appendChar('"');
_lineBuffer.appendText(field, fieldLength);
_lineBuffer.appendChar('"');
} else {
// non-numeric value
_lineBuffer.appendJsonEncoded(field, fieldLength);

View File

@ -3234,7 +3234,7 @@ const impTodos = [{
type: 'csv',
create: 'true',
separator: ',',
convert: true,
convert: false,
backslash: true
}, {
id: 'csvnoeol',

View File

@ -291,26 +291,26 @@ function importTestSuite () {
testCsvImportNoConvert : function () {
var expected = [
{ value1: 1 },
{ value1: 2, value2: false },
{ value1: 3, value2: true },
{ value1: 4, value2: 1 },
{ value1: 5, value2: 2 },
{ value1: 6, value2: 3 },
{ value1: 7, value2: "a" },
{ value1: 8, value2: "b" },
{ value1: 9, value2: " a" },
{ value1: 10, value2: -1 },
{ value1: 11, value2: -0.5 },
{ value1: 12, value2: 3.566 },
{ value1: 13, value2: 0 },
{ value1: 14 },
{ value1: 15, value2: " c" },
{ value1: 16, value2: " 1" }
{ value1: "1" },
{ value1: "2", value2: false },
{ value1: "3", value2: true },
{ value1: "4", value2: "1" },
{ value1: "5", value2: "2" },
{ value1: "6", value2: "3" },
{ value1: "7", value2: "a" },
{ value1: "8", value2: "b" },
{ value1: "9", value2: " a" },
{ value1: "10", value2: "-1" },
{ value1: "11", value2: "-.5" },
{ value1: "12", value2: "3.566" },
{ value1: "13", value2: "0" },
{ value1: "14" },
{ value1: "15", value2: " c" },
{ value1: "16", value2: " 1" }
];
var actual = getQueryResults("FOR i IN UnitTestsImportCsvNoConvert SORT i.value1 RETURN i");
assertEqual(expected, actual);
var actual = getQueryResults("FOR i IN UnitTestsImportCsvNoConvert SORT TO_NUMBER(i.value1) RETURN i");
assertEqual(JSON.stringify(expected), JSON.stringify(actual));
},
////////////////////////////////////////////////////////////////////////////////