"Fossies" - the Fresh Open Source Software Archive  

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

StatementCommand.java  (hsqldb-2.7.1):StatementCommand.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 62 skipping to change at line 62
import org.hsqldb.rights.User; import org.hsqldb.rights.User;
import org.hsqldb.scriptio.ScriptWriterText; import org.hsqldb.scriptio.ScriptWriterText;
import org.hsqldb.scriptio.ScriptWriterTextColumnNames; import org.hsqldb.scriptio.ScriptWriterTextColumnNames;
import org.hsqldb.types.TimestampData; import org.hsqldb.types.TimestampData;
import org.hsqldb.types.Type; import org.hsqldb.types.Type;
/** /**
* Implementation of Statement for SQL commands.<p> * Implementation of Statement for SQL commands.<p>
* *
* @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 StatementCommand extends Statement { public class StatementCommand extends Statement {
Object[] arguments; Object[] arguments;
StatementCommand(int type, Object[] args) { StatementCommand(int type, Object[] args) {
this(type, args, null, null); this(type, args, null, null);
} }
skipping to change at line 1010 skipping to change at line 1010
Integer type = (Integer) arguments[2]; Integer type = (Integer) arguments[2];
Boolean colNames = (Boolean) arguments[3]; Boolean colNames = (Boolean) arguments[3];
HsqlName tableName = (HsqlName) arguments[4]; HsqlName tableName = (HsqlName) arguments[4];
TimestampData timestamp = (TimestampData) arguments[5]; TimestampData timestamp = (TimestampData) arguments[5];
try { try {
if (!session.getGrantee().canPerformScriptOps()) { if (!session.getGrantee().canPerformScriptOps()) {
throw Error.error(ErrorCode.X_42507); throw Error.error(ErrorCode.X_42507);
} }
if (session.isProcessingScript() || session.isProcessingLog(
)) {
return Result.updateZeroResult;
}
if (name == null) { if (name == null) {
return session.database.getScript(false); return session.database.getScript(false);
} else { } else {
if (colNames.booleanValue()) { if (colNames.booleanValue()) {
dsw = new ScriptWriterTextColumnNames( dsw = new ScriptWriterTextColumnNames(
session.database, name); session.database, name);
} else { } else {
dsw = new ScriptWriterText(session.database, name, dsw = new ScriptWriterText(session.database, name,
true, true, true); true, true, true);
} }
skipping to change at line 1079 skipping to change at line 1083
case StatementTypes.LOAD_SCRIPT : { case StatementTypes.LOAD_SCRIPT : {
try { try {
String pathName = (String) arguments[0]; String pathName = (String) arguments[0];
int mode = ((Integer) arguments[1]).intValue(); int mode = ((Integer) arguments[1]).intValue();
Boolean isVersioning = (Boolean) arguments[2]; Boolean isVersioning = (Boolean) arguments[2];
if (!session.getGrantee().canPerformScriptOps()) { if (!session.getGrantee().canPerformScriptOps()) {
throw Error.error(ErrorCode.X_42507); throw Error.error(ErrorCode.X_42507);
} }
if (session.isProcessingScript() || session.isProcessingLog(
)) {
return Result.updateZeroResult;
}
return ScriptLoader.loadScriptData( return ScriptLoader.loadScriptData(
session, pathName, mode, isVersioning.booleanValue()); session, pathName, mode, isVersioning.booleanValue());
} catch (HsqlException e) { } catch (HsqlException e) {
return Result.newErrorResult(e, sql); return Result.newErrorResult(e, sql);
} }
} }
case StatementTypes.LOAD_DATA : { case StatementTypes.LOAD_DATA : {
try { try {
HsqlName tableName = (HsqlName) arguments[0]; HsqlName tableName = (HsqlName) arguments[0];
String textprops = (String) arguments[1]; String textprops = (String) arguments[1];
skipping to change at line 1104 skipping to change at line 1112
if (table == null) { if (table == null) {
throw Error.error( throw Error.error(
ErrorCode.X_42501, ErrorCode.X_42501,
tableName.getSchemaQualifiedStatementName()); tableName.getSchemaQualifiedStatementName());
} }
if (!session.getGrantee().canPerformScriptOps()) { if (!session.getGrantee().canPerformScriptOps()) {
throw Error.error(ErrorCode.X_42507); throw Error.error(ErrorCode.X_42507);
} }
if (session.isProcessingScript() || session.isProcessingLog(
)) {
return Result.updateZeroResult;
}
return TextFileOps.loadTextData(session, textprops, table, return TextFileOps.loadTextData(session, textprops, table,
mode); mode);
} catch (HsqlException e) { } catch (HsqlException e) {
return Result.newErrorResult(e, sql); return Result.newErrorResult(e, sql);
} }
} }
case StatementTypes.UNLOAD_DATA : { case StatementTypes.UNLOAD_DATA : {
try { try {
HsqlName tableName = (HsqlName) arguments[0]; HsqlName tableName = (HsqlName) arguments[0];
String textprops = (String) arguments[1]; String textprops = (String) arguments[1];
skipping to change at line 1128 skipping to change at line 1140
if (table == null) { if (table == null) {
throw Error.error( throw Error.error(
ErrorCode.X_42501, ErrorCode.X_42501,
tableName.getSchemaQualifiedStatementName()); tableName.getSchemaQualifiedStatementName());
} }
if (!session.getGrantee().canPerformScriptOps()) { if (!session.getGrantee().canPerformScriptOps()) {
throw Error.error(ErrorCode.X_42507); throw Error.error(ErrorCode.X_42507);
} }
if (session.isProcessingScript() || session.isProcessingLog(
)) {
return Result.updateZeroResult;
}
return TextFileOps.unloadTextData(session, textprops, return TextFileOps.unloadTextData(session, textprops,
table); table);
} catch (HsqlException e) { } catch (HsqlException e) {
return Result.newErrorResult(e, sql); return Result.newErrorResult(e, sql);
} }
} }
case StatementTypes.CHECK_INDEX : { case StatementTypes.CHECK_INDEX : {
try { try {
HsqlName tableName = (HsqlName) arguments[0]; HsqlName tableName = (HsqlName) arguments[0];
int type = ((Integer) arguments[1]).intValue(); int type = ((Integer) arguments[1]).intValue();
 End of changes. 6 change blocks. 
2 lines changed or deleted 22 lines changed or added

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