Skip to content

Commit 7c4b448

Browse files
authored
Merge branch 'main' into udo
2 parents 04960e2 + 805e469 commit 7c4b448

File tree

35 files changed

+380
-114
lines changed

35 files changed

+380
-114
lines changed

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

actions/gradle-test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ runs:
3131
- name: Copy Test Reports
3232
shell: bash
3333
if: always()
34-
run: mkdir -p test-reports && for d in fdb-java-annotations fdb-extensions fdb-record-layer-core fdb-record-layer-icu fdb-record-layer-spatial fdb-record-layer-lucene fdb-record-layer-jmh examples fdb-relational-api fdb-relational-core fdb-relational-cli fdb-relational-grpc fdb-relational-jdbc fdb-relational-server yaml-tests; do ln -s ../$d/.out/reports test-reports/$d; done
34+
run: mkdir -p test-reports && for d in fdb-java-annotations fdb-extensions fdb-test-utils fdb-record-layer-core fdb-record-layer-icu fdb-record-layer-spatial fdb-record-layer-lucene fdb-record-layer-jmh examples fdb-relational-api fdb-relational-core fdb-relational-cli fdb-relational-grpc fdb-relational-jdbc fdb-relational-server yaml-tests; do ln -s ../$d/.out/reports test-reports/$d; done

