Hi.

On Mon 2002-12-30 at 16:53:08 -0500, [EMAIL PROTECTED] wrote:
[...]
>     hashsum tinyblob not null ,       # hash of the card: have we seen this one?
>     index (hashsum)           # for quick lookups
> 
> Whenever I try this with the index, I get
> 
>   ERROR 1170 at line 49: BLOB column 'hash' used in key specification
>   without a key length

>From http://www.mysql.com/doc/en/CREATE_TABLE.html:

  * With col_name(length) syntax, you can specify an index that uses
    only a part of a CHAR or VARCHAR column. This can make the index
    file much smaller. See section 5.4.4 Column Indexes.
  * Only the MyISAM table type supports indexing on BLOB and TEXT
    columns. When putting an index on a BLOB or TEXT column you MUST
    always specify the length of the index:

    CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10)));

> I don't know where the key length needs to be specified; I tried
> 
>   hashsum tinyblob(255) not null

That is the column definition, but it was about key length, so better
look at the key definition:

  hashsum tinyblob not null ,
  index (hashsum(255))

If you got confused by "col_name(length)" from the docu, it
references:

  index_col_name:
        col_name [(length)]

on the same page.

HTH,

        Benjamin.


-- 
[EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to