db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1624507 - in /db/derby/code/trunk/java: optional/org/apache/derby/optional/lucene/LuceneSupport.java testing/org/apache/derbyTesting/functionTests/tests/lang/LuceneSupportPermsTest.java
Date Fri, 12 Sep 2014 12:00:05 GMT
Author: rhillegas
Date: Fri Sep 12 12:00:04 2014
New Revision: 1624507

URL: http://svn.apache.org/r1624507
Log:
DERBY-6730: Allow spaces in the names of key names used by Lucene indexes; commit derby-6730-02-ab-spacesInKeyName.diff.

Modified:
    db/derby/code/trunk/java/optional/org/apache/derby/optional/lucene/LuceneSupport.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LuceneSupportPermsTest.java

Modified: db/derby/code/trunk/java/optional/org/apache/derby/optional/lucene/LuceneSupport.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/optional/org/apache/derby/optional/lucene/LuceneSupport.java?rev=1624507&r1=1624506&r2=1624507&view=diff
==============================================================================
--- db/derby/code/trunk/java/optional/org/apache/derby/optional/lucene/LuceneSupport.java
(original)
+++ db/derby/code/trunk/java/optional/org/apache/derby/optional/lucene/LuceneSupport.java
Fri Sep 12 12:00:04 2014
@@ -462,7 +462,7 @@ public class LuceneSupport implements Op
         }
 
         // don't let the user create a table function with duplicate column names
-        vetColumnName( textcol );
+        vetColumnName( derbyIdentifier( textcol ) );
         for ( VTITemplate.ColumnDescriptor key : primaryKeys )
         {
             vetColumnName(  key.columnName );
@@ -1090,7 +1090,7 @@ public class LuceneSupport implements Op
     private static  void    vetColumnName( String columnName )
         throws SQLException
     {
-        String  derbyColumnName = derbyIdentifier( columnName );
+        String  derbyColumnName = columnName;
 
         if (
             DOCUMENT_ID.equals( derbyColumnName ) ||

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LuceneSupportPermsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LuceneSupportPermsTest.java?rev=1624507&r1=1624506&r2=1624507&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LuceneSupportPermsTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LuceneSupportPermsTest.java
Fri Sep 12 12:00:04 2014
@@ -1256,6 +1256,16 @@ public class LuceneSupportPermsTest exte
              ruthConnection,
              "create view v_6730_4 ( \"poemID\", \"poemText\" ) as select poemID, poemText
from ruth.poems"
              );
+        goodStatement
+            (
+             ruthConnection,
+             "create view v_6730_5 ( poemID, \"c l o b\" ) as select poemID, poemText from
ruth.poems"
+             );
+        goodStatement
+            (
+             ruthConnection,
+             "create view v_6730_6 ( \"k e y\", poemText ) as select poemID, poemText from
ruth.poems"
+             );
 
         goodStatement( dboConnection, LOAD_TOOL );
 
@@ -1308,6 +1318,30 @@ public class LuceneSupportPermsTest exte
              "  '\"poemID\"'\n" +
              ")\n"
              );
+        goodStatement
+            (
+             ruthConnection,
+             "call luceneSupport.createIndex\n" +
+             "(\n" +
+             "  'ruth',\n" +
+             "  'v_6730_5',\n" +
+             "  '\"c l o b\"',\n" +
+             "  null,\n" +
+             "  'poemID'\n" +
+             ")\n"
+             );
+        goodStatement
+            (
+             ruthConnection,
+             "call luceneSupport.createIndex\n" +
+             "(\n" +
+             "  'ruth',\n" +
+             "  'v_6730_6',\n" +
+             "  'poemText',\n" +
+             "  null,\n" +
+             "  '\"k e y\"'\n" +
+             ")\n"
+             );
 
         // Verify the expected casing of identifiers
         vet6730( ruthConnection );
@@ -1357,13 +1391,39 @@ public class LuceneSupportPermsTest exte
              "  null\n" +
              ")\n"
              );
+        goodStatement
+            (
+             ruthConnection,
+             "call luceneSupport.updateIndex\n" +
+             "(\n" +
+             "  'ruth',\n" +
+             "  'v_6730_5',\n" +
+             "  '\"c l o b\"',\n" +
+             "  null\n" +
+             ")\n"
+             );
+        goodStatement
+            (
+             ruthConnection,
+             "call luceneSupport.updateIndex\n" +
+             "(\n" +
+             "  'ruth',\n" +
+             "  'v_6730_6',\n" +
+             "  'poemText',\n" +
+             "  null\n" +
+             ")\n"
+             );
         vet6730( ruthConnection );
 
         goodStatement( ruthConnection, "call LuceneSupport.dropIndex( 'ruth', 'v_6730_1',
'poemText' )" );
         goodStatement( ruthConnection, "call LuceneSupport.dropIndex( 'ruth', 'v_6730_2',
'\"poemText\"' )" );
         goodStatement( ruthConnection, "call LuceneSupport.dropIndex( 'ruth', 'v_6730_3',
'poemText' )" );
         goodStatement( ruthConnection, "call LuceneSupport.dropIndex( 'ruth', 'v_6730_4',
'\"poemText\"' )" );
+        goodStatement( ruthConnection, "call LuceneSupport.dropIndex( 'ruth', 'v_6730_5',
'\"c l o b\"' )" );
+        goodStatement( ruthConnection, "call LuceneSupport.dropIndex( 'ruth', 'v_6730_6',
'poemText' )" );
         goodStatement( dboConnection, UNLOAD_TOOL );
+        goodStatement( ruthConnection, "drop view v_6730_6" );
+        goodStatement( ruthConnection, "drop view v_6730_5" );
         goodStatement( ruthConnection, "drop view v_6730_4" );
         goodStatement( ruthConnection, "drop view v_6730_3" );
         goodStatement( ruthConnection, "drop view v_6730_2" );
@@ -1415,6 +1475,24 @@ public class LuceneSupportPermsTest exte
              expectedResults,
              false
              );
+        assertResults
+            (
+             conn,
+             "select i.poemID, i.score\n" +
+             "from table ( ruth.\"V_6730_5__c l o b\"( 'star', 1000, null ) ) i\n" +
+             "order by i.score desc\n",
+            expectedResults,
+             false
+             );
+        assertResults
+            (
+             conn,
+             "select i.\"k e y\", i.score\n" +
+             "from table ( ruth.v_6730_6__poemText( 'star', 1000, null ) ) i\n" +
+             "order by i.score desc\n",
+             expectedResults,
+             false
+             );
         
         String[][]  expectedListResults = new String[][]
         {
@@ -1422,6 +1500,8 @@ public class LuceneSupportPermsTest exte
             { "RUTH", "V_6730_2", "poemText", "org.apache.lucene.analysis.en.EnglishAnalyzer"
},
             { "RUTH", "V_6730_3", "POEMTEXT", "org.apache.lucene.analysis.en.EnglishAnalyzer"
},
             { "RUTH", "V_6730_4", "poemText", "org.apache.lucene.analysis.en.EnglishAnalyzer"
},
+            { "RUTH", "V_6730_5", "c l o b", "org.apache.lucene.analysis.en.EnglishAnalyzer"
},
+            { "RUTH", "V_6730_6", "POEMTEXT", "org.apache.lucene.analysis.en.EnglishAnalyzer"
},
         };
         assertResults
             (



Mime
View raw message