mysql - BLOB/TEXT column 'value' used in key specification without a key length -


I have developed an extension which works up to 1.6 on Magren (I'm trying Enterprise Edition, And I think the community is the same problem, because it is the same code). In my install script, I see the $ installer-> gt; CreateEntityTables ($ this- & gt; getTable ('alphanum / info')); The installation is done until it is not in the _text unit table. It crashed there! It turns out that when I log in to SQL and run it via PHPmyadmin, then this error is: Blob / Text column 'value' is used without the key 'key' . I saw the code there, and this is what is trying to create an index on the value column:

  -> addIndex ($ this- & gt; getIdxName ($ eavTableName, array ( 'attribute_id array (' attribute_id ',' value ')) - & gt; addIndex ($ this- & gt; getIdxName ($ eavTableName, array (' entity_type_id ' , 'Value')), array ('entity_type_id', 'value'))   

If there is no if statement is not there, Do not I am missing that there is something? Do I need to change my DB configuration? Can this be a bug?

I have a for expansion if brings the statement around (from the original series To do this) I saw the last REV (1.5.something), and there was not that index. I do not understand why when he added it, why did not he have so much problem. Is it my problem?

I do not know if this will help to include the SQL that Magento has created:

  create table " Alphanum_info_text` (`value_id` et no not auto_ignment comment 'value id', 'entity t Type IP "," Entity Type Id ', `Attribut_aidi` Lgusnpadit to Ansanted NOT NULL default' 0 'Recommend' attribute id ',` Stor_aidi` miniatures' not covered' by default '0' Comment 'store ID' Unit_ID 'ANS & End Null Default' 0 Comment 'Entity ID', 'value' is not text Note 'attribute value', (`value_id`) index of primary IDX_ALPHANUM_INFO_TEXT_ENTITY_TYPE_ID` (` entity_type_id`), index `IDX_ALPHANUM_INFO_TEXT_ATTRIBUTE_ID` (` attribute_id `), Index `IDX_ALPHANUM_INFO_TEXT_STORE_ID` (` store_id`), index `IDX_ALPHANUM_INFO_TEXT_ENTITY_ID` (` entity_id`), index `IDX_ALPHANUM_INFO_TEXT_ATTRIBUTE_ID_VALUE` (` attribute_id`, `value`), index` idx_ALPHANUM_INFO_TEXT_ENTITY_TYPE_ID_VALUE` (`entity_type_id`,` value`), constraint ` FK_ALPHANUM_INFO_TEXT_ENTITY_ID_EAV_ENTITY_ENTITY_ID` remove the foreign key ( `entity_id`) rEFERENCES` eav_entity` ( `entity_id`) update removes CASCADE CASCADE, barrier` FK_ALPHA_NUM_TEXT_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID` foreign key ( `entity_type_id`) rEFERENCES` eav_entity_type` ( `entity_type_id`) CASCADE Updates on Cascade, Contract 'FKAlafanumFFARAdAdst' (`ST R_aidi`) references Pr` Kor_stor` ( `Stor_aidi`) Update on Disle Cascade) on removal of the comment =" Eva Unit Price Table "engine = INNODB charset = UTF-8 Collet = Utif 8_jijiel_si   < / Div> 

It seems that this is the problem (just the same problem), these are the two lines:

  index `IDX_ALPHANUM_INFO_TEXT_ATTRIBUTE_ID_VALUE` (` attribute_id`, `value`), Suckank` IDX_ALPHANUM_INFO_TEXT_ENTITY_TYPE_ID_VALUE` (` entity_type_id`, `value`),  number like  

need Atmk values ​​have been listed as:

  index `IDX_ALPHANUM_INFO_TEXT_ATTRIBUTE_ID_VALUE` (` attribute_id`, `value` (255)), Suckank` IDX_ALPHANUM_INFO_TEXT_ENTITY_TYPE_ID_VALUE` (` entity_type_id`, `value` (255 ),   

In the plug, and it will work, the trick is getting to insert it properly, due to the brief I will not send the whole function, but Mage_Eav_Model_Entity_Setup :: About 1341 in createEntityTables , you need to modify these lines:

  -> AdInx ($ this-> getIdxName ($ eavTableName, array ('attribute_id', 'value')), array ('attribute_id', 'value')) - & gt; The array ('entity_type_id', 'value')) is   

as follows: $ add- $ ($-- this-> getIdxName ($ eavTableName, array ('entity_type_id', 'value')) :

  - & gt; Add ('name' = & gt; 'value', 'add-index' size '=> 255):' value ')) - & gt; Aedindaks ($ this- & gt; getIdxName ($ eavTableName, array ( 'entity_type_id', 'value')), array ( 'entity_type_id', $ type = = 'Text'? Array ( 'name' = & gt; 'value ',' Size '= & gt; 255):' value '))   

I'm pretty sure you should set the size value, but I think it's the entire 64k Setting them in will cause damage to the indexing purpose. First place is hope that someone who knows a bit more about SQL, I bend it.

Hope that helps.

Comments

Popular posts from this blog

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -