hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r1380483 - /hive/trunk/metastore/scripts/upgrade/mysql/008-HIVE-2246.mysql.sql
Date Tue, 04 Sep 2012 08:26:06 GMT
Author: cws
Date: Tue Sep  4 08:26:05 2012
New Revision: 1380483

URL: http://svn.apache.org/viewvc?rev=1380483&view=rev
Log:
HIVE-3424. Error by upgrading a Hive 0.7.0 database to 0.8.0 (008-HIVE-2246.mysql.sql) (Alexander
Alten-Lorenz via cws)

Modified:
    hive/trunk/metastore/scripts/upgrade/mysql/008-HIVE-2246.mysql.sql

Modified: hive/trunk/metastore/scripts/upgrade/mysql/008-HIVE-2246.mysql.sql
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/scripts/upgrade/mysql/008-HIVE-2246.mysql.sql?rev=1380483&r1=1380482&r2=1380483&view=diff
==============================================================================
--- hive/trunk/metastore/scripts/upgrade/mysql/008-HIVE-2246.mysql.sql (original)
+++ hive/trunk/metastore/scripts/upgrade/mysql/008-HIVE-2246.mysql.sql Tue Sep  4 08:26:05
2012
@@ -26,9 +26,11 @@ CREATE PROCEDURE REVERT()
     DROP TABLE IF EXISTS COLUMNS_V2;
     DROP TABLE IF EXISTS TABLE_SDS;
     DROP TABLE IF EXISTS CDS;
+    SET FOREIGN_KEY_CHECKS = 0;
     ALTER TABLE COLUMNS_OLD 
       ADD CONSTRAINT `COLUMNS_FK1` FOREIGN KEY (`SD_ID`) REFERENCES `SDS`(`SD_ID`)
     ;
+    SET FOREIGN_KEY_CHECKS = 1;	
     RENAME TABLE COLUMNS_OLD TO COLUMNS;
 
   END $$
@@ -214,8 +216,10 @@ CREATE PROCEDURE CREATE_TABLE_SDS()
 CREATE PROCEDURE RENAME_OLD_COLUMNS()
   BEGIN
     RENAME TABLE `COLUMNS` TO `COLUMNS_OLD`;
+    SET FOREIGN_KEY_CHECKS = 0;	
     ALTER TABLE COLUMNS_OLD 
       DROP FOREIGN KEY `COLUMNS_FK1`;
+    SET FOREIGN_KEY_CHECKS = 1;
   END $$
 
 /*



Mime
View raw message