[Phpmyadmin-devel] BINARY and VARBINARY
Alexander M. Turek
me at derrabus.de
Sat Jul 31 11:33:02 CEST 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi devels,
it looks as if MySQL has silently deprecated the BINARY sttribute in
MySQL 4.1. If you create a CHAR(3) BINARY field, it becomes CHAR(3)
CHARACTER SET latin1 COLLATE latin1_bin.
Old [VAR]CHAR BINARY fields are mapped to [VAR]BINARY. This leads us to
various incompatibilities:
1) We don't have these fields in our list of possible table fields and I
don't know if MySQL 3.23.32 supports the syntax, so adding them
generally wouldn't we a good idea, imho.
2) tbl_properties_structure.php recognizes these fields correctly as
binary fields, but strips off the string "BINARY", so "VARBINARY(20)"
becomes "var(20)" and even worse "BINARY(20)" becomes "(20)".
3) when trying to alter these fields, both are recognized as VARCHAR
BINARY, which is dangerous because if we just want to change the size
for instance, they get changed to "VARCHAR CHARACTER SET latin1 COLLATE
latin1_bin"...
3) The binary column in tbl_properties_structure is superfluous, imho.
And so is the BINARY entry in the list of field attributes.
4) The parser does not recognize BINARY as column type.
Here's a simple table for reproducing the problem:
CREATE TABLE `binarytest` (
`one` binary(3),
`two` varbinary(10)
)
- --
Alexander M. Turek
<rabus at users.sourceforge.net>
_ __ __ _ _ _
_ __ | |__ _ __ | \/ |_ _ / \ __| |_ __ ___ (_)_ __
| '_ \| '_ \| '_ \| |\/| | | | | / _ \ / _` | '_ ` _ \| | '_ \
| |_) | | | | |_) | | | | |_| |/ ___ \ (_| | | | | | | | | | |
| .__/|_| |_| .__/|_| |_|\__, /_/ \_\__,_|_| |_| |_|_|_| |_|
|_| |_| |___/
<http://www.phpmyadmin.net>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBC+XHoHdnxuobFY4RAl5MAJ9rhasmTe78CKqEPzqnXC1NjSdtnACfQaiO
C5a5uEpLgo0zrS/QBSxGH1k=
=IzsE
-----END PGP SIGNATURE-----
More information about the Developers
mailing list