My thought -- this should be left up to the application -- some may
auto-detect, others may want to store a mime/type to hint/force/coerce how
to process them.

Blobs are merely byte strings, and are ordered by the numerical value of
each byte.

If you think of a blob as a "binary large object" you can make the argument
that binary collations apply.  However:

1)  In MySQL terms, { VARCHAR | TEXT} BINARY uses a binary collation on a
character string, and { VARBINARY | BLOB} is a byte string.  Very different!

2)  You have to decide whether to fight Jim's on the existence of blobs and
insistence that "blob" isn't an acronym, or accept the fact that the ISO
2003 SQL Standard lists both "BLOB" and "BINARY LARGE OBJECT" as "binary
large object string types", thereby assigning a meaning to "blob" that Jim
didn't intend...and doesn't like.

http://savage.net.au/SQL/sql-2003-2.bnf.html

(SQL 99 also defines it IIRC, but I couldn't find a handy link)

3) You'd have to somehow define at least one collation, and do you really
want to make a character set where "smiley face" comes before "heart"?
There is no such a thing as case (upper, lower) with regards to blobs
either.

In general, I don't see a reason for specifying a collation unless there's
more than one way to sort the data type.  (many charsets have at least 2
collations -- foo and foo_bin).

----------------

What kind of constraints would you have on a { BLOB | VARBINARY } ?  Current
MySQL constraints/attributes of binary strings are:

VARBINARY(length) -- length is from 0 - 65,532 (+2 bytes field overhead +1
byte for 1 set of 8 nullable fields = max row length of 65,536; length of 0
can hold '' or NULL)

DEFAULT [NULL] - VARBINARY only, not BLOB

NOT NULL - I could be wrong on this one.

BLOB max length = 65,532


-Sheeri

On 11/15/08, Brian Aker <[EMAIL PROTECTED]> wrote:
>
> Hi!
>
> What do people think about declaring a mime/type for blobs? What about
> storing a mime/type with each insert of blob?
>
> We talk about collations (and character sets) for text types. What about
> blobs?
>
> How about constraints? (and the cost of adding them)
>
> Cheers,
>        -Brian
>
> --
> _______________________________________________________
> Brian "Krow" Aker, brian at tangent.org
> Seattle, Washington
> http://krow.net/                     <-- Me
> http://tangent.org/                <-- Software
> _______________________________________________________
> You can't grep a dead tree.
>
>
>
>
> _______________________________________________
> Mailing list: 
> https://launchpad.net/~drizzle-discuss<https://launchpad.net/%7Edrizzle-discuss>
> Post to     : [email protected]
> Unsubscribe : 
> https://launchpad.net/~drizzle-discuss<https://launchpad.net/%7Edrizzle-discuss>
> More help   : https://help.launchpad.net/ListHelp
>



-- 
- Sheeri K. Cabral

Note:  Currently I work for The Pythian Group (http://www.pythian.com/ ), a
remote DBA firm, and consulting would constitute a conflict of
interest.  However, I do recommend our work, and if you're looking for DBA
work (I do MySQL work, but they have great Oracle and SQL Server DBAs too)
right now, whether you need a few hours a week, or someone fulltime while
you continue a job search.

I have a webpage with tips on how to find a DBA:
http://sheeri.net/how-to-find-a-dba/
I can recommend http://www.toomanyconnections.com as a good site to find
MySQL (and Oracle) DBAs.
If you're looking for web design, I recommend the small business my husband
works for, http://www.digital-loom.com
I regret that I have no other information for any other type of position,
including developer, programmer and systems administrator.
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to