"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "hsqldb/src/org/hsqldb/FunctionSQL.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.

FunctionSQL.java  (hsqldb-2.7.1):FunctionSQL.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 54 skipping to change at line 54
import org.hsqldb.types.DateTimeType; import org.hsqldb.types.DateTimeType;
import org.hsqldb.types.IntervalType; import org.hsqldb.types.IntervalType;
import org.hsqldb.types.NumberType; import org.hsqldb.types.NumberType;
import org.hsqldb.types.Type; import org.hsqldb.types.Type;
import org.hsqldb.types.Types; import org.hsqldb.types.Types;
/** /**
* Implementation of SQL standard function calls * Implementation of SQL standard function calls
* *
* @author Fred Toussi (fredt@users dot sourceforge.net) * @author Fred Toussi (fredt@users dot sourceforge.net)
* @version 2.7.0 * @version 2.7.2
* @since 1.9.0 * @since 1.9.0
*/ */
public class FunctionSQL extends Expression { public class FunctionSQL extends Expression {
protected static final int FUNC_POSITION_CHAR = 1; // numeric protected static final int FUNC_POSITION_CHAR = 1; // numeric
private static final int FUNC_POSITION_BINARY = 2; private static final int FUNC_POSITION_BINARY = 2;
private static final int FUNC_OCCURENCES_REGEX = 3; private static final int FUNC_OCCURENCES_REGEX = 3;
private static final int FUNC_POSITION_REGEX = 4; private static final int FUNC_POSITION_REGEX = 4;
protected static final int FUNC_EXTRACT = 5; protected static final int FUNC_EXTRACT = 5;
protected static final int FUNC_BIT_LENGTH = 6; protected static final int FUNC_BIT_LENGTH = 6;
skipping to change at line 551 skipping to change at line 551
public Expression getFunctionExpression() { public Expression getFunctionExpression() {
return this; return this;
} }
/** /**
* Evaluates and returns this Function in the context of the session. * Evaluates and returns this Function in the context of the session.
*/ */
public Object getValue(Session session) { public Object getValue(Session session) {
Object[] data = ValuePool.emptyObjectArray; Object[] data;
if (nodes.length > 0) { if (nodes.length == 0) {
data = ValuePool.emptyObjectArray;
} else {
data = new Object[nodes.length]; data = new Object[nodes.length];
for (int i = 0; i < nodes.length; i++) { for (int i = 0; i < nodes.length; i++) {
Expression e = nodes[i]; Expression e = nodes[i];
if (e != null) { if (e != null) {
data[i] = e.getValue(session, e.dataType); data[i] = e.getValue(session, e.dataType);
} }
} }
} }
 End of changes. 4 change blocks. 
4 lines changed or deleted 6 lines changed or added

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