Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Resolving SQL Error
 
GregRandall
Jr. Member
 
Total Posts:  6
Joined:  2008-04-03
 

in mysql4-upgrade-0.8.10-0.8.11.php, the first MYSQL statement caused a MYSQL error as it was trying to remove a foreign key that didn’t exist on our Magento database.

The website would not load.

Removing this first line and keeping the second MYSQL statement resolved the error.

 
Magento Community Magento Community
Magento Community
Magento Community
 
justbeez
Jr. Member
 
Total Posts:  7
Joined:  2008-04-09
 

I receive a number of these errors everytime I update.  The scripts that are running aren’t needed (the DB structure is already updated), so I have to move all the old upgrade scripts out of the directory to keep them from throwing errors.

I’d love to hear if there’s some way to fix this issue.

 
Magento Community Magento Community
Magento Community
Magento Community
 
schmelzgeist
Sr. Member
 
Total Posts:  92
Joined:  2008-05-27
Marzipane World Capital (Lübeck, Germany)
 
Greg Randall - 15 September 2008 01:54 PM

in mysql4-upgrade-0.8.10-0.8.11.php, the first MYSQL statement caused a MYSQL error as it was trying to remove a foreign key that didn’t exist on our Magento database.

The website would not load.

Removing this first line and keeping the second MYSQL statement resolved the error.

i think i have the same MysqlError :

PDOException Object
(
    
[message:protected] => SQLSTATE[HY000]General error1025 Error on rename of './magento10/design_change' to './magento10/#sql2-74cc-6505d' (errno152)
    
[string:private] => 
    
[code:protected] => HY000
    [file
:protected] => /home/httpd/docs/show/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php
    [line
:protected] => 150
    [trace
:private] => Array
        (
            
[0] => Array
                (
                    
[file] => /home/httpd/docs/show/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] 
=> 150
                    [function] 
=> query
                    [class] 
=> PDO
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => ALTER TABLE `design_changeDROP FOREIGN KEY `FK_DESIGN_CHANGE_STORE`
                        )

                )

            
[1] => Array
                (
                    
[file] => /home/httpd/docs/show/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] 
=> 212
                    [function] 
=> raw_query
                    [class] 
=> Varien_Db_Adapter_Pdo_Mysql
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => ALTER TABLE `design_changeDROP FOREIGN KEY `FK_DESIGN_CHANGE_STORE`
                        )

                )

            
[2] => Array
                (
                    
[file] => /home/httpd/docs/show/magento/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] 
=> 493
                    [function] 
=> multi_query
                    [class] 
=> Varien_Db_Adapter_Pdo_Mysql
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => 
ALTER TABLE `design_changeDROP FOREIGN KEY `FK_DESIGN_CHANGE_STORE`;
ALTER TABLE `design_change`
  
ADD CONSTRAINT `FK_DESIGN_CHANGE_STOREFOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;

                        )

                )

            
[3] => Array
                (
                    
[file] => /home/httpd/docs/show/magento/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php
                    [line] 
=> 36
                    [function] 
=> run
                    [class] 
=> Mage_Core_Model_Resource_Setup
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => 
ALTER TABLE `design_changeDROP FOREIGN KEY `FK_DESIGN_CHANGE_STORE`;
ALTER TABLE `design_change`
  
ADD CONSTRAINT `FK_DESIGN_CHANGE_STOREFOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;

                        )

                )

            
[4] => Array
                (
                    
[file] => /home/httpd/docs/show/magento/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] 
=> 268
                    [args] 
=> Array
                        (
                            
[0] => /home/httpd/docs/show/magento/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php
                        
)

                    
[function] => include
                )

            
[5] => Array
                (
                    
[file] => /home/httpd/docs/show/magento/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] 
=> 178
                    [function] 
=> _modifyResourceDb
                    [class] 
=> Mage_Core_Model_Resource_Setup
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => upgrade
                            [1] 
=> 0.8.10
                            [2] 
=> 0.8.11
                        
)

                )

            
[6] => Array
                (
                    
[file] => /home/httpd/docs/show/magento/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] 
=> 145
                    [function] 
=> _upgradeResourceDb
                    [class] 
=> Mage_Core_Model_Resource_Setup
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => 0.8.10
                            [1] 
=> 0.8.11
                        
)

                )
 
Magento Community Magento Community
Magento Community
Magento Community
 
Michael_1
Enthusiast
 
Total Posts:  826
Joined:  2007-08-31
 

Replacing the following lines in app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php :

