[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fdo-commits
Subject:    [fdo-commits] r6765 - in trunk/Providers/GenericRdbms/Src: ODBCDriver UnitTest/Odbc
From:       svn_fdo () osgeo ! org
Date:       2013-01-30 14:50:19
Message-ID: 20130130145019.8BA4C390602 () trac ! osgeo ! org
[Download RAW message or body]

Author: brentrobinson
Date: 2013-01-30 06:50:19 -0800 (Wed, 30 Jan 2013)
New Revision: 6765

Modified:
   trunk/Providers/GenericRdbms/Src/ODBCDriver/pkeys_.c
   trunk/Providers/GenericRdbms/Src/UnitTest/Odbc/OdbcBaseSetup.cpp
   trunk/Providers/GenericRdbms/Src/UnitTest/Odbc/OdbcFdoSelectTest.cpp
Log:
Ticket#841: Removed fallback, to set identity to not null properties, for all data \
sources in addition to Teradata.

Modified: trunk/Providers/GenericRdbms/Src/ODBCDriver/pkeys_.c
===================================================================
--- trunk/Providers/GenericRdbms/Src/ODBCDriver/pkeys_.c	2013-01-30 14:41:42 UTC (rev \
                6764)
+++ trunk/Providers/GenericRdbms/Src/ODBCDriver/pkeys_.c	2013-01-30 14:50:19 UTC (rev \
6765) @@ -512,53 +512,6 @@
         ODBCDR_RDBI_ERR( odbcdr_col_deac(context) );
     }
 
-    /*********************************************************************************
                
-     * Approach #5: Find all non-nullable columns and use them as the identity \
                property.
-	 *
-	 * Do not use this approach for Teradata sources since it pick a wrong key for \
                views.
-     *********************************************************************************/
                
-
-    if ((!bFoundIdentityProperties) && !(ODBCDriverType_Teradata == \
                connData->driver_type ))
-    {
-	    int  length;
-	    int  scale;
-	    int  nullable;
-        int  is_autoincrement;
-	    int  position;
-	    int  eof = FALSE;
-
-        ODBCDR_RDBI_ERR( local_odbcdr_col_act( context, owner, object, &dbaselink ) \
                );
-
-        while (!eof && rdbi_status == RDBI_SUCCESS)
-        {
-            rdbi_status = local_odbcdr_col_get(
-                context,
-	            &szColumnName,
-	            &szTypeName,
-	            &length,
-	            &scale,
-	            &nullable,
-                &is_autoincrement,
-	            &position,
-	            &eof
-	            );
-
-            if (!eof && rdbi_status == RDBI_SUCCESS && !nullable)
-            {
-                odbcdr_NameListEntry_pkey_def newNle;
-                ODBCDRV_STRING_COPY_RST(newNle.name, &szColumnName);
-                if (NULL == ut_da_append( &context->odbcdr_nameList_pkeys, 1L, (void \
                *) &newNle ))
-                {
-                    rdbi_status = RDBI_MALLOC_FAILED;
-                    goto the_exit;
-                }
-                bFoundIdentityProperties = true;
-            }
-        }
-
-        ODBCDR_RDBI_ERR( odbcdr_col_deac(context) );
-    }
-
     /*********************************************************************************/
  
 	context->odbcdr_nameListNextPosition_pkeys = 0;

Modified: trunk/Providers/GenericRdbms/Src/UnitTest/Odbc/OdbcBaseSetup.cpp
===================================================================
--- trunk/Providers/GenericRdbms/Src/UnitTest/Odbc/OdbcBaseSetup.cpp	2013-01-30 \
                14:41:42 UTC (rev 6764)
+++ trunk/Providers/GenericRdbms/Src/UnitTest/Odbc/OdbcBaseSetup.cpp	2013-01-30 \
14:50:19 UTC (rev 6765) @@ -289,7 +289,8 @@
 	L"cityid int NOT NULL,",
 	L"name varchar(50) NULL,",
 	L"city varchar(50) NULL,",
-	L"cdate datetime NULL",
+	L"cdate datetime NULL,",
+    L"primary key (cityid)",
 	L");",
     L"",
 	L"insert into cities ",
@@ -306,7 +307,8 @@
 	L"featid1 int NOT NULL,",
 	L"name varchar(50) NULL,",
 	L"x real NULL,",
