svn commit: r1759155 - /ofbiz/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1759155 - /ofbiz/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java

shijh
Author: shijh
Date: Sun Sep  4 08:57:44 2016
New Revision: 1759155

URL: http://svn.apache.org/viewvc?rev=1759155&view=rev
Log:
OFBIZ-8137 Entityname starts with schema name causes error in PostgreSQL

Modified:
    ofbiz/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java

Modified: ofbiz/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java?rev=1759155&r1=1759154&r2=1759155&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java (original)
+++ ofbiz/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java Sun Sep  4 08:57:44 2016
@@ -1001,7 +1001,7 @@ public class DatabaseUtil {
                     String tableName = tableSet.getString("TABLE_NAME");
                     // for those databases which do not return the schema name with the table name (pgsql 7.3)
                     boolean appendSchemaName = false;
-                    if (tableName != null && lookupSchemaName != null && !tableName.startsWith(lookupSchemaName)) {
+                    if (tableName != null && lookupSchemaName != null && !tableName.startsWith(lookupSchemaName + "\\.")) {
                         appendSchemaName = true;
                     }
                     if (needsUpperCase && tableName != null) {
@@ -3042,7 +3042,7 @@ public class DatabaseUtil {
             String tableName = rawTableName;
             // for those databases which do not return the schema name with the table name (pgsql 7.3)
             boolean appendSchemaName = false;
-            if (tableName != null && lookupSchemaName != null && !tableName.startsWith(lookupSchemaName)) {
+            if (tableName != null && lookupSchemaName != null && !tableName.startsWith(lookupSchemaName + "\\.")) {
                 appendSchemaName = true;
             }
             if (needsUpperCase && tableName != null) {