Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@

------create tables---------
CREATE TABLE registries(
id BIGINT NOT NULL,
id NUMBER(19) NOT NULL,
registy_name VARCHAR(255) NOT NULL,
registry_type VARCHAR(255) NOT NULL,
registry_uri VARCHAR(255) NOT NULL,
CONSTRAINT PK_registries PRIMARY KEY (id));

CREATE TABLE mpacks(
id BIGINT NOT NULL,
id NUMBER(19) NOT NULL,
mpack_name VARCHAR(255) NOT NULL,
mpack_version VARCHAR(255) NOT NULL,
mpack_uri VARCHAR(255),
registry_id BIGINT,
registry_id NUMBER(19),
CONSTRAINT PK_mpacks PRIMARY KEY (id),
CONSTRAINT uni_mpack_name_version UNIQUE(mpack_name, mpack_version),
CONSTRAINT FK_registries FOREIGN KEY (registry_id) REFERENCES registries(id));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
*/
package org.apache.ambari.server.orm.db;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;

import org.apache.commons.lang3.StringUtils;
import org.junit.Assert;
Expand All @@ -34,6 +36,7 @@
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.common.io.Resources;


/**
Expand Down Expand Up @@ -65,6 +68,13 @@ public void testVerifyOracle() throws Exception {
verifyDDL("Oracle");
}

@Test
public void testOracleHasNoBigintType() throws Exception {
String ddl = Resources.toString(Resources.getResource("Ambari-DDL-Oracle-CREATE.sql"), StandardCharsets.UTF_8);
Assert.assertFalse("Oracle has no BIGINT type, use NUMBER(19)",
Pattern.compile("\\bBIGINT\\b", Pattern.CASE_INSENSITIVE).matcher(ddl).find());
}

@Test
public void testVerifySqlAnywhere() throws Exception {
verifyDDL("SQLAnywhere");
Expand Down