manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1566762 - in /manifoldcf/branches/release-1.5-branch: ./ CHANGES.txt framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
Date Mon, 10 Feb 2014 21:54:46 GMT
Author: kwright
Date: Mon Feb 10 21:54:45 2014
New Revision: 1566762

URL: http://svn.apache.org/r1566762
Log:
Pull up fix for CONNECTORS-887 from trunk.

Modified:
    manifoldcf/branches/release-1.5-branch/   (props changed)
    manifoldcf/branches/release-1.5-branch/CHANGES.txt
    manifoldcf/branches/release-1.5-branch/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java

Propchange: manifoldcf/branches/release-1.5-branch/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk:r1566761

Modified: manifoldcf/branches/release-1.5-branch/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-1.5-branch/CHANGES.txt?rev=1566762&r1=1566761&r2=1566762&view=diff
==============================================================================
--- manifoldcf/branches/release-1.5-branch/CHANGES.txt (original)
+++ manifoldcf/branches/release-1.5-branch/CHANGES.txt Mon Feb 10 21:54:45 2014
@@ -4,6 +4,9 @@ $Id$
 
 ======================= Release 1.5.1 =====================
 
+CONNECTORS-887: Upgrade issues with MySQL.
+(Florian Schmedding, Karl Wright)
+
 CONNECTORS-870: Avoid line break for login.jsp description
 when locale is Japanese.
 (Shinichiro Abe)

Modified: manifoldcf/branches/release-1.5-branch/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-1.5-branch/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java?rev=1566762&r1=1566761&r2=1566762&view=diff
==============================================================================
--- manifoldcf/branches/release-1.5-branch/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
(original)
+++ manifoldcf/branches/release-1.5-branch/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
Mon Feb 10 21:54:45 2014
@@ -338,13 +338,13 @@ public class DBInterfaceMySQL extends Da
         queryBuffer.append(',');
       else
         first = false;
-      appendDescription(queryBuffer,columnName,cd,false);
+      appendDescription(queryBuffer,columnName,cd,false,true);
     }
     queryBuffer.append(')');
     performModification(queryBuffer.toString(),null,invalidateKeys);
   }
 
-  protected static void appendDescription(StringBuilder queryBuffer, String columnName, ColumnDescription
cd, boolean forceNull)
+  protected static void appendDescription(StringBuilder queryBuffer, String columnName, ColumnDescription
cd, boolean forceNull, boolean includeRestrict)
   {
     queryBuffer.append(columnName);
     queryBuffer.append(' ');
@@ -355,7 +355,7 @@ public class DBInterfaceMySQL extends Da
       queryBuffer.append(" NOT NULL");
     if (cd.getIsPrimaryKey())
       queryBuffer.append(" PRIMARY KEY");
-    if (cd.getReferenceTable() != null)
+    if (cd.getReferenceTable() != null && includeRestrict)
     {
       queryBuffer.append(" REFERENCES ");
       queryBuffer.append(cd.getReferenceTable());
@@ -419,8 +419,8 @@ public class DBInterfaceMySQL extends Da
           String columnName = iter.next();
           ColumnDescription cd = columnModifyMap.get(columnName);
           StringBuilder sb = new StringBuilder();
-          appendDescription(sb,columnName,cd,false);
-          performModification("ALTER TABLE "+tableName+" MODIFY "+sb.toString(),null,invalidateKeys);
+          appendDescription(sb,columnName,cd,false,false);
+          performModification("ALTER TABLE "+tableName+" CHANGE "+columnName+" "+sb.toString(),null,invalidateKeys);
         }
       }
 
@@ -433,7 +433,7 @@ public class DBInterfaceMySQL extends Da
           String columnName = iter.next();
           ColumnDescription cd = columnMap.get(columnName);
           StringBuilder sb = new StringBuilder();
-          appendDescription(sb,columnName,cd,false);
+          appendDescription(sb,columnName,cd,false,true);
           performModification("ALTER TABLE "+tableName+" ADD "+sb.toString(),null,invalidateKeys);
         }
       }



Mime
View raw message