-	L"y real NULL",
+	L"y real NULL,",
+    L"primary key (featid1)",
 	L");",
     L"",
 	L"insert into table1 ",
@@ -326,15 +328,17 @@
 	L"name1 varchar(50) NULL,",
 	L"x real NULL,",
 	L"y numeric(11,3) NULL,",
-	L"z float NULL",
-	L");",
+	L"z float NULL,",
+    L"primary key (featid1)",
+    L");",
     L"",
 	L"create table table7 (",
 	L"featid1 int NOT NULL,",
 	L"name1 varchar(50) NULL,",
 	L"x tinyint NULL,",
 	L"y smallint NULL,",
-	L"z int NULL",
+	L"z int NULL,",
+    L"primary key (featid1)",
 	L");",
     L"",
 	L"create table table8 (",
@@ -342,7 +346,8 @@
 	L"name1 varchar(50) NULL,",
 	L"x bigint NULL,",
 	L"y float NULL,",
-	L"z decimal(16,6)  NULL",
+	L"z decimal(16,6)  NULL,",
+    L"primary key (featid1)",
 	L");",
     L"",
     L"create schema Fdo;",
@@ -430,7 +435,8 @@
 	L"name1 varchar(50) NULL,",
 	L"x float NULL,",
 	L"y decimal(11,3) NULL,",
-	L"z double NULL",
+	L"z double NULL,",
+    L"primary key (featid1)",
 	L");",
     L"",
 	L"create table table7 (",
@@ -438,7 +444,8 @@
 	L"name1 varchar(50) NULL,",
 	L"x tinyint NULL,",
 	L"y smallint NULL,",
-	L"z int NULL",
+	L"z int NULL,",
+    L"primary key (featid1)",
 	L");",
     L"",
 	L"create table table8 (",
@@ -446,7 +453,8 @@
 	L"name1 varchar(50) NULL,",
 	L"x bigint NULL,",
 	L"y double NULL,",
-	L"z decimal(16,6)  NULL",
+	L"z decimal(16,6)  NULL,",
+    L"primary key (featid1)",
 	L");",
     L"",
     NULL

Modified: trunk/Providers/GenericRdbms/Src/UnitTest/Odbc/OdbcFdoSelectTest.cpp
===================================================================
--- trunk/Providers/GenericRdbms/Src/UnitTest/Odbc/OdbcFdoSelectTest.cpp	2013-01-30 \
                14:41:42 UTC (rev 6764)
+++ trunk/Providers/GenericRdbms/Src/UnitTest/Odbc/OdbcFdoSelectTest.cpp	2013-01-30 \
14:50:19 UTC (rev 6765) @@ -278,10 +278,11 @@
                 {
                     FdoPtr<FdoDataPropertyDefinition> idPropDef = \
                idPropDefs->GetItem(i);
                     printf("    Found identity property '%ls'.\n", \
idPropDef->GetName()); +                    // Shouldn't get here anymore. 
                     CPPUNIT_ASSERT_MESSAGE("Expected identity property named \
featid1", 0==wcscmp(L"featid1", idPropDef->GetName()));  }
                 printf("  Found total %d identity properties.\n", numIdProps);
-                CPPUNIT_ASSERT_MESSAGE("Expected 1 identity property", \
1==numIdProps); +                CPPUNIT_ASSERT_MESSAGE("Expected 0 identity \
properties", 0==numIdProps);  }
 
             // read through all the features
@@ -329,10 +330,11 @@
                 {
                     FdoPtr<FdoDataPropertyDefinition> idPropDef = \
                idPropDefs->GetItem(i);
                     printf("    Found identity property '%ls'.\n", \
idPropDef->GetName()); +                    // Shouldn't get here any more 
                     CPPUNIT_ASSERT_MESSAGE("Expected identity property named \
featid1", 0==wcscmp(L"featid1", idPropDef->GetName()));  }
                 printf("  Found total %d identity properties.\n", numIdProps);
-                CPPUNIT_ASSERT_MESSAGE("Expected 1 identity property", \
1==numIdProps); +                CPPUNIT_ASSERT_MESSAGE("Expected 0 identity \
property", 0==numIdProps);  }
 
             // read through all the features

_______________________________________________
fdo-commits mailing list
fdo-commits@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic