use of org.hsqldb_voltpatches.types.Type in project voltdb by VoltDB.
the class Table method checkColumnsMatch.
/**
* Match two valid, equal length, columns arrays for type of columns
*
* @param col column array from this Table
* @param other the other Table object
* @param othercol column array from the other Table
*/
void checkColumnsMatch(int[] col, Table other, int[] othercol) {
for (int i = 0; i < col.length; i++) {
Type type = colTypes[col[i]];
Type otherType = other.colTypes[othercol[i]];
if (type.typeComparisonGroup != otherType.typeComparisonGroup) {
throw Error.error(ErrorCode.X_42562);
}
}
}
use of org.hsqldb_voltpatches.types.Type in project voltdb by VoltDB.
the class Table method enforceRowConstraints.
/**
* Enforce max field sizes according to SQL column definition.
* SQL92 13.8
*/
void enforceRowConstraints(Session session, Object[] data) {
for (int i = 0; i < defaultColumnMap.length; i++) {
Type type = colTypes[i];
data[i] = type.convertToTypeLimits(session, data[i]);
if (type.isDomainType()) {
Constraint[] constraints = type.userTypeModifier.getConstraints();
for (int j = 0; j < constraints.length; j++) {
constraints[j].checkCheckConstraint(session, this, data[i]);
}
}
if (data[i] == null) {
if (colNotNull[i]) {
Constraint c = getNotNullConstraintForColumn(i);
if (c == null) {
if (getColumn(i).isPrimaryKey()) {
c = this.getPrimaryConstraint();
}
}
String[] info = new String[] { c.getName().name, tableName.name };
throw Error.error(ErrorCode.X_23503, ErrorCode.CONSTRAINT, info);
}
}
}
}
Aggregations