If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > 1170 error preventing table from being created

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-01-05, 16:52
oziris oziris is offline
Registered User
 
Join Date: Mar 2005
Posts: 2
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,
Predrag

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)
);
Reply With Quote
  #2 (permalink)  
Old 03-02-05, 08:27
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
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:
Code:
KEY xcart_products_ix_descr (descr(10))
Reply With Quote
  #3 (permalink)  
Old 03-02-05, 09:36
oziris oziris is offline
Registered User
 
Join Date: Mar 2005
Posts: 2
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.

Predrag
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On