http://www.mysql.com/doc/en/CREATE_INDEX.html

you key needs a length, not your field.

index (hashsum(length))         # for quick lookups

-----Original Message-----
From: David T-G [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 30, 2002 1:53 PM
To: mysql users
Subject: indexing a blob


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, all --

Having learned a bit about indexes, I have tried to practice a bit.  So
far things work for my char(20) fields, but I have a problem with a
tinyblob.  To wit:

  create table ccards
  (
    # ID number
    id smallint not null default 0 auto_increment primary key ,
    type smallint not null ,    # references ccardtypes.id
    name char(40) not null ,    # name as on card
    number tinytext not null ,  # card number
    expdate date not null ,     # expiration date
    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

I don't know where the key length needs to be specified; I tried

  hashsum tinyblob(255) not null



---------------------------------------------------------------------
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