public static String computeTestName( final String toScan, final int dataType, final long precision, final int fractionalPrecision) { return "\"" + toScan + "\", " + IntervalType.getIntervalType(dataType, precision, fractionalPrecision).getDefinition() + ", (" + precision + "," + fractionalPrecision + ")"; }
@Override protected void runTest() throws Exception { IntervalType t = IntervalType.getIntervalType(m_dataType, m_precision, m_fractionalPrecision); Scanner scanner = new Scanner(); Object i = scanner.convertToDatetimeInterval(null, m_toScan, t); }
IntervalType readIntervalType() { int precision = -1; int scale = -1; int startToken; int endToken; startToken = endToken = token.tokenType; read(); if (token.tokenType == Tokens.OPENBRACKET) { read(); precision = readInteger(); if (precision <= 0) { throw Error.error(ErrorCode.X_42592); } if (token.tokenType == Tokens.COMMA) { if (startToken != Tokens.SECOND) { throw unexpectedToken(); } read(); scale = readInteger(); if (scale < 0) { throw Error.error(ErrorCode.X_42592); } } readThis(Tokens.CLOSEBRACKET); } if (token.tokenType == Tokens.TO) { read(); endToken = token.tokenType; read(); } if (token.tokenType == Tokens.OPENBRACKET) { if (endToken != Tokens.SECOND || endToken == startToken) { throw unexpectedToken(); } read(); scale = readInteger(); if (scale < 0) { throw Error.error(ErrorCode.X_42592); } readThis(Tokens.CLOSEBRACKET); } int startIndex = ArrayUtil.find(Tokens.SQL_INTERVAL_FIELD_CODES, startToken); int endIndex = ArrayUtil.find(Tokens.SQL_INTERVAL_FIELD_CODES, endToken); return IntervalType.getIntervalType(startIndex, endIndex, precision, scale); }