jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r482130 - /jackrabbit/trunk/jackrabbit-core/src/main/javacc/sql/JCRSQL.jjt
Date Mon, 04 Dec 2006 11:00:44 GMT
Author: mreutegg
Date: Mon Dec  4 03:00:44 2006
New Revision: 482130

URL: http://svn.apache.org/viewvc?view=rev&rev=482130
Log:
JCR-660: SQL Parser fails with SQL 92 timestamp format

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/javacc/sql/JCRSQL.jjt

Modified: jackrabbit/trunk/jackrabbit-core/src/main/javacc/sql/JCRSQL.jjt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/javacc/sql/JCRSQL.jjt?view=diff&rev=482130&r1=482129&r2=482130
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/javacc/sql/JCRSQL.jjt (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/javacc/sql/JCRSQL.jjt Mon Dec  4 03:00:44 2006
@@ -517,6 +517,13 @@
     {
       if (t.image.startsWith("TIMESTAMP")) {
         jjtThis.setValue(t.image.substring(t.image.indexOf('\'') + 1, t.image.length() -
1));
+        if (jjtThis.getValue().indexOf(" ") == 10) {
+          // replace SQL 92 timesamp string with ISO8601
+          StringBuffer tmp = new StringBuffer();
+          tmp.append(jjtThis.getValue().substring(0, 10));
+          tmp.append("T").append(jjtThis.getValue().substring(11));
+          jjtThis.setValue(tmp.toString());
+        }
         jjtThis.setType(QueryConstants.TYPE_TIMESTAMP);
       /*
       } else if (t.image.startsWith("TIME")) {



Mime
View raw message