AW: [odb-users] MySQL BLOB Support

Pascal Stoll past0004 at
Wed Nov 2 10:37:42 EDT 2011

It works. Thank you again.

Best regards
Von: Boris Kolpackov [boris at]
Gesendet: Mittwoch, 2. November 2011 14:50
Bis: Pascal Stoll
Cc: odb-users at
Betreff: Re: [odb-users] MySQL BLOB Support

Hi Pascal,

Pascal Stoll <past0004 at> writes:

> i would like to know if it possible to store medium oder large blobs in
> mysql? By now i can only store normal blobs (64kb). Did i do something
> wrong?

By default QByteArray (which I assume is what you are using) is mapped to
the MySQL BLOB type. In MySQL, BLOB can store maximum 64Kb. If you want
to store more, you will need to map it to either MEDIUMBLOB or LONGBLOB.
You can do it on the per-type basis:

#pragma db value(QByteArray) type("LONGBLOB")

class object

  QByteArray data_; // Mapped to LONGBLOB.

Or on the per-member basis:

class object

  #pragma db type("MEDIUMBLOB")
  QByteArray data_;

You may also want to check other limitations on the BLOB sizes at the
bottom of this page from the MySQL documentation:


More information about the odb-users mailing list