diff --git a/community/consistency-check/src/main/java/org/neo4j/consistency/checking/full/PropertyAndNodeIndexedCheck.java b/community/consistency-check/src/main/java/org/neo4j/consistency/checking/full/PropertyAndNodeIndexedCheck.java index cabc900227b5e..325e1c4eed49d 100644 --- a/community/consistency-check/src/main/java/org/neo4j/consistency/checking/full/PropertyAndNodeIndexedCheck.java +++ b/community/consistency-check/src/main/java/org/neo4j/consistency/checking/full/PropertyAndNodeIndexedCheck.java @@ -238,15 +238,15 @@ private PrimitiveLongIterator queryIndexOrEmpty( IndexReader reader, IndexQuery[ catch ( IndexNotApplicableKernelException e ) { throw new RuntimeException( format( - "Cannot continue %s, as index provider does not support exact composite query: %s", - this.getClass().getSimpleName(), Arrays.toString( query ) ), e ); + "Consistency checking error: index provider does not support exact query %s", + Arrays.toString( query ) ), e ); } indexedNodeIds = LookupFilter.exactIndexMatches( propertyReader, indexedNodeIds, query ); return indexedNodeIds; } - public static boolean nodeHasSchemaProperties( + private static boolean nodeHasSchemaProperties( PrimitiveIntObjectMap nodePropertyMap, int[] indexPropertyIds ) { for ( int indexPropertyId : indexPropertyIds ) diff --git a/community/consistency-check/src/main/java/org/neo4j/consistency/report/ConsistencyReport.java b/community/consistency-check/src/main/java/org/neo4j/consistency/report/ConsistencyReport.java index eae19d23bcf2c..b6501ad2ef09b 100644 --- a/community/consistency-check/src/main/java/org/neo4j/consistency/report/ConsistencyReport.java +++ b/community/consistency-check/src/main/java/org/neo4j/consistency/report/ConsistencyReport.java @@ -189,7 +189,7 @@ interface NodeConsistencyReport extends PrimitiveConsistencyReport @Documented( "This node was found in the expected index, although multiple times" ) void indexedMultipleTimes( IndexRule index, Object[] propertyValues, long count ); - @Documented( "There is another node in the unique index with the same property values." ) + @Documented( "There is another node in the unique index with the same property value(s)." ) void uniqueIndexNotUnique( IndexRule index, Object[] propertyValues, long duplicateNodeId ); @Documented( "The referenced relationship group record is not in use." ) diff --git a/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/FullCheckIntegrationTest.java b/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/FullCheckIntegrationTest.java index 28363aec19578..ec154edaeb2a0 100644 --- a/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/FullCheckIntegrationTest.java +++ b/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/FullCheckIntegrationTest.java @@ -1084,38 +1084,6 @@ protected void transactionData( GraphStoreFixture.TransactionDataBuilder tx, .andThatsAllFolks(); } - public static Collection serializeRule( SchemaRule rule, DynamicRecord... records ) - { - return serializeRule( rule, asList( records ) ); - } - - public static Collection serializeRule( SchemaRule rule, Collection records ) - { - byte[] data = rule.serialize(); - DynamicRecordAllocator dynamicRecordAllocator = - new ReusableRecordsCompositeAllocator( records, schemaAllocator ); - Collection result = new ArrayList<>(); - AbstractDynamicStore.allocateRecordsFromBytes( result, data, dynamicRecordAllocator ); - return result; - } - - private static DynamicRecordAllocator schemaAllocator = new DynamicRecordAllocator() - { - private int next = 10000; // we start high to not conflict with real ids - - @Override - public int getRecordDataSize() - { - return SchemaStore.BLOCK_SIZE; - } - - @Override - public DynamicRecord nextRecord() - { - return new DynamicRecord( next++ ); - } - }; - @Test public void shouldReportArrayPropertyInconsistencies() throws Exception { @@ -1542,14 +1510,14 @@ protected void transactionData( GraphStoreFixture.TransactionDataBuilder tx, .andThatsAllFolks(); } - protected RelationshipRecord withNext( RelationshipRecord relationship, long next ) + private RelationshipRecord withNext( RelationshipRecord relationship, long next ) { relationship.setFirstNextRel( next ); relationship.setSecondNextRel( next ); return relationship; } - protected RelationshipRecord withPrev( RelationshipRecord relationship, long prev ) + private RelationshipRecord withPrev( RelationshipRecord relationship, long prev ) { relationship.setFirstInFirstChain( false ); relationship.setFirstInSecondChain( false ); @@ -2317,4 +2285,31 @@ public void andThatsAllFolks() assertEquals( "Total number of inconsistencies: " + stats, total, stats.getTotalInconsistencyCount() ); } } + + private static Collection serializeRule( SchemaRule rule, DynamicRecord... records ) + { + byte[] data = rule.serialize(); + DynamicRecordAllocator dynamicRecordAllocator = + new ReusableRecordsCompositeAllocator( asList( records ), schemaAllocator ); + Collection result = new ArrayList<>(); + AbstractDynamicStore.allocateRecordsFromBytes( result, data, dynamicRecordAllocator ); + return result; + } + + private static DynamicRecordAllocator schemaAllocator = new DynamicRecordAllocator() + { + private int next = 10000; // we start high to not conflict with real ids + + @Override + public int getRecordDataSize() + { + return SchemaStore.BLOCK_SIZE; + } + + @Override + public DynamicRecord nextRecord() + { + return new DynamicRecord( next++ ); + } + }; } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/LookupFilter.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/LookupFilter.java index e9022b422949e..e0e4c0496f3b1 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/LookupFilter.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/LookupFilter.java @@ -68,8 +68,8 @@ public static PrimitiveLongIterator exactIndexMatches( PropertyAccessor accessor for ( IndexQuery predicate : numericPredicates ) { int propertyKeyId = predicate.propertyKeyId(); - Property property = accessor.getProperty( nodeId, propertyKeyId ); - if ( property.isDefined() && !predicate.test( ((DefinedProperty)property).value() ) ) + Object value = accessor.getProperty( nodeId, propertyKeyId ).value( null ); + if ( !predicate.test( value ) ) { return false; }