Anonymous avatar Anonymous committed 12960fe Merge

hsqldb19: merge to new DEV300 m100

Comments (0)

Files changed (281)

connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageAccess.java

 
 package com.sun.star.sdbcx.comp.hsqldb;
 
+import java.io.IOException;
+
 /**
  *
  * @author  oj93728
  */
 
-public class StorageAccess implements org.hsqldb.lib.Storage {
+public class StorageAccess implements org.hsqldb.persist.RandomAccessInterface {
     String key;
     String name;
     boolean readonly;
 
         write(oneByte,0,8);
     }
+
+    public void synch()
+    {
+    }
+
+    public boolean ensureLength(long l)
+    {
+//        throw new UnsupportedOperationException("Not supported yet.");
+        return true;
+    }
+
+    public void setLength(long l) throws IOException
+    {
+  //      throw new UnsupportedOperationException("Not supported yet.");
+    }
 }

connectivity/inc/connectivity/TColumnsHelper.hxx

         virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
         virtual sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
 		virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
+		virtual ::rtl::OUString transformSQL(const ::rtl::OUString& _sSQL);
 	public:
 		OColumnsHelper(	::cppu::OWeakObject& _rParent
 						,sal_Bool _bCase

connectivity/qa/complex/connectivity/hsqldb/DatabaseMetaData.java

     }
     
     protected void assure(String _sText,boolean btest){
-        m_TestCase.assurePublic(_sText,btest);
     }
     
     protected void testMethod(String sName,Class[] params,Object[] objParams,int nCount){

connectivity/qa/connectivity/tools/CRMDatabase.java

                 new HsqlColumnDescriptor( "Address",VARCHAR50),
                 new HsqlColumnDescriptor( "City",VARCHAR50),
                 new HsqlColumnDescriptor( "Postal",VARCHAR50),
-                new HsqlColumnDescriptor( "Comment","LONGVARCHAR")} );
+                new HsqlColumnDescriptor( "Comment","CLOB")} );
         m_database.createTable( table, true );
 
         m_database.executeSQL( "INSERT INTO \"customers\" VALUES(1,'Food, Inc.','Down Under','Melbourne','509','Prefered') " );

connectivity/qa/drivers/hsqldb/HSQLDriverTest.java

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package qa.drivers.hsqldb;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XParameters;
+import com.sun.star.sdbc.XPreparedStatement;
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.sdbc.XRow;
+import com.sun.star.sdbc.XStatement;
+import com.sun.star.uno.UnoRuntime;
+import connectivity.tools.HsqlDatabase;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.io.Reader;
+import java.net.URL;
+
+public class HSQLDriverTest extends complexlib.ComplexTestCase {
+
+    // --------------------------------------------------------------------------------------------------------
+    public String getTestObjectName()
+    {
+        return getClass().getName();
+    }
+    public String[] getTestMethodNames() {
+        return new String[] { "testClobTrigger","testNamedParameter","testIntervalType" };
+    }
+    public void testNamedParameter(){
+        log.println("testNamedParameter");
+        try {
+            HsqlDatabase db = new HsqlDatabase(getORB());
+            final XPreparedStatement prep = db.defaultConnection().prepareStatement("SELECT * FROM INFORMATION_SCHEMA.SYSTEM_TABLES WHERE TABLE_NAME = :x");
+            final XParameters params = (XParameters) UnoRuntime.queryInterface(XParameters.class, prep);
+            params.setString(1, "SYSTEM_TABLES");
+            XResultSet rs = prep.executeQuery();
+            assure("Table not found",rs.next());
+            rs = db.defaultConnection().createStatement().executeQuery("SELECT (CURRENT_DATE - DATE '2000-01-01') DAY FROM INFORMATION_SCHEMA.SYSTEM_TABLES");
+            assure("Interval type not working",rs.next());
+
+
+            db.closeAndDelete();
+        } catch (Exception ex) {
+            assure(ex.getMessage(), false);
+        }
+    }
+    public void testIntervalType(){
+        log.println("testIntervalType");
+        try {
+            HsqlDatabase db = new HsqlDatabase(getORB());
+            final XResultSet rs = db.defaultConnection().createStatement().executeQuery("SELECT (CURRENT_DATE - DATE '2000-01-01') DAY FROM INFORMATION_SCHEMA.SYSTEM_TABLES");
+            final XRow row = (XRow) UnoRuntime.queryInterface(XRow.class, rs);
+            assure("Interval type not working",rs.next() && row.getString(1).length() != 0);
+
+            db.closeAndDelete();
+        } catch (Exception ex) {
+            assure(ex.getMessage(), false);
+        }
+    }
+    public void testClobTrigger() throws Exception{
+        log.println("testClobTrigger");
+        HsqlDatabase db = new HsqlDatabase(getORB());
+        final String url = db.getDocumentURL();
+        log.println(url);
+        try {
+
+            final String[] scripts = new String[]{"clob-test.sql"};
+
+            final XStatement stmt = db.defaultConnection().createStatement();
+            final XPropertySet prop = UnoRuntime.queryInterface(XPropertySet.class, stmt);
+            prop.setPropertyValue("EscapeProcessing", Boolean.FALSE);
+            for(String i : scripts){
+                executeScript(i,stmt);
+                db.store();
+            }
+        } catch (Exception ex) {
+            assure(ex.getMessage(), false);
+        }
+        
+        db.close();
+    }
+
+    protected final XMultiServiceFactory getORB() {
+        return (XMultiServiceFactory) param.getMSF();
+    }
+    Reader getScriptReader(final String resource) throws IOException {
+
+        final URL resourceURL = getClass().getResource(resource);
+
+        if (resourceURL == null) {
+            throw new IOException("No such resource: " + resource);
+        }
+
+        return new InputStreamReader(resourceURL.openStream());
+    }
+
+    void executeScript(final String resource,final XStatement statement) throws IOException, SQLException{
+
+        final LineNumberReader reader = new LineNumberReader(getScriptReader(resource));
+
+        log.println("Opened test script: " + resource);
+
+        while (true) {
+            final String line = reader.readLine();
+
+            if (line == null) {
+                break;
+            }
+
+            if ((line.length() == 0) || line.startsWith("--")) {
+                continue;
+            }
+
+            statement.execute(line);
+        }
+
+        log.println("Processed lines: " + reader.getLineNumber());
+    }
+}

connectivity/qa/drivers/hsqldb/clob-test.sql

