MySQL empty text/blob #69

Closed
hmagarotto opened this Issue Jan 18, 2013 · 7 comments

Comments

Projects
None yet
3 participants
Contributor

hmagarotto commented Jan 18, 2013

Assertion violation in debug binary with empty text field:

    Poco::Data::Session ses(Poco::Data::MySQL::Connector::KEY,...);
    ses << "DROP TABLE IF EXISTS Dummy", Poco::Data::now;
    ses <<  "CREATE TABLE Dummy(data TEXT)", Poco::Data::now;
    ses << "INSERT INTO Dummy VALUES('')", Poco::Data::now;
    ses << "SELECT data FROM Dummy", Poco::Data::now;

Assertion violation: pChar in file ".../poco-1.4.6-all/Data/include/Poco/Data/BLOB.h", line 180

Contributor

hmagarotto commented Jan 18, 2013

--- poco-1.4.6-all.original/Data/MySQL/src/Extractor.cpp    2013-01-18 17:53:20.461811217 -0200
+++ poco-1.4.6-all/Data/MySQL/src/Extractor.cpp 2013-01-18 17:51:59.145814212 -0200
@@ -158,6 +158,9 @@
   if ( ! _stmt.fetchColumn(pos, &bind) )
     return false;

+  if ( ! length )
+      return true;
+  
   std::vector<char> data(length);
   bind.buffer = &data[0];
   bind.buffer_length= length;
Owner

aleks-f commented Jan 20, 2013

Did you re-run the whole testsuite after this fix?

Owner

aleks-f commented Jan 20, 2013

It looks right for 1.4.6. This has changed quite a bit in 1.5; no need for a fix there.

Contributor

hmagarotto commented Jan 22, 2013

Sorry for a late response.
I re-run the whole testsuite and everything seems to be ok.
I still don't test 1.5 version. Will be released a fix version for 1.4.6?
Thanks.

@ghost ghost assigned aleks-f Feb 2, 2013

@ghost ghost assigned obiltschnig Mar 24, 2013

Owner

aleks-f commented Mar 24, 2013

Re-assigning this to Günter.

Owner

aleks-f commented May 1, 2014

@obiltschnig: any plans for including this in 1.4.x?

Owner

obiltschnig commented Nov 19, 2014

missed this for 1.4.6. Will be in next 1.4.x release (if there's one...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment