[Gambas-user] Retrieving picture from Database Mysql
Benoit Minisini
gambas at ...1...
Mon Apr 9 18:00:56 CEST 2007
On lundi 9 avril 2007, Steven Lobbezoo wrote:
> But, You should watch it :
> Gambas does NOT recognise blob fields correctly.
> You need to define a "Large Blob" in Mysql, not a medium ore small or
> varchar unlimited. All these other formats are interpreted (I suppose in
> the name of compatibility) as char and not transferred (You will only get
> the first four characters (8 Bytes)) correctly.
> I consider this leveling at a common lowest dominator a very bad thing,
> since it prives you from all kind of features in MySql, but anyway.... I
> suppose it's the french way (THey do that in politics too). ;-))
> That why I use db.Exec all the time, pity!
>
> Steven
>
Actually the mess is in MySQL.
There is no difference between a blob or a text field in MySQL, they are
exactly the same fields.
So to be able to make the difference, the Gambas database driver decided that:
- LONG TEXT (or BLOB) fields are translated to a Gambas Blob.
- TINY and MEDIUM TEXT (or BLOB) fields and all other text fields are
translated to a Gambas String. If a text field is truncated, then this is a
bug and you should tell me exactly which MySQL field type is concerned.
So this is not really a matter of the french way to do politics :-) but a way
to workaround a stupid database management system API.
I think SQL is the worse standard I ever seen, if one call that a standard,
and that the API of mysql, postgresql and ODBC are the worst I ever seen.
Only SQLite seems to have a decent API.
Regards,
--
Benoit Minisini
More information about the User
mailing list