"Fossies" - the Fresh Open Source Software Archive  

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

TextCache.java  (hsqldb-2.7.1):TextCache.java  (hsqldb-2.7.2)
/* Copyright (c) 2001-2021, 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 33 skipping to change at line 33
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
package org.hsqldb.persist; package org.hsqldb.persist;
import java.io.UnsupportedEncodingException;
import org.hsqldb.Database; import org.hsqldb.Database;
import org.hsqldb.DatabaseType; import org.hsqldb.DatabaseType;
import org.hsqldb.HsqlException; import org.hsqldb.HsqlException;
import org.hsqldb.Row; import org.hsqldb.Row;
import org.hsqldb.Table; import org.hsqldb.Table;
import org.hsqldb.error.Error; import org.hsqldb.error.Error;
import org.hsqldb.error.ErrorCode; import org.hsqldb.error.ErrorCode;
import org.hsqldb.lib.FileUtil; import org.hsqldb.lib.FileUtil;
import org.hsqldb.lib.HsqlByteArrayOutputStream; import org.hsqldb.lib.HsqlByteArrayOutputStream;
import org.hsqldb.lib.LongKeyHashMap; import org.hsqldb.lib.LongKeyHashMap;
skipping to change at line 69 skipping to change at line 67
* compatible pair of org.hsqldb.rowio input/output class instances. * compatible pair of org.hsqldb.rowio input/output class instances.
* *
* *
* fredt - This used to write rows as soon as they are inserted * fredt - This used to write rows as soon as they are inserted
* but now this is subject to transaction management. * but now this is subject to transaction management.
* A memory buffer contains the rows not yet committed. * A memory buffer contains the rows not yet committed.
* Refactored for version 2.2.6. * Refactored for version 2.2.6.
* *
* @author Bob Preston (sqlbob@users dot sourceforge.net) * @author Bob Preston (sqlbob@users dot sourceforge.net)
* @author Fred Toussi (fredt@users dot sourceforge.net) * @author Fred Toussi (fredt@users dot sourceforge.net)
* @version 2.5.1 * @version 2.7.2
* @since 1.7.0 * @since 1.7.0
*/ */
public class TextCache extends DataFileCache { public class TextCache extends DataFileCache {
// //
TextFileSettings textFileSettings; TextFileSettings textFileSettings;
//state of Cache //state of Cache
protected String header; protected String header;
protected Table table; protected Table table;
skipping to change at line 425 skipping to change at line 423
throw Error.error(ErrorCode.TEXT_TABLE_HEADER); throw Error.error(ErrorCode.TEXT_TABLE_HEADER);
} }
private void writeHeader(String header) { private void writeHeader(String header) {
try { try {
byte[] buf = null; byte[] buf = null;
String firstLine = header + TextFileSettings.NL; String firstLine = header + TextFileSettings.NL;
try { buf = firstLine.getBytes(textFileSettings.charEncoding);
buf = firstLine.getBytes(textFileSettings.charEncoding);
} catch (UnsupportedEncodingException e) {
buf = firstLine.getBytes();
}
dataFile.seek(0); dataFile.seek(0);
dataFile.write(buf, 0, buf.length); dataFile.write(buf, 0, buf.length);
fileFreePosition = buf.length; fileFreePosition = buf.length;
} catch (Throwable t) { } catch (Throwable t) {
throw Error.error(ErrorCode.TEXT_FILE_IO, t); throw Error.error(ErrorCode.TEXT_FILE_IO, t);
} }
} }
 End of changes. 4 change blocks. 
9 lines changed or deleted 3 lines changed or added

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