Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005

    Unanswered: 1170 error preventing table from being created

    When I try to run the query below to create table in my database I received following error:

    #1170 - BLOB column 'descr' used in key specification without a key length

    This query was created automatically by the shopping software that I am using as a backup. All the other tables were restored correctly but this one hangs up. Can someone help me to fix this command?

    Thank you very much,

    CREATE TABLE xcart_products (
    productid int(11) NOT NULL auto_increment,
    productcode varchar(32) NOT NULL ,
    product varchar(255) NOT NULL ,
    provider varchar(32) NOT NULL ,
    brand varchar(255) NOT NULL ,
    model varchar(255) NOT NULL ,
    distribution varchar(255) NOT NULL ,
    weight decimal(12,2) NOT NULL default '0.00' ,
    categoryid int(11) NOT NULL ,
    categoryid1 int(11) NOT NULL ,
    categoryid2 int(11) NOT NULL ,
    categoryid3 int(11) NOT NULL ,
    list_price decimal(12,2) NOT NULL default '0.00' ,
    descr text NOT NULL ,
    fulldescr text NOT NULL ,
    avail int(11) NOT NULL ,
    rating int(11) NOT NULL ,
    forsale char(1) NOT NULL default 'Y' ,
    add_date int(11) NOT NULL ,
    image_x int(11) NOT NULL ,
    image_y int(11) NOT NULL ,
    views_stats int(11) NOT NULL ,
    sales_stats int(11) NOT NULL ,
    del_stats int(11) NOT NULL ,
    shipping_freight decimal(12,2) NOT NULL default '0.00' ,
    free_shipping char(1) NOT NULL default 'N' ,
    discount_avail char(1) ,
    param00 varchar(255) NOT NULL ,
    param01 varchar(255) NOT NULL ,
    param02 varchar(255) NOT NULL ,
    param03 varchar(255) NOT NULL ,
    param04 varchar(255) NOT NULL ,
    param05 varchar(255) NOT NULL ,
    param06 varchar(255) NOT NULL ,
    param07 varchar(255) NOT NULL ,
    param08 varchar(255) NOT NULL ,
    param09 varchar(255) NOT NULL ,
    min_amount int(11) NOT NULL default '1' ,
    dim_x int(11) NOT NULL ,
    dim_y int(11) NOT NULL ,
    dim_z int(11) NOT NULL ,
    low_avail_limit int(11) NOT NULL default '10' ,
    orderby int(11) NOT NULL ,
    vat int(11) NOT NULL ,
    free_tax char(1) NOT NULL default 'N' ,
    apply_gst char(1) NOT NULL default 'N' ,
    apply_pst char(1) NOT NULL default 'N' ,
    product_type char(1) NOT NULL default 'N' ,
    PRIMARY KEY (productid),
    KEY product (product),
    KEY categoryid1 (categoryid1, categoryid2, categoryid3),
    KEY category (categoryid),
    KEY rating (rating),
    KEY add_date (add_date),
    KEY provider (provider),
    KEY avail (avail),
    KEY orderby (orderby),
    KEY best_sellers (sales_stats, views_stats),
    KEY categories (forsale, categoryid, categoryid1, categoryid2, categoryid3),
    KEY descr (descr),
    KEY descr_2 (descr),
    KEY descr_3 (descr),
    KEY descr_4 (descr)

  2. #2
    Join Date
    Mar 2004
    This was answered by another poster on a different discussion board so I thought I'd post his answer here for those that come across it.

    The thing that was missing is defining how many characters of a text field are going to be indexed in the key, so you would need to change to:
    KEY xcart_products_ix_descr (descr(10))

  3. #3
    Join Date
    Mar 2005
    Actually that didn't work. I kept getting syntax error for some reason. I was doing it through PHP MyAdmin and that might have something to do with it.

    I ended up deleting that KEY descr and my restoration worked fine as well as upgrade to new version after that. Thanks for everyone's assistance.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts