mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into engine-api
This commit is contained in:
commit
b51839dae7
|
@ -1,6 +1,8 @@
|
||||||
devel
|
devel
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
* fixed issue #2367
|
||||||
|
|
||||||
* added "bindVars" to attributes of currently running and slow queries
|
* added "bindVars" to attributes of currently running and slow queries
|
||||||
|
|
||||||
* added "jsonl" as input file type for arangoimp
|
* added "jsonl" as input file type for arangoimp
|
||||||
|
|
|
@ -576,7 +576,9 @@ void ImportHelper::addField(char const* field, size_t fieldLength, size_t row,
|
||||||
} else {
|
} else {
|
||||||
if (IsInteger(field, fieldLength) || IsDecimal(field, fieldLength)) {
|
if (IsInteger(field, fieldLength) || IsDecimal(field, fieldLength)) {
|
||||||
// numeric value. don't convert
|
// numeric value. don't convert
|
||||||
|
_lineBuffer.appendChar('"');
|
||||||
_lineBuffer.appendText(field, fieldLength);
|
_lineBuffer.appendText(field, fieldLength);
|
||||||
|
_lineBuffer.appendChar('"');
|
||||||
} else {
|
} else {
|
||||||
// non-numeric value
|
// non-numeric value
|
||||||
_lineBuffer.appendJsonEncoded(field, fieldLength);
|
_lineBuffer.appendJsonEncoded(field, fieldLength);
|
||||||
|
|
|
@ -3234,7 +3234,7 @@ const impTodos = [{
|
||||||
type: 'csv',
|
type: 'csv',
|
||||||
create: 'true',
|
create: 'true',
|
||||||
separator: ',',
|
separator: ',',
|
||||||
convert: true,
|
convert: false,
|
||||||
backslash: true
|
backslash: true
|
||||||
}, {
|
}, {
|
||||||
id: 'csvnoeol',
|
id: 'csvnoeol',
|
||||||
|
|
|
@ -291,26 +291,26 @@ function importTestSuite () {
|
||||||
|
|
||||||
testCsvImportNoConvert : function () {
|
testCsvImportNoConvert : function () {
|
||||||
var expected = [
|
var expected = [
|
||||||
{ value1: 1 },
|
{ value1: "1" },
|
||||||
{ value1: 2, value2: false },
|
{ value1: "2", value2: false },
|
||||||
{ value1: 3, value2: true },
|
{ value1: "3", value2: true },
|
||||||
{ value1: 4, value2: 1 },
|
{ value1: "4", value2: "1" },
|
||||||
{ value1: 5, value2: 2 },
|
{ value1: "5", value2: "2" },
|
||||||
{ value1: 6, value2: 3 },
|
{ value1: "6", value2: "3" },
|
||||||
{ value1: 7, value2: "a" },
|
{ value1: "7", value2: "a" },
|
||||||
{ value1: 8, value2: "b" },
|
{ value1: "8", value2: "b" },
|
||||||
{ value1: 9, value2: " a" },
|
{ value1: "9", value2: " a" },
|
||||||
{ value1: 10, value2: -1 },
|
{ value1: "10", value2: "-1" },
|
||||||
{ value1: 11, value2: -0.5 },
|
{ value1: "11", value2: "-.5" },
|
||||||
{ value1: 12, value2: 3.566 },
|
{ value1: "12", value2: "3.566" },
|
||||||
{ value1: 13, value2: 0 },
|
{ value1: "13", value2: "0" },
|
||||||
{ value1: 14 },
|
{ value1: "14" },
|
||||||
{ value1: 15, value2: " c" },
|
{ value1: "15", value2: " c" },
|
||||||
{ value1: 16, value2: " 1" }
|
{ value1: "16", value2: " 1" }
|
||||||
];
|
];
|
||||||
|
|
||||||
var actual = getQueryResults("FOR i IN UnitTestsImportCsvNoConvert SORT i.value1 RETURN i");
|
var actual = getQueryResults("FOR i IN UnitTestsImportCsvNoConvert SORT TO_NUMBER(i.value1) RETURN i");
|
||||||
assertEqual(expected, actual);
|
assertEqual(JSON.stringify(expected), JSON.stringify(actual));
|
||||||
},
|
},
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue