Skip to content

Commit

Permalink
TEIID-4136 updating the length
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Apr 14, 2016
1 parent 907b35a commit 83c7c89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Expand Up @@ -207,7 +207,7 @@ public List<?> translate(Function function) {
convertModifier.addTypeMapping("numeric(38, 0)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
convertModifier.addTypeMapping("numeric(38, 19)", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
convertModifier.addTypeMapping("varchar(40)", FunctionModifier.STRING); //$NON-NLS-1$
convertModifier.addTypeMapping("varchar(4000)", FunctionModifier.STRING); //$NON-NLS-1$
if (!isSourceRequiredForCapabilities()) {
handleTimeConversions();
}
Expand Down
Expand Up @@ -220,7 +220,7 @@ public void helpTest(Expression srcExpression, String tgtType, String expectedEx
LANG_FACTORY.createLiteral("string", String.class)}, //$NON-NLS-1$
String.class);

helpGetString1(func, "cast(-123124534.3 AS varchar(40))"); //$NON-NLS-1$
helpGetString1(func, "cast(-123124534.3 AS varchar(4000))"); //$NON-NLS-1$
}
/***************** End of cast(string AS input)******************/

Expand Down Expand Up @@ -789,7 +789,7 @@ public void helpTest(Expression srcExpression, String tgtType, String expectedEx
// Source = BYTE

@Test public void testByteToString() throws Exception {
helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "string", "cast(1 AS varchar(40))"); //$NON-NLS-1$ //$NON-NLS-2$
helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "string", "cast(1 AS varchar(4000))"); //$NON-NLS-1$ //$NON-NLS-2$
}

@Test public void testByteToLong() throws Exception {
Expand All @@ -815,7 +815,7 @@ public void helpTest(Expression srcExpression, String tgtType, String expectedEx
// Source = SHORT

@Test public void testShortToString() throws Exception {
helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "string", "cast(1 AS varchar(40))"); //$NON-NLS-1$ //$NON-NLS-2$
helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "string", "cast(1 AS varchar(4000))"); //$NON-NLS-1$ //$NON-NLS-2$
}

@Test public void testShortToLong() throws Exception {
Expand All @@ -841,7 +841,7 @@ public void helpTest(Expression srcExpression, String tgtType, String expectedEx
// Source = INTEGER

@Test public void testIntegerToString() throws Exception {
helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "string", "cast(1 AS varchar(40))"); //$NON-NLS-1$ //$NON-NLS-2$
helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "string", "cast(1 AS varchar(4000))"); //$NON-NLS-1$ //$NON-NLS-2$
}

@Test public void testIntegerToLong() throws Exception {
Expand All @@ -867,7 +867,7 @@ public void helpTest(Expression srcExpression, String tgtType, String expectedEx
// Source = LONG

@Test public void testLongToString() throws Exception {
helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "string", "cast(1 AS varchar(40))"); //$NON-NLS-1$ //$NON-NLS-2$
helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "string", "cast(1 AS varchar(4000))"); //$NON-NLS-1$ //$NON-NLS-2$
}

@Test public void testLongToBigInteger() throws Exception {
Expand All @@ -889,7 +889,7 @@ public void helpTest(Expression srcExpression, String tgtType, String expectedEx
// Source = BIGINTEGER

@Test public void testBigIntegerToString() throws Exception {
helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "string", "cast(1 AS varchar(40))"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "string", "cast(1 AS varchar(4000))"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}

@Test public void testBigIntegerToLong() throws Exception {
Expand All @@ -911,7 +911,7 @@ public void helpTest(Expression srcExpression, String tgtType, String expectedEx
// Source = FLOAT

@Test public void testFloatToString() throws Exception {
helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "string", "cast(1.2 AS varchar(40))"); //$NON-NLS-1$ //$NON-NLS-2$
helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "string", "cast(1.2 AS varchar(4000))"); //$NON-NLS-1$ //$NON-NLS-2$
}

@Test public void testFloatToLong() throws Exception {
Expand All @@ -933,7 +933,7 @@ public void helpTest(Expression srcExpression, String tgtType, String expectedEx
// Source = DOUBLE

@Test public void testDoubleToString() throws Exception {
helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "string", "cast(1.2 AS varchar(40))"); //$NON-NLS-1$ //$NON-NLS-2$
helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "string", "cast(1.2 AS varchar(4000))"); //$NON-NLS-1$ //$NON-NLS-2$
}

@Test public void testDoubleToLong() throws Exception {
Expand Down

0 comments on commit 83c7c89

Please sign in to comment.