[fdo-commits] r744 - in
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS:
. Custom Custom/Gdbi Driver Fdo SchemaMgr SchemaMgr/Lp
SchemaMgr/Ph SchemaMgr/Ph/Rd sql
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Wed Feb 14 12:02:54 EST 2007
Author: brentrobinson
Date: 2007-02-14 12:02:54 -0500 (Wed, 14 Feb 2007)
New Revision: 744
Added:
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Custom/
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Custom/Gdbi/
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Custom/Gdbi/Gdbi.vcproj
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Custom/Gdbi/GdbiCommands.cpp
Modified:
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/PostGISDriver.vcproj
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/desc_slct.c
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/est_cursor.c
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/execute.c
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/fetch.c
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/fre_cursor.c
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/get_gen_id.c
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/get_gen_id.h
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/rdbi_init.c
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/run_sql.c
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/set_schema.c
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/type.c
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Fdo/FdoRdbmsPostGisConnection.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Fdo/FdoRdbmsPostGisConnection.h
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Fdo/FdoRdbmsPostGisFilterProcessor.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/PostGIS.sln
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/PostGIS.vcproj
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Lp/ClassDefinition.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColTypeMapper.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Column.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnChar.h
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnDecimal.h
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnGeom.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnGeom.h
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Mgr.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Mgr.h
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Owner.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Owner.h
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/ColumnReader.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/ConstraintReader.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/DbObjectReader.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/FkeyReader.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/IndexReader.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/PkeyReader.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupReader.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupReader.h
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupWriter.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupWriter.h
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Table.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Table.h
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/PostGISSchemaMgr.vcproj
branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/sql/postgis_fdo_sys.sql
Log:
PostGis GenericRdbms Post-Mortem: Got main feature command unit tests running for FDO-enabled and non FDO-enabled datastores.
Added: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Custom/Gdbi/Gdbi.vcproj
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Custom/Gdbi/Gdbi.vcproj (rev 0)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Custom/Gdbi/Gdbi.vcproj 2007-02-14 17:02:54 UTC (rev 744)
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="Gdbi"
+ ProjectGUID="{2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}"
+ RootNamespace="Gdbi"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../Lib/Win32/Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\Gdbi;../../../../;$(FDO)/Unmanaged;$(FDO)/Unmanaged/inc;$(FDOUTILITIES)/Common/inc"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="true"
+ RuntimeTypeInfo="true"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)/Gdbi_PostGis.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../Lib/Win32/Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ InlineFunctionExpansion="0"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\..\Gdbi;../../../../;$(FDO)/Unmanaged;$(FDO)/Unmanaged/inc;$(FDOUTILITIES)/Common/inc"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)/Gdbi_PostGis.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+ >
+ <File
+ RelativePath="GdbiCommands.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Gdbi\GdbiConnection.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Gdbi\GdbiException.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Gdbi\GdbiQueryResult.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Gdbi\GdbiStatement.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Gdbi\stdafx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc"
+ >
+ <File
+ RelativePath="..\..\..\Gdbi\GdbiCommands.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Gdbi\GdbiConnection.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Gdbi\GdbiException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Gdbi\GdbiQueryIdentifier.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Gdbi\GdbiQueryResult.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Gdbi\GdbiStatement.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Gdbi\GdbiTypes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Gdbi\stdafx.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Custom/Gdbi/GdbiCommands.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Custom/Gdbi/GdbiCommands.cpp (rev 0)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Custom/Gdbi/GdbiCommands.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -0,0 +1,667 @@
+/*
+ * Copyright (C) 2004-2006 Autodesk, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of version 2.1 of the GNU Lesser
+ * General Public License as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ */
+#include "stdafx.h"
+#include "GdbiCommands.h"
+#include "FdoCommonOSUtil.h"
+#ifdef HAVE_GEOM_INFO_TYPE
+#include <inc/geometry/fgf/AllGeometry_c.h>
+#endif
+
+GdbiCommands::GdbiCommands( rdbi_context_def* rdbi_context ):
+m_pRdbiContext( rdbi_context )
+{
+ mFeatureSeq.size = 0;
+ mFeatureSeq.next = 0;
+
+ rdbi_vndr_info_def info;
+ rdbi_vndr_info( m_pRdbiContext, &info );
+ mArraySize = info.maxFetchSize;
+}
+
+GdbiCommands::~GdbiCommands(void)
+{
+}
+
+void GdbiCommands::CheckDB()
+{
+ if( m_pRdbiContext== NULL || m_pRdbiContext->rdbi_cnct == NULL || ! m_pRdbiContext->rdbi_cnct->in_use )
+ throw GdbiException::Create(NlsMsgGet(FDORDBMS_13, "Connection not established"));
+ if( m_pRdbiContext->last_error_msg != NULL )
+ {
+ free( m_pRdbiContext->last_error_msg );
+ m_pRdbiContext->last_error_msg = NULL;
+ }
+}
+
+void GdbiCommands::ThrowException()
+{
+ if( m_pRdbiContext->last_error_msg == NULL )
+ ::rdbi_get_msg (m_pRdbiContext);
+
+ throw GdbiException::Create( m_pRdbiContext->last_error_msg );
+}
+
+int GdbiCommands::err_stat()
+{
+ return m_pRdbiContext->rdbi_last_status;
+}
+
+int GdbiCommands::run_sql( FdoStringP sql, bool isDDL, int *rows_processed )
+{
+ CheckDB();
+ int rc = RDBI_GENERIC_ERROR;
+
+ if( SupportsUnicode() )
+ rc = ::rdbi_run_sqlW (m_pRdbiContext, sql, isDDL ? 1 : 0, rows_processed );
+ else
+ rc = ::rdbi_run_sql (m_pRdbiContext, sql, isDDL ? 1 : 0, rows_processed );
+
+ if( rc == RDBI_SUCCESS )
+ return rc;
+
+ ThrowException();
+ return RDBI_GENERIC_ERROR; // to supress a compiler warning
+}
+
+int GdbiCommands::sql( FdoStringP sql, int *qid )
+{
+ CheckDB();
+ int rc = RDBI_GENERIC_ERROR;
+
+ rc = ::rdbi_est_cursor (m_pRdbiContext, qid);
+
+ if( rc == RDBI_SUCCESS )
+ {
+ if( SupportsUnicode() )
+ rc = ::rdbi_sqlW (m_pRdbiContext, *qid, sql );
+ else
+ rc = ::rdbi_sql (m_pRdbiContext, *qid, sql );
+ }
+
+ if( rc == RDBI_SUCCESS )
+ return rc;
+
+ ThrowException();
+ return RDBI_GENERIC_ERROR; // to supress a compiler warning
+}
+
+int GdbiCommands::execute( int qid, int count, int offset )
+{
+ CheckDB();
+ int rc = ::rdbi_execute (m_pRdbiContext, qid, count, offset);
+
+ if( rc == RDBI_SUCCESS )
+ return rc;
+
+ ThrowException();
+ return RDBI_GENERIC_ERROR; // to supress a compiler warning
+}
+
+int GdbiCommands::free_cursor( int qid )
+{
+ if( m_pRdbiContext == NULL )
+ return RDBI_SUCCESS; // This is called by a cleanup code invoked after the connection is closed
+
+ CheckDB();
+
+ if( ::rdbi_fre_cursor (m_pRdbiContext, qid) == RDBI_SUCCESS )
+ return RDBI_SUCCESS;
+
+ ThrowException();
+ return RDBI_GENERIC_ERROR; // to supress a compiler warning
+}
+
+void GdbiCommands::set_null( GDBI_NI_TYPE *null_ind, int start, int end)
+{
+ ::rdbi_set_null(m_pRdbiContext, (void *)null_ind, start, end);
+}
+
+int GdbiCommands::alcnullind(int n, GDBI_NI_TYPE **null_ind)
+{
+ int rc = rdbi_alcnullind(m_pRdbiContext, n, (char **)null_ind);
+ if (rc != RDBI_SUCCESS)
+ ThrowException();
+ return (rc == RDBI_SUCCESS);
+}
+
+void GdbiCommands::set_nnull( GDBI_NI_TYPE *null_ind, int start, int end)
+{
+ ::rdbi_set_nnull(m_pRdbiContext, (void *)null_ind, start, end);
+}
+
+int GdbiCommands::is_null( GDBI_NI_TYPE *null_ind, int offset )
+{
+ return ::rdbi_is_null(m_pRdbiContext, (void *)null_ind, offset );
+}
+
+int GdbiCommands::bind(
+ int cursorId, /* index into cursor array */
+ char *name, /* column/expression position */
+ int datatype, /* A data type from Inc/rdbi.h */
+ int size, /* binary size */
+ char *address, /* data address */
+ GDBI_NI_TYPE *null_ind
+ )
+{
+ int loc_datatype = datatype;
+ int loc_size = size;
+ char *loc_address = address;
+
+ CheckDB();
+
+ if( datatype == RDBI_WSTRING && ! SupportsUnicode() )
+ {
+ throw new GdbiException(L"Cannot bind widechar strings; target RDBMS does not support widechar strings");
+ }
+
+ if( ::rdbi_bind(m_pRdbiContext, cursorId, name, loc_datatype, loc_size, loc_address, (void *)null_ind) == RDBI_SUCCESS )
+ return RDBI_SUCCESS;
+
+ ThrowException();
+ return RDBI_GENERIC_ERROR; // to supress a compiler warning
+}
+
+int GdbiCommands::tran_begin( char *tran_id )
+{
+ CheckDB();
+
+ if( ::rdbi_tran_begin( m_pRdbiContext, tran_id) )
+ return RDBI_SUCCESS;
+
+ ThrowException();
+ return RDBI_GENERIC_ERROR; // to supress a compiler warning
+}
+
+int GdbiCommands::tran_end( char *tran_id )
+{
+ CheckDB();
+
+ if( ::rdbi_tran_end( m_pRdbiContext, tran_id ) )
+ return RDBI_SUCCESS;
+
+ ThrowException();
+ return RDBI_GENERIC_ERROR; // to supress a compiler warning
+}
+
+int GdbiCommands::tran_rolbk( )
+{
+ return ::rdbi_tran_rolbk( m_pRdbiContext );
+}
+
+int GdbiCommands::define(
+ int sqlid, /* index into cursor array */
+ char *name, /* column/expression position */
+ int datatype, /* A data type from Inc/rdbi.h */
+ int size, /* binary size */
+ char *address, /* data address */
+ GDBI_NI_TYPE *null_ind /* pointer to null indicator variables */
+ )
+{
+ CheckDB();
+
+ if( ::rdbi_define(m_pRdbiContext, sqlid, name, datatype, size, address, (void *)null_ind ) == RDBI_SUCCESS )
+ return RDBI_SUCCESS;
+
+ ThrowException();
+ return RDBI_GENERIC_ERROR; // to supress a compiler warning
+}
+
+int GdbiCommands::desc_slct(
+ int sqlid, /* Index into ptrs to Oracle work areas */
+ int pos, /* position within select clause */
+ int name_len, /* The maximum size of name */
+ wchar_t *name, /* Name of this field */
+ int *rdbi_type, /* rdbi constant */
+ int *binary_size, /* bytes of memory to store the field */
+ int *null_ok )
+{
+ CheckDB();
+ int rc;
+ if( this->SupportsUnicode() )
+ rc = ::rdbi_desc_slctW(m_pRdbiContext, sqlid, pos, name_len, name, rdbi_type, binary_size, null_ok );
+ else
+ {
+ char colName[GDBI_COLUMN_SIZE];
+ rc = ::rdbi_desc_slct(m_pRdbiContext, sqlid, pos, name_len, colName, rdbi_type, binary_size, null_ok );
+ wcsncpy(name,(const wchar_t*)FdoStringP( colName ), name_len );
+ name[name_len-1]='\0';
+ }
+ if( rc == RDBI_SUCCESS || rc == RDBI_NOT_IN_DESC_LIST )
+ return rc;
+
+ ThrowException();
+ return RDBI_GENERIC_ERROR; // to supress a compiler warning
+}
+
+int GdbiCommands::end_select( int sqlid )
+{
+ if( m_pRdbiContext == NULL )
+ return RDBI_SUCCESS; // This is called by a cleanup code invoked after the connection is closed
+
+ CheckDB();
+
+ if( ::rdbi_end_select( m_pRdbiContext, sqlid ) == RDBI_SUCCESS )
+ return RDBI_SUCCESS;
+
+ ThrowException();
+ return RDBI_GENERIC_ERROR; // to supress a compiler warning
+}
+
+int GdbiCommands::fetch( int sqlid, int count, int *rows_processed )
+{
+ CheckDB();
+
+ int rc = ::rdbi_fetch( m_pRdbiContext, sqlid, count, rows_processed );
+ if( rc == RDBI_SUCCESS || rc == RDBI_END_OF_FETCH )
+ return rc;
+
+ ThrowException();
+ return RDBI_GENERIC_ERROR; // to supress a compiler warning
+}
+
+int GdbiCommands::crsr_nrows( int sqlid )
+{
+ return ::rdbi_crsr_nrows( m_pRdbiContext, sqlid );
+}
+
+int GdbiCommands::vndr_info(
+ rdbi_vndr_info_def *info
+)
+{
+ int rc = ::rdbi_vndr_info( m_pRdbiContext, info );
+ if( rc == RDBI_SUCCESS )
+ return rc;
+
+ ThrowException();
+ return RDBI_GENERIC_ERROR; // to supress a compiler warning
+}
+
+//
+// Use the RDBMS sequence number capability(i.e Oracle )
+// TODO: need to cache the sequences for all sequences. Currently it will only work with one sequence for feature ids
+long GdbiCommands::NextSequenceNumber( FdoString* dbiSequenceName )
+{
+ FdoString* dbiSeqName = dbiSequenceName;
+ FdoString* adbSeqName;
+
+ if( dbiSequenceName == NULL || dbiSequenceName[0] == '\0' )
+ dbiSeqName = DBI_FEATURE_SEQUENCEW;
+
+ if ( wcscmp( dbiSeqName, DBI_FEATURE_SEQUENCEW ) == 0 )
+ adbSeqName = ADB_FEATURESEQW;
+ else if ( wcscmp( dbiSeqName, DBI_CLASS_SEQUENCEW ) == 0 )
+ adbSeqName = ADB_CLASSSEQW;
+ else if ( wcscmp( dbiSeqName, DBI_PLAN_SEQUENCEW ) == 0 )
+ adbSeqName = ADB_PLANSEQW;
+ else if ( wcscmp( dbiSeqName, DBI_PLAN_GROUP_SEQUENCEW ) == 0 )
+ adbSeqName = ADB_PLANGROUPSEQW;
+ else // Todo: Throw exception.
+ adbSeqName = dbiSeqName;
+
+ // Call specific provider implementation to get a number
+ if( m_pRdbiContext->dispatch.capabilities.supports_sequence )
+ return NextRDBMSSequenceNumber( adbSeqName );
+ else if ( m_pRdbiContext->dispatch.capabilities.supports_autoincrement )
+ return NextRDBMSAutoincrementNumber( adbSeqName );
+ else
+ return NextGDBISequenceNumber( adbSeqName );
+}
+
+//
+// In case sequence is not supported the method simulate a sequence allocation scheme.
+// The caller should start a transaction if one is not started. Apply Schema does.
+
+long GdbiCommands::NextGDBISequenceNumber( FdoString* adbSequenceName )
+{
+ bool rc = false;
+ FdoStringP strUse;
+ int cursor;
+ int select_begun = FALSE;
+ int number = 0;
+ int rows_proc;
+ double doubleVal;
+ gdbi_full_seq_def *gptr = &mFeatureSeq;
+ CheckDB();
+
+ if (gptr->next < gptr->size)
+ {
+ number = gptr->sequence[gptr->next];
+ gptr->next++;
+ rc = true;
+ goto the_exit;
+ }
+
+ /* build SQL update command */
+ strUse = FdoStringP::Format( L"update %ls set startnum=startnum+%d where seqid='%ls';", ADB_SEQUENCE_TABLEW, ADB_SN_ALLOC_INCREMENT, adbSequenceName);
+
+ if( sql( strUse, &cursor ) == RDBI_SUCCESS )
+ this->execute( cursor );
+
+ if( cursor != - 1 )
+ this->free_cursor( cursor );
+
+ /* build SQL update command */
+ strUse = FdoStringP::Format( L"select startnum from %ls where seqid='%ls';", ADB_SEQUENCE_TABLEW, adbSequenceName);
+
+ if( ::rdbi_est_cursor(m_pRdbiContext, &cursor) != RDBI_SUCCESS )
+ goto the_exit;
+
+ if (SupportsUnicode())
+ {
+ if( ::rdbi_sql_vaW( m_pRdbiContext, RDBI_VA_EXEC, cursor, strUse,
+ /* bind variables */
+ RDBI_VA_EOL,
+ /* define variables */
+ RDBI_DOUBLE, 0, &doubleVal,
+ RDBI_VA_EOL ) != RDBI_SUCCESS )
+ goto the_exit;
+ }
+ else
+ {
+ if( ::rdbi_sql_va( m_pRdbiContext, RDBI_VA_EXEC, cursor, strUse,
+ /* bind variables */
+ RDBI_VA_EOL,
+ /* define variables */
+ RDBI_DOUBLE, 0, &doubleVal,
+ RDBI_VA_EOL ) != RDBI_SUCCESS )
+ goto the_exit;
+ }
+ if( ::rdbi_fetch (m_pRdbiContext, cursor, 1, &rows_proc) != RDBI_SUCCESS )
+ goto the_exit;
+
+ if(rows_proc == 0) goto the_exit;
+
+ number = (long)doubleVal;
+ gptr->size = ADB_SN_ALLOC_INCREMENT;
+ for(int i=0; i<ADB_SN_ALLOC_INCREMENT;i++)
+ gptr->sequence[i] = number--;
+
+ gptr->next = 0;
+ select_begun = TRUE;
+ number = gptr->sequence[gptr->next];
+ gptr->next++;
+
+ rc = true;
+the_exit:
+ if (select_begun)
+ rdbi_end_select(m_pRdbiContext, cursor);
+
+ if( ! rc )
+ ThrowException();
+
+ return number;
+}
+
+// In case sequence is not supported this method simulate a sequence allocation scheme.
+long GdbiCommands::NextRDBMSAutoincrementNumber( FdoString* adbSequenceName )
+{
+ FdoStringP tableName;
+ int number = 0;
+ bool seqSupported = true;
+
+ CheckDB();
+
+ // Get the table name from the sequence name.
+ if ( wcscmp( adbSequenceName, ADB_CLASSSEQW ) == 0 )
+ tableName = ADB_CLASSDEF_TABW;
+ else if ( wcscmp( adbSequenceName, ADB_PLANSEQW ) == 0 )
+ tableName = ADB_SPATIAL_CONTEXT_TABLEW;
+ else if ( wcscmp( adbSequenceName, ADB_PLANGROUPSEQW ) == 0 )
+ tableName = ADB_SPATIAL_CONTEXT_GROUP_TABLEW;
+ else if ( wcscmp( adbSequenceName, ADB_FEATURESEQW ) == 0 )
+ tableName = L"";
+ else
+ seqSupported = false;
+
+ if ( !seqSupported )
+ {
+ // Should not happen since we handle all known SEQ cases
+ ThrowException();
+ }
+ else
+ {
+ if (SupportsUnicode())
+ {
+ if ( ::rdbi_get_gen_idW ( m_pRdbiContext, tableName, &number ) != RDBI_SUCCESS )
+ ThrowException();
+ }
+ else
+ {
+ if ( ::rdbi_get_gen_id ( m_pRdbiContext, tableName, &number ) != RDBI_SUCCESS )
+ ThrowException();
+ }
+ // Note: The number is the current generated one.
+ }
+
+ return number;
+}
+
+long GdbiCommands::NextRDBMSSequenceNumber( FdoString* adbSequenceName )
+{
+
+ bool rc = false; /* return code */
+ int switched_to_2 = FALSE;
+ int tran_begun = FALSE;
+ int select_begun = FALSE;
+ int sqlid_coc = -1;
+ FdoStringP sql_buf; /* place to format SQL command */
+ int rows_proc;
+ gdbi_full_seq_def *gptr = &mFeatureSeq;
+ long number = -1;
+ int CURSOR = -1;
+
+ CheckDB();
+
+ if ( (gptr->next < gptr->size) && (FdoCommonOSUtil::wcsicmp(adbSequenceName, gptr->seq_name) == 0) )
+ {
+ number = gptr->sequence[gptr->next];
+ gptr->next++;
+ rc = true;
+ goto the_exit;
+ }
+
+ if (CURSOR == -1)
+ {
+// if( ::rdbi_est_cursor(m_pRdbiContext, &CURSOR) != RDBI_SUCCESS )
+// goto the_exit;
+
+ select_begun = TRUE;
+//BR - TODO - resolve PostGis specific syntax
+ /* build SQL select command */
+// sql_buf = FdoStringP::Format(L"select cast(nextval('%ls') as integer) as nextid from %ls", adbSequenceName, ADB_SEQUENCE_TABLEW);
+ sql_buf = FdoStringP::Format(L"select nextval('%ls')", adbSequenceName);
+// sql_buf = FdoStringP::Format(L"select startnum from %ls", /*adbSequenceName,*/ ADB_SEQUENCE_TABLEW);
+ long defvar;
+
+int qid;
+long isNull;
+int rows;
+this->sql(sql_buf, &qid );
+this->define( qid, "1", RDBI_LONG, sizeof(long), (char*) gptr->sequence, &isNull );
+execute( qid, 0, 0 );
+fetch( qid, 1, &rows );
+end_select( qid );
+free_cursor( qid );
+
+gptr->size = 1;
+gptr->next = 0;
+
+//BR - TODO - figure out why rdbi_sql_va doesn't work with PostGis
+#if 0
+ /* add the where clause for other than 'feature' numbers */
+ if (FdoCommonOSUtil::wcsicmp(adbSequenceName, ADB_FEATURESEQW) != 0)
+ sql_buf += FdoStringP::Format(L" where %ls = '%ls'", ADB_SEQID_COLUMNW, adbSequenceName);
+
+ if (SupportsUnicode())
+ {
+ if( ::rdbi_sql_vaW( m_pRdbiContext, 0, CURSOR, sql_buf,
+ /* bind variables */
+ RDBI_VA_EOL,
+ /* define variables */
+ RDBI_LONG, 0, gptr->sequence,
+ RDBI_VA_EOL ) != RDBI_SUCCESS )
+ goto the_exit;
+ }
+ else
+ {
+ if( ::rdbi_sql_va( m_pRdbiContext, 0, CURSOR, sql_buf,
+ /* bind variables */
+ RDBI_VA_EOL,
+ /* define variables */
+ RDBI_LONG, 0, &defvar, //gptr->sequence,
+ RDBI_VA_EOL ) != RDBI_SUCCESS )
+ goto the_exit;
+ }
+ }
+
+ if ( (0 == FdoCommonOSUtil::wcsicmp (adbSequenceName, ADB_FEATURESEQW))
+ || (0 == FdoCommonOSUtil::wcsicmp (adbSequenceName, ADB_USERSEQW)))
+ {
+ /* select next feature ids */
+ gptr->size = ADB_SN_ALLOC_INCREMENT;
+ if( ::rdbi_exec_fetch(m_pRdbiContext, CURSOR, gptr->size, FALSE, &rows_proc) != RDBI_SUCCESS )
+ goto the_exit;
+
+ if(rows_proc == 0) goto the_exit;
+
+ gptr->next = 0;
+ }
+ else
+ {
+
+ if( ::rdbi_exec_fetch(m_pRdbiContext, CURSOR, 1, FALSE, &rows_proc) != RDBI_SUCCESS )
+ goto the_exit;
+
+ if(rows_proc == 0) goto the_exit;
+
+ gptr->size = 1;
+ if(rows_proc == 0) goto the_exit;
+ gptr->next = 0;
+#endif
+ }
+
+ select_begun = TRUE;
+ number = gptr->sequence[gptr->next];
+ gptr->next++;
+ wcscpy( gptr->seq_name, adbSequenceName );
+
+ rc = true;
+the_exit:
+#if 0
+ if (select_begun) {
+ ::rdbi_end_select(m_pRdbiContext, CURSOR);
+ ::rdbi_fre_cursor(m_pRdbiContext, CURSOR);
+ }
+#endif
+ if( ! rc )
+ ThrowException();
+
+ return number;
+}
+
+bool GdbiCommands::IsFieldWriteable( FdoStringP tableName, FdoStringP columnName )
+{
+ bool isWriteable = true;
+
+ if ( m_pRdbiContext->dispatch.capabilities.supports_autoincrement )
+ {
+ // All the columns are writeable except INDENTITY/AUTO_INCREMENT columns
+ if ( ( wcscmp( tableName, L"f_classdefinition" ) == 0 && wcscmp( columnName, L"classid" ) == 0 ) ||
+ ( wcscmp( tableName, L"f_spatialcontext" ) == 0 && wcscmp( columnName, L"scid" ) == 0 ) ||
+ ( wcscmp( tableName, L"f_spatialcontextgroup" ) == 0 && wcscmp( columnName, L"scgid" ) == 0 ) )
+ isWriteable = false;
+ }
+
+ return isWriteable;
+}
+void GdbiCommands::set_array_size(int arraySize)
+{
+ rdbi_vndr_info_def info;
+ rdbi_vndr_info( m_pRdbiContext, &info );
+ if (arraySize <= info.maxFetchSize)
+ mArraySize = arraySize;
+}
+
+int GdbiCommands::get_array_size()
+{
+ return mArraySize;
+}
+int GdbiCommands::lob_create_ref( int sqlid, void **lob_ref )
+{
+ int rc = ::rdbi_lob_create_ref(m_pRdbiContext, sqlid, lob_ref);
+ if (rc == RDBI_SUCCESS)
+ return rc;
+
+ return RDBI_GENERIC_ERROR;
+}
+int GdbiCommands::lob_destroy_ref( int sqlid, void *lob_ref )
+{
+ int rc = ::rdbi_lob_destroy_ref(m_pRdbiContext, sqlid, lob_ref);
+ if (rc == RDBI_SUCCESS)
+ return rc;
+
+ return RDBI_GENERIC_ERROR;
+}
+int GdbiCommands::autocommit_on()
+{
+ int rc = ::rdbi_autocommit_on(m_pRdbiContext);
+
+ return rc;
+}
+int GdbiCommands::autocommit_off()
+{
+ int rc = ::rdbi_autocommit_off(m_pRdbiContext);
+
+ return rc;
+}
+
+int GdbiCommands::autocommit_mode()
+{
+ int autoCmt = ::rdbi_autocommit_mode(m_pRdbiContext);
+
+ return autoCmt;
+}
+
+int GdbiCommands::geom_to_fgf (
+ int sqlid,
+ void * rdbmsGeometryInfo_I,
+ void ** fgfGeometryByteArray_O )
+{
+#ifdef HAVE_GEOM_INFO_TYPE
+ RdbmsGeometryValueInfo * geomInfo2 = (RdbmsGeometryValueInfo *) rdbmsGeometryInfo_I;
+
+ int rc = ::rdbi_geom_to_fgf(m_pRdbiContext, sqlid, geomInfo2, (pByteArray_def *)fgfGeometryByteArray_O);
+
+ return rc;
+#else
+ return FALSE;
+#endif
+}
+
+int GdbiCommands::geom_srid_set(
+ int sqlid,
+ char *geom_col_name,
+ long srid)
+{
+ int rc = ::rdbi_geom_srid_set(m_pRdbiContext, sqlid, geom_col_name, srid);
+ if (rc == RDBI_SUCCESS)
+ return rc;
+
+ return RDBI_GENERIC_ERROR;
+}
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/PostGISDriver.vcproj
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/PostGISDriver.vcproj 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/PostGISDriver.vcproj 2007-02-14 17:02:54 UTC (rev 744)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8,00"
+ Version="8.00"
Name="PostGISDriver"
ProjectGUID="{69D1E6E5-9391-40FE-A989-B9BEBE3EE305}"
RootNamespace="PostGISDriver"
@@ -463,6 +463,18 @@
</FileConfiguration>
</File>
<File
+ RelativePath=".\geom_srid.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ CompileAs="2"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath=".\Geometry.c"
>
<FileConfiguration
@@ -754,6 +766,10 @@
>
</File>
<File
+ RelativePath=".\geom_srid.h"
+ >
+ </File>
+ <File
RelativePath=".\Geometry.h"
>
</File>
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/desc_slct.c
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/desc_slct.c 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/desc_slct.c 2007-02-14 17:02:54 UTC (rev 744)
@@ -128,6 +128,9 @@
*binary_size = fsize + 1;
else /* CHAR(N) */
*binary_size = fsize;
+
+ if ( (*binary_size) > PGSQL_VARCHAR_MAX_SIZE )
+ *binary_size = PGSQL_VARCHAR_MAX_SIZE;
break;
case RDBI_STRING: /* Variable-length strings. */
@@ -137,7 +140,7 @@
fsize = postgis_get_varchar_length(pgres, position);
}
- if (fsize > 0) /* VARCHAR(N) */
+ if ( (fsize > 0) && (fsize < PGSQL_VARCHAR_MAX_SIZE) ) /* VARCHAR(N) */
*binary_size = fsize;
else /* TEXT */
*binary_size = PGSQL_VARCHAR_MAX_SIZE;
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/est_cursor.c
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/est_cursor.c 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/est_cursor.c 2007-02-14 17:02:54 UTC (rev 744)
@@ -1,91 +1,91 @@
-/*
- * Copyright (C) 2006 Refractions Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser
- * General Public License as published by the Free Software Foundation.
- *
- * This library 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 for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include "stdafx.h"
-
-#include "est_cursor.h"
-#include "pgconn_status.h"
-
-#include <stdlib.h> // malloc()
-#include <string.h> // memset()
-#include <assert.h>
-
-// TODO: mloskot - does PostGIS need the _obj version of this function?
-
-
-int postgis_est_cursor (postgis_context_def *context, char **cursor)
-{
- return (postgis_est_cursor_obj (context, cursor));
-}
-
-int postgis_est_cursor_obj (postgis_context_def *context, char **cursor)
-{
- PGconn* postgis = NULL;
- postgis_cursor_def* curs = NULL;
- int ret = RDBI_GENERIC_ERROR;
-
- assert(NULL != context);
-
- if (-1 == context->postgis_current_connect)
- {
- ret = RDBI_NOT_CONNECTED;
- }
- else
- {
+/*
+ * Copyright (C) 2006 Refractions Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of version 2.1 of the GNU Lesser
+ * General Public License as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "stdafx.h"
+
+#include "est_cursor.h"
+#include "pgconn_status.h"
+
+#include <stdlib.h> // malloc()
+#include <string.h> // memset()
+#include <assert.h>
+
+// TODO: mloskot - does PostGIS need the _obj version of this function?
+
+
+int postgis_est_cursor (postgis_context_def *context, char **cursor)
+{
+ return (postgis_est_cursor_obj (context, cursor));
+}
+
+int postgis_est_cursor_obj (postgis_context_def *context, char **cursor)
+{
+ PGconn* postgis = NULL;
+ postgis_cursor_def* curs = NULL;
+ int ret = RDBI_GENERIC_ERROR;
+
+ assert(NULL != context);
+
+ if (-1 == context->postgis_current_connect)
+ {
+ ret = RDBI_NOT_CONNECTED;
+ }
+ else
+ {
postgis = context->postgis_connections[context->postgis_current_connect];
if (RDBI_SUCCESS != postgis_pgconn_status(postgis))
ret = RDBI_NOT_CONNECTED;
- else
- {
- // INFO: mloskot - PostgreSQL prepared statements
- // does not need any pre-initialization steps,
- // statement allocation, etc.
- // So, we only allocates cursor area.
-
- curs = (postgis_cursor_def*)malloc (sizeof (postgis_cursor_def));
- if (NULL == curs)
- {
- return RDBI_MALLOC_FAILED;
- }
-
- memset (curs, 0, sizeof (postgis_cursor_def));
-
- // The stmt_name may be "" to create an unnamed statement,
- // in which case any pre-existing unnamed statement is
- // automatically replaced.It is an error if the statement name is
- // already defined in the current session.
-
- strncpy (curs->stmt_name, "", POSTGIS_STMT_NAME_SIZE);
-
- /* Initialize cursor members. */
- curs->stmt_result = NULL;
- curs->current_row = POSTGIS_STMT_NOROWS; /* = -1 */
- curs->define_count = 0;
- curs->defines = NULL;
- curs->bind_count = 0;
- curs->binds = NULL;
- curs->redefines = NULL;
- curs->rebinds = NULL;
-
- *cursor = (char*)curs;
- ret = RDBI_SUCCESS;
- }
- }
-
- return (ret);
-}
+ else
+ {
+ // INFO: mloskot - PostgreSQL prepared statements
+ // does not need any pre-initialization steps,
+ // statement allocation, etc.
+ // So, we only allocates cursor area.
+
+ curs = (postgis_cursor_def*)malloc (sizeof (postgis_cursor_def));
+ if (NULL == curs)
+ {
+ return RDBI_MALLOC_FAILED;
+ }
+
+ memset (curs, 0, sizeof (postgis_cursor_def));
+
+ // The stmt_name may be "" to create an unnamed statement,
+ // in which case any pre-existing unnamed statement is
+ // automatically replaced.It is an error if the statement name is
+ // already defined in the current session.
+
+ sprintf (curs->stmt_name, "fdo%x", (unsigned long)&(curs->stmt_name), POSTGIS_STMT_NAME_SIZE);
+
+ /* Initialize cursor members. */
+ curs->stmt_result = NULL;
+ curs->current_row = POSTGIS_STMT_NOROWS; /* = -1 */
+ curs->define_count = 0;
+ curs->defines = NULL;
+ curs->bind_count = 0;
+ curs->binds = NULL;
+ curs->redefines = NULL;
+ curs->rebinds = NULL;
+
+ *cursor = (char*)curs;
+ ret = RDBI_SUCCESS;
+ }
+ }
+
+ return (ret);
+}
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/execute.c
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/execute.c 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/execute.c 2007-02-14 17:02:54 UTC (rev 744)
@@ -25,6 +25,7 @@
#include "pgresult_clear.h"
#include "pgresult_error.h"
#include "pgresult_status.h"
+#include "null.h"
#include "Geometry.h"
@@ -90,62 +91,82 @@
for (int i = 0; i < params_count; ++i)
{
- switch (curs->binds[i].buffer_type)
- {
- case PGSQL_TYPE_CHAR: /* TODO: mloskot - check if not move to separate case */
- case PGSQL_TYPE_BPCHAR:
- case PGSQL_TYPE_VARCHAR:
- case PGSQL_TYPE_TEXT:
+ if ( curs->binds[i].is_null && postgis_is_null(context, curs->binds[i].is_null, 0) ) {
+ buf = NULL;
+ buf_size = 0;
+ }
+ else {
+ switch (curs->binds[i].buffer_type)
{
- buf_size = curs->binds[i].buffer_length * sizeof(char);
- buf = (char*)malloc(buf_size);
- memset(buf, 0, buf_size);
- strncpy(buf, (const char*)curs->binds[i].buffer, buf_size);
+ case PGSQL_TYPE_CHAR: /* TODO: mloskot - check if not move to separate case */
+ case PGSQL_TYPE_BPCHAR:
+ case PGSQL_TYPE_VARCHAR:
+ case PGSQL_TYPE_TEXT:
+ {
+ buf_size = curs->binds[i].buffer_length * sizeof(char);
+ buf = (char*)malloc(buf_size);
+ memset(buf, 0, buf_size);
+ strncpy(buf, (const char*)curs->binds[i].buffer, buf_size);
+ }
+ break;
+ case PGSQL_TYPE_BOOL:
+ case PGSQL_TYPE_INT2:
+ {
+ buf_size = NUMBER_OF_DIGITS10(short);
+ buf = (char*)malloc(buf_size);
+ memset(buf, 0, buf_size);
+ snprintf(buf, buf_size, "%d", (int)(*((short*)curs->binds[i].buffer)));
+ }
+ break;
+ case PGSQL_TYPE_INT4:
+ {
+ buf_size = NUMBER_OF_DIGITS10(int);
+ buf = (char*)malloc(buf_size);
+ memset(buf, 0, buf_size);
+ snprintf(buf, buf_size, "%d", (*((int*)curs->binds[i].buffer)));
+ }
+ break;
+ case PGSQL_TYPE_INT8:
+ {
+ buf_size = NUMBER_OF_DIGITS10(rdbi_int64_t);
+ buf = (char*)malloc(buf_size);
+ memset(buf, 0, buf_size);
+ snprintf(buf, buf_size, "%I64d", (*((rdbi_int64_t*)curs->binds[i].buffer)));
+ }
+ break;
+ case PGSQL_TYPE_FLOAT:
+ {
+ buf_size = NUMBER_OF_FLOAT_DIGITS;
+ buf = (char*)malloc(buf_size);
+ memset(buf, 0, buf_size);
+ snprintf(buf, buf_size, "%.20g", (*((float*)curs->binds[i].buffer)));
+ }
+ break;
+ case PGSQL_TYPE_DOUBLE:
+ {
+ buf_size = NUMBER_OF_DOUBLE_DIGITS;
+ buf = (char*)malloc(buf_size);
+ memset(buf, 0, buf_size);
+ snprintf(buf, buf_size, "%.20g", (*((double*)curs->binds[i].buffer)));
+ }
+ break;
+ default:
+ if (postgis_get_geometry_oid(postgis) == curs->binds[i].buffer_type) {
+ int count = 0;
+ char* wkb = WkbFromGeometry( (*(void**)(curs->binds[i].buffer)), &count);
+ buf = (char*)malloc((count * 2) + 1);
+ int j;
+ char* p = buf;
+ for ( j = 4; j < count; j++ ) {
+ sprintf( p, "%02X", wkb[j] );
+ p += 2;
+ }
+ }
+ else {
+ assert(!"execute: NOT IMPLEMENTED TYPE");
+ }
}
- break;
- case PGSQL_TYPE_INT2:
- {
- buf_size = NUMBER_OF_DIGITS10(short);
- buf = (char*)malloc(buf_size);
- memset(buf, 0, buf_size);
- snprintf(buf, buf_size, "%d", (int)(*((short*)curs->binds[i].buffer)));
- }
- break;
- case PGSQL_TYPE_INT4:
- {
- buf_size = NUMBER_OF_DIGITS10(int);
- buf = (char*)malloc(buf_size);
- memset(buf, 0, buf_size);
- snprintf(buf, buf_size, "%d", (*((int*)curs->binds[i].buffer)));
- }
- break;
- case PGSQL_TYPE_INT8:
- {
- buf_size = NUMBER_OF_DIGITS10(rdbi_int64_t);
- buf = (char*)malloc(buf_size);
- memset(buf, 0, buf_size);
- snprintf(buf, buf_size, "%I64d", (*((rdbi_int64_t*)curs->binds[i].buffer)));
- }
- break;
- case PGSQL_TYPE_FLOAT:
- {
- buf_size = NUMBER_OF_FLOAT_DIGITS;
- buf = (char*)malloc(buf_size);
- memset(buf, 0, buf_size);
- snprintf(buf, buf_size, "%.20g", (*((float*)curs->binds[i].buffer)));
- }
- break;
- case PGSQL_TYPE_DOUBLE:
- {
- buf_size = NUMBER_OF_DOUBLE_DIGITS;
- buf = (char*)malloc(buf_size);
- memset(buf, 0, buf_size);
- snprintf(buf, buf_size, "%.20g", (*((double*)curs->binds[i].buffer)));
- }
- break;
- default:
- assert(!"execute: UNKNOWN TYPE");
}
/* Assign value to input parameter. */
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/fetch.c
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/fetch.c 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/fetch.c 2007-02-14 17:02:54 UTC (rev 744)
@@ -22,6 +22,7 @@
#include "local.h"
#include "conn_status.h"
#include "pgresult_status.h"
+#include "pgresult_error.h"
#include "Geometry.h"
#include <stdlib.h> /* strtol() */
@@ -108,6 +109,14 @@
buffer[fvalue_length] = '\0';
break;
}
+ case PGSQL_TYPE_BOOL:
+ {
+ assert(sizeof(short) == curs->defines[i].buffer_length);
+
+ short val = (fvalue[0] == 't') ? 1 : 0;
+ memcpy(curs->defines[i].buffer, &val, sizeof(short));
+ }
+ break;
case PGSQL_TYPE_INT2:
{
assert(sizeof(short) == curs->defines[i].buffer_length);
@@ -159,7 +168,21 @@
break;
default:
- assert(!"fetch: NOT IMPLEMENTED TYPE");
+ if (postgis_get_geometry_oid(postgis) == curs->defines[i].buffer_type) {
+ int defcount = strlen(fvalue);
+ char* buffer = new char[(size_t)(defcount/2)];
+ int j;
+ int k = 0;
+ for ( j = 0; j < defcount; j+=2 ) {
+ buffer[k++] = ((fvalue[j] - (fvalue[j] >= 'A' ? ('A' - 10) : '0')) * 16) + (fvalue[j+1] - (fvalue[j+1] >= 'A' ? ('A' - 10) : '0'));
+ }
+ void* geomPtr = GeometryFromWkb ( buffer, k );
+ memcpy(curs->defines[i].buffer, &geomPtr, sizeof(void*));
+ delete[] buffer;
+ }
+ else {
+ assert(!"fetch: NOT IMPLEMENTED TYPE");
+ }
}
buffer = NULL;
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/fre_cursor.c
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/fre_cursor.c 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/fre_cursor.c 2007-02-14 17:02:54 UTC (rev 744)
@@ -20,6 +20,7 @@
#include "Geometry.h"
#include "fre_cursor.h"
+#include "run_sql.h"
#include "pgresult_clear.h"
#include <stdlib.h> // free()
@@ -101,12 +102,17 @@
postgis_pgresult_clear(curs->stmt_result);
}
+ /* Free binds collection. */
+ postgis_fre_binds (curs);
+
+ char buffer[50];
+ int rows_processed;
+ sprintf( buffer, "DEALLOCATE %s", curs->stmt_name );
+ postgis_run_sql( context, buffer, false, &rows_processed );
+
/* Reset statement name. */
memset(curs->stmt_name, 0, POSTGIS_STMT_NAME_SIZE);
- /* Free binds collection. */
- postgis_fre_binds (curs);
-
/* Free the whole cursor instance. */
free (curs);
curs = NULL;
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/get_gen_id.c
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/get_gen_id.c 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/get_gen_id.c 2007-02-14 17:02:54 UTC (rev 744)
@@ -32,7 +32,7 @@
int postgis_get_gen_id(
postgis_context_def* context,
const char* table_name,
- const char* column_name,
+// const char* column_name,
int* id)
{
postgis_cursor_def* curs = NULL;
@@ -42,7 +42,7 @@
assert(NULL != context);
assert(NULL != table_name);
assert(NULL != id);
-
+#if 0
if (0 == stricmp(table_name, "f_classdefinition"))
column_name = "classid";
else if (0 == stricmp(table_name, "f_spatialcontext"))
@@ -53,7 +53,7 @@
column_name = "scgid";
else
assert(!"postgis_get_gen_id() - UNKNOWN TABLE");
-
+#endif
return ret;
}
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/get_gen_id.h
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/get_gen_id.h 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/get_gen_id.h 2007-02-14 17:02:54 UTC (rev 744)
@@ -38,7 +38,7 @@
int postgis_get_gen_id(
postgis_context_def* context,
const char* table_name,
- const char* column_name,
+// const char* column_name,
int* id);
#endif /* POSTGIS_GET_GEN_ID_H */
\ No newline at end of file
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/rdbi_init.c
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/rdbi_init.c 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/rdbi_init.c 2007-02-14 17:02:54 UTC (rev 744)
@@ -30,6 +30,7 @@
#include "execute.h"
#include "fetch.h"
#include "fre_cursor.h"
+#include "geom_srid.h"
#include "get_gen_id.h"
#include "get_msg.h"
#include "null.h"
@@ -104,7 +105,7 @@
methods->set_schema = (int (*)(void*, const char*))postgis_set_schema;
methods->set_schemaW = NULL;
methods->vndr_info = (int (*)(void*, rdbi_vndr_info_def*))postgis_vndr_info;
- methods->geom_srid_set = NULL;
+ methods->geom_srid_set = (int (*)(void*, char*, char*, long))postgis_geom_srid_set;
methods->geom_dimens_set = NULL;
methods->get_geoms_ext = NULL;
methods->lob_create_ref = NULL;
@@ -119,12 +120,12 @@
methods->autocommit_on = NULL;
methods->autocommit_off = NULL;
methods->autocommit_mode = NULL;
- methods->capabilities.supports_sequence = 0;
- methods->capabilities.supports_autoincrement = 1;
+ methods->capabilities.supports_sequence = 1;
+ methods->capabilities.supports_autoincrement = 0;
methods->capabilities.supports_unicode = 0;
methods->capabilities.supports_int64_binding = 1;
- methods->get_gen_id = (int (*)(void*, const char*, const char*, int*))postgis_get_gen_id;
+ methods->get_gen_id = (int (*)(void*, const char*, /*const char*, */int*))postgis_get_gen_id;
*contextp = context;
ret = RDBI_SUCCESS;
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/run_sql.c
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/run_sql.c 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/run_sql.c 2007-02-14 17:02:54 UTC (rev 744)
@@ -73,7 +73,8 @@
{
buf = PQcmdTuples(pgresult);
rows = strtol(buf, NULL, 10);
- assert(ERANGE != errno && EINVAL != errno);
+// BR - TODO - recheck if needed.
+// assert(ERANGE != errno && EINVAL != errno);
}
(*rows_processed) = (int)rows;
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/set_schema.c
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/set_schema.c 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/set_schema.c 2007-02-14 17:02:54 UTC (rev 744)
@@ -38,7 +38,7 @@
char* sql = NULL;
size_t sql_len = 0;
- const size_t sql_part_len = 20;
+ const size_t sql_part_len = 35;
/* Strings manipulation helpers */
@@ -63,7 +63,7 @@
else
{
memset(sql, 0, sql_len);
- sprintf(sql, "SET search_path TO %s", schema_name);
+ sprintf(sql, "SET search_path TO %s, public", schema_name);
pgresult = PQexec(postgis, sql);
ret = postgis_pgresult_status(pgresult);
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/type.c
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/type.c 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Driver/type.c 2007-02-14 17:02:54 UTC (rev 744)
@@ -32,6 +32,9 @@
switch (type)
{
+ case RDBI_BOOLEAN:
+ ret = PGSQL_TYPE_BOOL;
+ break;
case RDBI_CHAR:
ret = PGSQL_TYPE_CHAR;
break;
@@ -101,6 +104,9 @@
switch (typeoid)
{
+ case PGSQL_TYPE_BOOL:
+ ret = RDBI_BOOLEAN;
+ break;
case PGSQL_TYPE_INT2:
ret = RDBI_SHORT;
break;
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Fdo/FdoRdbmsPostGisConnection.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Fdo/FdoRdbmsPostGisConnection.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Fdo/FdoRdbmsPostGisConnection.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -278,6 +278,13 @@
return (ret);
}
+const char* FdoRdbmsPostGisConnection::GetBindString( int n )
+{
+ char *str = GetDbiConnection()->GetUtility()->newCharP();
+ sprintf(str,"$%d",n);
+ return str;
+}
+
FdoConnectionState FdoRdbmsPostGisConnection::Open()
{
if (FdoConnectionState_Open != GetConnectionState())
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Fdo/FdoRdbmsPostGisConnection.h
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Fdo/FdoRdbmsPostGisConnection.h 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Fdo/FdoRdbmsPostGisConnection.h 2007-02-14 17:02:54 UTC (rev 744)
@@ -125,6 +125,9 @@
///
/// @return State of connection.
///
+
+ virtual const char* GetBindString( int n );
+
virtual FdoConnectionState Open();
/// Closes the connection to the data store.
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Fdo/FdoRdbmsPostGisFilterProcessor.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Fdo/FdoRdbmsPostGisFilterProcessor.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/Fdo/FdoRdbmsPostGisFilterProcessor.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -222,7 +222,7 @@
// For now, we'll take advantage of PostGIS's limitations and reduce all geometry types
// and dimensionalities to a 2D polygon with one ring, and just use the MBRIntersects operator.
FdoStringP buf = FdoStringP::Format(
- L"MBRIntersects(GeomFromText('Polygon((%ls %ls,%ls %ls,%ls %ls,%ls %ls,%ls %ls))'),%ls)",
+ L"Intersects(GeomFromText('Polygon((%ls %ls,%ls %ls,%ls %ls,%ls %ls,%ls %ls))'),%ls)",
minxStr, minyStr,
maxxStr, minyStr,
maxxStr, maxyStr,
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/PostGIS.sln
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/PostGIS.sln 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/PostGIS.sln 2007-02-14 17:02:54 UTC (rev 744)
@@ -1,13 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmMessage", "..\..\..\fdocore\Utilities\SchemaMgr\SmMessage.vcproj", "{11793E23-75E5-4407-AF82-BE0FC6994EBD}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmOverrides", "..\..\..\fdocore\Utilities\SchemaMgr\Overrides.vcproj", "{2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}"
- ProjectSection(ProjectDependencies) = postProject
- {11793E23-75E5-4407-AF82-BE0FC6994EBD} = {11793E23-75E5-4407-AF82-BE0FC6994EBD}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fdordbmsmsg", "..\..\Nls\fdordbms.vcproj", "{9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RdbmsOverrides", "..\SchemaMgr\RdbmsOverrides.vcproj", "{4D87353A-981A-4B99-9262-516D4F677535}"
@@ -16,8 +9,6 @@
{9BF08D0E-CD3B-4687-86E2-6DB8270E94E9} = {9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\..\..\fdocore\Utilities\Common\FdoCommon.vcproj", "{9037A345-04EB-418C-98D0-3D5B19FC9D55}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LockManager", "..\LockManager\LockManager.vcproj", "{080C612A-C598-476E-A0CC-5D98FA48B738}"
ProjectSection(ProjectDependencies) = postProject
{9BF08D0E-CD3B-4687-86E2-6DB8270E94E9} = {9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}
@@ -35,11 +26,6 @@
{9BF08D0E-CD3B-4687-86E2-6DB8270E94E9} = {9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Gdbi", "..\Gdbi\Gdbi.vcproj", "{531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}"
- ProjectSection(ProjectDependencies) = postProject
- {9BF08D0E-CD3B-4687-86E2-6DB8270E94E9} = {9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "geometry_fgf_lib", "..\Geometry\Fgf\geometry_fgf.vcproj", "{29CDD5C2-B733-4B6A-B92A-FD3DCD0D57B5}"
ProjectSection(ProjectDependencies) = postProject
{9BF08D0E-CD3B-4687-86E2-6DB8270E94E9} = {9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}
@@ -55,23 +41,6 @@
{9BF08D0E-CD3B-4687-86E2-6DB8270E94E9} = {9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SchemaMgr", "..\..\..\fdocore\Utilities\SchemaMgr\SchemaMgr.vcproj", "{F5346F00-C869-4B51-A947-FC097288C625}"
- ProjectSection(ProjectDependencies) = postProject
- {11793E23-75E5-4407-AF82-BE0FC6994EBD} = {11793E23-75E5-4407-AF82-BE0FC6994EBD}
- {9BF08D0E-CD3B-4687-86E2-6DB8270E94E9} = {9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmLogicalPhysical", "..\..\..\fdocore\Utilities\SchemaMgr\LogicalPhysical.vcproj", "{67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}"
- ProjectSection(ProjectDependencies) = postProject
- {9037A345-04EB-418C-98D0-3D5B19FC9D55} = {9037A345-04EB-418C-98D0-3D5B19FC9D55}
- {11793E23-75E5-4407-AF82-BE0FC6994EBD} = {11793E23-75E5-4407-AF82-BE0FC6994EBD}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmPhysical", "..\..\..\fdocore\Utilities\SchemaMgr\Physical.vcproj", "{80E04928-D74C-441C-8851-09B8BD281D5F}"
- ProjectSection(ProjectDependencies) = postProject
- {11793E23-75E5-4407-AF82-BE0FC6994EBD} = {11793E23-75E5-4407-AF82-BE0FC6994EBD}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "..\Util\util.vcproj", "{001B698F-66FF-4486-AD57-53318CF47A4A}"
ProjectSection(ProjectDependencies) = postProject
{9BF08D0E-CD3B-4687-86E2-6DB8270E94E9} = {9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}
@@ -79,7 +48,7 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PostGIS", "PostGIS.vcproj", "{DFC59C58-1267-42A0-A8EE-4E4FC19040B7}"
ProjectSection(ProjectDependencies) = postProject
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3} = {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F} = {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}
{69D1E6E5-9391-40FE-A989-B9BEBE3EE305} = {69D1E6E5-9391-40FE-A989-B9BEBE3EE305}
{86921DDB-715C-4E22-A107-41108E2D4FBB} = {86921DDB-715C-4E22-A107-41108E2D4FBB}
{29CDD5C2-B733-4B6A-B92A-FD3DCD0D57B5} = {29CDD5C2-B733-4B6A-B92A-FD3DCD0D57B5}
@@ -126,50 +95,6 @@
README.txt = README.txt
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_list_datastores", "..\UnitTest\util_list_datastores.vcproj", "{3FF70ADE-0220-4F38-A893-E6C1247DFCA5}"
- ProjectSection(ProjectDependencies) = postProject
- {DFC59C58-1267-42A0-A8EE-4E4FC19040B7} = {DFC59C58-1267-42A0-A8EE-4E4FC19040B7}
- {D2EF6A19-4817-4978-8D61-066A694A6A34} = {D2EF6A19-4817-4978-8D61-066A694A6A34}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_list_providers", "..\UnitTest\util_list_providers.vcproj", "{2C132A4B-2602-4B29-8EAE-E7FC685FD507}"
- ProjectSection(ProjectDependencies) = postProject
- {DFC59C58-1267-42A0-A8EE-4E4FC19040B7} = {DFC59C58-1267-42A0-A8EE-4E4FC19040B7}
- {D2EF6A19-4817-4978-8D61-066A694A6A34} = {D2EF6A19-4817-4978-8D61-066A694A6A34}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_run_sql_cmd", "..\UnitTest\util_run_sql_cmd.vcproj", "{736900C1-77C0-41B5-B433-74C2B49A3309}"
- ProjectSection(ProjectDependencies) = postProject
- {DFC59C58-1267-42A0-A8EE-4E4FC19040B7} = {DFC59C58-1267-42A0-A8EE-4E4FC19040B7}
- {D2EF6A19-4817-4978-8D61-066A694A6A34} = {D2EF6A19-4817-4978-8D61-066A694A6A34}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_connect", "..\UnitTest\util_connect.vcproj", "{AC3C8965-006F-4E81-A793-AF0820108962}"
- ProjectSection(ProjectDependencies) = postProject
- {DFC59C58-1267-42A0-A8EE-4E4FC19040B7} = {DFC59C58-1267-42A0-A8EE-4E4FC19040B7}
- {D2EF6A19-4817-4978-8D61-066A694A6A34} = {D2EF6A19-4817-4978-8D61-066A694A6A34}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTestPostGIS", "..\UnitTest\UnitTestPostGIS.vcproj", "{D2EF6A19-4817-4978-8D61-066A694A6A34}"
- ProjectSection(ProjectDependencies) = postProject
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3} = {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}
- {69D1E6E5-9391-40FE-A989-B9BEBE3EE305} = {69D1E6E5-9391-40FE-A989-B9BEBE3EE305}
- {86921DDB-715C-4E22-A107-41108E2D4FBB} = {86921DDB-715C-4E22-A107-41108E2D4FBB}
- {A97744C0-DCC5-4D58-91B5-7DB006BD40C1} = {A97744C0-DCC5-4D58-91B5-7DB006BD40C1}
- {001B698F-66FF-4486-AD57-53318CF47A4A} = {001B698F-66FF-4486-AD57-53318CF47A4A}
- {DFC59C58-1267-42A0-A8EE-4E4FC19040B7} = {DFC59C58-1267-42A0-A8EE-4E4FC19040B7}
- {C4BAD553-2752-4D33-8505-8332781E27E0} = {C4BAD553-2752-4D33-8505-8332781E27E0}
- {9037A345-04EB-418C-98D0-3D5B19FC9D55} = {9037A345-04EB-418C-98D0-3D5B19FC9D55}
- {E3307244-0639-4F87-A21B-B4369C0FD93F} = {E3307244-0639-4F87-A21B-B4369C0FD93F}
- {080C612A-C598-476E-A0CC-5D98FA48B738} = {080C612A-C598-476E-A0CC-5D98FA48B738}
- {9BF08D0E-CD3B-4687-86E2-6DB8270E94E9} = {9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_create_datastore", "..\UnitTest\util_create_datastore.vcproj", "{E0CA53E6-10C5-4889-AA76-37318421B372}"
- ProjectSection(ProjectDependencies) = postProject
- {DFC59C58-1267-42A0-A8EE-4E4FC19040B7} = {DFC59C58-1267-42A0-A8EE-4E4FC19040B7}
- EndProjectSection
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "com", "com", "{6196F41D-2159-4FEC-955E-F23CCE53A768}"
ProjectSection(SolutionItems) = preProject
..\..\com\f_associationdefinition.sql = ..\..\com\f_associationdefinition.sql
@@ -190,12 +115,26 @@
..\..\com\postgis_fdo_sys_idx.sql = ..\..\com\postgis_fdo_sys_idx.sql
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_describe_schema", "..\UnitTest\util_describe_schema.vcproj", "{5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "%FDOUTILITIES%\Common\FdoCommon.vcproj", "{9037A345-04EB-418C-98D0-3D5B19FC9D55}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmLogicalPhysical", "%FDOUTILITIES%\SchemaMgr\LogicalPhysical.vcproj", "{67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmOverrides", "%FDOUTILITIES%\SchemaMgr\Overrides.vcproj", "{2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmPhysical", "%FDOUTILITIES%\SchemaMgr\Physical.vcproj", "{80E04928-D74C-441C-8851-09B8BD281D5F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SchemaMgr", "%FDOUTILITIES%\SchemaMgr\SchemaMgr.vcproj", "{F5346F00-C869-4B51-A947-FC097288C625}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmMessage", "%FDOUTILITIES%\SchemaMgr\SmMessage.vcproj", "{11793E23-75E5-4407-AF82-BE0FC6994EBD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTestPostGIS", "..\UnitTest\UnitTestPostGIS.vcproj", "{D2EF6A19-4817-4978-8D61-066A694A6A34}"
ProjectSection(ProjectDependencies) = postProject
- {D2EF6A19-4817-4978-8D61-066A694A6A34} = {D2EF6A19-4817-4978-8D61-066A694A6A34}
{DFC59C58-1267-42A0-A8EE-4E4FC19040B7} = {DFC59C58-1267-42A0-A8EE-4E4FC19040B7}
+ {C4BAD553-2752-4D33-8505-8332781E27E0} = {C4BAD553-2752-4D33-8505-8332781E27E0}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Gdbi", "Custom\Gdbi\Gdbi.vcproj", "{2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -206,30 +145,6 @@
ReleaseOra|Win32 = ReleaseOra|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {11793E23-75E5-4407-AF82-BE0FC6994EBD}.Debug|Win32.ActiveCfg = Debug|Win32
- {11793E23-75E5-4407-AF82-BE0FC6994EBD}.Debug|Win32.Build.0 = Debug|Win32
- {11793E23-75E5-4407-AF82-BE0FC6994EBD}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {11793E23-75E5-4407-AF82-BE0FC6994EBD}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {11793E23-75E5-4407-AF82-BE0FC6994EBD}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {11793E23-75E5-4407-AF82-BE0FC6994EBD}.DebugOra|Win32.Build.0 = Debug|Win32
- {11793E23-75E5-4407-AF82-BE0FC6994EBD}.Release|Win32.ActiveCfg = Release|Win32
- {11793E23-75E5-4407-AF82-BE0FC6994EBD}.Release|Win32.Build.0 = Release|Win32
- {11793E23-75E5-4407-AF82-BE0FC6994EBD}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {11793E23-75E5-4407-AF82-BE0FC6994EBD}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {11793E23-75E5-4407-AF82-BE0FC6994EBD}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {11793E23-75E5-4407-AF82-BE0FC6994EBD}.ReleaseOra|Win32.Build.0 = Release|Win32
- {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.Debug|Win32.ActiveCfg = Debug|Win32
- {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.Debug|Win32.Build.0 = Debug|Win32
- {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.DebugOra|Win32.Build.0 = Debug|Win32
- {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.Release|Win32.ActiveCfg = Release|Win32
- {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.Release|Win32.Build.0 = Release|Win32
- {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.ReleaseOra|Win32.Build.0 = Release|Win32
{9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}.Debug|Win32.ActiveCfg = Debug|Win32
{9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}.Debug|Win32.Build.0 = Debug|Win32
{9BF08D0E-CD3B-4687-86E2-6DB8270E94E9}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
@@ -254,18 +169,6 @@
{4D87353A-981A-4B99-9262-516D4F677535}.ReleaseDynamic|Win32.Build.0 = Release|Win32
{4D87353A-981A-4B99-9262-516D4F677535}.ReleaseOra|Win32.ActiveCfg = Release|Win32
{4D87353A-981A-4B99-9262-516D4F677535}.ReleaseOra|Win32.Build.0 = Release|Win32
- {9037A345-04EB-418C-98D0-3D5B19FC9D55}.Debug|Win32.ActiveCfg = Debug|Win32
- {9037A345-04EB-418C-98D0-3D5B19FC9D55}.Debug|Win32.Build.0 = Debug|Win32
- {9037A345-04EB-418C-98D0-3D5B19FC9D55}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {9037A345-04EB-418C-98D0-3D5B19FC9D55}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {9037A345-04EB-418C-98D0-3D5B19FC9D55}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {9037A345-04EB-418C-98D0-3D5B19FC9D55}.DebugOra|Win32.Build.0 = Debug|Win32
- {9037A345-04EB-418C-98D0-3D5B19FC9D55}.Release|Win32.ActiveCfg = Release|Win32
- {9037A345-04EB-418C-98D0-3D5B19FC9D55}.Release|Win32.Build.0 = Release|Win32
- {9037A345-04EB-418C-98D0-3D5B19FC9D55}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {9037A345-04EB-418C-98D0-3D5B19FC9D55}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {9037A345-04EB-418C-98D0-3D5B19FC9D55}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {9037A345-04EB-418C-98D0-3D5B19FC9D55}.ReleaseOra|Win32.Build.0 = Release|Win32
{080C612A-C598-476E-A0CC-5D98FA48B738}.Debug|Win32.ActiveCfg = Debug|Win32
{080C612A-C598-476E-A0CC-5D98FA48B738}.Debug|Win32.Build.0 = Debug|Win32
{080C612A-C598-476E-A0CC-5D98FA48B738}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
@@ -302,18 +205,6 @@
{F40C3E7C-1A1B-42D4-BD5A-24AADD5D77F1}.ReleaseDynamic|Win32.Build.0 = Release|Win32
{F40C3E7C-1A1B-42D4-BD5A-24AADD5D77F1}.ReleaseOra|Win32.ActiveCfg = Release|Win32
{F40C3E7C-1A1B-42D4-BD5A-24AADD5D77F1}.ReleaseOra|Win32.Build.0 = Release|Win32
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}.Debug|Win32.ActiveCfg = Debug|Win32
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}.Debug|Win32.Build.0 = Debug|Win32
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}.DebugOra|Win32.Build.0 = Debug|Win32
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}.Release|Win32.ActiveCfg = Release|Win32
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}.Release|Win32.Build.0 = Release|Win32
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {531AC4EE-B2BF-4FC9-8A03-EF272DCAEAB3}.ReleaseOra|Win32.Build.0 = Release|Win32
{29CDD5C2-B733-4B6A-B92A-FD3DCD0D57B5}.Debug|Win32.ActiveCfg = Debug|Win32
{29CDD5C2-B733-4B6A-B92A-FD3DCD0D57B5}.Debug|Win32.Build.0 = Debug|Win32
{29CDD5C2-B733-4B6A-B92A-FD3DCD0D57B5}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
@@ -350,42 +241,6 @@
{E2DBE00A-1AAB-4CA3-B6FB-9CDE0FE5C553}.ReleaseDynamic|Win32.Build.0 = ReleaseDynamic|Win32
{E2DBE00A-1AAB-4CA3-B6FB-9CDE0FE5C553}.ReleaseOra|Win32.ActiveCfg = ReleaseDynamic|Win32
{E2DBE00A-1AAB-4CA3-B6FB-9CDE0FE5C553}.ReleaseOra|Win32.Build.0 = ReleaseDynamic|Win32
- {F5346F00-C869-4B51-A947-FC097288C625}.Debug|Win32.ActiveCfg = Debug|Win32
- {F5346F00-C869-4B51-A947-FC097288C625}.Debug|Win32.Build.0 = Debug|Win32
- {F5346F00-C869-4B51-A947-FC097288C625}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {F5346F00-C869-4B51-A947-FC097288C625}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {F5346F00-C869-4B51-A947-FC097288C625}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {F5346F00-C869-4B51-A947-FC097288C625}.DebugOra|Win32.Build.0 = Debug|Win32
- {F5346F00-C869-4B51-A947-FC097288C625}.Release|Win32.ActiveCfg = Release|Win32
- {F5346F00-C869-4B51-A947-FC097288C625}.Release|Win32.Build.0 = Release|Win32
- {F5346F00-C869-4B51-A947-FC097288C625}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {F5346F00-C869-4B51-A947-FC097288C625}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {F5346F00-C869-4B51-A947-FC097288C625}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {F5346F00-C869-4B51-A947-FC097288C625}.ReleaseOra|Win32.Build.0 = Release|Win32
- {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.Debug|Win32.ActiveCfg = Debug|Win32
- {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.Debug|Win32.Build.0 = Debug|Win32
- {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.DebugOra|Win32.Build.0 = Debug|Win32
- {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.Release|Win32.ActiveCfg = Release|Win32
- {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.Release|Win32.Build.0 = Release|Win32
- {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.ReleaseOra|Win32.Build.0 = Release|Win32
- {80E04928-D74C-441C-8851-09B8BD281D5F}.Debug|Win32.ActiveCfg = Debug|Win32
- {80E04928-D74C-441C-8851-09B8BD281D5F}.Debug|Win32.Build.0 = Debug|Win32
- {80E04928-D74C-441C-8851-09B8BD281D5F}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {80E04928-D74C-441C-8851-09B8BD281D5F}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {80E04928-D74C-441C-8851-09B8BD281D5F}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {80E04928-D74C-441C-8851-09B8BD281D5F}.DebugOra|Win32.Build.0 = Debug|Win32
- {80E04928-D74C-441C-8851-09B8BD281D5F}.Release|Win32.ActiveCfg = Release|Win32
- {80E04928-D74C-441C-8851-09B8BD281D5F}.Release|Win32.Build.0 = Release|Win32
- {80E04928-D74C-441C-8851-09B8BD281D5F}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {80E04928-D74C-441C-8851-09B8BD281D5F}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {80E04928-D74C-441C-8851-09B8BD281D5F}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {80E04928-D74C-441C-8851-09B8BD281D5F}.ReleaseOra|Win32.Build.0 = Release|Win32
{001B698F-66FF-4486-AD57-53318CF47A4A}.Debug|Win32.ActiveCfg = Debug|Win32
{001B698F-66FF-4486-AD57-53318CF47A4A}.Debug|Win32.Build.0 = Debug|Win32
{001B698F-66FF-4486-AD57-53318CF47A4A}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
@@ -446,54 +301,78 @@
{C4BAD553-2752-4D33-8505-8332781E27E0}.ReleaseDynamic|Win32.Build.0 = Release|Win32
{C4BAD553-2752-4D33-8505-8332781E27E0}.ReleaseOra|Win32.ActiveCfg = Release|Win32
{C4BAD553-2752-4D33-8505-8332781E27E0}.ReleaseOra|Win32.Build.0 = Release|Win32
- {3FF70ADE-0220-4F38-A893-E6C1247DFCA5}.Debug|Win32.ActiveCfg = Debug|Win32
- {3FF70ADE-0220-4F38-A893-E6C1247DFCA5}.Debug|Win32.Build.0 = Debug|Win32
- {3FF70ADE-0220-4F38-A893-E6C1247DFCA5}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {3FF70ADE-0220-4F38-A893-E6C1247DFCA5}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {3FF70ADE-0220-4F38-A893-E6C1247DFCA5}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {3FF70ADE-0220-4F38-A893-E6C1247DFCA5}.DebugOra|Win32.Build.0 = Debug|Win32
- {3FF70ADE-0220-4F38-A893-E6C1247DFCA5}.Release|Win32.ActiveCfg = Release|Win32
- {3FF70ADE-0220-4F38-A893-E6C1247DFCA5}.Release|Win32.Build.0 = Release|Win32
- {3FF70ADE-0220-4F38-A893-E6C1247DFCA5}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {3FF70ADE-0220-4F38-A893-E6C1247DFCA5}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {3FF70ADE-0220-4F38-A893-E6C1247DFCA5}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {3FF70ADE-0220-4F38-A893-E6C1247DFCA5}.ReleaseOra|Win32.Build.0 = Release|Win32
- {2C132A4B-2602-4B29-8EAE-E7FC685FD507}.Debug|Win32.ActiveCfg = Debug|Win32
- {2C132A4B-2602-4B29-8EAE-E7FC685FD507}.Debug|Win32.Build.0 = Debug|Win32
- {2C132A4B-2602-4B29-8EAE-E7FC685FD507}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {2C132A4B-2602-4B29-8EAE-E7FC685FD507}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {2C132A4B-2602-4B29-8EAE-E7FC685FD507}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {2C132A4B-2602-4B29-8EAE-E7FC685FD507}.DebugOra|Win32.Build.0 = Debug|Win32
- {2C132A4B-2602-4B29-8EAE-E7FC685FD507}.Release|Win32.ActiveCfg = Release|Win32
- {2C132A4B-2602-4B29-8EAE-E7FC685FD507}.Release|Win32.Build.0 = Release|Win32
- {2C132A4B-2602-4B29-8EAE-E7FC685FD507}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {2C132A4B-2602-4B29-8EAE-E7FC685FD507}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {2C132A4B-2602-4B29-8EAE-E7FC685FD507}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {2C132A4B-2602-4B29-8EAE-E7FC685FD507}.ReleaseOra|Win32.Build.0 = Release|Win32
- {736900C1-77C0-41B5-B433-74C2B49A3309}.Debug|Win32.ActiveCfg = Debug|Win32
- {736900C1-77C0-41B5-B433-74C2B49A3309}.Debug|Win32.Build.0 = Debug|Win32
- {736900C1-77C0-41B5-B433-74C2B49A3309}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {736900C1-77C0-41B5-B433-74C2B49A3309}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {736900C1-77C0-41B5-B433-74C2B49A3309}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {736900C1-77C0-41B5-B433-74C2B49A3309}.DebugOra|Win32.Build.0 = Debug|Win32
- {736900C1-77C0-41B5-B433-74C2B49A3309}.Release|Win32.ActiveCfg = Release|Win32
- {736900C1-77C0-41B5-B433-74C2B49A3309}.Release|Win32.Build.0 = Release|Win32
- {736900C1-77C0-41B5-B433-74C2B49A3309}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {736900C1-77C0-41B5-B433-74C2B49A3309}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {736900C1-77C0-41B5-B433-74C2B49A3309}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {736900C1-77C0-41B5-B433-74C2B49A3309}.ReleaseOra|Win32.Build.0 = Release|Win32
- {AC3C8965-006F-4E81-A793-AF0820108962}.Debug|Win32.ActiveCfg = Debug|Win32
- {AC3C8965-006F-4E81-A793-AF0820108962}.Debug|Win32.Build.0 = Debug|Win32
- {AC3C8965-006F-4E81-A793-AF0820108962}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {AC3C8965-006F-4E81-A793-AF0820108962}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {AC3C8965-006F-4E81-A793-AF0820108962}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {AC3C8965-006F-4E81-A793-AF0820108962}.DebugOra|Win32.Build.0 = Debug|Win32
- {AC3C8965-006F-4E81-A793-AF0820108962}.Release|Win32.ActiveCfg = Release|Win32
- {AC3C8965-006F-4E81-A793-AF0820108962}.Release|Win32.Build.0 = Release|Win32
- {AC3C8965-006F-4E81-A793-AF0820108962}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {AC3C8965-006F-4E81-A793-AF0820108962}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {AC3C8965-006F-4E81-A793-AF0820108962}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {AC3C8965-006F-4E81-A793-AF0820108962}.ReleaseOra|Win32.Build.0 = Release|Win32
+ {9037A345-04EB-418C-98D0-3D5B19FC9D55}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9037A345-04EB-418C-98D0-3D5B19FC9D55}.Debug|Win32.Build.0 = Debug|Win32
+ {9037A345-04EB-418C-98D0-3D5B19FC9D55}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
+ {9037A345-04EB-418C-98D0-3D5B19FC9D55}.DebugDynamic|Win32.Build.0 = Debug|Win32
+ {9037A345-04EB-418C-98D0-3D5B19FC9D55}.DebugOra|Win32.ActiveCfg = Debug|Win32
+ {9037A345-04EB-418C-98D0-3D5B19FC9D55}.DebugOra|Win32.Build.0 = Debug|Win32
+ {9037A345-04EB-418C-98D0-3D5B19FC9D55}.Release|Win32.ActiveCfg = Release|Win32
+ {9037A345-04EB-418C-98D0-3D5B19FC9D55}.Release|Win32.Build.0 = Release|Win32
+ {9037A345-04EB-418C-98D0-3D5B19FC9D55}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
+ {9037A345-04EB-418C-98D0-3D5B19FC9D55}.ReleaseDynamic|Win32.Build.0 = Release|Win32
+ {9037A345-04EB-418C-98D0-3D5B19FC9D55}.ReleaseOra|Win32.ActiveCfg = Release|Win32
+ {9037A345-04EB-418C-98D0-3D5B19FC9D55}.ReleaseOra|Win32.Build.0 = Release|Win32
+ {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.Debug|Win32.ActiveCfg = Debug|Win32
+ {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.Debug|Win32.Build.0 = Debug|Win32
+ {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
+ {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.DebugDynamic|Win32.Build.0 = Debug|Win32
+ {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.DebugOra|Win32.ActiveCfg = Debug|Win32
+ {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.DebugOra|Win32.Build.0 = Debug|Win32
+ {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.Release|Win32.ActiveCfg = Release|Win32
+ {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.Release|Win32.Build.0 = Release|Win32
+ {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
+ {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.ReleaseDynamic|Win32.Build.0 = Release|Win32
+ {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.ReleaseOra|Win32.ActiveCfg = Release|Win32
+ {67068A2A-B8E3-4206-AD5E-4CE1CD881AC4}.ReleaseOra|Win32.Build.0 = Release|Win32
+ {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.Debug|Win32.Build.0 = Debug|Win32
+ {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
+ {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.DebugDynamic|Win32.Build.0 = Debug|Win32
+ {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.DebugOra|Win32.ActiveCfg = Debug|Win32
+ {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.DebugOra|Win32.Build.0 = Debug|Win32
+ {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.Release|Win32.ActiveCfg = Release|Win32
+ {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.Release|Win32.Build.0 = Release|Win32
+ {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
+ {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.ReleaseDynamic|Win32.Build.0 = Release|Win32
+ {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.ReleaseOra|Win32.ActiveCfg = Release|Win32
+ {2CFF7B5C-2CC5-435B-8E8E-C4AC3ACFEF83}.ReleaseOra|Win32.Build.0 = Release|Win32
+ {80E04928-D74C-441C-8851-09B8BD281D5F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {80E04928-D74C-441C-8851-09B8BD281D5F}.Debug|Win32.Build.0 = Debug|Win32
+ {80E04928-D74C-441C-8851-09B8BD281D5F}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
+ {80E04928-D74C-441C-8851-09B8BD281D5F}.DebugDynamic|Win32.Build.0 = Debug|Win32
+ {80E04928-D74C-441C-8851-09B8BD281D5F}.DebugOra|Win32.ActiveCfg = Debug|Win32
+ {80E04928-D74C-441C-8851-09B8BD281D5F}.DebugOra|Win32.Build.0 = Debug|Win32
+ {80E04928-D74C-441C-8851-09B8BD281D5F}.Release|Win32.ActiveCfg = Release|Win32
+ {80E04928-D74C-441C-8851-09B8BD281D5F}.Release|Win32.Build.0 = Release|Win32
+ {80E04928-D74C-441C-8851-09B8BD281D5F}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
+ {80E04928-D74C-441C-8851-09B8BD281D5F}.ReleaseDynamic|Win32.Build.0 = Release|Win32
+ {80E04928-D74C-441C-8851-09B8BD281D5F}.ReleaseOra|Win32.ActiveCfg = Release|Win32
+ {80E04928-D74C-441C-8851-09B8BD281D5F}.ReleaseOra|Win32.Build.0 = Release|Win32
+ {F5346F00-C869-4B51-A947-FC097288C625}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F5346F00-C869-4B51-A947-FC097288C625}.Debug|Win32.Build.0 = Debug|Win32
+ {F5346F00-C869-4B51-A947-FC097288C625}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
+ {F5346F00-C869-4B51-A947-FC097288C625}.DebugDynamic|Win32.Build.0 = Debug|Win32
+ {F5346F00-C869-4B51-A947-FC097288C625}.DebugOra|Win32.ActiveCfg = Debug|Win32
+ {F5346F00-C869-4B51-A947-FC097288C625}.DebugOra|Win32.Build.0 = Debug|Win32
+ {F5346F00-C869-4B51-A947-FC097288C625}.Release|Win32.ActiveCfg = Release|Win32
+ {F5346F00-C869-4B51-A947-FC097288C625}.Release|Win32.Build.0 = Release|Win32
+ {F5346F00-C869-4B51-A947-FC097288C625}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
+ {F5346F00-C869-4B51-A947-FC097288C625}.ReleaseDynamic|Win32.Build.0 = Release|Win32
+ {F5346F00-C869-4B51-A947-FC097288C625}.ReleaseOra|Win32.ActiveCfg = Release|Win32
+ {F5346F00-C869-4B51-A947-FC097288C625}.ReleaseOra|Win32.Build.0 = Release|Win32
+ {11793E23-75E5-4407-AF82-BE0FC6994EBD}.Debug|Win32.ActiveCfg = Debug|Win32
+ {11793E23-75E5-4407-AF82-BE0FC6994EBD}.Debug|Win32.Build.0 = Debug|Win32
+ {11793E23-75E5-4407-AF82-BE0FC6994EBD}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
+ {11793E23-75E5-4407-AF82-BE0FC6994EBD}.DebugDynamic|Win32.Build.0 = Debug|Win32
+ {11793E23-75E5-4407-AF82-BE0FC6994EBD}.DebugOra|Win32.ActiveCfg = Debug|Win32
+ {11793E23-75E5-4407-AF82-BE0FC6994EBD}.DebugOra|Win32.Build.0 = Debug|Win32
+ {11793E23-75E5-4407-AF82-BE0FC6994EBD}.Release|Win32.ActiveCfg = Release|Win32
+ {11793E23-75E5-4407-AF82-BE0FC6994EBD}.Release|Win32.Build.0 = Release|Win32
+ {11793E23-75E5-4407-AF82-BE0FC6994EBD}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
+ {11793E23-75E5-4407-AF82-BE0FC6994EBD}.ReleaseDynamic|Win32.Build.0 = Release|Win32
+ {11793E23-75E5-4407-AF82-BE0FC6994EBD}.ReleaseOra|Win32.ActiveCfg = Release|Win32
+ {11793E23-75E5-4407-AF82-BE0FC6994EBD}.ReleaseOra|Win32.Build.0 = Release|Win32
{D2EF6A19-4817-4978-8D61-066A694A6A34}.Debug|Win32.ActiveCfg = Debug|Win32
{D2EF6A19-4817-4978-8D61-066A694A6A34}.Debug|Win32.Build.0 = Debug|Win32
{D2EF6A19-4817-4978-8D61-066A694A6A34}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
@@ -506,30 +385,18 @@
{D2EF6A19-4817-4978-8D61-066A694A6A34}.ReleaseDynamic|Win32.Build.0 = Release|Win32
{D2EF6A19-4817-4978-8D61-066A694A6A34}.ReleaseOra|Win32.ActiveCfg = Release|Win32
{D2EF6A19-4817-4978-8D61-066A694A6A34}.ReleaseOra|Win32.Build.0 = Release|Win32
- {E0CA53E6-10C5-4889-AA76-37318421B372}.Debug|Win32.ActiveCfg = Debug|Win32
- {E0CA53E6-10C5-4889-AA76-37318421B372}.Debug|Win32.Build.0 = Debug|Win32
- {E0CA53E6-10C5-4889-AA76-37318421B372}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {E0CA53E6-10C5-4889-AA76-37318421B372}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {E0CA53E6-10C5-4889-AA76-37318421B372}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {E0CA53E6-10C5-4889-AA76-37318421B372}.DebugOra|Win32.Build.0 = Debug|Win32
- {E0CA53E6-10C5-4889-AA76-37318421B372}.Release|Win32.ActiveCfg = Release|Win32
- {E0CA53E6-10C5-4889-AA76-37318421B372}.Release|Win32.Build.0 = Release|Win32
- {E0CA53E6-10C5-4889-AA76-37318421B372}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {E0CA53E6-10C5-4889-AA76-37318421B372}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {E0CA53E6-10C5-4889-AA76-37318421B372}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {E0CA53E6-10C5-4889-AA76-37318421B372}.ReleaseOra|Win32.Build.0 = Release|Win32
- {5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}.Debug|Win32.ActiveCfg = Debug|Win32
- {5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}.Debug|Win32.Build.0 = Debug|Win32
- {5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
- {5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}.DebugDynamic|Win32.Build.0 = Debug|Win32
- {5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}.DebugOra|Win32.ActiveCfg = Debug|Win32
- {5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}.DebugOra|Win32.Build.0 = Debug|Win32
- {5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}.Release|Win32.ActiveCfg = Release|Win32
- {5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}.Release|Win32.Build.0 = Release|Win32
- {5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
- {5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}.ReleaseDynamic|Win32.Build.0 = Release|Win32
- {5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}.ReleaseOra|Win32.ActiveCfg = Release|Win32
- {5B687AED-0A54-4595-B4A7-ADF0A8BFC04D}.ReleaseOra|Win32.Build.0 = Release|Win32
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}.Debug|Win32.Build.0 = Debug|Win32
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}.DebugDynamic|Win32.ActiveCfg = Debug|Win32
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}.DebugDynamic|Win32.Build.0 = Debug|Win32
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}.DebugOra|Win32.ActiveCfg = Debug|Win32
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}.DebugOra|Win32.Build.0 = Debug|Win32
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}.Release|Win32.ActiveCfg = Release|Win32
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}.Release|Win32.Build.0 = Release|Win32
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}.ReleaseDynamic|Win32.ActiveCfg = Release|Win32
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}.ReleaseDynamic|Win32.Build.0 = Release|Win32
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}.ReleaseOra|Win32.ActiveCfg = Release|Win32
+ {2D1B39E1-0ED4-48B4-BD94-FC1AA67AE15F}.ReleaseOra|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/PostGIS.vcproj
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/PostGIS.vcproj 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/PostGIS.vcproj 2007-02-14 17:02:54 UTC (rev 744)
@@ -40,6 +40,7 @@
/>
<Tool
Name="VCCLCompilerTool"
+ AdditionalOptions="-Zm113"
Optimization="0"
AdditionalIncludeDirectories="../../inc/rdbi;../;../../;../../inc;../../inc/fdo;../Fdo/Connection;../Fdo/Other;../Fdo/FeatureCommands;../Fdo/Custom;../Fdo/Schema;../Fdo/Lt;../Fdo/Lock;../Fdo/SpatialContext;$(FDO)\Unmanaged;$(FDO)\Unmanaged\inc;$(FDOUTILITIES)/SchemaMgr/inc;$(FDOUTILITIES)\Common\inc;..\Gdbi;..\LongTransactionManager;..\GenericLongTransactionManager;..\LockManager"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;FDORDBMS_EXPORTS;_USRDLL;POSTGIS_EXPORTS;_LIB;_CRT_SECURE_NO_DEPRECATE"
@@ -67,7 +68,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="FdoGeneric.lib Rdbi.lib PostGisDriver.lib libpq.lib FDO.lib FDOGeometry.lib FDOCommon.lib FDOSpatial.lib Gdbi.lib util.lib SchemaMgr_OVNew.lib Advapi32.lib"
+ AdditionalDependencies="FdoGeneric.lib Rdbi.lib PostGisDriver.lib libpq.lib FDO.lib FDOGeometry.lib FDOCommon.lib FDOSpatial.lib Gdbi_PostGis.lib util.lib SchemaMgr_OVNew.lib Advapi32.lib"
OutputFile="$(OutDir)/PostGISProvider.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\Lib\Win32\Debug;$(FDO)\Unmanaged\Lib\Win32\Debug;$(FDOPOSTGRESQL)\lib\ms;$(FDOUTILITIES)\SchemaMgr\Lib\Win32\Debug"
@@ -159,7 +160,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="FdoGeneric.lib Rdbi.lib PostGisDriver.lib libpq.lib FDO.lib geometry_fgf.lib FDOGeometry.lib FDOCommon.lib FDOSpatial.lib Gdbi.lib LongTransactionManager.lib SchemaMgr_OVNew.lib Advapi32.lib"
+ AdditionalDependencies="FdoGeneric.lib Rdbi.lib PostGisDriver.lib libpq.lib FDO.lib geometry_fgf.lib FDOGeometry.lib FDOCommon.lib FDOSpatial.lib Gdbi_PostGis.lib LongTransactionManager.lib SchemaMgr_OVNew.lib Advapi32.lib"
OutputFile="$(OutDir)/PostGISProvider.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\Lib\Win32\Release;$(FDO)\Unmanaged\Lib\Win32\Release;$(FDOPOSTGRESQL)\lib\ms;$(FDOUTILITIES)\SchemaMgr\Lib\Win32\Release"
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Lp/ClassDefinition.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Lp/ClassDefinition.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Lp/ClassDefinition.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -75,9 +75,6 @@
{
bool hasMappings = false;
- // TODO: mloskot - to be remove after tested!
- assert(!"TODO: Check this full-of-crazy casts place!");
-
FdoPostGISOvPhysicalSchemaMapping* pgSchemaMapping = NULL;
pgSchemaMapping =
static_cast<FdoPostGISOvPhysicalSchemaMapping*>(schemaMapping.p);
@@ -103,8 +100,6 @@
FdoPhysicalClassMappingP FdoSmLpPostGisClassDefinition::GetSchemaMappings(
bool includeDefaults) const
{
- // TODO: mloskot - to be remove after tested!
- assert(!"TODO: Check this full-of-crazy casts place!");
// TODO: mloskot - Why cast from FdoPostGISOvClassDefinition to FdoPostGISOvClassDefinition?
// Original code:
@@ -131,9 +126,6 @@
bool FdoSmLpPostGisClassDefinition::SetSchemaMappings(
FdoPhysicalClassMappingP classMapping, bool includeDefaults) const
{
- // TODO: mloskot - to be remove after tested!
- assert(!"TODO: Check this full-of-crazy casts place!");
-
// TODO: mloskot - Why so dirty and unsafe const-take-off ?
// Shouldn't it be cast to FdoSmLpClassBase or the
// cast is only to removing const qualifier?
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColTypeMapper.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColTypeMapper.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColTypeMapper.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -112,7 +112,7 @@
//################################################
// TODO: mloskot - check geometry_columns
//################################################
-static TypeEntry geometryEntry(FdoSmPhColType_Geom, L"geometry",
+static TypeEntry geometryEntry(FdoSmPhColType_Geom, L"GEOMETRY",
FdoGeometryType_MultiGeometry,
FdoGeometricType_Point
| FdoGeometricType_Curve
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Column.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Column.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Column.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -44,6 +44,8 @@
// Get basic name/type/nullability SQL:
FdoStringP addSql = FdoSmPhColumn::GetAddSql();
+//BR - TODO - implement sequences or use serial columns for autoincrementing.
+#if 0
// Add auto-increment column information:
const FdoSmPhPostGisDbObject* parent =
dynamic_cast<const FdoSmPhPostGisDbObject*>(this->GetParent());
@@ -59,7 +61,7 @@
addSql += L" AUTO_INCREMENT ";
}
-
+#endif
return addSql;
}
@@ -69,9 +71,10 @@
// then replace column type to SERIAL.
// TODO: mloskot - This MySQL stuff is intentionally left for testing.
-
+#if 0
if (FdoSmPhColumn::GetAutoincrement())
return L" AUTO_INCREMENT ";
else
+#endif
return L"";
}
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnChar.h
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnChar.h 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnChar.h 2007-02-14 17:02:54 UTC (rev 744)
@@ -68,7 +68,7 @@
// TODO: mloskot - Change following values to reflect PostgreSQL types.
// Remove unused values, ie. mTextMaxLen
- static const FdoInt64 mVarcharMaxLen = 255;
+ static const FdoInt64 mVarcharMaxLen = 65535;
static const FdoInt64 mTextMaxLen = 65535;
static const FdoInt64 mMediumTextMaxLen = 16777215;
};
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnDecimal.h
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnDecimal.h 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnDecimal.h 2007-02-14 17:02:54 UTC (rev 744)
@@ -109,12 +109,10 @@
/// Constants define limits of NUMERIC type.
///
- /// TODO: mloskot - Check value of eMaxScale
- ///
enum Limits
{
eMaxPrecision = 1000,
- eMaxScale = 0 // FIXME
+ eMaxScale = 1000
};
};
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnGeom.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnGeom.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnGeom.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -17,6 +17,7 @@
#include "stdafx.h"
#include "ColumnGeom.h"
#include "Rd/ColumnReader.h"
+#include "Mgr.h"
FdoSmPhPostGisColumnGeom::FdoSmPhPostGisColumnGeom(FdoStringP columnName,
FdoSchemaElementState state,
@@ -82,6 +83,40 @@
return FdoStringP::Format(L"%d", mFdoGeometryType);
}
+FdoStringP FdoSmPhPostGisColumnGeom::GetAddSql()
+{
+ if ( GetParent()->GetElementState() == FdoSchemaElementState_Added ) {
+ return L"";
+ }
+ else {
+ return FdoStringP::Format(
+ L"select AddGeometryColumn( '%ls', '%ls', '%ls', -1, 'GEOMETRY', %d)",
+ GetParent()->GetParent()->GetName(),
+ GetParent()->GetName(),
+ GetName(),
+ // BR TODO - set proper SRID.
+ GetHasElevation() ? 3 : 2
+ );
+ }
+}
+
+bool FdoSmPhPostGisColumnGeom::Add()
+{
+ FdoSmPhPostGisMgrP mgr(GetManager()->SmartCast<FdoSmPhPostGisMgr>());
+
+ GdbiConnection* gdbiConn = NULL;
+ gdbiConn = mgr->GetGdbiConnection();
+
+ FdoStringP sqlStmt = GetAddSql();
+
+ if ( sqlStmt != L"" ) {
+ gdbiConn->ExecuteNonQuery(
+ static_cast<const char*>(sqlStmt), true);
+ }
+
+ return true;
+}
+
void FdoSmPhPostGisColumnGeom::PostFinalize()
{
SetHasElevation(false);
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnGeom.h
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnGeom.h 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/ColumnGeom.h 2007-02-14 17:02:54 UTC (rev 744)
@@ -61,6 +61,9 @@
///
virtual void PostFinalize();
+ virtual FdoStringP GetAddSql();
+
+ virtual bool Add();
};
/// \brief
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Mgr.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Mgr.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Mgr.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -18,6 +18,8 @@
#include "Mgr.h"
#include "Database.h"
#include "TempObject.h"
+#include "SpatialContextGroupReader.h"
+#include "SpatialContextGroupWriter.h"
#include <Rdbms/Override/PostGIS/PostGisOvPhysicalSchemaMapping.h>
#include <Rdbms/Override/PostGIS/PostGisOvStorageEngineType.h>
@@ -101,6 +103,16 @@
return propReader;
}
+FdoPtr<FdoSmPhSpatialContextGroupReader> FdoSmPhPostGisMgr::CreateSpatialContextGroupReader()
+{
+ return( new FdoSmPhPostGisSpatialContextGroupReader(FDO_SAFE_ADDREF(this)) );
+}
+
+FdoSmPhSpatialContextGroupWriterP FdoSmPhPostGisMgr::NewSpatialContextGroupWriter()
+{
+ return (FdoSmPhSpatialContextGroupWriter*)(new FdoSmPhPostGisSpatialContextGroupWriter(FDO_SAFE_ADDREF(this)) );
+}
+
FdoStringP FdoSmPhPostGisMgr::GetOverrideOwner(
FdoRdbmsOvSchemaMappingP mapping)
{
@@ -203,7 +215,7 @@
FdoSmPhColType type)
{
// Default return if 'value' is empty
- FdoStringP sqlString(L"null");
+ FdoStringP sqlString;
if (value.GetLength() > 0)
{
@@ -218,6 +230,12 @@
sqlString = value;
}
}
+ else {
+ if ( type == FdoSmPhColType_String )
+ sqlString = L"cast(null as varchar)";
+ else
+ sqlString = L"null";
+ }
return sqlString;
}
@@ -235,7 +253,7 @@
assert(pos >= 0);
- return FdoStringP::Format(L"%ls$", pos + 1);
+ return FdoStringP::Format(L"$%d", pos + 1);
}
FdoBoolean FdoSmPhPostGisMgr::IsDbObjectNameReserved(FdoStringP objName)
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Mgr.h
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Mgr.h 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Mgr.h 2007-02-14 17:02:54 UTC (rev 744)
@@ -154,29 +154,16 @@
virtual FdoSize ColNameMaxLen();
- //
- // TODO: mloskot - Testing private SC impl.
- //
- //virtual FdoPtr<FdoSmPhSpatialContextWriter> NewSpatialContextWriter()
- //{
- // return NULL;
- //}
- //virtual FdoPtr<FdoSmPhSpatialContextGroupWriter> NewSpatialContextGroupWriter()
- //{
- // return NULL;
- //}
+ virtual FdoPtr<FdoSmPhSpatialContextGroupReader> CreateSpatialContextGroupReader();
- //virtual FdoPtr<FdoSmPhSpatialContextGroupReader> CreateSpatialContextGroupReader()
- //{
- // return NULL;
- //}
-
protected:
/// \todo To be documented.
virtual FdoSmPhDatabaseP CreateDatabase(FdoStringP database);
+ virtual FdoPtr<FdoSmPhSpatialContextGroupWriter> NewSpatialContextGroupWriter();
+
private:
FdoSmPhReaderP mReaderDbObjects;
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Owner.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Owner.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Owner.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -347,10 +347,8 @@
gdbiConn = mgr->GetGdbiConnection();
assert(NULL != gdbiConn);
- assert(!"TODO: DROP SCHEMA");
-
FdoStringP sqlStmt = FdoStringP::Format(
- L"DROP DATABASE IF EXISTS %ls",
+ L"DROP SCHEMA %ls CASCADE",
static_cast<FdoString*>(GetDbName()));
gdbiConn->ExecuteNonQuery(static_cast<const char*>(sqlStmt));
@@ -358,6 +356,27 @@
return true;
}
+void FdoSmPhPostGisOwner::AddMetaSchema( FdoStringsP keywords, bool IsSystem)
+{
+ FdoSmPhGrdMgrP mgr = GetManager()->SmartCast<FdoSmPhGrdMgr>();
+ GdbiConnection* gdbiConn = mgr->GetGdbiConnection();
+ if (IsSystem)
+ mgr->ExecSchemaFile( L"fdosys_sys.sql", keywords );
+ else {
+ mgr->ExecSchemaFile( L"postgis_fdo_sys.sql", keywords );
+ mgr->ExecSchemaFile( L"postgis_fdo_sys_idx.sql", keywords );
+ CreateMetaClass();
+
+ FdoStringP sqlStmt = FdoStringP::Format(
+ L"update f_schemainfo set description = '%ls' where upper(schemaname) = '%ls'",
+ GetDescription(),
+ (FdoString*) FdoStringP(GetName()).Upper()
+ );
+
+ gdbiConn->ExecuteNonQuery( (const char*) sqlStmt );
+ }
+}
+
void FdoSmPhPostGisOwner::SetOptions()
{
bool validOption = false;
@@ -411,9 +430,86 @@
FdoString* FdoSmPhPostGisOwner::GetDbNameClause(bool isEqual)
{
- if (isEqual)
- return L"schemaname = current_schema()";
+
+ if (isEqual)
+ mDbNameClause = FdoStringP::Format( L"schemaname = '%ls'", GetName() );
else
- return L"schemaname != current_schema()";
+ mDbNameClause = FdoStringP::Format( L"schemaname != '%ls'", GetName() );
+
+ return mDbNameClause;
}
+void FdoSmPhPostGisOwner::CreateMetaClass()
+{
+ FdoSmPhPostGisMgrP mgr = GetManager()->SmartCast<FdoSmPhPostGisMgr>();
+ GdbiConnection* gdbiConn = mgr->GetGdbiConnection();
+ FdoStringP sql_stmt;
+
+//BR - TODO - hardcoded classid and owning user.
+
+ sql_stmt = FdoStringP::Format(L"insert into f_classdefinition "
+ L"(classid,classname,schemaname,tablename,classtype,description,isabstract,parentclassname,istablecreator, isfixedtable, hasversion, haslock) "
+ L"values (1,'Class', 'F_MetaClass', ' ', 1, '%ls', 0, 'ClassDefinition', 0, 1, 0, 0)",
+ NlsMsgGet(FDORDBMS_504, "Non-feature metaclass"));
+ gdbiConn->ExecuteNonQuery( (const char*) sql_stmt);
+
+ sql_stmt = FdoStringP::Format(L"insert into f_classdefinition "
+ L"(classid,classname, schemaname, tablename,classtype, description, isabstract, parentclassname, istablecreator, isfixedtable, hasversion, haslock) "
+ L"values (2,'ClassDefinition', 'F_MetaClass', 'f_classdefinition', 1, '%ls', 1, null, 0, 1, 0, 0) ",
+ NlsMsgGet(FDORDBMS_496, "Base for all metaclasses"));
+ gdbiConn->ExecuteNonQuery( (const char*) sql_stmt);
+
+ sql_stmt = FdoStringP::Format(L"insert into f_attributedefinition "
+ L"(tablename, classid, columnname, attributename, columntype, columnsize, columnscale, attributetype, isnullable, "
+ L"isfeatid, issystem, isreadonly, isautogenerated, isrevisionnumber, owner, description, iscolumncreator, isfixedcolumn) "
+ L"values('f_classdefinition', 2, 'classname', 'ClassName', 'CHAR', 30, 0, 'string', 0, 0, 1, 1, 0, 0,"
+ L"'todo', '%ls', 0, 1)",
+ NlsMsgGet(FDORDBMS_497, "FDO base property: object class name"));
+ gdbiConn->ExecuteNonQuery( (const char*) sql_stmt);
+
+ sql_stmt = FdoStringP::Format(L"insert into f_attributedefinition "
+ L"(tablename, classid, columnname, attributename, columntype, columnsize, columnscale, attributetype, isnullable, "
+ L"isfeatid, issystem, isreadonly, isautogenerated, isrevisionnumber, owner, description, iscolumncreator, isfixedcolumn) "
+ L"values('f_classdefinition', 2, 'schemaname', 'SchemaName', 'CHAR', 255, 0, 'string', 1, 0, 1, 1, 0, 0,"
+ L"'todo','%ls', 0, 1)",
+ NlsMsgGet(FDORDBMS_498, "FDO base property: object class schema name"));
+ gdbiConn->ExecuteNonQuery( (const char*) sql_stmt);
+
+ sql_stmt = FdoStringP::Format(L"insert into f_classdefinition "
+ L"(classid,classname,schemaname,tablename,classtype,description,isabstract,parentclassname,istablecreator,isfixedtable,hasversion,haslock) "
+ L"values (3,'Feature','F_MetaClass','f_feature',1,'%ls',0,'ClassDefinition',0,1,0,0)",
+ NlsMsgGet(FDORDBMS_499, "Feature metaclass"));
+ gdbiConn->ExecuteNonQuery( (const char*) sql_stmt);
+
+ sql_stmt = FdoStringP::Format(L"insert into f_attributedefinition "
+ L"(tablename,classid,columnname,attributename,idposition,columntype,columnsize,columnscale,attributetype,"
+ L"isnullable,isfeatid,issystem,isreadonly,isautogenerated,isrevisionnumber,owner,description,iscolumncreator,isfixedcolumn) "
+ L"values ('f_feature',3,'featid','FeatId',1,'BIGINT',0,0,'int64',0,1,1,1,1,0, "
+ L"'todo','%ls',0,1)",
+ NlsMsgGet(FDORDBMS_500, "Feature id number (uniquely identifies a feature)"));
+ gdbiConn->ExecuteNonQuery( (const char*) sql_stmt);
+
+ sql_stmt = FdoStringP::Format(L"insert into f_attributedefinition "
+ L"(tablename,classid,columnname,attributename,idposition,columntype,columnsize,columnscale,attributetype, "
+ L"isnullable,isfeatid,issystem,isreadonly,isautogenerated,isrevisionnumber,owner,description,iscolumncreator,isfixedcolumn) "
+ L"values ('f_feature',3,'classid','ClassId',1,'BIGINT',0,0,'int64',0,0,1,1,1,0, "
+ L"'todo','%ls',0,1)",
+ NlsMsgGet(FDORDBMS_501, "Class id number (uniquely identifies a class)"));
+ gdbiConn->ExecuteNonQuery( (const char*) sql_stmt);
+
+ sql_stmt = FdoStringP::Format(L"insert into f_attributedefinition "
+ L"(tablename,classid,columnname,attributename,columntype,columnsize,columnscale,attributetype, "
+ L"isnullable,isfeatid,issystem,isreadonly,isautogenerated,isrevisionnumber,owner,description,iscolumncreator,isfixedcolumn) "
+ L"values ('f_feature',3,'revisionnumber','RevisionNumber','BIGINT',0,0,'double',0,0,1,1,1,1, "
+ L"'todo','%ls',0,1)",
+ NlsMsgGet(FDORDBMS_502, "Edit count for supporting optimistic locking. This value is incremented everytime the object is updated."));
+ gdbiConn->ExecuteNonQuery( (const char*) sql_stmt);
+
+ sql_stmt = FdoStringP::Format(L"insert into f_attributedefinition "
+ L"(tablename,classid,columnname,attributename,columntype,columnsize,columnscale,attributetype,geometrytype,isnullable, "
+ L"isfeatid,issystem,isreadonly,isautogenerated,isrevisionnumber,owner,description,iscolumncreator,isfixedcolumn) "
+ L"values ('n/a',3,'n/a','Bounds','GEOMETRY',0,0,'4','84224',1,0,1,1,0,0, "
+ L"'todo','%ls', 0, 0)",
+ NlsMsgGet(FDORDBMS_503, "Bounding box for the feature"));
+ gdbiConn->ExecuteNonQuery( (const char*) sql_stmt);
+}
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Owner.h
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Owner.h 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Owner.h 2007-02-14 17:02:54 UTC (rev 744)
@@ -81,6 +81,9 @@
///
FdoStringP GetKeyColumnUsageTable() const;
+ // Create Meta class
+ void CreateMetaClass();
+
/// Get the function name that returns the datastore
/// name from the server.
/// \param
@@ -165,6 +168,9 @@
virtual bool Delete();
+ // Adds the MetaSchema tables and indexes to this owner.
+ void AddMetaSchema( FdoStringsP keywords, bool IsSystem = false );
+
private:
/// Initializes internal state of the owner instance.
@@ -176,7 +182,7 @@
FdoStringP mColumnsTable;
FdoStringP mTableConstraintsTable;
FdoStringP mKeyColumnUsageTable;
-
+ FdoStringP mDbNameClause;
};
/// \brief
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/ColumnReader.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/ColumnReader.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/ColumnReader.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -57,10 +57,22 @@
SetBoolean( L"", L"is_autoincremented", false );
+ FdoStringP GeomColType = GetString(L"", L"geom_type");
+ FdoStringP colType = GetString(L"", L"type_string");
+ if ( GeomColType != L"" )
+ colType = GeomColType;
+
mColType = FdoSmPhPostGisColTypeMapper::String2Type(
- GetString(L"", L"type_string"),
+ colType,
GetLong(L"", L"size"),
GetLong(L"", L"scale"));
+
+ if ( (GeomColType != L"") && (mColType == FdoSmPhColType_Unknown) ) {
+ mColType = FdoSmPhPostGisColTypeMapper::String2Type(
+ L"GEOMETRY",
+ GetLong(L"", L"size"),
+ GetLong(L"", L"scale"));
+ }
}
return gotRow;
@@ -153,18 +165,20 @@
// $1 - name of table
sql = FdoStringP::Format(
- L"SELECT %ls c.table_name, c.column_name AS name, 1 AS type,"
- L"COALESCE(c.character_maximum_length, c.character_octet_length,"
+ L" SELECT %ls c.table_name, c.column_name AS name, 1 AS type,"
+ L" COALESCE(c.character_maximum_length, c.character_octet_length,"
L" c.numeric_precision) AS size,"
- L"c.numeric_scale AS scale ,"
- L"CASE WHEN c.is_nullable = 'YES' THEN 1 ELSE 0 END AS nullable,"
- L"lower(c.data_type) AS type_string,"
- L"0 AS isunsigned,"
- L"0 AS is_autoincremented "
- L"FROM %ls AS c %ls "
- L"WHERE c.table_schema = $1"
+ L" c.numeric_scale AS scale ,"
+ L" CASE WHEN c.is_nullable = 'YES' THEN 1 ELSE 0 END AS nullable,"
+ L" lower(c.data_type) AS type_string,"
+ L" 0 AS isunsigned,"
+ L" 0 AS is_autoincremented, "
+ L" (select type from public.geometry_columns d where c.table_schema = d.f_table_schema and c.table_name = d.f_table_name and c.column_name = d.f_geometry_column) as geom_type,"
+ L" c.ordinal_position as ordinal_position"
+ L" FROM %ls AS c %ls "
+ L" WHERE c.table_schema = $1"
L" %ls "
- L"ORDER BY c.table_name, c.ordinal_position ASC",
+ L" ORDER BY c.table_name, c.ordinal_position ASC",
(join ? L"distinct" : L""),
static_cast<FdoString*>(columnsTableName),
static_cast<FdoString*>(joinFrom),
@@ -186,6 +200,13 @@
field = new FdoSmPhField(row, L"isunsigned",
row->CreateColumnInt64(L"isunsigned", false));
+ field = new FdoSmPhField(row, L"isautoincremented",
+ row->CreateColumnInt64(L"isautoincremented", false));
+
+ field = new FdoSmPhField(row,
+ L"geom_type",
+ row->CreateColumnDbObject(L"geom_type", true));
+
reader = new FdoSmPhRdGrdQueryReader(row, sql, mgr,
MakeBinds(mgr, ownerName, objectName));
}
@@ -203,7 +224,7 @@
FdoSmPhFieldP tblField(fields->GetItem(L"table_schema"));
tblField->SetFieldValue(ownerName);
- if (L"" != objectName)
+ if (objectName != L"")
{
tblField = fields->GetItem(L"table_name");
tblField->SetFieldValue(objectName);
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/ConstraintReader.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/ConstraintReader.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/ConstraintReader.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -68,7 +68,10 @@
{
FdoStringP ownerName(owner->GetName());
+ // BR - TODO
+ return (FdoSmPhReader*) NULL;
+
// template_postgis=# \d information_schema.table_constraints
// View "information_schema.table_constraints"
// Column | Type |
@@ -149,6 +152,9 @@
FdoSmPhRdTableJoinP join,
FdoStringP constraintType)
{
+ // BR - TODO
+ return (FdoSmPhReader*) NULL;
+
FdoSmPhPostGisOwnerP pgOwner(owner->SmartCast<FdoSmPhPostGisOwner>());
// TODO: mloskot - PostgreSQL does support CHECK constraints:
@@ -170,10 +176,10 @@
FdoStringP qualification;
- if (L"" != tableName)
+ if (tableName != L"")
{
// Selecting single object, qualify by this object.
- qualification = L" and tc.table_name collate utf8_bin = $1\n";
+ qualification = L" and tc.table_name = $2\n";
}
else
{
@@ -191,19 +197,19 @@
// $1 = 'public'
FdoStringP sqlString = FdoStringP::Format(
- L"SELECT %ls tc.constraint_name AS constraint_name,"
- L"tc.constraint_type AS constraint_type,"
- L"tc.table_name AS table_name,"
- L"kcu.column_name AS column_name"
- L"FROM %ls AS tc, %ls AS kcu %ls"
- L"WHERE (tc.constraint_schema = kcu.constraint_schema"
- L"AND tc.constraint_name = kcu.constraint_name"
- L"AND tc.table_schema = kcu.table_schema"
- L"AND tc.table_name = kcu.table_name"
- L"AND tc.table_schema = $1"
+ L" SELECT %ls tc.constraint_name AS constraint_name,"
+ L" tc.constraint_type AS constraint_type,"
+ L" tc.table_name AS table_name,"
+ L" kcu.column_name AS column_name"
+ L" FROM %ls AS tc, %ls AS kcu %ls"
+ L" WHERE (tc.constraint_schema = kcu.constraint_schema"
+ L" AND tc.constraint_name = kcu.constraint_name"
+ L" AND tc.table_schema = kcu.table_schema"
+ L" AND tc.table_name = kcu.table_name"
+ L" AND tc.table_schema = $1"
L" %ls\n"
- L"AND tc.constraint_type = 'UNIQUE')"
- L"ORDER BY tc.table_name, tc.constraint_name",
+ L" AND tc.constraint_type = 'UNIQUE')"
+ L" ORDER BY tc.table_name, tc.constraint_name",
(join ? L"distinct" : L""),
static_cast<FdoString*>(pgOwner->GetTableConstraintsTable()),
static_cast<FdoString*>(pgOwner->GetKeyColumnUsageTable()),
@@ -238,7 +244,7 @@
binds->CreateColumnDbObject(L"table_schema", false));
field->SetFieldValue(ownerName);
- if (L"" != tableName)
+ if (tableName != L"")
{
field = new FdoSmPhField(binds, "table_name",
binds->CreateColumnDbObject(L"table_name", false));
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/DbObjectReader.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/DbObjectReader.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/DbObjectReader.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -155,18 +155,18 @@
// TODO: mloskot - Remove unused fields.
sqlString = FdoStringP::Format(
- L"SELECT %ls t.table_name AS name, "
- L"lower(t.table_type) AS type, "
- L"' '::text AS autoincrement_column_name, "
- L"0 AS autoincrement_column_seed, "
- L"' '::text AS storage_engine, "
- L"' '::text AS data_directory, "
- L"' '::text AS index_directory "
- L"FROM %ls AS t %ls "
- L"WHERE t.table_schema = $1 "
- L"%ls"
- L"AND t.table_type IN ('BASE TABLE','VIEW') "
- L"ORDER BY t.table_name ASC ",
+ L" SELECT %ls t.table_name AS name, "
+ L" lower(t.table_type) AS type, "
+ L" ' '::text AS autoincrement_column_name, "
+ L" 0 AS autoincrement_column_seed, "
+ L" ' '::text AS storage_engine, "
+ L" ' '::text AS data_directory, "
+ L" ' '::text AS index_directory "
+ L" FROM %ls AS t %ls "
+ L" WHERE t.table_schema = $1 "
+ L" %ls"
+ L" AND t.table_type IN ('BASE TABLE','VIEW') "
+ L" ORDER BY t.table_name ASC ",
(join ? L"distinct" : L""),
static_cast<FdoString*>(tablesTableName),
static_cast<FdoString*>(joinFrom),
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/FkeyReader.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/FkeyReader.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/FkeyReader.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -48,6 +48,9 @@
const FdoSmPhOwner* owner,
FdoSmPhDbObjectP dbObject)
{
+ //BR TODO:
+ return (FdoSmPhReader*)NULL;
+
// NOTE: mloskot - We need to remove const qualifier first,
// then cast to specialized type.
FdoSmPhPostGisOwner* pgOwner =
@@ -106,15 +109,15 @@
L" kcu.referenced_column_name as r_column_name\n"
L" from %ls tc,\n"
L" %ls kcu\n"
- L" where tc.constraint_schema collate utf8_bin = kcu.constraint_schema\n"
- L" and tc.constraint_name collate utf8_bin = kcu.constraint_name\n"
- L" and tc.constraint_schema collate utf8_bin = ?\n"
+ L" where tc.constraint_schema = kcu.constraint_schema\n"
+ L" and tc.constraint_name = kcu.constraint_name\n"
+ L" and tc.constraint_schema = $1\n"
L" %ls\n"
L" and tc.constraint_type='FOREIGN KEY'\n"
- L" order by tc.table_name collate utf8_bin, tc.constraint_name collate utf8_bin, kcu.ordinal_position",
+ L" order by tc.table_name, tc.constraint_name, kcu.ordinal_position",
(FdoString*) pgOwner->GetTableConstraintsTable(),
(FdoString*) pgOwner->GetKeyColumnUsageTable(),
- dbObject ? L"and tc.table_name collate utf8_bin = ?" : L""
+ dbObject ? L"and tc.table_name = $2" : L""
);
// Create a field object for each field in the select list
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/IndexReader.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/IndexReader.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/IndexReader.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -52,8 +52,10 @@
FdoSmPhDbObjectP dbObject)
{
- assert(!"TODO: No information_schema.statistics table in PostgreSQL!");
+ //BR TODO:
+ return (FdoSmPhReader*)NULL;
+
FdoStringP objectName = (dbObject ? dbObject->GetName() : L"");
FdoStringP ownerName = owner->GetName();
@@ -70,10 +72,10 @@
L"select index_name, table_name, column_name, if(non_unique>0,'NONUNIQUE','UNIQUE') as uniqueness, index_type\n"
L" from INFORMATION_SCHEMA.statistics\n"
L" where\n"
- L" table_schema collate utf8_bin = ?\n"
+ L" table_schema = $1\n"
L" %ls\n"
- L" order by table_name collate utf8_bin, index_name collate utf8_bin, seq_in_index",
- dbObject ? L"and table_name collate utf8_bin = ?" : L""
+ L" order by table_name, index_name, seq_in_index",
+ dbObject ? L"and table_name = $2" : L""
);
// Create a field object for each field in the select list
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/PkeyReader.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/PkeyReader.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Rd/PkeyReader.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -117,17 +117,17 @@
L"select tc.constraint_name as constraint_name,\n"
L" tc.table_name as table_name, kcu.column_name as column_name\n"
L" from %ls tc, %ls kcu\n"
- L" where (tc.constraint_schema collate utf8_bin = kcu.constraint_schema\n"
- L" and tc.constraint_name collate utf8_bin = kcu.constraint_name\n"
- L" and tc.table_schema collate utf8_bin = kcu.table_schema\n"
- L" and tc.table_name collate utf8_bin = kcu.table_name\n"
- L" and tc.table_schema collate utf8_bin = ?\n"
+ L" where (tc.constraint_schema = kcu.constraint_schema\n"
+ L" and tc.constraint_name = kcu.constraint_name\n"
+ L" and tc.table_schema = kcu.table_schema\n"
+ L" and tc.table_name = kcu.table_name\n"
+ L" and tc.table_schema = $1\n"
L" %ls\n"
L" and tc.constraint_type = 'PRIMARY KEY')\n"
- L" order by tc.table_name collate utf8_bin, kcu.ordinal_position",
+ L" order by tc.table_name, kcu.ordinal_position",
(FdoString*) pgOwner->GetTableConstraintsTable(),
(FdoString*) pgOwner->GetKeyColumnUsageTable(),
- dbObject ? L"and tc.table_name collate utf8_bin = ?" : L""
+ dbObject ? L"and tc.table_name = $2" : L""
);
// Create a field object for each field in the select list.
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupReader.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupReader.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupReader.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -16,16 +16,15 @@
//
#include "stdafx.h"
#include "SpatialContextGroupReader.h"
-#include <Sm/Ph/SpatialContextGroupReader.h>
-#include <Sm/Ph/SpatialContextGroupWriter.h>
+#include "SpatialContextGroupWriter.h"
#include <Sm/Ph/Mt/SpatialContextGroupReader.h>
#include <Sm/Ph/Rd/SpatialContextGroupReader.h>
FdoSmPhPostGisSpatialContextGroupReader::FdoSmPhPostGisSpatialContextGroupReader(
FdoSmPhMgrP physicalSchema)
- : FdoSmPhSpatialContextGroupReader(physicalSchema)
+ : FdoSmPhSpatialContextGroupReader()
{
- physicalSchema->ColNameMaxLen();
+ this->SetSubReader( MakeReader(physicalSchema) );
}
FdoSmPhPostGisSpatialContextGroupReader::~FdoSmPhPostGisSpatialContextGroupReader(void)
@@ -39,7 +38,7 @@
// Create the row collection describing class attributes.
FdoSmPhRowsP rows = new FdoSmPhRowCollection();
- FdoSmPhRowP scgRow = FdoSmPhSpatialContextGroupWriter::MakeRow(mgr);
+ FdoSmPhRowP scgRow = FdoSmPhPostGisSpatialContextGroupWriter::MakeRow(mgr);
rows->Add( scgRow );
// TODO: add handling for spatial contexts in configuration files.
@@ -63,15 +62,10 @@
{
// F_SPATIALCONTEXTGROUP does not exist, read from native physical schema.
- // TODO: mloskot - Temporarily disabled
- pSubReader = NULL; // MakeRdReader( rows, mgr );
+ pSubReader = MakeRdReader( rows, mgr );
}
// }
return pSubReader;
}
-FdoSmPhReaderP FdoSmPhPostGisSpatialContextGroupReader::MakeMtReader( FdoSmPhRowsP rows, FdoSmPhMgrP mgr )
-{
- return new FdoSmPhMtSpatialContextGroupReader( rows, mgr );
-}
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupReader.h
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupReader.h 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupReader.h 2007-02-14 17:02:54 UTC (rev 744)
@@ -17,7 +17,7 @@
#ifndef FDOSMPHPOSTGISSPATIALCONTEXTGROUPREADER_H
#define FDOSMPHPOSTGISSPATIALCONTEXTGROUPREADER_H
-#include <Sm/Ph/Reader.h>
+#include <Sm/Ph/SpatialContextGroupReader.h>
/// Retrieves all spatial contexts from current PostGIS datastore.
///
@@ -37,9 +37,6 @@
/// Top level function for creating inner reader
FdoSmPhReaderP MakeReader(FdoSmPhMgrP mgr);
- /// Create inner reader for MetaSchema
- FdoSmPhReaderP MakeMtReader(FdoSmPhRowsP rows, FdoSmPhMgrP mgr);
-
private:
};
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupWriter.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupWriter.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupWriter.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -17,205 +17,23 @@
*/
#include "stdafx.h"
-#include <Sm/Ph/SpatialContextGroupWriter.h>
+#include "SpatialContextGroupWriter.h"
#include <Sm/Ph/Rd/QueryReader.h>
#include <Sm/Ph/CommandWriter.h>
-FdoSmPhSpatialContextGroupWriter::FdoSmPhSpatialContextGroupWriter(FdoSmPhMgrP mgr) :
- FdoSmPhWriter( MakeWriter(mgr) )
+FdoSmPhPostGisSpatialContextGroupWriter::FdoSmPhPostGisSpatialContextGroupWriter(FdoSmPhMgrP mgr) :
+ FdoSmPhGrdSpatialContextGroupWriter()
{
+ this->SetSubWriter( MakeWriter(mgr) );
}
-FdoSmPhSpatialContextGroupWriter::~FdoSmPhSpatialContextGroupWriter(void)
+FdoSmPhPostGisSpatialContextGroupWriter::~FdoSmPhPostGisSpatialContextGroupWriter(void)
{
}
-FdoInt64 FdoSmPhSpatialContextGroupWriter::GetId()
+FdoSmPhRowP FdoSmPhPostGisSpatialContextGroupWriter::MakeRow( FdoSmPhMgrP mgr )
{
- return( (FdoInt64) GetLong(L"", L"scgid") );
-}
-
-FdoStringP FdoSmPhSpatialContextGroupWriter::GetCrsName()
-{
- return(GetString(L"", L"crsname"));
-}
-
-FdoStringP FdoSmPhSpatialContextGroupWriter::GetCrsWkt()
-{
- return(GetString(L"", L"crswkt"));
-}
-
-FdoInt64 FdoSmPhSpatialContextGroupWriter::GetSrid()
-{
- // TODO: get FdoInt64 when underlying support exists.
- return( (FdoInt64) GetLong(L"", L"srid") );
-}
-
-double FdoSmPhSpatialContextGroupWriter::GetXTolerance()
-{
- return( GetDouble(L"", L"xtolerance") );
-}
-
-double FdoSmPhSpatialContextGroupWriter::GetZTolerance()
-{
- return( GetDouble(L"", L"ztolerance") );
-}
-
-double FdoSmPhSpatialContextGroupWriter::GetXMin()
-{
- // TODO: mloskot - xmin is a reserved keyword in PostgreSQL
- return( GetDouble(L"", L"minx") );
-}
-
-double FdoSmPhSpatialContextGroupWriter::GetYMin()
-{
- // TODO: mloskot - ymin is a reserved keyword in PostgreSQL
- return( GetDouble(L"", L"miny") );
-}
-
-double FdoSmPhSpatialContextGroupWriter::GetZMin()
-{
- // TODO: mloskot - zmin is NOT a reserved keyword in PostgreSQL,
- // but renamed for consistency
- return( GetDouble(L"", L"minz") );
-}
-
-double FdoSmPhSpatialContextGroupWriter::GetXMax()
-{
- // TODO: mloskot - xmax is a reserved keyword in PostgreSQL
- return( GetDouble(L"", L"maxx") );
-}
-
-double FdoSmPhSpatialContextGroupWriter::GetYMax()
-{
- // TODO: mloskot - ymax is a reserved keyword in PostgreSQL
- return( GetDouble(L"", L"maxy") );
-}
-
-double FdoSmPhSpatialContextGroupWriter::GetZMax()
-{
- // TODO: mloskot - zmax is NOT a reserved keyword in PostgreSQL,
- // but renamed for consistency
- return( GetDouble(L"", L"maxz") );
-}
-
-FdoStringP FdoSmPhSpatialContextGroupWriter::GetExtentType()
-{
- return(GetString(L"", L"extenttype"));
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetId( FdoInt64 lValue)
-{
- // TODO: pass FdoInt64 when underlying support exists.
- SetLong(L"", L"scgid", (long) lValue);
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetCrsName(FdoStringP sValue)
-{
- SetString(L"", L"crsname", sValue );
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetCrsWkt(FdoStringP sValue)
-{
- SetString(L"", L"crswkt", sValue );
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetSrid(FdoInt64 lValue)
-{
- // TODO: pass FdoInt64 when underlying support exists.
- SetLong(L"", L"srid", (long) lValue);
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetXTolerance(double dValue)
-{
- SetDouble(L"", L"xtolerance", dValue);
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetZTolerance(double dValue)
-{
- SetDouble(L"", L"ztolerance", dValue);
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetXMin(double dValue)
-{
- // TODO: mloskot - xmin is a reserved keyword in PostgreSQL
- SetDouble(L"", L"minx", dValue);
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetYMin(double dValue)
-{
- // TODO: mloskot - ymin is a reserved keyword in PostgreSQL
- SetDouble(L"", L"miny", dValue);
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetZMin(double dValue)
-{
- // TODO: mloskot - zmin is NOT a reserved keyword in PostgreSQL,
- // but renamed for consistency
- SetDouble(L"", L"minz", dValue);
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetXMax(double dValue)
-{
- // TODO: mloskot - xmax is a reserved keyword in PostgreSQL
- SetDouble(L"", L"maxx", dValue);
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetYMax(double dValue)
-{
- // TODO: mloskot - maxy is a reserved keyword in PostgreSQL
- SetDouble(L"", L"maxy", dValue);
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetZMax(double dValue)
-{
- // TODO: mloskot - zmax is NOT a reserved keyword in PostgreSQL,
- // but renamed for consistency
- SetDouble(L"", L"maxz", dValue);
-}
-
-void FdoSmPhSpatialContextGroupWriter::SetExtentType(FdoStringP sValue)
-{
- SetString(L"", L"extenttype", sValue );
-}
-
-void FdoSmPhSpatialContextGroupWriter::Add()
-{
- FdoSmPhWriter::Add();
-}
-
-void FdoSmPhSpatialContextGroupWriter::Modify( FdoInt64 scId )
-{
- FdoSmPhWriter::Modify(
- FdoStringP::Format(
-#ifdef _WIN32
- L"where scgid = %I64d",
-#else
- L"where scgid = %lld",
-#endif
- scId )
- );
-}
-
-void FdoSmPhSpatialContextGroupWriter::Delete( FdoInt64 scId )
-{
- if ( scId >= 0 ) {
- FdoSmPhWriter::Delete(
- FdoStringP::Format(
-#ifdef _WIN32
- L"where scgid = %I64d",
-#else
- L"where scgid = %lld",
-#endif
- scId
- )
- );
- }
-}
-
-FdoSmPhRowP FdoSmPhSpatialContextGroupWriter::MakeRow( FdoSmPhMgrP mgr )
-{
bool hasMs = FdoSmPhOwnerP(mgr->GetOwner())->GetHasMetaSchema();
FdoStringP scgDefTable = mgr->GetDcDbObjectName(L"f_spatialcontextgroup");
@@ -232,20 +50,22 @@
field = new FdoSmPhField( row, L"srid", (FdoSmPhColumn*) NULL, L"" );
field = new FdoSmPhField( row, L"xtolerance", (FdoSmPhColumn*) NULL, L"0.001" );
field = new FdoSmPhField( row, L"ztolerance", (FdoSmPhColumn*) NULL, L"0.001" );
- field = new FdoSmPhField( row, L"minx", (FdoSmPhColumn*) NULL, L"-2000000" );
- field = new FdoSmPhField( row, L"miny", (FdoSmPhColumn*) NULL, L"-2000000" );
- field = new FdoSmPhField( row, L"minz", (FdoSmPhColumn*) NULL, L"-2000000" );
- field = new FdoSmPhField( row, L"maxx", (FdoSmPhColumn*) NULL, L"2000000" );
- field = new FdoSmPhField( row, L"maxy", (FdoSmPhColumn*) NULL, L"2000000" );
- field = new FdoSmPhField( row, L"maxz", (FdoSmPhColumn*) NULL, L"2000000" );
+ field = new FdoSmPhField( row, L"xmin", row->CreateColumnDouble(L"minx",true), L"-2000000" );
+ field = new FdoSmPhField( row, L"ymin", row->CreateColumnDouble(L"miny",true), L"-2000000" );
+ field = new FdoSmPhField( row, L"zmin", row->CreateColumnDouble(L"minz",true), L"-2000000" );
+ field = new FdoSmPhField( row, L"xmax", row->CreateColumnDouble(L"minx",true), L"2000000" );
+ field = new FdoSmPhField( row, L"ymax", row->CreateColumnDouble(L"miny",true), L"2000000" );
+ field = new FdoSmPhField( row, L"zmax", row->CreateColumnDouble(L"minz",true), L"2000000" );
+
field = new FdoSmPhField( row, L"extenttype", (FdoSmPhColumn*) NULL, L"S" );
return( row );
}
-FdoSmPhWriterP FdoSmPhSpatialContextGroupWriter::MakeWriter( FdoSmPhMgrP mgr )
+FdoSmPhWriterP FdoSmPhPostGisSpatialContextGroupWriter::MakeWriter( FdoSmPhMgrP mgr )
{
FdoSmPhCommandWriterP subWriter = mgr->CreateCommandWriter( MakeRow(mgr) );
return subWriter.p->SmartCast<FdoSmPhWriter>();
}
+
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupWriter.h
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupWriter.h 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/SpatialContextGroupWriter.h 2007-02-14 17:02:54 UTC (rev 744)
@@ -1,5 +1,5 @@
-#ifndef FDOSMPHSPATIALCONTEXTGROUPWRITER_H
-#define FDOSMPHSPATIALCONTEXTGROUPWRITER_H 1
+#ifndef FDOSMPHPOSTGISSPATIALCONTEXTGROUPWRITER_H
+#define FDOSMPHPOSTGISSPATIALCONTEXTGROUPWRITER_H 1
/*
* Copyright (C) 2004-2006 Autodesk, Inc.
*
@@ -22,13 +22,13 @@
#pragma once
#endif
-#include <Sm/Ph/Writer.h>
+#include "../../../SchemaMgr/Ph/SpatialContextGroupWriter.h"
#include <Sm/Ph/Mgr.h>
#include <Sm/Ph/Row.h>
// This class writes spatial context group definitions
// to the f_spatialcontextgroup table.
-class FdoSmPhSpatialContextGroupWriter : public FdoSmPhWriter
+class FdoSmPhPostGisSpatialContextGroupWriter : public FdoSmPhGrdSpatialContextGroupWriter
{
public:
@@ -36,77 +36,10 @@
//
/// Parameters:
/// mgr: holds the connection for the datastore to use.
- FdoSmPhSpatialContextGroupWriter(FdoSmPhMgrP mgr);
+ FdoSmPhPostGisSpatialContextGroupWriter(FdoSmPhMgrP mgr);
- ~FdoSmPhSpatialContextGroupWriter(void);
+ ~FdoSmPhPostGisSpatialContextGroupWriter(void);
- /// Various field value getters
-
- /// Spatial Context Group ID - internal to Provider
- FdoInt64 GetId();
-
- /// Coordinate Reference System name
- FdoStringP GetCrsName();
-
- /// Coordinate Reference System definition in OpenGIS WKT format
- FdoStringP GetCrsWkt();
-
- /// Spatial Reference ID (if not zero, must agree with CrsName).
- FdoInt64 GetSrid();
-
- /// Tolerances and extents
- double GetXTolerance();
- double GetZTolerance();
- double GetXMin();
- double GetYMin();
- double GetZMin();
- double GetXMax();
- double GetYMax();
- double GetZMax();
-
- /// Extent Type -- immutable 'S' (static) or updatable 'D' (dynamic)
- FdoStringP GetExtentType();
-
- /// Corresponding setter functions. There's none for scgid
- /// since it is autogenerated when a new spatial context group is written.
-
- /// Coordinate Reference System name
- void SetCrsName(FdoStringP sValue);
-
- /// Coordinate Reference System definition in OpenGIS WKT format
- void SetCrsWkt(FdoStringP sValue);
-
- /// Spatial Reference ID (if not zero, must agree with CrsName).
- void SetSrid(FdoInt64 lValue);
-
- /// Tolerances and extents
- void SetXTolerance(double dValue);
- void SetZTolerance(double dValue);
- void SetXMin(double dValue);
- void SetYMin(double dValue);
- void SetZMin(double dValue);
- void SetXMax(double dValue);
- void SetYMax(double dValue);
- void SetZMax(double dValue);
-
- /// Extent Type -- immutable 'S' (static) or updatable 'D' (dynamic)
- void SetExtentType(FdoStringP sValue);
-
- /// Add the current row as a new spatial context group
- virtual void Add();
-
- /// Modify a spatial context group using the current field values.
- //
- /// Parameters
- /// scId: primary key of the spatial context group to modify
- virtual void Modify( FdoInt64 scgId );
-
- /// Delete a spatial context group using the current field values.
- //
- /// Parameters
- /// scgId: primary key of the spatial context group to delete
- virtual void Delete( FdoInt64 scgId );
-
/// Get a field list for reading from or writing to
/// f_spatialcontextgroup.
//
@@ -116,15 +49,12 @@
protected:
/// Unused constructor needed only to build on Linux
- FdoSmPhSpatialContextGroupWriter() {}
+ FdoSmPhPostGisSpatialContextGroupWriter() {}
-
FdoSmPhWriterP MakeWriter( FdoSmPhMgrP mgr );
-
- void SetId( FdoInt64 lValue);
};
-typedef FdoPtr<FdoSmPhSpatialContextGroupWriter> FdoSmPhSpatialContextGroupWriterP;
+typedef FdoPtr<FdoSmPhPostGisSpatialContextGroupWriter> FdoSmPhPostGisSpatialContextGroupWriterP;
#endif
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Table.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Table.cpp 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Table.cpp 2007-02-14 17:02:54 UTC (rev 744)
@@ -235,3 +235,19 @@
return sqlStmt;
}
+
+// BR - TODO - WORKAROUND - This function can be removed once base GetAddColsSql
+// has been fixed to skip empty column clauses
+FdoStringsP FdoSmPhPostGisTable::GetAddColsSql()
+{
+ FdoStringsP clauses = FdoSmPhGrdTable::GetAddColsSql();
+
+ FdoInt32 idx;
+
+ for ( idx = (clauses->GetCount() - 1); idx >= 0; idx-- ) {
+ if ( *(clauses->GetString(idx)) == 0 )
+ clauses->RemoveAt(idx);
+ }
+
+ return clauses;
+}
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Table.h
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Table.h 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/Ph/Table.h 2007-02-14 17:02:54 UTC (rev 744)
@@ -86,6 +86,8 @@
///
virtual FdoStringP GetDropConstraintSql(FdoStringP name);
+ virtual FdoStringsP GetAddColsSql();
+
private:
/// Destructor is private.
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/PostGISSchemaMgr.vcproj
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/PostGISSchemaMgr.vcproj 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/SchemaMgr/PostGISSchemaMgr.vcproj 2007-02-14 17:02:54 UTC (rev 744)
@@ -40,6 +40,7 @@
/>
<Tool
Name="VCCLCompilerTool"
+ AdditionalOptions="-Zm111"
Optimization="0"
AdditionalIncludeDirectories="$(FDO)\Unmanaged\Inc;$(FDO)\Unmanaged;$(FDOUTILITIES)\SchemaMgr\Inc;..\..\..;..\..\..\Inc;$(FDOUTILITIES)\Common\Inc"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FDORDBMS_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
@@ -330,6 +331,10 @@
>
</File>
<File
+ RelativePath=".\Ph\SpatialContextGroupWriter.cpp"
+ >
+ </File>
+ <File
RelativePath="Ph\Table.cpp"
>
</File>
@@ -531,6 +536,10 @@
>
</File>
<File
+ RelativePath=".\Ph\SpatialContextGroupWriter.h"
+ >
+ </File>
+ <File
RelativePath="Ph\Table.h"
>
</File>
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/sql/postgis_fdo_sys.sql
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/sql/postgis_fdo_sys.sql 2007-02-14 00:39:05 UTC (rev 743)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/PostGIS/sql/postgis_fdo_sys.sql 2007-02-14 17:02:54 UTC (rev 744)
@@ -61,7 +61,7 @@
accessmode varchar(1),
activescid bigint,
opendate timestamp,
- sessionid smallint,
+ sessionid integer,
process varchar(128)
);
COMMENT ON TABLE f_dbopen IS 'TODO';
@@ -91,9 +91,10 @@
#endif
+
/*****************************************************************************/
create table f_classdefinition (
- classid serial not null,
+ classid integer not null,
classname varchar(255) not null,
schemaname varchar(255),
tablename varchar(64) not null,
@@ -115,13 +116,6 @@
);
COMMENT ON TABLE f_classdefinition IS 'Definition of classes from FDO feature schema.';
-/* insert only classes that do not require any data in the F_AttributeDefinition table */
-
-insert into f_classdefinition
-(classname, schemaname, tablename,classtype, description, isabstract, parentclassname, istablecreator, isfixedtable, hasversion, haslock)
-values
-('Class', 'F_MetaClass', ' ', 1, 'Non-feature metaclass', 0, 'ClassDefinition', 0, 1, 0, 0);
-
/*****************************************************************************/
create table f_attributedefinition (
tablename varchar(64) not null,
@@ -151,44 +145,10 @@
);
COMMENT ON TABLE f_attributedefinition IS 'Definition of properties for classes from FDO feature schema.';
-/* Base properties common to all classes */
-insert into f_classdefinition
-(classname, schemaname, tablename,classtype, description, isabstract, parentclassname, istablecreator, isfixedtable, hasversion, haslock)
-values
-('ClassDefinition', 'F_MetaClass', 'f_classdefinition', 1, 'Base for all metaclasses', 1, null, 0, 1, 0, 0);
-
-insert into f_attributedefinition
-(tablename, classid, columnname, attributename, columntype, columnsize, columnscale, attributetype, isnullable,
-isfeatid, issystem, isreadonly, isautogenerated, isrevisionnumber, owner, description, iscolumncreator, isfixedcolumn)
-values
-('f_classdefinition', currval('f_classdefinition_classid_seq'), 'classname', 'ClassName', 'CHAR', 30, 0, 'string', 0, 0, 1, 1, 0, 0,
-current_user, 'FDO base property: object class name', 0, 1);
-
-insert into f_attributedefinition
-(tablename, classid, columnname, attributename, columntype, columnsize, columnscale, attributetype, isnullable,
-isfeatid, issystem, isreadonly, isautogenerated, isrevisionnumber, owner, description, iscolumncreator, isfixedcolumn)
-values
-('f_classdefinition', currval('f_classdefinition_classid_seq'), 'schemaname', 'SchemaName', 'CHAR', 255, 0, 'string', 1, 0, 1, 1, 0, 0,
-current_user, 'FDO base property: object class schema name', 0, 1);
-
-insert into f_attributedefinition
-(tablename, classid, columnname, attributename, idposition, columntype, columnsize, columnscale, attributetype,
-isnullable, isfeatid, issystem, isreadonly, isautogenerated, isrevisionnumber, owner, description, iscolumncreator, isfixedcolumn)
-values
-('f_feature', currval('f_classdefinition_classid_seq'), 'classid', 'ClassId', 1, 'BIGINT', 0, 0, 'int64', 0, 0, 1, 1, 1, 0,
-current_user, 'Class id number (uniquely identifies a class)', 0, 1);
-
-insert into f_attributedefinition
-(tablename, classid, columnname, attributename, columntype, columnsize, columnscale, attributetype, geometrytype, isnullable,
-isfeatid, issystem, isreadonly, isautogenerated, isrevisionnumber, owner, description, iscolumncreator, isfixedcolumn)
-values
-('n/a', currval('f_classdefinition_classid_seq'), 'n/a', 'Bounds', 'GEOMETRY', 0, 0, '4', '84224', 1, 0, 1, 1, 0, 0,
-current_user, 'Bounding box for the feature', 0, 0);
-
/*****************************************************************************/
create table f_spatialcontextgroup (
- scgid serial not null,
+ scgid bigint not null,
crsname varchar(255),
crswkt varchar(2048),
srid bigint,
@@ -213,13 +173,13 @@
COMMENT ON TABLE f_spatialcontextgroup IS 'TODO';
insert into f_spatialcontextgroup
-(crsname, xtolerance, ztolerance, minx, miny, maxx, maxy, extenttype)
+(scgid, crsname, xtolerance, ztolerance, minx, miny, maxx, maxy, extenttype)
values
-('', 0.001, 0.001, -2000000, -2000000, 2000000, 2000000, 'S');
+(1,'', 0.001, 0.001, -2000000, -2000000, 2000000, 2000000, 'S');
/*****************************************************************************/
create table f_spatialcontextgeom (
- scid serial not null,
+ scid bigint not null,
geomtablename varchar(64) not null,
geomcolumnname varchar(64) not null,
dimensionality smallint not null
@@ -262,7 +222,7 @@
/*****************************************************************************/
create table f_spatialcontext (
- scid serial not null,
+ scid bigint not null,
scname varchar(255) not null,
description varchar(255),
scgid bigint null,
@@ -276,9 +236,9 @@
COMMENT ON TABLE f_spatialcontext IS 'Definition of FDO spatial context.';
insert into f_spatialcontext
-(scname, description, scgid)
+(scid,scname, description, scgid)
values
-('Default', 'Default Database Spatial Context', 1);
+(1, 'Default', 'Default Database Spatial Context', 1);
/*****************************************************************************/
create table f_classtype (
@@ -292,6 +252,44 @@
/*****************************************************************************/
+/* create sequences */
+create sequence F_FeatureSeq start with 2;
+create sequence F_LockSeq start with 2;
+create sequence F_PlanSeq start with 2;
+#ifdef FDO_VERSIONS
+create sequence F_VersionSeq start with 1;
+create sequence F_GenerationSeq start with 1;
+#endif
+create sequence F_ClassSeq start with 4;
+create sequence F_PlangroupSeq start with 2;
+create sequence F_UserSeq start with 1;
+
+create table f_sequence(
+ seqid varchar(30) not null,
+ startnum double precision ,
+ CONSTRAINT f_sequence_pk PRIMARY KEY (seqid)
+ );
+
+insert into f_sequence values( 'F_FEATURESEQ',2);
+insert into f_sequence values( 'F_LOCKSEQ',2);
+insert into f_sequence values( 'F_PLANSEQ',2);
+insert into f_sequence values( 'F_VERSIONSEQ',1);
+insert into f_sequence values( 'F_CLASSSEQ',4);
+insert into f_sequence values( 'F_PLANGROUPSEQ',2);
+insert into f_sequence values( 'F_USERSEQ',1);
+insert into f_sequence values( 'F_Seq_1',1);
+insert into f_sequence values( 'F_Seq_2',1);
+insert into f_sequence values( 'F_Seq_3',1);
+insert into f_sequence values( 'F_Seq_4',1);
+insert into f_sequence values( 'F_Seq_5',1);
+insert into f_sequence values( 'F_Seq_6',1);
+insert into f_sequence values( 'F_Seq_7',1);
+insert into f_sequence values( 'F_Seq_8',1);
+insert into f_sequence values( 'F_Seq_9',1);
+insert into f_sequence values( 'F_Seq_10',1);
+insert into f_sequence values( 'F_Seq_11',1);
+insert into f_sequence values( 'F_Seq_12',1);
+
#endif /* PostGIS */
#endif /* VISION_noschema */
More information about the fdo-commits
mailing list