+CREATE TABLE TEST_CLOB(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY,DESCRIPTION CLOB(16M) DEFAULT NULL)
+CREATE TABLE TEST_CLOB_2(ID SMALLINT PRIMARY KEY,DESCRIPTION CLOB(16M))
+CREATE TRIGGER INS_CLOB AFTER INSERT ON TEST_CLOB REFERENCING NEW ROW AS NEWROW FOR EACH ROW INSERT INTO TEST_CLOB_2 (ID, DESCRIPTION) VALUES (NEWROW.ID, NEWROW.DESCRIPTION)
+INSERT INTO TEST_CLOB VALUES (1,'Ut wisi enim ad minim veniam, quis nostrud exerci')
+INSERT INTO TEST_CLOB VALUES (2,'Ut wisi enim ad minim veniam, quis nostrud exerci')

connectivity/qa/drivers/hsqldb/makefile.mk

+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.7.60.1 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ = ..$/..$/..
+TARGET  = HSQLDriverTest
+PRJNAME = connectivity
+PACKAGE = qa$/drivers$/hsqldb
+
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+
+
+#----- compile .java files -----------------------------------------
+
+JARFILES        = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar ConnectivityTools.jar
+JAVAFILES       =\
+		HSQLDriverTest.java
+		
+JAVACLASSFILES	= $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+SQLFILES	:= $(subst,./,$(CLASSDIR)$/$(PACKAGE)$/ $(shell @$(FIND) . -name "*.sql"))
+
+#----- make a jar from compiled files ------------------------------
+
+MAXLINELENGTH = 100000
+
+JARCLASSDIRS    = $(PACKAGE)
+JARTARGET       = $(TARGET).jar
+JARCOMPRESS 	= TRUE
+
+RUNNER_ARGS = -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar" org.openoffice.Runner -TestBase java_complex 
+
+RUNNER_CALL = $(AUGMENT_LIBRARY_PATH) java
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE :  target.mk
+
+.IF "$(JARTARGETN)"!=""
+$(JARTARGETN) : $(SQLFILES)
+.ENDIF          # "$(JARTARGETN)"!=""
+
+$(CLASSDIR)$/$(PACKAGE)$/%.sql : %.sql
+	@@-$(MKDIRHIER) $(@:d)
+    $(COPY) $< $@
+    
+run: $(CLASSDIR)$/$(JARTARGET)
+	+echo "begin"
+	+echo $(AUGMENT_LIBRARY_PATH)
+	+echo "end"
+	+$(RUNNER_CALL) $(RUNNER_ARGS) -o qa.drivers.hsqldb.$(TARGET)
Add a comment to this file

connectivity/source/commontools/DateConversion.cxx

File contents unchanged.

Add a comment to this file

connectivity/source/commontools/FValue.cxx

File contents unchanged.

connectivity/source/commontools/TColumnsHelper.cxx

 	Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement(  );
 	if ( xStmt.is() )
 	{
-		xStmt->execute(aSql);
+		xStmt->execute(transformSQL(aSql));
 		::comphelper::disposeComponent(xStmt);
 	}
     return createObject( _rForName );
 }
 // -------------------------------------------------------------------------
+::rtl::OUString OColumnsHelper::transformSQL(const ::rtl::OUString& _sSQL)
+{
+	return _sSQL;
+}
+// -------------------------------------------------------------------------
 // XDrop
 void OColumnsHelper::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
 {

connectivity/source/commontools/TTableHelper.cxx

     {
         ::rtl::OUString sName;
 		Event.Accessor	>>= sName;
-        if ( m_aRefNames.find(sName) != m_aRefNames.end() )
+        if ( m_pComponent && m_aRefNames.find(sName) != m_aRefNames.end() )
             m_pComponent->refreshKeys();
     }
     virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (RuntimeException)
 
 	if ( xResult.is() )
 	{
-        sdbcx::TKeyProperties pKeyProps(new sdbcx::KeyProperties(::rtl::OUString(),KeyType::PRIMARY,0,0));
-        ::rtl::OUString aPkName;
-        bool bAlreadyFetched = false;
-        const Reference< XRow > xRow(xResult,UNO_QUERY);
-        while ( xResult->next() )
-        {
-            pKeyProps->m_aKeyColumnNames.push_back(xRow->getString(4));
-            if ( !bAlreadyFetched )
-            {
-		        aPkName = xRow->getString(6);
-                bAlreadyFetched = true;
-            }
-        }
-        
-        m_pImpl->m_aKeys.insert(TKeyMap::value_type(aPkName,pKeyProps));
-        _rNames.push_back(aPkName);
+		sal_Bool bNext = xResult->next();
+		if ( bNext )
+		{
+			sdbcx::TKeyProperties pKeyProps(new sdbcx::KeyProperties(::rtl::OUString(),KeyType::PRIMARY,0,0));
+			::rtl::OUString aPkName;
+			bool bAlreadyFetched = false;
+			const Reference< XRow > xRow(xResult,UNO_QUERY);
+			while ( bNext )
+			{
+				pKeyProps->m_aKeyColumnNames.push_back(xRow->getString(4));
+				if ( !bAlreadyFetched )
+				{
+					aPkName = xRow->getString(6);
+					bAlreadyFetched = true;
+				}
+				bNext = xResult->next();
+			}
+			m_pImpl->m_aKeys.insert(TKeyMap::value_type(aPkName,pKeyProps));
+			_rNames.push_back(aPkName);
+		}
 	} // if ( xResult.is() && xResult->next() )
     ::comphelper::disposeComponent(xResult);
 }
 			const sal_Int32 nDeleteRule = xRow->getInt(11);
             const ::rtl::OUString sFkName = xRow->getString(12);
 			
-                if ( pKeyProps.get() )
-                {
-                }
-                
-				
 			if ( sFkName.getLength() && !xRow->wasNull() )
             {
                 if ( sOldFKName != sFkName )
Add a comment to this file

connectivity/source/commontools/dbtools.cxx

File contents unchanged.

connectivity/source/drivers/hsqldb/HColumns.cxx

 #include "precompiled_connectivity.hxx"
 #include "hsqldb/HColumns.hxx"
 #include "TConnection.hxx"
-
+#include "hsqldb/HTools.hxx"
 
 using namespace ::comphelper;
 using namespace connectivity::hsqldb;
 	return new OHSQLColumn(sal_True);
 }
 // -----------------------------------------------------------------------------
+::rtl::OUString OHSQLColumns::transformSQL(const ::rtl::OUString& _sSQL)
+{
+	return HTools::replaceIdentityColumns(_sSQL);
+}
 // -----------------------------------------------------------------------------
 OHSQLColumn::OHSQLColumn(	sal_Bool	_bCase)
 	: connectivity::sdbcx::OColumn(	_bCase )
 // -------------------------------------------------------------------------
 void OHSQLColumn::construct()
 {
-	m_sAutoIncrement = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IDENTITY"));
+	m_sAutoIncrement = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GENERATED BY DEFAULT AS IDENTITY"));
 	registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION),PROPERTY_ID_AUTOINCREMENTCREATION,0,&m_sAutoIncrement,	::getCppuType(&m_sAutoIncrement));
 }
 // -----------------------------------------------------------------------------
 	return aSupported;
 }
 // -----------------------------------------------------------------------------
