waitForIndexes();
session.save();
waitForIndexes();
// Issues some queries that should use this index ...
Query query = jcrSql2Query("SELECT * FROM [notion:typed] WHERE [notion:longProperty] = 1234");
validateQuery().rowCount(1L).validate(query, query.execute());
query = jcrSql2Query("SELECT * FROM [notion:typed] WHERE [notion:longProperty] <= 1234");
validateQuery().rowCount(2L).validate(query, query.execute());
query = jcrSql2Query("SELECT * FROM [notion:typed] WHERE [notion:longProperty] < 1234");
validateQuery().rowCount(1L).validate(query, query.execute());
query = jcrSql2Query("SELECT * FROM [notion:typed] WHERE [notion:longProperty] > 0");
validateQuery().rowCount(2L).validate(query, query.execute());
query = jcrSql2Query("SELECT * FROM [notion:typed] WHERE [notion:longProperty] BETWEEN 1234 AND 5678");
validateQuery().rowCount(2L).validate(query, query.execute());
query = jcrSql2Query("SELECT * FROM [notion:typed] WHERE [notion:longProperty] BETWEEN 1234 EXCLUSIVE AND 5678");
validateQuery().rowCount(1L).validate(query, query.execute());
query = jcrSql2Query("SELECT * FROM [notion:typed] WHERE [notion:longProperty] NOT BETWEEN 1234 EXCLUSIVE AND 5678");
validateQuery().rowCount(2L).validate(query, query.execute());
query = jcrSql2Query("SELECT * FROM [notion:typed] WHERE [notion:longProperty] <= -1");
validateQuery().rowCount(1L).validate(query, query.execute());
query = jcrSql2Query("SELECT * FROM [notion:typed] WHERE [notion:longProperty] <= CAST('-1' AS LONG)");
validateQuery().rowCount(1L).validate(query, query.execute());
query = jcrSql2Query("SELECT * FROM [notion:typed] WHERE [notion:longProperty] < -1");
validateQuery().rowCount(0L).validate(query, query.execute());
// Issue a query that does not use this index ...
query = jcrSql2Query("SELECT * FROM [nt:unstructured] WHERE [notion:longProperty] > 10");
validateQuery().rowCount(2L).validate(query, query.execute());
}