NullPointerException compiling a GROUP that reaches one query through joins built under different statistics
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Start by tracing GroupExpr.getInnerJoin and how group joins are matched and compiled into subqueries; the issue identifies GroupSelect.getSQLQuery and CompiledQuery$InnerSelect$QuerySelect.getSQLQuery in the failure path. Reproduce the empty select with group joins built under different statistics, then confirm those joins compile to one subquery and the query succeeds.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
In one compiled query the same GROUP can come through two group joins that differ only in the joins GroupExpr.getInnerJoin builds from the current statistics. This happens, for example, when changes in the session alter the statistics between the moments two instances of the same GROUP expression get their join. One of them is an inner join of the query and the expression goes through the other. They are not matched, so the select made for the inner join gets no expressions, compiles to an empty select with untyped keys and fails:
active (Item i, Store s, DATE d) = GROUP LAST Rule r ORDER group(r), r
WHERE dateFrom(group(r)) <= d AND in(group(r), s) AND in(r, i);
active (Batch b, Shop sh, DATE d) = active(item(b), store(sh), d);
price (Batch b, Shop sh) += value(active(b, sh, currentDate())) IF active(b, sh, currentDate());
// in a session where dateFrom(Group) was changed (no APPLY), EXPORT of a form filtered by price:
// java.lang.NullPointerException: Cannot invoke "lsfusion.server.data.type.Type.getCast(String, SQLSyntax, TypeEnvironment)" because "value" is null
// at CompiledQuery$InnerSelect$QuerySelect.getSQLQuery <- getEmptySelect <- pushWhere <- GroupSelect.getSQLQuery, in Property.readChangeTable
Seen on 6.3 with a real database. Whether it fails depends on the change made in the session and differs from one server restart to another. The same stack is reported in #1958.
Reason
A query that reads correct data fails with an internal error, depending on the statistics, which the developer neither controls nor sees.
Fix
Group joins that differ only in the statistics-built joins compile to one subquery.
- Lenguaje dominante
- Java
- Estrellas
- 214
- Forks
- 46
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de lsfusion/platform
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 62/100
Todos los issues de lsfusion/platform
Issues similares
-
account assessment course feature lecture
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
app:learninggoalhub enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyPosiblemente ocupada @vaibhavgupta443 la tomó hoy. Abiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
apache/wicket#1991 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100