$installer->run("
ALTER TABLE `{
$installer->getTable('design_change')}` DROP FOREIGN KEY `FK_DESIGN_CHANGE_STORE`;
ALTER TABLE `{
$installer->getTable('design_change')}`
  ADD CONSTRAINT `FK_DESIGN_CHANGE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{
$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
"
);

with

$installer->getConnection()->dropForeignKey($installer->getTable('design_change'), 'FK_DESIGN_CHANGE_STORE');
$installer->getConnection()->addConstraint(
    
'FK_DESIGN_CHANGE_STORE',
    
$installer->getTable('design_change'), 'store_id',
    
$installer->getTable('core_store'),    'store_id'
);

should help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
schmelzgeist
Sr. Member
 
Total Posts:  92
Joined:  2008-05-27
Marzipane World Capital (Lübeck, Germany)
 

thanks, it did. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
cipherd
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2008-12-18
Charlotte, NC
 
Michael - 16 September 2008 08:10 AM

Replacing the following lines in app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php :

$installer->run("
ALTER TABLE `{
$installer->getTable('design_change')}` DROP FOREIGN KEY `FK_DESIGN_CHANGE_STORE`;
ALTER TABLE `{
$installer->getTable('design_change')}`
  ADD CONSTRAINT `FK_DESIGN_CHANGE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{
$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
"
);

with

$installer->getConnection()->dropForeignKey($installer->getTable('design_change'), 'FK_DESIGN_CHANGE_STORE');
$installer->getConnection()->addConstraint(
    
'FK_DESIGN_CHANGE_STORE',
    
$installer->getTable('design_change'), 'store_id',
    
$installer->getTable('core_store'),    'store_id'
);

should help.

Magento sucks! I tried what you said and nothing worked.  I believe it was purposely done like this so that you would purchase technical support...any company charging so much already knows that their stuff is a joke!

 
Magento Community Magento Community
Magento Community
Magento Community
 
stefan.scholl
Jr. Member
 
Total Posts:  9
Joined:  2009-01-12
 
cipherd - 21 December 2008 03:56 PM

Magento sucks! I tried what you said and nothing worked.  I believe it was purposely done like this so that you would purchase technical support...any company charging so much already knows that their stuff is a joke!

http://www.google.com/search?q=mysql4-upgrade-0.8.10-0.8.11.php currently shows me my own question, this thread (and many more in this forum) and 3 sites which just emit this error message. Magento 1.2.0.1.

So I’m quite happy that I’m not alone. :-}

Have you heard anything new regarding this bug?

 
Magento Community Magento Community
Magento Community
Magento Community
 
cipherd
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2008-12-18
Charlotte, NC
 

Yes I just removed the code that was having problems and then replace them afterwards when the installation was finished. But hey the upgrade is suppose to resolve these issues.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bamby
Jr. Member
 
Total Posts:  4
Joined:  2009-02-25
 

To resolve this problem

Its all to do with innodb setting on your mysql

in the my.conf file on your linux database there is information regarding mysql setup -

find

# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.

#skip-innodb

and make sure that ‘innodb’ is not skipped

once you do that your shop will not give you mysql 4 upgrad errors

 
Magento Community Magento Community
Magento Community
Magento Community
 
quanza
Sr. Member
 
Avatar
Total Posts:  97
Joined:  2008-12-02
Tokyo, Japan
 

If you’re doing a fresh install and not importing the sample data, as the first poster says, comment out the php that tries to drop the table key.

in /app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php,

$installer $this;
/* @var $installer Mage_Core_Model_Resource_Setup */

$installer->startSetup();

# ***** comment out the following line, to look like this ********
#$installer->getConnection()->dropForeignKey($installer->getTable('design_change'), 'FK_DESIGN_CHANGE_STORE');

$storeIds $installer->getConnection()->fetchCol(
    
"SELECT store_id FROM {$installer->getTable('core_store')}"
);

then re-start the installation and you should zip through.  I’ll post a bug report on this. argh.

 
Magento Community Magento Community
Magento Community
Magento Community
 
annanta
Jr. Member
 
Total Posts:  12
Joined:  2009-12-19
 

HI,

I am getting this error on my new update. Is there anything that I can do?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
RomJohnson
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2008-09-13
 

Me too: “SQLSTATE[HY000]: General error: 1025 Error on rename of ‘./my_db/report_compared_product_index’ to ‘./my_db/#sql2-69d3-140c2’ (errno: 152)”

Any idea???

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top