I use MariaDB 5.5 (x64) on Windows 7 and MariaDB ODBC driver 1.0 in order to make connection.
I have table ‘location’ with 4 columns (Id, World, Location, Scene). ‘Scene’ column saves text as LONGTEXT datatype. Let’s say it contains this value -
I could not make head nor tail of your pastebin. The DbConnection::Execute() method returns DbResult object. So, have you use a debugger to check on this returned object directly? If you did and the problem was really coming from the text size of the LONGTEXT datatype then you can file a bug to nanodbc project, assuming if there is nothing wrong with our thin wrapper implementation. If you look at the DbConnection class for ODBC then you can see there is really nothing much in it (only wrapper code).
[quote=“itisscan”]I use MariaDB 5.5 (x64) on Windows 7 and MariaDB ODBC driver 1.0 in order to make connection.
I have table ‘location’ with 4 columns (Id, World, Location, Scene). ‘Scene’ column saves text as LONGTEXT datatype. Let’s say it contains this value -
I get DbResult object, check if it returns some rows (vector’s size != 0), then get first value as String. Look,
DbResult result = m_pConnection->Execute("SELECT A.Scene FROM location A WHERE A.Name = "EarthBaseStation";", true);
const Vector<VariantVector>& rows = result.GetRows();
if (rows.Size() == 0)
{
success = false;
}
else
{
for (auto it = rows.Begin(); it != rows.End(); it++)
{
// get scene as string
sceneStr = it->Begin()->GetString();
}
}
URHO3D_LOGDEBUG(sceneStr);
Have you tried to step into the nanodbc method call? What I am trying to say is, you can help to first isolate the problem. If it is inside nanodbc the file a bug in nanodbc project. If it is inside Urho3D then file a bug in Urho3D project.
I think the bug is in nanodbc, because when query was successfully executed and urho3d try to bind primitive data type that Variant class support, it’s called this method
// All other types are stored using their string representation in the Variant
colValues[i] = result.resultImpl_.get<nanodbc::string_type>((short)i).c_str();
in the result we step into below method, where nanodbc reads row’s data in the buffer, look -
I have checked the do { … } while(rc > 0); loop. I noticed that if text’s size is 1787 character, then in the first iteration we get 1024 first characters and remains to read 715 characters.
However it looks like in the second iteration we do not start reading from 1025 character, but start reading from the beginning. In the result we get the wrong result that I have described previous.
I suppose the bug is how nanodbc reads the row’s data in the buffer or it just consequence to wrong executing of query.
Thanks to Itisscan. Numerous issues been found with Nanodbc. Maybe the Urho3D repo can be updated to the current master or release. I was able to merge the copy to build and is testing out. It seems to be okay.
My apology. I realized I forgot to do a subtree push before rebasing and had to do merging work all over again. Fortunately the redo part can be done rather quickly with substree. However, I have to force push the changes one more time to our master branch. So, for those who have pulled down master branch earlier, you may find that your Urho3D project source tree is out of sync with remote master now. To recover that, simply reset your local master branch to a last known good commit, say 23c8af64c777090c6d38b9c063c498f9336784fb, then git pull again as per normal. For those that need explicit instruction, see below.
I hope I don’t have to create a youtube video for that .