+

connectivity/source/drivers/hsqldb/HDriver.cxx

 #include <com/sun/star/embed/XStorage.hpp>
 #include <com/sun/star/frame/XDesktop.hpp>
 #include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
 #include "HTerminateListener.hxx"
 #include "hsqldb/HCatalog.hxx"
 #include "diagnose_ex.h"
 #include <rtl/ustrbuf.hxx>
 #include <osl/file.h>
 #include <osl/process.h>
-#include <connectivity/dbexception.hxx>
 #include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/interaction.hxx>
 #include <unotools/confignode.hxx>
 #include <unotools/ucbstreamhelper.hxx>
 #include "resource/hsqldb_res.hrc"
 {
 //........................................................................
 	using namespace hsqldb;
+    using namespace ::comphelper;
 	using namespace ::com::sun::star::uno;
 	using namespace ::com::sun::star::sdbc;
 	using namespace ::com::sun::star::sdbcx;
     using namespace ::com::sun::star::frame;
 	using namespace ::com::sun::star::lang;
 	using namespace ::com::sun::star::embed;
-	using namespace ::com::sun::star::io;
+    using namespace ::com::sun::star::io;
     using namespace ::com::sun::star::task;
 	using namespace ::com::sun::star::reflection;
 
 			{
 				::rtl::OUString sURL;
 				Reference<XStorage> xStorage;
+                Reference< XInteractionHandler > xInteraction;
 				const PropertyValue* pIter = info.getConstArray();
 				const PropertyValue* pEnd = pIter + info.getLength();
 
 					{
 						pIter->Value >>= sURL;
 					}
+                    else if ( pIter->Name.equalsAscii("InteractionHandler") )
+					{
+						pIter->Value >>= xInteraction;
+					}
 				}
 
 				if ( !xStorage.is() || !sURL.getLength() )
                 // don't want to expose HSQLDB's schema capabilities which exist since 1.8.0RC10
                 aProperties.put( "default_schema",
                     ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
+				aProperties.put( "hsqldb.default_table_type",
+                    ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cached" ) ) );
 
                 // security: permitted Java classes
                 NamedValue aPermittedClasses(
                     makeAny( lcl_getPermittedJavaMethods_nothrow( m_xFactory ) )
                 );
                 aProperties.put( "SystemProperties", Sequence< NamedValue >( &aPermittedClasses, 1 ) );
-				
-				const ::rtl::OUString sProperties( RTL_CONSTASCII_USTRINGPARAM( "properties" ) );
-				::rtl::OUString sMessage;
+				aProperties.put( "jdbc.interval_as_varchar", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
+
+                bool bAskUser = false,bModified = false;
+                ::rtl::OUString sProperties( RTL_CONSTASCII_USTRINGPARAM( "properties" ) );
                 try
                 {
                     if ( !bIsNewDatabase && xStorage->isStreamElement(sProperties) )
                                     {
                                         sVersionString = sValue;
                                     }
+									else if ( sLine.Equals("modified=yes",0,sizeof("modified=yes")-1) )
+                                    {
+										bModified = true;
+									}
                                     else
                                     {
-                                        if  (   sIniKey.Equals( "version" )
-                                            &&  ( sVersionString.Len() == 0 )
+                                        if  (   (  sVersionString.Len() == 0 )
+												&& sIniKey.Equals( "version" )
                                             )
                                         {
                                             sVersionString = sValue;
 									const sal_Int32 nMajor = sVersionString.GetToken(0,'.').ToInt32();
 									const sal_Int32 nMinor = sVersionString.GetToken(1,'.').ToInt32();
 									const sal_Int32 nMicro = sVersionString.GetToken(2,'.').ToInt32();
-									if ( 	 nMajor > 1 
-										|| ( nMajor == 1 && nMinor > 8 )
-										|| ( nMajor == 1 && nMinor == 8 && nMicro > 0 ) )
+									if ( nMajor < 2 )
 					                {
-					                    ::connectivity::SharedResources aResources;
-					                    sMessage = aResources.getResourceString(STR_ERROR_NEW_VERSION);
+										bAskUser = true;
 					                }
                                 }
                             }
                 catch(Exception&)
                 {
                 }
-				if ( sMessage.getLength() )
+
+				// check if database was shutdown correctly before converting to new a version
+				if ( bModified && bAskUser )
 				{
+					::connectivity::SharedResources aResources;
+					const ::rtl::OUString sMessage = aResources.getResourceString(STR_SHUTDOWN_REQUIRED);
 					::dbtools::throwGenericSQLException(sMessage ,*this);
 				}
+				// need to convert file, ask for user approvement
+                if ( xInteraction.is() && bAskUser )
+                {
+					::connectivity::SharedResources aResources;
+					const ::rtl::OUString sRequest( aResources.getResourceString(STR_CONVERT_TO_NEW_VERSION));
+                    SQLException aInfo(sRequest,*this,::rtl::OUString(),0,Any());
+                    OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aInfo));
+			        Reference< XInteractionRequest > xRequest(pRequest);
+                    OInteraction< XInteractionApprove >* pApprove = new OInteraction< XInteractionApprove >();
+			        pRequest->addContinuation(pApprove);
+                    OInteraction< XInteractionDisapprove >* pDisApprove = new OInteraction< XInteractionDisapprove >;
+			        pRequest->addContinuation(pDisApprove);
+                    xInteraction->handle(xRequest);
+                    if ( !pDisApprove->wasSelected() )
+				        bAskUser = false;
+					aProperties.put( "sql.enforce_size", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) ) );
+                }
 
                 // readonly?
 				Reference<XPropertySet> xProp(xStorage,UNO_QUERY);
 					xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OpenMode"))) >>= nMode;
 					if ( (nMode & ElementModes::WRITE) != ElementModes::WRITE )
 					{
-                        aProperties.put( "readonly", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
+                        bAskUser = true; // which means already added
+                        //aProperties.put( "readonly", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
 					}
-				}
+				} // if ( xProp.is() )
+                if ( bAskUser )
+                    aProperties.put( "readonly", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
 
                 Sequence< PropertyValue > aConnectionArgs;
                 aProperties >>= aConnectionArgs;
                 {
                     xOrig = xDriver->connect( sConnectURL, aConnectionArgs );
                 }
+				catch(const SQLException& e)
+                {
+                    StorageContainer::revokeStorage(sKey,NULL);
+                    OSL_UNUSED(e);
+                    throw;
+                }
                 catch(const Exception& e)
                 {
                     StorageContainer::revokeStorage(sKey,NULL);
-                    (void)e;
+                    OSL_UNUSED(e);
                     throw;
                 }
 

connectivity/source/drivers/hsqldb/HStorageAccess.cxx

 		if ( xOut.is() )
 		{
 			jbyte *buf = env->GetByteArrayElements(buffer,NULL);
+            OSL_ENSURE(len <= env->GetArrayLength(buffer),"Length is greater than the buffer!");
+
 			if (JNI_FALSE != env->ExceptionCheck())
             {
                 env->ExceptionClear();

connectivity/source/drivers/hsqldb/HStorageMap.cxx

 		{
 			try
 			{
-                m_xStream.clear();
-			    m_xSeek.clear();
+				m_xStream.clear();
+				m_xSeek.clear();
+				if ( m_xOutputStream.is() )
 				if ( m_xInputStream.is() )
 				{
 					m_xInputStream->closeInput();

connectivity/source/drivers/hsqldb/HTable.cxx

 #include "precompiled_connectivity.hxx"
 #include "hsqldb/HTable.hxx"
 #include "hsqldb/HTables.hxx"
+#include "hsqldb/HTools.hxx"
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSet.hpp>
 #include <com/sun/star/sdbcx/KeyType.hpp>
 	if(sSQL.lastIndexOf(',') == (sSQL.getLength()-1))
 		sSQL = sSQL.replaceAt(sSQL.getLength()-1,1,::rtl::OUString::createFromAscii(")"));
 
+	sSQL = HTools::replaceIdentityColumns(sSQL);
+
 	Reference< XStatement > xStmt = getConnection()->createStatement(  );
 	if ( xStmt.is() )
 	{

connectivity/source/drivers/hsqldb/HTables.cxx

 #include "hsqldb/HTables.hxx"
 #include "hsqldb/HViews.hxx"
 #include "hsqldb/HTable.hxx"
+#include "hsqldb/HTools.hxx"
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSet.hpp>
 #include <com/sun/star/sdbc/ColumnValue.hpp>
 void OTables::createTable( const Reference< XPropertySet >& descriptor )
 {
 	Reference< XConnection > xConnection = static_cast<OHCatalog&>(m_rParent).getConnection();
-	::rtl::OUString aSql = ::dbtools::createSqlCreateTableStatement(descriptor,xConnection);
+	::rtl::OUString aSql(::dbtools::createSqlCreateTableStatement(descriptor,xConnection));
+    aSql = HTools::replaceIdentityColumns(aSql);
 
     Reference< XStatement > xStmt = xConnection->createStatement(  );
 	if ( xStmt.is() )

connectivity/source/drivers/hsqldb/HTools.cxx

 	/** === begin UNO using === **/
 	/** === end UNO using === **/
 
-	//====================================================================
-	//= HTools
-	//====================================================================
-	//--------------------------------------------------------------------
-    void HTools::appendTableFilterCrit( ::rtl::OUStringBuffer& _inout_rBuffer, const ::rtl::OUString& _rCatalog,
-        const ::rtl::OUString _rSchema, const ::rtl::OUString _rName, bool _bShortForm )
+//====================================================================
+//= HTools
+//====================================================================
+//--------------------------------------------------------------------
+void HTools::appendTableFilterCrit( ::rtl::OUStringBuffer& _inout_rBuffer, const ::rtl::OUString& _rCatalog,
+    const ::rtl::OUString _rSchema, const ::rtl::OUString _rName, bool _bShortForm )
+{
+    _inout_rBuffer.appendAscii( " WHERE " );
+    if ( _rCatalog.getLength() )
     {
-        _inout_rBuffer.appendAscii( " WHERE " );
-        if ( _rCatalog.getLength() )
-        {
-            _inout_rBuffer.appendAscii( _bShortForm ? "TABLE_CAT" : "TABLE_CATALOG" );
-            _inout_rBuffer.appendAscii( " = '" );
-            _inout_rBuffer.append     ( _rCatalog );
-            _inout_rBuffer.appendAscii( "' AND " );
-        }
-        if ( _rSchema.getLength() )
-        {
-            _inout_rBuffer.appendAscii( _bShortForm ? "TABLE_SCHEM" : "TABLE_SCHEMA" );
-            _inout_rBuffer.appendAscii( " = '" );
-            _inout_rBuffer.append     ( _rSchema );
-            _inout_rBuffer.appendAscii( "' AND " );
-        }
-        _inout_rBuffer.appendAscii( "TABLE_NAME = '" );
-        _inout_rBuffer.append     ( _rName );
-        _inout_rBuffer.appendAscii( "'" );
+        _inout_rBuffer.appendAscii( _bShortForm ? "TABLE_CAT" : "TABLE_CATALOG" );
+        _inout_rBuffer.appendAscii( " = '" );
+        _inout_rBuffer.append     ( _rCatalog );
+        _inout_rBuffer.appendAscii( "' AND " );
     }
+    if ( _rSchema.getLength() )
+    {
+        _inout_rBuffer.appendAscii( _bShortForm ? "TABLE_SCHEM" : "TABLE_SCHEMA" );
+        _inout_rBuffer.appendAscii( " = '" );
+        _inout_rBuffer.append     ( _rSchema );
+        _inout_rBuffer.appendAscii( "' AND " );
+    }
+    _inout_rBuffer.appendAscii( "TABLE_NAME = '" );
+    _inout_rBuffer.append     ( _rName );
+    _inout_rBuffer.appendAscii( "'" );
+}
+// -------------------------------------------------------------------------
+::rtl::OUString HTools::replaceIdentityColumns(const ::rtl::OUString& _sSQL)
+{
+	::rtl::OUString sReplace(RTL_CONSTASCII_USTRINGPARAM("NOT NULL GENERATED BY DEFAULT AS IDENTITY"));
+    ::rtl::OUString sReplaceWith(RTL_CONSTASCII_USTRINGPARAM("GENERATED BY DEFAULT AS IDENTITY"));
+	::rtl::OUString sSQL = _sSQL;
+    sal_Int32 nIndex = sSQL.indexOf(sReplace);
+    while ( nIndex != -1 )
+    {
+        sSQL = sSQL.replaceAt(nIndex,sReplace.getLength(),sReplaceWith);
+        nIndex = sSQL.indexOf(sReplace);
+    }
+	return sSQL;
+}
+
 
 //........................................................................
 } } // namespace connectivity::hsqldb

connectivity/source/drivers/hsqldb/HView.cxx

         try
         {
             ::rtl::OUStringBuffer aCommand;
-            aCommand.appendAscii( "SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.SYSTEM_VIEWS " );
+            aCommand.appendAscii( "SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS " );
             HTools::appendTableFilterCrit( aCommand, m_CatalogName, m_SchemaName, m_Name, false );
             ::utl::SharedUNOComponent< XStatement > xStatement; xStatement.set( m_xConnection->createStatement(), UNO_QUERY_THROW );
             Reference< XResultSet > xResult( xStatement->executeQuery( aCommand.makeStringAndClear() ), UNO_QUERY_THROW );

connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx

     ::rtl::OUString sKey = StorageContainer::jstring2ustring(env,key);
     ::rtl::OUString sName = StorageContainer::jstring2ustring(env,name);
 #endif
+	::boost::shared_ptr< StreamHelper > pStream = StorageContainer::getRegisteredStream( env, name, key );
+    Reference< XOutputStream > xFlush = pStream.get() ? pStream->getOutputStream() : Reference< XOutputStream>();
+    OSL_ENSURE( xFlush.is(), "StorageNativeOutputStream::sync: could not retrieve an output stream!" );
+    if ( xFlush.is() )
+    {
+        try
+        {
+            xFlush->flush();
+        }
+        catch(Exception&)
+        {
+            OSL_ENSURE( false, "StorageNativeOutputStream::sync: could not flush output stream!" );
+        }
+    }
 }
 // -----------------------------------------------------------------------------
 /*

connectivity/source/drivers/hsqldb/makefile.mk

 
 .IF "$(SOLAR_JAVA)"==""
 nojava:
-	@echo "Not building jurt because Java is disabled"
+	@echo "Not building hsqldb because Java is disabled"
 .ENDIF
 
 .IF "$(SYSTEM_HSQLDB)" == "YES"
Add a comment to this file

connectivity/source/drivers/jdbc/CallableStatement.cxx

File contents unchanged.

Add a comment to this file

connectivity/source/drivers/jdbc/JConnection.cxx

File contents unchanged.

Add a comment to this file

connectivity/source/drivers/jdbc/Object.cxx

File contents unchanged.

Add a comment to this file

connectivity/source/drivers/jdbc/PreparedStatement.cxx

File contents unchanged.

Add a comment to this file

connectivity/source/drivers/jdbc/ResultSet.cxx

File contents unchanged.

Add a comment to this file

connectivity/source/drivers/odbcbase/OPreparedStatement.cxx

File contents unchanged.

Add a comment to this file

connectivity/source/drivers/odbcbase/OTools.cxx

File contents unchanged.

connectivity/source/inc/hsqldb/HColumns.hxx

 		{
 		protected:
 			virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
+			virtual ::rtl::OUString transformSQL(const ::rtl::OUString& _sSQL);
 		public:
 			OHSQLColumns(	::cppu::OWeakObject& _rParent
 							,sal_Bool _bCase
 		protected:
 			virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
 			virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
 		public:
             OHSQLColumn(sal_Bool _bCase);
 			virtual void construct();

connectivity/source/inc/hsqldb/HTools.hxx

             const ::rtl::OUString _rSchema, const ::rtl::OUString _rName,
             bool _bShortForm
         );
+
+		/** replaceIdentityColumns replace "NOT NULL GENERATED BY DEFAULT AS IDENTITY" with "GENERATED BY DEFAULT AS IDENTITY"
+			@param	_sSQL the sql statement to execute
+			
+			@return	::rtl::OUString
+		*/
+		static ::rtl::OUString replaceIdentityColumns(const ::rtl::OUString& _sSQL);
     };
 
 //........................................................................
Add a comment to this file

connectivity/source/inc/java/LocalRef.hxx

File contents unchanged.

connectivity/source/inc/resource/hsqldb_res.hrc

 #define STR_NO_TABLE_EDITOR_DIALOG  ( STR_HSQLDB_BASE +    3 )
 #define STR_NO_TABLENAME            ( STR_HSQLDB_BASE +    4 )
 #define STR_NO_DOCUMENTUI           ( STR_HSQLDB_BASE +    5 )
-#define STR_ERROR_NEW_VERSION       ( STR_HSQLDB_BASE +    6 )
+#define STR_CONVERT_TO_NEW_VERSION  ( STR_HSQLDB_BASE +    6 )
+#define STR_SHUTDOWN_REQUIRED		( STR_HSQLDB_BASE +    7 )
 
 #endif // CONNECTIVITY_RESOURCE_HSQLDB_HRC
 
Add a comment to this file

connectivity/source/parse/sqlnode.cxx

File contents unchanged.

connectivity/source/resource/conn_shared_res.src

 {
     Text [ en-US ] = "The provided DocumentUI is not allowed to be NULL.";
 };
-String STR_ERROR_NEW_VERSION
+String STR_CONVERT_TO_NEW_VERSION
 {
-    Text = "The connection could not be established. The database was created by a newer version of %PRODUCTNAME.";
+    Text [ en-US ] = "The database file is stored in an old version. Do you want to convert into the new version?";
+};
+String STR_SHUTDOWN_REQUIRED
+{
+    Text [ en-US ] = "The database file was not stored correctly by a previous version of %PRODUCTNAME.\nPlease open the file with OpenOffice.org 3.3 or Oracle Open Office 3.3, then click the Tables icon and save.";
 };
 

connectivity/source/sdbcx/VCatalog.cxx

 // -------------------------------------------------------------------------
 void ODescriptor::construct()
 {
-    sal_Int32 nAttrib = isNew() ? 0 : ::com::sun::star::beans::PropertyAttribute::READONLY;
+    sal_Int32 nAttrib = isNew() ? ::com::sun::star::beans::PropertyAttribute::BOUND : ::com::sun::star::beans::PropertyAttribute::READONLY;
 	registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME), PROPERTY_ID_NAME ,nAttrib,&m_Name,::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
 }
 // -------------------------------------------------------------------------
Add a comment to this file

cui/source/inc/dbregister.hxx

File contents unchanged.

Add a comment to this file

cui/source/options/dbregister.cxx

File contents unchanged.

Add a comment to this file

cui/source/options/dbregisterednamesconfig.cxx

File contents unchanged.

Add a comment to this file

cui/source/options/dbregistersettings.cxx

File contents unchanged.

Add a comment to this file

cui/source/options/dbregistersettings.hxx

File contents unchanged.

dbaccess/source/core/api/KeySet.cxx

 		--m_aKeyIter;
 		refreshRow();
 	}
-	return m_aKeyIter != m_aKeyMap.begin();
+	return m_aKeyIter != m_aKeyMap.end() && m_aKeyIter != m_aKeyMap.begin();
 }
 // -----------------------------------------------------------------------------
 void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException)
Add a comment to this file

dbaccess/source/core/api/RowSet.cxx

File contents unchanged.

dbaccess/source/core/api/column.cxx

 {
 	DBG_CTOR(OColumn, NULL);
 
-    registerProperty( PROPERTY_NAME, PROPERTY_ID_NAME, _bNameIsReadOnly ? PropertyAttribute::READONLY : 0,
+    registerProperty( PROPERTY_NAME, PROPERTY_ID_NAME, _bNameIsReadOnly ? PropertyAttribute::READONLY : PropertyAttribute::BOUND,
         &m_sName, ::getCppuType( &m_sName ) );
 }
 
Add a comment to this file

dbaccess/source/core/dataaccess/databasecontext.cxx

File contents unchanged.

Add a comment to this file

dbaccess/source/core/dataaccess/databasedocument.cxx

File contents unchanged.

dbaccess/source/core/dataaccess/datasource.cxx

 			if ( m_pImpl->isEmbeddedDatabase() )
 			{
 				sal_Int32 nCount = aDriverInfo.getLength();
-				aDriverInfo.realloc(nCount + 2 );
+				aDriverInfo.realloc(nCount + 3 );
 				aDriverInfo[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"));
 				aDriverInfo[nCount++].Value <<= m_pImpl->getURL();
 				aDriverInfo[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Storage"));
                 Reference< css::document::XDocumentSubStorageSupplier> xDocSup( m_pImpl->getDocumentSubStorageSupplier() );
 				aDriverInfo[nCount++].Value <<= xDocSup->getDocumentSubStorage(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("database")),ElementModes::READWRITE);
+                aDriverInfo[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler"));
+				aDriverInfo[nCount++].Value <<= m_pImpl->m_aContext.createComponent( "com.sun.star.sdb.InteractionHandler" );
 			}
 			if (nAdditionalArgs)
 				xReturn = xManager->getConnectionWithInfo(m_pImpl->m_sConnectURL, ::comphelper::concatSequences(aUserPwd,aDriverInfo));
Add a comment to this file

dbaccess/source/core/dataaccess/documentcontainer.cxx

File contents unchanged.

Add a comment to this file

dbaccess/source/core/inc/core_resource.hrc

File contents unchanged.

Add a comment to this file

dbaccess/source/core/resource/strings.src

File contents unchanged.

dbaccess/source/ui/browser/unodatbr.cxx

 					case DataType::BINARY:
 					case DataType::VARBINARY:
 					case DataType::LONGVARBINARY:
+                    case DataType::BLOB:
 						aCurrentModelType = ::rtl::OUString::createFromAscii("TextField");
 						sDefaultProperty = PROPERTY_DEFAULTTEXT;
 						break;

dbaccess/source/ui/control/ColumnControlWindow.cxx

 		case tpFormat:
 		case tpDefault:
 //		case tpAutoIncrement:
-		case tpColumnName:
+		//case tpColumnName:
 			break;
 		default:
 			OFieldDescControl::ActivateAggregate( eType );
 		case tpFormat:
 		case tpDefault:
 //		case tpAutoIncrement:
-		case tpColumnName:
+//		case tpColumnName:
 			break;
 		default:
 			OFieldDescControl::DeactivateAggregate( eType );

dbaccess/source/ui/control/FieldDescControl.cxx

 	if (bNeedVScrollBar)
 	{
 		m_pVertScroll->Show();
-		m_pVertScroll->SetRangeMax(nActive - nLastVisible);
+		m_pVertScroll->SetRangeMax(nActive);
+        m_pVertScroll->SetVisibleSize(nLastVisible);
 //		m_pVertScroll->SetThumbPos(0);
 
 		m_pVertScroll->SetPosSizePixel( Point(nNewHWidth, 0), Size(nVScrollWidth, szOverallSize.Height()) );
 	}
 	else
 	{
+        m_nOldVThumb = 0;
 		m_pVertScroll->Hide();
 		m_pVertScroll->SetRangeMax(0);
 		m_pVertScroll->SetThumbPos(0);
 	}
-
+    m_nOldHThumb = 0;
 	if (bNeedHScrollBar)
 	{
 		m_pHorzScroll->Show();
-		m_pHorzScroll->SetRangeMax((lMaxXPosition - lMaxXAvailable + HSCROLL_STEP - 1 )/HSCROLL_STEP);
+		m_pHorzScroll->SetRangeMax((lMaxXPosition - lMaxXAvailable + HSCROLL_STEP + 1 )/HSCROLL_STEP + 1);
+        m_pHorzScroll->SetVisibleSize(m_pHorzScroll->GetRangeMax() - 1);
 //		m_pHorzScroll->SetThumbPos(0);
 
 		m_pHorzScroll->SetPosSizePixel( Point(0, nNewVHeight), Size(bNeedVScrollBar ? nNewHWidth : szOverallSize.Width(), nHScrollHeight) );
 	}
 	else
-	{
+	{   
 		m_pHorzScroll->Hide();
 		m_pHorzScroll->SetRangeMax(0);
 		m_pHorzScroll->SetThumbPos(0);
 		if ( isRightAligned() )
 		{
 			Size aOwnSize = GetSizePixel();
-			aPosition.X() = aOwnSize.Width() - aSize.Width();
+            long nVScrollWidth = m_pVertScroll->GetSizePixel().Width();
+			aPosition.X() = aOwnSize.Width() - aSize.Width() - nVScrollWidth - LogicToPixel(Size(3, 0),MAP_APPFONT).Width();
 		}
 		else
 			aPosition.X() = CONTROL_WIDTH_1 + CONTROL_SPACING_X;

dbaccess/source/ui/misc/UITools.cxx

 			if (  pTypeInfo = queryTypeInfoByType(DataType::CLOB,_rTypeInfo) )
 				break;
 			break;
+        case DataType::BINARY:
+			if ( pTypeInfo = queryTypeInfoByType(DataType::VARBINARY,_rTypeInfo) )
+				break;
+			break;
+        case DataType::VARBINARY:
+			if ( pTypeInfo = queryTypeInfoByType(DataType::LONGVARBINARY,_rTypeInfo) )
+				break;
+			break;
+        case DataType::LONGVARBINARY:
+			if (  pTypeInfo = queryTypeInfoByType(DataType::BLOB,_rTypeInfo) )
+				break;
+			break;
 		default:
 			;
 	} // switch(_nDataType)
Add a comment to this file

dbaccess/source/ui/misc/WCopyTable.cxx

File contents unchanged.

Add a comment to this file

dbaccess/source/ui/querydesign/QueryDesignView.cxx

File contents unchanged.

Add a comment to this file

dbaccess/source/ui/tabledesign/TableController.cxx

File contents unchanged.

dbaccess/source/ui/uno/ColumnControl.cxx

 		}
 
 		OColumnPeer* pPeer = new OColumnPeer(pParentWin,m_xORB);
-		OSL_ENSURE(pPeer != NULL, "FmXGridControl::createPeer : imp_CreatePeer didn't return a peer !");
+		OSL_ENSURE(pPeer != NULL, "OColumnControl::createPeer : imp_CreatePeer didn't return a peer !");
 		setPeer( pPeer );
 
 		UnoControlComponentInfos aComponentInfos(maComponentInfos);
Add a comment to this file

extensions/source/bibliography/datman.cxx

File contents unchanged.

Add a comment to this file

forms/source/component/FormComponent.cxx

File contents unchanged.

hsqldb/makefile.mk

 .IF "$(SOLAR_JAVA)" != ""
 # --- Files --------------------------------------------------------
 
-TARFILE_NAME=hsqldb_$(HSQLDB_VERSION)
-TARFILE_MD5=17410483b5b5f267aa18b7e00b65e6e0
+TARFILE_NAME=hsqldb-$(HSQLDB_VERSION)
+TARFILE_MD5=e38bd6529629c799a6fdbebd326d1497
 
-TARFILE_ROOTDIR=hsqldb
+TARFILE_ROOTDIR=$(PRJNAME)-$(HSQLDB_VERSION)$/$(PRJNAME)
 
-CONVERTFILES=build$/build.xml \
-			src$/org$/hsqldb$/persist$/HsqlDatabaseProperties.java \
-			src$/org$/hsqldb$/Library.java
+CONVERTFILES=build$/build.xml
+#			src$/org$/hsqldb$/persist$/HsqlDatabaseProperties.java \
+#			src$/org$/hsqldb$/Library.java
 
-PATCH_FILES=patches$/i96823.patch \
-			patches$/i97032.patch \
-			patches$/i103528.patch \
-			patches$/i104901.patch
+PATCH_FILES=patches$/hsqldb_new.patch
+
+#ADDITIONAL_FILES=   src$/org$/hsqldb$/index$/IndexAVLMemory.java \
+#					src$/org$/hsqldb$/persist$/ScaledRAFileSimple.java \
+#					src$/org$/hsqldb$/lib$/ArraySort.java \
+#					src$/org$/hsqldb$/result$/ResultProperties.java \
+#					src$/org$/hsqldb$/navigator$/RowSetNavigatorDataTable.java
+
+#                     src$/org$/hsqldb$/TxManager.java \
+#                     src$/org$/hsqldb$/lib$/LongKeyIntValueHashMap.java \
+#                     src$/org$/hsqldb$/persist$/ScaledRAFileInJar.java \
+#                     src$/org$/hsqldb$/test$/TestCollation.java
 
 .IF "$(JAVACISGCJ)"=="yes"
 JAVA_HOME=
 .EXPORT : JAVA_HOME
-BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) $(PRJNAME)
 .ELSE
 .IF "$(debug)"!=""
-BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.debug="on" -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.debug="on" -f $(ANT_BUILDFILE) $(PRJNAME)
 .ELSE
-BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) $(PRJNAME)
 .ENDIF
 .ENDIF
 
 
 .IF "$(SOLAR_JAVA)" != ""
 .INCLUDE : tg_ext.mk
+
+ALLTAR : $(CLASSDIR)$/$(PRJNAME).jar 
+$(CLASSDIR)$/$(PRJNAME).jar : $(PACKAGE_DIR)$/$(INSTALL_FLAG_FILE)
+	$(COPY) $(PACKAGE_DIR)$/$(TARFILE_ROOTDIR)$/lib$/$(PRJNAME).jar $(CLASSDIR)$/$(PRJNAME).jar
+
 .ENDIF
 

hsqldb/patches/hsqldb.patch

+--- misc/hsqldb-2.0.0-rc7/hsqldb/build/build.xml	2009-12-14 12:43:42.124147700 +0100
++++ misc/build/hsqldb-2.0.0-rc7/hsqldb/build/build.xml	2009-12-14 11:24:38.092053800 +0100
+@@ -48,7 +48,9 @@
+    <property name="junit38.lib" value="lib/junit.jar"/>
+    <property name='jflex.lib' value='lib/JFlex.jar'/>
+ 
+-   <target name="init"/>
++   <target name="init" unless="switch.inplace">
++     <mkdir dir="${swsrc}"/>
++   </target>
+ 
+    <target name='explainjars'
+            description="List description of jars that you can build">
+@@ -240,8 +242,8 @@
+           <arg value="-JAVA2"/>
+           <arg value="-JAVA4"/>
+           <arg value="-JAVA6"/>
+-          <arg value="--pathlist=jdkcodeswitch.list"/>
+-          <arg value="--basedir=../${swsrc}"/>
++          <arg value="--pathlist=build/jdkcodeswitch.list"/>
++          <arg value="--basedir=${swsrc}"/>
+           <!-- Since these paths are interpreted by the JVM, not ant,
+                the path must be relative to run dir (build), not the
+                At basedir -->
+@@ -255,8 +257,8 @@
+           <arg value="+JAVA2"/>
+           <arg value="-JAVA4"/>
+           <arg value="-JAVA6"/>
+-          <arg value="--pathlist=jdkcodeswitch.list"/>
+-          <arg value="--basedir=../${swsrc}"/>
++          <arg value="--pathlist=build/jdkcodeswitch.list"/>
++          <arg value="--basedir=${swsrc}"/>
+           <!-- Since these paths are interpreted by the JVM, not ant,
+                the path must be relative to run dir (build), not the
+                At basedir -->
+@@ -269,8 +271,8 @@
+           <arg value="+JAVA2"/>
+           <arg value="+JAVA4"/>
+           <arg value="-JAVA6"/>
+-          <arg value="--pathlist=jdkcodeswitch.list"/>
+-          <arg value="--basedir=../${swsrc}"/>
++          <arg value="--pathlist=build/jdkcodeswitch.list"/>
++          <arg value="--basedir=${swsrc}"/>
+           <!-- Since these paths are interpreted by the JVM, not ant,
+                the path must be relative to run dir (build), not the
+                At basedir -->
+@@ -283,8 +285,8 @@
+           <arg value="+JAVA2"/>
+           <arg value="+JAVA4"/>
+           <arg value="+JAVA6"/>
+-          <arg value="--pathlist=jdkcodeswitch.list"/>
+-          <arg value="--basedir=../${swsrc}"/>
++          <arg value="--pathlist=build/jdkcodeswitch.list"/>
++          <arg value="--basedir=${swsrc}"/>
+           <!-- Since these paths are interpreted by the JVM, not ant,
+                the path must be relative to run dir (build), not the
+                At basedir -->
+Files misc/hsqldb-2.0.0-rc7/hsqldb/lib/hsqldb.jar and misc/build/hsqldb-2.0.0-rc7/hsqldb/lib/hsqldb.jar differ
+--- misc/hsqldb-2.0.0-rc7/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java	2009-11-27 16:04:26.000000000 +0100
++++ misc/build/hsqldb-2.0.0-rc7/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java	2009-12-14 11:24:37.701401300 +0100
+@@ -425,6 +425,7 @@
+             setProperty(hsqldb_nio_data_file, false);
+             setProperty(hsqldb_lock_file, true);
+             setProperty(hsqldb_default_table_type, "cached");
++            setProperty(jdbc_interval_as_varchar,true);
+         }
+ 
+         // OOo end
+--- misc/hsqldb-2.0.0-rc7/hsqldb/src/org/hsqldb/types/DateTimeType.java	2009-11-02 19:49:56.000000000 +0100
++++ misc/build/hsqldb-2.0.0-rc7/hsqldb/src/org/hsqldb/types/DateTimeType.java	2009-12-14 12:42:38.187056900 +0100
+@@ -207,6 +207,10 @@
+         return true;
+     }
+ 
++    public boolean isIntervalType() {
++        return typeCode > Types.SQL_TIMESTAMP;
++    }
++
+     public boolean isDateTimeTypeWithZone() {
+         return withTimeZone;
+     }
-..\%__SRC%\misc\build\hsqldb\lib\hsqldb.jar %_DEST%\bin%_EXT%\hsqldb.jar
+..\%__SRC%\class\hsqldb.jar %_DEST%\bin%_EXT%\hsqldb.jar

hsqldb/version.mk

 # when you want to change the HSQLDB version, you must update the d.lst
 # in the HSQLDB_thon project accordingly !!!
-HSQLDB_MAJOR=1
-HSQLDB_MINOR=8
-HSQLDB_MICRO=0
-HSQLDB_VERSION=$(HSQLDB_MAJOR)_$(HSQLDB_MINOR)_$(HSQLDB_MICRO)
+HSQLDB_MAJOR=2
+HSQLDB_MINOR=0
+HSQLDB_MICRO=1
+HSQLDB_EXT=-rc1
+HSQLDB_VERSION=$(HSQLDB_MAJOR).$(HSQLDB_MINOR).$(HSQLDB_MICRO)$(HSQLDB_EXT)
+

offapi/com/sun/star/form/component/DatabaseImageControl.idl

 	<member scope="com::sun::star::sdbc">DataType::BINARY</member>,
 	<member scope="com::sun::star::sdbc">DataType::VARBINARY</member>,
 	<member scope="com::sun::star::sdbc">DataType::LONGVARBINARY</member>,
+	<member scope="com::sun::star::sdbc">DataType::BLOB</member>,
 	<member scope="com::sun::star::sdbc">DataType::OTHER</member>,
 	<member scope="com::sun::star::sdbc">DataType::LONGVARCHAR</member></p>
 

reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java

  ************************************************************************/
 package com.sun.star.report.pentaho.output;
 
+import com.sun.star.lib.uno.adapter.XInputStreamToInputStreamAdapter;
 import com.sun.star.report.ImageService;
 import com.sun.star.report.InputRepository;
 import com.sun.star.report.OutputRepository;
 import com.sun.star.report.ReportExecutionException;
 import com.sun.star.report.pentaho.DefaultNameGenerator;
+import com.sun.star.sdbc.XBlob;
+import com.sun.star.uno.Any;
 
 import java.awt.Dimension;
 import java.awt.Image;
         {
             return produceFromBlob((Blob) imageData);
         }
+        
+        if (imageData instanceof XBlob)
+        {
+            return produceFromBlob((XBlob) imageData);
+        }
 
         if (imageData instanceof byte[])
         {
         {
             return produceFromImage((Image) imageData);
         }
+        if ( imageData instanceof Any)
+        {
+            return produceImage(((Any)imageData).getObject(),preserveIRI);
+        }
         // not usable ..
         return null;
     }
         }
         return null;
     }
