mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 02:18:04 +01:00
Only support extracting JSON fields when the SDK supports it (#3717)
* Added preprocessor defined to detect support for JSON * Only support extracting JSON fields when the SDK supports it * Fix version comparison
This commit is contained in:
@@ -487,6 +487,7 @@ void MySQLTest::testLongTEXT()
|
||||
_pExecutor->longText();
|
||||
}
|
||||
|
||||
#ifdef POCO_MYSQL_JSON
|
||||
void MySQLTest::testJSON()
|
||||
{
|
||||
if (!_pSession) fail("Test not available.");
|
||||
@@ -494,7 +495,7 @@ void MySQLTest::testJSON()
|
||||
recreatePersonJSONTable();
|
||||
_pExecutor->json();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void MySQLTest::testUnsignedInts()
|
||||
{
|
||||
@@ -796,7 +797,7 @@ void MySQLTest::recreatePersonLongBLOBTable()
|
||||
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail ("recreatePersonLongBLOBTable()"); }
|
||||
}
|
||||
|
||||
|
||||
#ifdef POCO_MYSQL_JSON
|
||||
void MySQLTest::recreatePersonJSONTable()
|
||||
{
|
||||
dropTable("Person");
|
||||
@@ -804,7 +805,7 @@ void MySQLTest::recreatePersonJSONTable()
|
||||
catch (ConnectionException& ce) { std::cout << ce.displayText() << std::endl; fail("recreatePersonJSONTable()"); }
|
||||
catch (StatementException& se) { std::cout << se.displayText() << std::endl; fail("recreatePersonJSONTable()"); }
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void MySQLTest::recreateIntsTable()
|
||||
{
|
||||
|
||||
@@ -81,7 +81,9 @@ public:
|
||||
void testBLOBStmt();
|
||||
void testLongBLOB();
|
||||
void testLongTEXT();
|
||||
#ifdef POCO_MYSQL_JSON
|
||||
void testJSON();
|
||||
#endif
|
||||
|
||||
void testUnsignedInts();
|
||||
void testFloat();
|
||||
@@ -122,7 +124,9 @@ private:
|
||||
void recreatePersonTimeTable();
|
||||
void recreatePersonTimestampTable();
|
||||
void recreatePersonLongBLOBTable();
|
||||
#ifdef POCO_MYSQL_JSON
|
||||
void recreatePersonJSONTable();
|
||||
#endif
|
||||
void recreateStringsTable();
|
||||
void recreateIntsTable();
|
||||
void recreateUnsignedIntsTable();
|
||||
|
||||
@@ -1513,6 +1513,7 @@ void SQLExecutor::longText()
|
||||
poco_assert (longTextRes == biography);
|
||||
}
|
||||
|
||||
#ifdef POCO_MYSQL_JSON
|
||||
void SQLExecutor::json()
|
||||
{
|
||||
std::string funct = "json()";
|
||||
@@ -1537,7 +1538,7 @@ void SQLExecutor::json()
|
||||
catch (StatementException& se) { std::cout << se.displayText() << std::endl; fail(funct); }
|
||||
poco_assert(res == biography);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void SQLExecutor::tuples()
|
||||
{
|
||||
|
||||
@@ -86,7 +86,9 @@ public:
|
||||
void timestamp();
|
||||
void longBlob();
|
||||
void longText();
|
||||
#ifdef POCO_MYSQL_JSON
|
||||
void json();
|
||||
#endif
|
||||
void unsignedInts();
|
||||
void floats();
|
||||
void doubles();
|
||||
|
||||
Reference in New Issue
Block a user