fdb-extensions/fdb-extensions.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ dependencies {
3030
implementation(libs.slf4j.api)
3131
compileOnly(libs.jsr305)
3232

33+
testImplementation project(':fdb-test-utils')
3334
testImplementation(libs.bundles.test.impl)
3435
testRuntimeOnly(libs.bundles.test.runtime)
3536
testCompileOnly(libs.bundles.test.compileOnly)

fdb-record-layer-core/fdb-record-layer-core.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dependencies {
3535
compileOnly(libs.autoService)
3636
annotationProcessor(libs.autoService)
3737

38-
testImplementation testFixtures(project(':fdb-extensions'))
38+
testImplementation project(':fdb-test-utils')
3939
testImplementation(libs.bundles.test.impl)
4040
testRuntimeOnly(libs.bundles.test.runtime)
4141
testCompileOnly(libs.bundles.test.compileOnly)

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/InOpValue.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ public Optional<QueryPredicate> toQueryPredicate(@Nullable final TypeRepository
120120
return compileTimeEvalMaybe(typeRepository);
121121
}
122122

123-
final var isLiteralList = inArrayValue.getCorrelatedTo().isEmpty();
124-
SemanticException.check(isLiteralList, SemanticException.ErrorCode.UNSUPPORTED);
125-
126123
if (typeRepository != null) {
127124
final var literalValue = Preconditions.checkNotNull(inArrayValue.evalWithoutStore(EvaluationContext.forTypeRepository(typeRepository)));
128125
return Optional.of(new ValuePredicate(probeValue, new Comparisons.ListComparison(Comparisons.Type.IN, (List<?>)literalValue)));
@@ -221,26 +218,31 @@ private static Value encapsulateInternal(@Nonnull final List<? extends Typed> ar
221218

222219
final Typed arg1 = arguments.get(1);
223220
final Type res1 = arg1.getResultType();
224-
SemanticException.check(res1.isArray(), SemanticException.ErrorCode.INCOMPATIBLE_TYPE);
221+
SemanticException.check(res1.isArray() || res0.isArray(), SemanticException.ErrorCode.INCOMPATIBLE_TYPE);
222+
223+
final Type arrayType = res0.isArray() ? res0 : res1;
224+
final Typed arrayArg = res0.isArray() ? arg0 : arg1;
225+
final Type operandType = res0.isArray() ? res1 : res0;
226+
final Typed operandArg = res0.isArray() ? arg1 : arg0;
225227

226-
final var arrayElementType = Objects.requireNonNull(((Type.Array) res1).getElementType());
227-
if (!arrayElementType.isUnresolved() && res0.getTypeCode() != arrayElementType.getTypeCode()) {
228-
final var maximumType = Type.maximumType(arg0.getResultType(), arrayElementType);
228+
final var arrayElementType = Objects.requireNonNull(((Type.Array) arrayType).getElementType());
229+
if (!arrayElementType.isUnresolved() && operandType.getTypeCode() != arrayElementType.getTypeCode()) {
230+
final var maximumType = Type.maximumType(operandType, arrayElementType);
229231
// Incompatible types
230232
SemanticException.check(maximumType != null, SemanticException.ErrorCode.INCOMPATIBLE_TYPE);
231233

232234
// Promote arg0 if the resulting type is different
233-
if (!arg0.getResultType().equals(maximumType)) {
234-
return new InOpValue(PromoteValue.inject((Value)arg0, maximumType), (Value)arg1);
235+
if (!operandType.equals(maximumType)) {
236+
return new InOpValue(PromoteValue.inject((Value)operandArg, maximumType), (Value)arrayArg);
235237
} else {
236-
return new InOpValue((Value)arg0, PromoteValue.inject((Value)arg1, new Type.Array(maximumType)));
238+
return new InOpValue((Value)operandArg, PromoteValue.inject((Value)arrayArg, new Type.Array(maximumType)));
237239
}
238240
}
239241

240-
if (res0.isRecord()) {
242+
if (operandType.isRecord()) {
241243
// we cannot yet promote this properly
242244
SemanticException.check(arrayElementType.isRecord(), SemanticException.ErrorCode.INCOMPATIBLE_TYPE);
243-
final var probeElementTypes = Objects.requireNonNull(((Type.Record)res0).getElementTypes());
245+
final var probeElementTypes = Objects.requireNonNull(((Type.Record)operandType).getElementTypes());
244246
final var inElementTypes = Objects.requireNonNull(((Type.Record)arrayElementType).getElementTypes());
245247
for (int i = 0; i < inElementTypes.size(); i++) {
246248
final var probeElementType = probeElementTypes.get(i);
@@ -251,7 +253,7 @@ private static Value encapsulateInternal(@Nonnull final List<? extends Typed> ar
251253
SemanticException.ErrorCode.INCOMPATIBLE_TYPE);
252254
}
253255
}
254-
return new InOpValue((Value)arg0, (Value)arg1);
256+
return new InOpValue((Value)operandArg, (Value)arrayArg);
255257
}
256258
}
257259

fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/test/FDBDatabaseExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private static FDB getInitedFDB() {
8888
synchronized (FDBDatabaseExtension.class) {
8989
if (fdb == null) {
9090
// Note: in some ways, this mirrors the TestDatabaseExtension abstraction in the
91-
// fdb-extensions project. We could re-use this here, except that if we did, we'd
91+
// fdb-test-utils project. We could re-use this here, except that if we did, we'd
9292
// never test the FDBDatabaseFactory's methods for initializing FDB
9393
FDBDatabaseFactory baseFactory = FDBDatabaseFactory.instance();
9494
if (TRACE) {

fdb-record-layer-icu/fdb-record-layer-icu.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dependencies {
2828
compileOnly(libs.autoService)
2929
annotationProcessor(libs.autoService)
3030

31-
testImplementation testFixtures(project(':fdb-extensions'))
31+
testImplementation project(':fdb-test-utils')
3232
testImplementation project(path: coreProject, configuration: 'tests')
3333
testImplementation(libs.bundles.test.impl)
3434
testRuntimeOnly(libs.bundles.test.runtime)

fdb-record-layer-lucene/fdb-record-layer-lucene.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies {
3333
compileOnly(libs.autoService)
3434
annotationProcessor(libs.autoService)
3535

36-
testImplementation testFixtures(project(':fdb-extensions'))
36+
testImplementation project(':fdb-test-utils')
3737
testImplementation project(path: coreProject, configuration: 'tests')
3838
testImplementation(libs.bundles.test.impl)
3939
testImplementation(libs.lucene.testFramework)

fdb-record-layer-spatial/fdb-record-layer-spatial.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies {
3636
testImplementation(libs.bundles.test.impl)
3737
testRuntimeOnly(libs.bundles.test.runtime)
3838
testCompileOnly(libs.bundles.test.compileOnly)
39-
testImplementation testFixtures(project(':fdb-extensions'))
39+
testImplementation project(':fdb-test-utils')
4040
testImplementation project(path: coreProject, configuration: 'tests')
4141
}
4242

fdb-relational-core/src/main/antlr/RelationalParser.g4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,7 @@ expressionAtom
11651165
inList
11661166
: '(' (queryExpressionBody | expressions) ')'
11671167
| preparedStatementParameter
1168+
| fullColumnName
11681169
;
11691170

11701171
preparedStatementParameter

0 commit comments

Comments
 (0)