"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "hsqldb/src/org/hsqldb/types/Type.java" between
hsqldb-2.7.1.zip and hsqldb-2.7.2.zip

About: HSQLDB (HyperSQL DataBase) is a SQL relational database engine written in Java. It supports nearly full ANSI-92 SQL (BNF format) and full core SQL:2008.

Type.java  (hsqldb-2.7.1):Type.java  (hsqldb-2.7.2)
/* Copyright (c) 2001-2022, The HSQL Development Group /* Copyright (c) 2001-2023, The HSQL Development Group
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* Redistributions of source code must retain the above copyright notice, this * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer. * list of conditions and the following disclaimer.
* *
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
skipping to change at line 50 skipping to change at line 50
import org.hsqldb.error.ErrorCode; import org.hsqldb.error.ErrorCode;
import org.hsqldb.lib.IntKeyHashMap; import org.hsqldb.lib.IntKeyHashMap;
import org.hsqldb.lib.IntValueHashMap; import org.hsqldb.lib.IntValueHashMap;
import org.hsqldb.lib.OrderedHashSet; import org.hsqldb.lib.OrderedHashSet;
import org.hsqldb.rights.Grantee; import org.hsqldb.rights.Grantee;
/** /**
* Base class for type objects.<p> * Base class for type objects.<p>
* *
* @author Fred Toussi (fredt@users dot sourceforge.net) * @author Fred Toussi (fredt@users dot sourceforge.net)
* @version 2.6.0 * @version 2.7.2
* @since 1.9.0 * @since 1.9.0
*/ */
public abstract class Type implements SchemaObject, Cloneable { public abstract class Type implements SchemaObject, Cloneable {
public interface ReType { public interface ReType {
int keep = 0; // only metadata change is required int keep = 0; // only metadata change is required
int check = 1; // range check is also required int check = 1; // range check is also required
int change = -1; // data conversion is required int change = -1; // data conversion is required
} }
skipping to change at line 724 skipping to change at line 724
new DateTimeType(Types.SQL_TIMESTAMP, Types.SQL_DATE, 0); new DateTimeType(Types.SQL_TIMESTAMP, Types.SQL_DATE, 0);
public static final DateTimeType SQL_TIME = public static final DateTimeType SQL_TIME =
new DateTimeType(Types.SQL_TIME, Types.SQL_TIME, new DateTimeType(Types.SQL_TIME, Types.SQL_TIME,
DTIType.defaultTimeFractionPrecision); DTIType.defaultTimeFractionPrecision);
public static final DateTimeType SQL_TIME_MAX = public static final DateTimeType SQL_TIME_MAX =
new DateTimeType(Types.SQL_TIME, Types.SQL_TIME, new DateTimeType(Types.SQL_TIME, Types.SQL_TIME,
DTIType.maxFractionPrecision); DTIType.maxFractionPrecision);
public static final DateTimeType SQL_TIME_WITH_TIME_ZONE = public static final DateTimeType SQL_TIME_WITH_TIME_ZONE =
new DateTimeType(Types.SQL_TIME, Types.SQL_TIME_WITH_TIME_ZONE, new DateTimeType(Types.SQL_TIME, Types.SQL_TIME_WITH_TIME_ZONE,
DTIType.defaultTimeFractionPrecision); DTIType.defaultTimeFractionPrecision);
public static final DateTimeType SQL_TIME_WITH_TIME_ZONE_MAX =
new DateTimeType(Types.SQL_TIME, Types.SQL_TIME_WITH_TIME_ZONE,
DTIType.maxFractionPrecision);
public static final DateTimeType SQL_TIMESTAMP = public static final DateTimeType SQL_TIMESTAMP =
new DateTimeType(Types.SQL_TIMESTAMP, Types.SQL_TIMESTAMP, new DateTimeType(Types.SQL_TIMESTAMP, Types.SQL_TIMESTAMP,
DTIType.defaultTimestampFractionPrecision); DTIType.defaultTimestampFractionPrecision);
public static final DateTimeType SQL_TIMESTAMP_WITH_TIME_ZONE = public static final DateTimeType SQL_TIMESTAMP_WITH_TIME_ZONE =
new DateTimeType(Types.SQL_TIMESTAMP, new DateTimeType(Types.SQL_TIMESTAMP,
Types.SQL_TIMESTAMP_WITH_TIME_ZONE, Types.SQL_TIMESTAMP_WITH_TIME_ZONE,
DTIType.defaultTimestampFractionPrecision); DTIType.defaultTimestampFractionPrecision);
public static final DateTimeType SQL_TIMESTAMP_NO_FRACTION = public static final DateTimeType SQL_TIMESTAMP_NO_FRACTION =
new DateTimeType(Types.SQL_TIMESTAMP, Types.SQL_TIMESTAMP, 0); new DateTimeType(Types.SQL_TIMESTAMP, Types.SQL_TIMESTAMP, 0);
public static final DateTimeType SQL_TIMESTAMP_WITH_TIME_ZONE_MAX = public static final DateTimeType SQL_TIMESTAMP_WITH_TIME_ZONE_MAX =
skipping to change at line 994 skipping to change at line 997
case Types.VARBINARY : case Types.VARBINARY :
case Types.LONGVARBINARY : case Types.LONGVARBINARY :
return Types.SQL_VARBINARY; return Types.SQL_VARBINARY;
case Types.BLOB : case Types.BLOB :
return Types.SQL_BLOB; return Types.SQL_BLOB;
case Types.ARRAY : case Types.ARRAY :
return Types.SQL_ARRAY; return Types.SQL_ARRAY;
case Types.TIME_WITH_TIMEZONE :
return Types.SQL_TIME_WITH_TIME_ZONE;
case Types.TIMESTAMP_WITH_TIMEZONE :
return Types.SQL_TIMESTAMP_WITH_TIME_ZONE;
default : default :
return jdbcTypeNumber; return jdbcTypeNumber;
} }
} }
/** /**
* translate an internal type number to JDBC type number if a type is not * translate an internal type number to JDBC type number if a type is not
* supported internally, it is returned without translation * supported internally, it is returned without translation
* *
* @param type int * @param type int
skipping to change at line 1032 skipping to change at line 1041
case Types.SQL_VARBINARY : case Types.SQL_VARBINARY :
return Types.VARBINARY; return Types.VARBINARY;
case Types.SQL_BIT : case Types.SQL_BIT :
case Types.SQL_BIT_VARYING : case Types.SQL_BIT_VARYING :
return Types.BIT; return Types.BIT;
case Types.SQL_ARRAY : case Types.SQL_ARRAY :
return Types.ARRAY; return Types.ARRAY;
case Types.SQL_TIME_WITH_TIME_ZONE :
return Types.TIME_WITH_TIMEZONE;
case Types.SQL_TIMESTAMP_WITH_TIME_ZONE :
return Types.TIMESTAMP_WITH_TIMEZONE;
default : default :
return type; return type;
} }
} }
public static Type getType(Type type, Collation collation) { public static Type getType(Type type, Collation collation) {
if (type.getCollation() == collation) { if (type.getCollation() == collation) {
return type; return type;
} }
skipping to change at line 1161 skipping to change at line 1176
} }
return existing.getAggregateType(add); return existing.getAggregateType(add);
} }
public static final IntValueHashMap typeAliases; public static final IntValueHashMap typeAliases;
public static final IntValueHashMap typeNames; public static final IntValueHashMap typeNames;
public static final IntKeyHashMap jdbcConvertTypes; public static final IntKeyHashMap jdbcConvertTypes;
static { static {
typeNames = new IntValueHashMap(37); typeNames = new IntValueHashMap();
typeNames.put(Tokens.T_CHARACTER, Types.SQL_CHAR); typeNames.put(Tokens.T_CHARACTER, Types.SQL_CHAR);
typeNames.put(Tokens.T_VARCHAR, Types.SQL_VARCHAR); typeNames.put(Tokens.T_VARCHAR, Types.SQL_VARCHAR);
typeNames.put(Tokens.T_VARCHAR_IGNORECASE, Types.VARCHAR_IGNORECASE); typeNames.put(Tokens.T_VARCHAR_IGNORECASE, Types.VARCHAR_IGNORECASE);
typeNames.put(Tokens.T_NVARCHAR, Types.SQL_VARCHAR); typeNames.put(Tokens.T_NVARCHAR, Types.SQL_VARCHAR);
typeNames.put(Tokens.T_DATE, Types.SQL_DATE); typeNames.put(Tokens.T_DATE, Types.SQL_DATE);
typeNames.put(Tokens.T_TIME, Types.SQL_TIME); typeNames.put(Tokens.T_TIME, Types.SQL_TIME);
typeNames.put(Tokens.T_TIMESTAMP, Types.SQL_TIMESTAMP); typeNames.put(Tokens.T_TIMESTAMP, Types.SQL_TIMESTAMP);
typeNames.put(Tokens.T_INTERVAL, Types.SQL_INTERVAL); typeNames.put(Tokens.T_INTERVAL, Types.SQL_INTERVAL);
typeNames.put(Tokens.T_TINYINT, Types.TINYINT); typeNames.put(Tokens.T_TINYINT, Types.TINYINT);
skipping to change at line 1188 skipping to change at line 1203
typeNames.put(Tokens.T_NUMERIC, Types.SQL_NUMERIC); typeNames.put(Tokens.T_NUMERIC, Types.SQL_NUMERIC);
typeNames.put(Tokens.T_DECIMAL, Types.SQL_DECIMAL); typeNames.put(Tokens.T_DECIMAL, Types.SQL_DECIMAL);
typeNames.put(Tokens.T_BOOLEAN, Types.SQL_BOOLEAN); typeNames.put(Tokens.T_BOOLEAN, Types.SQL_BOOLEAN);
typeNames.put(Tokens.T_BINARY, Types.SQL_BINARY); typeNames.put(Tokens.T_BINARY, Types.SQL_BINARY);
typeNames.put(Tokens.T_VARBINARY, Types.SQL_VARBINARY); typeNames.put(Tokens.T_VARBINARY, Types.SQL_VARBINARY);
typeNames.put(Tokens.T_CLOB, Types.SQL_CLOB); typeNames.put(Tokens.T_CLOB, Types.SQL_CLOB);
typeNames.put(Tokens.T_BLOB, Types.SQL_BLOB); typeNames.put(Tokens.T_BLOB, Types.SQL_BLOB);
typeNames.put(Tokens.T_BIT, Types.SQL_BIT); typeNames.put(Tokens.T_BIT, Types.SQL_BIT);
typeNames.put(Tokens.T_OTHER, Types.OTHER); typeNames.put(Tokens.T_OTHER, Types.OTHER);
typeNames.put(Tokens.T_UUID, Types.SQL_GUID); typeNames.put(Tokens.T_UUID, Types.SQL_GUID);
typeNames.put("TIME WITH TIME ZONE", Types.SQL_TIME_WITH_TIME_ZONE);
typeNames.put("TIMESTAMP WITH TIME ZONE", Types.SQL_TIMESTAMP_WITH_TIME_
ZONE);
// //
typeAliases = new IntValueHashMap(64); typeAliases = new IntValueHashMap(64);
typeAliases.put(Tokens.T_CHAR, Types.SQL_CHAR); typeAliases.put(Tokens.T_CHAR, Types.SQL_CHAR);
typeAliases.put(Tokens.T_INT, Types.SQL_INTEGER); typeAliases.put(Tokens.T_INT, Types.SQL_INTEGER);
typeAliases.put(Tokens.T_DEC, Types.SQL_DECIMAL); typeAliases.put(Tokens.T_DEC, Types.SQL_DECIMAL);
typeAliases.put(Tokens.T_LONGVARCHAR, Types.LONGVARCHAR); typeAliases.put(Tokens.T_LONGVARCHAR, Types.LONGVARCHAR);
typeAliases.put(Tokens.T_DATETIME, Types.SQL_TIMESTAMP); typeAliases.put(Tokens.T_DATETIME, Types.SQL_TIMESTAMP);
typeAliases.put(Tokens.T_LONGVARBINARY, Types.LONGVARBINARY); typeAliases.put(Tokens.T_LONGVARBINARY, Types.LONGVARBINARY);
 End of changes. 7 change blocks. 
3 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)