0

The below query is not executing .. Please let me know the problem..

CREATE TABLE IF NOT EXISTS `catalog_category_entity_varchar` (
  `value_id` int(11) NOT NULL AUTO_INCREMENT,
  `entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `entity_id` int(10) unsigned NOT NULL DEFAULT '0',
  `value` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`) USING BTREE,
  KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`),
  KEY `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE` (`attribute_id`),
  KEY `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE` (`store_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1122 ;

This table belongs to the Magento Project..

7
  • the syntax is ok, u have permission to create ? Commented Apr 27, 2011 at 5:38
  • yes i have permission to create. There is no permission problem.. Commented Apr 27, 2011 at 5:39
  • #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE, KEY FK_ATTRIBUTE_VARCHAR_ENTITY` (entity_id), KEY FK_CATA' at line 9 This is the error is showing when i try execute in phpmyadmin. Commented Apr 27, 2011 at 5:40
  • In the above query what this line is meant?? Is referring to any other table?? KEY 'FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE' ('attribute_id'), Commented Apr 27, 2011 at 5:46
  • @Mayilarun: it creates a key field based on the attribute_id to speed up queries. Commented Apr 27, 2011 at 5:50

1 Answer 1

2

In mysql versions prior to 5.1 you have to use USING BTREE before parenthesis. Try changing

UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`) USING BTREE

to

UNIQUE KEY `IDX_BASE` USING BTREE (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`) 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.