db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r997976 - /db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLTransformer.java
Date Fri, 17 Sep 2010 04:21:47 GMT
Author: tfischer
Date: Fri Sep 17 04:21:47 2010
New Revision: 997976

URL: http://svn.apache.org/viewvc?rev=997976&view=rev
Log:
properly SQL-escape default values in SQL scripts

Modified:
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLTransformer.java

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLTransformer.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLTransformer.java?rev=997976&r1=997975&r2=997976&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLTransformer.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLTransformer.java
Fri Sep 17 04:21:47 2010
@@ -280,13 +280,8 @@ public class SQLTransformer implements S
 
             if (TypeMap.isTextType(schemaType))
             {
-                // TODO: Properly SQL-escape the text.
-                resultList.add(
-                        new StringBuffer()
-                        .append('\'')
-                        .append(sqlType.getDefaultValue())
-                        .append('\'')
-                        .toString());
+                resultList.add(platform.quoteAndEscape(
+                        sqlType.getDefaultValue()));
             }
             else
             {



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message