sql server dialect does not encode schema when it is specified
--------------------------------------------------------------

                 Key: GEOT-3265
                 URL: http://jira.codehaus.org/browse/GEOT-3265
             Project: GeoTools
          Issue Type: Bug
          Components: data sqlserver
    Affects Versions: 2.7-M3, 2.6.5
            Reporter: Justin Deoliveira
            Assignee: Justin Deoliveira
             Fix For: 2.6.6, 2.7-M4


Patch from Mike Fowler:
{code}
Index: 
trunk/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/SQLServerDialect.java
===================================================================
--- 
trunk/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/SQLServerDialect.java
    (revision 36182)
+++ 
trunk/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/SQLServerDialect.java
    (working copy)
@@ -153,6 +153,8 @@
         sql.append( ".STSrid");
        
         sql.append( " FROM ");
+        encodeSchemaName(schemaName, sql );
+        sql.append( ".");
         encodeTableName(tableName, sql );
        
         sql.append( " WHERE ");
@@ -278,9 +280,9 @@
             throws SQLException {
        
         StringBuffer sql = new StringBuffer("SELECT");
-        sql.append( " IDENT_CURRENT('").append( tableName ).append("')");
+        sql.append( " IDENT_CURRENT('").append(schemaName).append(".").append( 
tableName ).append("')");
         sql.append( " + ");
-        sql.append( " IDENT_INCR('").append( tableName ).append("')");
+        sql.append( " IDENT_INCR('").append(schemaName).append(".").append( 
tableName ).append("')");
        
         dataStore.getLogger().fine( sql.toString() );
{code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to