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

PDOException Object with 1.1.5 Upgrade
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

I’m getting a really long error message on both the frontend and admin now, any help would be greatly appreciated!!

http://www.minervapromotions.com/stores

PDOException Object
(
    
[message:protected] => SQLSTATE[HY000]General error1025 Error on rename of './minerva8_stores/design_change' to './minerva8_stores/#sql2-4bfe-18d885' (errno152)
    
[string:private] => 
    
[code:protected] => HY000
    [file
:protected] => /home/minerva8/public_html/stores/lib/Varien/Db/Adapter/Pdo/Mysql.php
    [line
:protected] => 156
    [trace
:private] => Array
        (
            
[0] => Array
                (
                    
[file] => /home/minerva8/public_html/stores/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] 
=> 156
                    [function] 
=> query
                    [class] 
=> PDO
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => ALTER TABLE `design_changeDROP FOREIGN KEY `FK_DESIGN_CHANGE_STORE`
                        )

                )

            
[1] => Array
                (
                    
[file] => /home/minerva8/public_html/stores/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] 
=> 218
                    [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/minerva8/public_html/stores/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/minerva8/public_html/stores/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/minerva8/public_html/stores/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] 
=> 268
                    [args] 
=> Array
                        (
                            
[0] => /home/minerva8/public_html/stores/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php
                        
)

                    
[function] => include
                )

            
[5] => Array
                (
                    
[file] => /home/minerva8/public_html/stores/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/minerva8/public_html/stores/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
                        
)

                )

            
[7] => Array
                (
                    
[file] => /home/minerva8/public_html/stores/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] 
=> 120
                    [function] 
=> applyUpdates
                    [class] 
=> Mage_Core_Model_Resource_Setup
                    [type] 
=> ->
                    
[args] => Array
                        (
                        )

                )

            
[8] => Array
                (
                    
[file] => /home/minerva8/public_html/stores/app/code/core/Mage/Core/Model/Config.php
                    [line] 
=> 215
                    [function] 
=> applyAllUpdates
                    [class] 
=> Mage_Core_Model_Resource_Setup
                    [type] 
=> ::
                    
[args] => Array
                        (
                        )

                )

            
[9] => Array
                (
                    
[file] => /home/minerva8/public_html/stores/app/code/core/Mage/Core/Model/App.php
                    [line] 
=> 236
                    [function] 
=> init
                    [class] 
=> Mage_Core_Model_Config
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => Array
                                (
                                )

                        )

                )

            
[10] => Array
                (
                    
[file] => /home/minerva8/public_html/stores/app/Mage.php
                    [line] 
=> 424
                    [function] 
=> init
                    [class] 
=> Mage_Core_Model_App
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => 
                            
[1] => store
                            [2] 
=> Array
                                (
                                )

                        )

                )

            
[11] => Array
                (
                    
[file] => /home/minerva8/public_html/stores/app/Mage.php
                    [line] 
=> 443
                    [function] 
=> app
                    [class] 
=> Mage
                    [type] 
=> ::
                    
[args] => Array
                        (
                            
[0] => 
                            
[1] => store
                            [2] 
=> Array
                                (
                                )

                        )

                )

            
[12] => Array
                (
                    
[file] => /home/minerva8/public_html/stores/index.php
                    [line] 
=> 46
                    [function] 
=> run
                    [class] 
=> Mage
                    [type] 
=> ::
                    
[args] => Array
                        (
                        )

                )

        )

    
[errorInfo] => Array
        (
            
[0] => HY000
            [1] 
=> 1025
            [2] 
=> Error on rename of './minerva8_stores/design_change' to './minerva8_stores/#sql2-4bfe-18d885' (errno152)
        )

)

Error in file"/home/minerva8/public_html/stores/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php" SQLSTATE[HY000]General error1025 Error on rename of './minerva8_stores/design_change' to './minerva8_stores/#sql2-4bfe-18d885' (errno152)

#0 /home/minerva8/public_html/stores/app/code/core/Mage/Core/Model/Resource/Setup.php(286): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/minerva8/public_html/stores/app/code/core/Mage/Core/Model/Resource/Setup.php(178): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '0.8.10', '0.8.11')
#2 /home/minerva8/public_html/stores/app/code/core/Mage/Core/Model/Resource/Setup.php(145): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('0.8.10', '0.8.11')
#3 /home/minerva8/public_html/stores/app/code/core/Mage/Core/Model/Resource/Setup.php(120): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/minerva8/public_html/stores/app/code/core/Mage/Core/Model/Config.php(215): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/minerva8/public_html/stores/app/code/core/Mage/Core/Model/App.php(236): Mage_Core_Model_Config->init(Array)
#6 /home/minerva8/public_html/stores/app/Mage.php(424): Mage_Core_Model_App->init('', 'store', Array)
#7 /home/minerva8/public_html/stores/app/Mage.php(443): Mage::app('', 'store', Array)
#8 /home/minerva8/public_html/stores/index.php(46): Mage::run()
#9 {main}
 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

If anyone else runs into this - a temporary fix of deleting the sql commands out of app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php restored my site.

 
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 as well.

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