summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Winkler2011-07-17 09:17:54 (EDT)
committerStefan Winkler2011-07-17 09:17:54 (EDT)
commit713e6f6d9009627eedb76c392f5878b08998f0b7 (patch)
tree754b9785fc30aade118b1699657665338fc43928
parentf60a74cdff29f8e91bea51282e385e2acfe1238e (diff)
downloadcdo-713e6f6d9009627eedb76c392f5878b08998f0b7.zip
cdo-713e6f6d9009627eedb76c392f5878b08998f0b7.tar.gz
cdo-713e6f6d9009627eedb76c392f5878b08998f0b7.tar.bz2
[351393] [DB] Make the URI column in the table "cdo_ext_refs" larger
https://bugs.eclipse.org/bugs/show_bug.cgi?id=351393
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ExternalReferenceManager.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_351393_Test.java70
3 files changed, 72 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ExternalReferenceManager.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ExternalReferenceManager.java
index b4b49c1..34b5f89 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ExternalReferenceManager.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ExternalReferenceManager.java
@@ -157,7 +157,7 @@ public class ExternalReferenceManager extends Lifecycle
IDBStore store = idHandler.getStore();
table = store.getDBSchema().addTable("cdo_external_refs"); //$NON-NLS-1$
idField = table.addField("id", idHandler.getDBType()); //$NON-NLS-1$
- uriField = table.addField("uri", DBType.VARCHAR); //$NON-NLS-1$
+ uriField = table.addField("uri", DBType.VARCHAR, 1024); //$NON-NLS-1$
timestampField = table.addField("committime", DBType.BIGINT); //$NON-NLS-1$
table.addIndex(IDBIndex.Type.PRIMARY_KEY, idField);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java
index a333523..a793e8a 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java
@@ -233,5 +233,6 @@ public abstract class AllConfigs extends ConfigTestSuite
testClasses.add(Bugzilla_351067_Test.class);
testClasses.add(Bugzilla_351096_Test.class);
testClasses.add(Bugzilla_338921_Test.class);
+ testClasses.add(Bugzilla_351393_Test.class);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_351393_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_351393_Test.java
new file mode 100644
index 0000000..8882610
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_351393_Test.java
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.tests.bugzilla;
+
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.tests.AbstractCDOTest;
+import org.eclipse.emf.cdo.tests.model1.OrderDetail;
+import org.eclipse.emf.cdo.tests.model1.Product1;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+
+/**
+ * @author Stefan Winkler
+ */
+public class Bugzilla_351393_Test extends AbstractCDOTest
+{
+ public void testExtRef() throws Exception
+ {
+ skipExternalReferences();
+
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put("test", new XMIResourceFactoryImpl());
+ URI uri = URI.createURI("test:///tmp/file.xmi?" + "12345678901234567890" + // 41
+ "12345678901234567890" + // 61
+ "12345678901234567890" + // 81
+ "12345678901234567890" + // 101
+ "12345678901234567890" + // 121
+ "12345678901234567890" + // 141
+ "12345678901234567890" + // 161
+ "12345678901234567890" + // 181
+ "12345678901234567890" + // 201
+ "12345678901234567890" + // 221
+ "12345678901234567890" + // 241
+ "12345678901234567890" + // 261
+ "12345678901234567890" + // 281
+ "12345678901234567890" + // 301
+ "12345678901234567890"); // 321 characters (> 256)
+
+ Resource extRes = resourceSet.createResource(uri);
+
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("test1"));
+
+ resourceSet.getResource(resource.getURI(), false);
+
+ OrderDetail od1 = getModel1Factory().createOrderDetail();
+ Product1 p1 = getModel1Factory().createProduct1();
+ p1.getOrderDetails().add(od1);
+
+ resource.getContents().add(p1);
+ extRes.getContents().add(od1);
+
+ transaction.commit();
+ }
+}