[Phpmyadmin-devel] BLOB always binary?
Rabus
rabus at bugfixes.info
Sun Jun 1 06:47:08 CEST 2003
Hi Marc & list,
-----Original Message-----
From: Marc Delisle
>
> Hi,
>
> In this change:
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpmyadmin/phpM
> yAdmin/tbl_properties_structure.php3.diff?r1=1.37&r2=1.38
>
> rabus treats all BLOBs as binary.
>
> According to
> http://www.mysql.com/doc/en/BLOB.html
>
> we don't know if a BLOB has binary contents (even if the B stands for
> Binary). Lots of users put text only in their blobs, and IMO
> there is nothing wrong with this in MySQL. Do we really want
> to force users on this?
First of all, we have to define, what BINARY means in MySQL.
Of course, you could store binary data in a TEXT field as well as in a
BLOB one, in a CHAR as well as in a CHAR BINARY.
The only difference between CHAR and CHAR BINARY for instance is, that
MySQL sorts CHAR BINARY in a case-sensitive way and CHAR in a
case-insensitive way (based on the latin1 charset or - in MySQL 4.1 - on
the charset that is assigned to the corresponding field).
And this exactly is also the difference between TEXT and BLOB.
Also, the doc page you mentioned says:
"In most respects, you can regard a TEXT column as a VARCHAR column that
can be as big as you like. Similarly, you can regard a BLOB column as a
VARCHAR BINARY column."
If you do a SHOW FIELDS query on a table with a BLOB field, MySQL will
tell you that a BLOB field is treated as "binary".
Furthermore, you can try to create a TEXT BINARY field and see what
happens :-)
It is not that I want to force users on anything. It's just about making
them aware that BLOB is a binary field.
For MySQL 4.1 users, it's also an interface clarification. Otherwise,
some unexpirienced users will wonder why there is not charset assigned
to a BLOB field.
Regards,
Alexander M. Turek
<alex at bugfixes.info>
+-----------------------------+
| The phpMyAdmin Project |
| http://www.phpmyadmin.net |
| rabus at users.sourceforge.net |
+-----------------------------+
| [bugfixes.info] |
| http://www.bugfixes.info |
| rabus at bugfixes.info |
+-----------------------------+
More information about the Developers
mailing list