You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2014/09/18 11:34:57 UTC
svn commit: r1625926 -
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBBlobStore.java
Author: reschke
Date: Thu Sep 18 09:34:56 2014
New Revision: 1625926
URL: http://svn.apache.org/r1625926
Log:
OAK-1266 - use 767 byte key for all databases (removing the MariaDB special case)
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBBlobStore.java
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBBlobStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBBlobStore.java?rev=1625926&r1=1625925&r2=1625926&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBBlobStore.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBBlobStore.java Thu Sep 18 09:34:56 2014
@@ -146,29 +146,27 @@ public class RDBBlobStore extends Cachin
Statement stmt = con.createStatement();
if (baseName.equals("DATASTORE_META")) {
- if ("MySQL".equals(dbtype)) {
- stmt.execute("create table " + tableName
- + " (ID varchar(767) not null primary key, LVL int, LASTMOD bigint)");
- } else if ("Oracle".equals(dbtype)) {
- stmt.execute("create table " + tableName
- + " (ID varchar(1000) not null primary key, LVL number, LASTMOD number)");
+ String ct;
+ if ("Oracle".equals(dbtype)) {
+ ct = "create table " + tableName
+ + " (ID varchar(767) not null primary key, LVL number, LASTMOD number)";
} else {
- stmt.execute("create table " + tableName
- + " (ID varchar(1000) not null primary key, LVL int, LASTMOD bigint)");
+ ct = "create table " + tableName + " (ID varchar(767) not null primary key, LVL int, LASTMOD bigint)";
}
+ stmt.execute(ct);
} else {
- // the code below likely will need to be extended for
- // new database types
+ String ct;
if ("PostgreSQL".equals(dbtype)) {
- stmt.execute("create table " + tableName + " (ID varchar(1000) not null primary key, DATA bytea)");
+ ct = "create table " + tableName + " (ID varchar(767) not null primary key, DATA bytea)";
} else if ("DB2".equals(dbtype) || (dbtype != null && dbtype.startsWith("DB2/"))) {
- stmt.execute("create table " + tableName + " (ID varchar(1000) not null primary key, DATA blob("
- + MINBLOB + "))");
+ ct = "create table " + tableName + " (ID varchar(767) not null primary key, DATA blob(" + MINBLOB
+ + "))";
} else if ("MySQL".equals(dbtype)) {
- stmt.execute("create table " + tableName + " (ID varchar(767) not null primary key, DATA mediumblob)");
+ ct = "create table " + tableName + " (ID varchar(767) not null primary key, DATA mediumblob)";
} else {
- stmt.execute("create table " + tableName + " (ID varchar(1000) not null primary key, DATA blob)");
+ ct = "create table " + tableName + " (ID varchar(767) not null primary key, DATA blob)";
}
+ stmt.execute(ct);
}
stmt.close();