Fixed GH #1155: Select from MySQL table with longtext column causes SIGSEGV (#1164)

This commit is contained in:
jnytra
2017-07-06 00:44:21 +02:00
committed by Aleksandar Fabijanic
parent 15c076b3ea
commit f8bacb47b5
6 changed files with 96 additions and 2 deletions

View File

@@ -1429,6 +1429,33 @@ void SQLExecutor::blobStmt()
poco_assert (res == blob);
}
void SQLExecutor::longText()
{
std::string funct = "longText()";
std::string lastName("lastname");
std::string firstName("firstname");
std::string address("Address");
std::string info("0123456789");
Poco::Data::CLOB img("0123456789", 10);
int count = 0;
try { *_pSession << "INSERT INTO Person VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(info), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
try { *_pSession << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (count == 1);
std::string res;
poco_assert (res.size() == 0);
Statement stmt = (*_pSession << "SELECT Info FROM Person", into(res));
try { stmt.execute(); }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
poco_assert (res == info);
}
void SQLExecutor::tuples()
{