+    
+    private OfficeImage produceFromBlob(final XBlob blob)
+    {
+        try
+        {
+            final InputStream inputStream = new XInputStreamToInputStreamAdapter(blob.getBinaryStream());
+            final int length = (int) blob.length();
+
+            final ByteArrayOutputStream bout = new ByteArrayOutputStream(length);
+            try
+            {
+                IOUtils.getInstance().copyStreams(inputStream, bout);
+            } finally
+            {
+                inputStream.close();
+            }
+            return produceFromByteArray(bout.toByteArray());
+        }
+        catch (java.lang.Exception e)
+        {
+            LOGGER.warn("Failed to produce image from Blob", e);
+        }
+        return null;
+    }
 
     private OfficeImage produceFromByteArray(final byte[] data)
     {

reportdesign/source/ui/report/ReportController.cxx

                 case sdbc::DataType::BINARY:
 			    case sdbc::DataType::VARBINARY:
 			    case sdbc::DataType::LONGVARBINARY:
+                case sdbc::DataType::BLOB:
 				    nOBJID = OBJ_DLG_IMAGECONTROL;
 				    break;
 			    default:
Add a comment to this file

svx/inc/svx/fmtools.hxx

File contents unchanged.

Add a comment to this file

svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx

File contents unchanged.

Add a comment to this file

svx/source/form/fmvwimp.cxx

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/agenda/AgendaTemplate.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/agenda/AgendaWizardDialogConst.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/agenda/CGAgenda.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/agenda/CGTopic.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/agenda/CallWizard.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/agenda/TemplateConsts.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/agenda/TopicsControl.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/ConfigGroup.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/ConfigNode.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/ConfigSet.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/Configuration.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/DebugHelper.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/Desktop.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/FileAccess.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/Helper.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/IRenderer.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/Indexable.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/InvalidQueryException.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/JavaTools.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/NoValidPathException.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/NumberFormatter.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/NumericalHelper.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/Properties.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/PropertySetHelper.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/Resource.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/SystemDialog.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/TerminateWizardException.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/UCB.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/XMLHelper.java

File contents unchanged.

Add a comment to this file

wizards/com/sun/star/wizards/common/XMLProvider.java

File contents unchanged.