- fixed GH #362: Defect in Var::parseString when there is no space between value and newline

- fixed GH #314: JSON parsing bug
- added GH #313: MetaColumn additions for Data::ODBC and Data::SQLite
This commit is contained in:
Alex Fabijanic 2014-04-29 21:25:30 -05:00
parent f038ac4e63
commit 8a9e7792d9
9 changed files with 23 additions and 6 deletions

View File

@ -55,6 +55,9 @@ Release 1.5.3 (2014-05-xx)
- added SQlite Full Text Search support
- added Thread::trySleep() and Thread::wakeUp()
- fixed GH #410: Bug in JSON::Object.stringify() in 1.5.2
- fixed GH #362: Defect in Var::parseString when there is no space between value and newline
- fixed GH #314: JSON parsing bug
- added GH #313: MetaColumn additions for Data::ODBC and Data::SQLite
Release 1.5.2 (2013-09-16)
==========================

View File

@ -107,6 +107,7 @@ void ODBCMetaColumn::init()
case SQL_CHAR:
case SQL_VARCHAR:
case SQL_LONGVARCHAR:
case -8:// PostgreSQL CHAR (with size specified - psqlODBC)
case -9:// SQL Server NVARCHAR
case -10:// PostgreSQL VARCHAR (without size specified)
setType(MetaColumn::FDT_STRING); break;

View File

@ -110,6 +110,9 @@ Utility::Utility()
_types.insert(TypeMap::value_type("INT64", MetaColumn::FDT_INT64));
_types.insert(TypeMap::value_type("LONG", MetaColumn::FDT_INT64));
_types.insert(TypeMap::value_type("INTEGER64", MetaColumn::FDT_INT64));
_types.insert(TypeMap::value_type("TINYINT", MetaColumn::FDT_INT8));
_types.insert(TypeMap::value_type("SMALLINT", MetaColumn::FDT_INT16));
_types.insert(TypeMap::value_type("BIGINT", MetaColumn::FDT_INT64));
_types.insert(TypeMap::value_type("COUNTER", MetaColumn::FDT_UINT64));
_types.insert(TypeMap::value_type("AUTOINCREMENT", MetaColumn::FDT_UINT64));
_types.insert(TypeMap::value_type("REAL", MetaColumn::FDT_DOUBLE));

View File

@ -41,7 +41,7 @@
<ClCompile Include="src\SQLiteTestSuite.cpp">
<Filter>_Suite\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\WinDriver.cpp">
<ClCompile Include="src\Driver.cpp">
<Filter>_Driver\Source Files</Filter>
</ClCompile>
</ItemGroup>

View File

@ -485,7 +485,7 @@ Var Var::parseArray(const std::string& val, std::string::size_type& pos)
std::string Var::parseString(const std::string& val, std::string::size_type& pos)
{
static const std::string STR_STOP("\"");
static const std::string OTHER_STOP(" ,]}"); // we stop at space, ',', ']' or '}'
static const std::string OTHER_STOP("\n ,]}");
bool inString = false;
//skip optional ' "

View File

@ -2192,10 +2192,18 @@ void VarTest::testJSONDeserializeString()
assert (b.convert<std::string>() == "test");
Var c('c');
std::string tst2 = Var::toString(c);
Var b2 = Var::parse(tst2);
tst = Var::toString(c);
Var b2 = Var::parse(tst);
char cc = b2.convert<char>();
assert (cc == 'c');
tst = "{ \"a\" : 1, \"b\" : 2 \n}";
a = Var::parse(tst);
assert(a.toString() == "{ \"a\" : \"1\", \"b\" : \"2\" }");
tst = "{ \"a\" : 1, \"b\" : 2\n}";
a = Var::parse(tst);
assert(a.toString() == "{ \"a\" : \"1\", \"b\" : \"2\" }");
}

View File

@ -96,7 +96,7 @@ void ParseHandler::startObject()
void ParseHandler::endObject()
{
_stack.pop();
if (!_stack.empty()) _stack.pop();
}
@ -132,7 +132,7 @@ void ParseHandler::startArray()
void ParseHandler::endArray()
{
_stack.pop();
if (!_stack.empty()) _stack.pop();
}

View File

@ -0,0 +1 @@
{"data":"10"}}

View File

@ -0,0 +1 @@
[1,2,3]]