Skip to content

Table with a generated column cycle results in a NullPointerException #2826

@mrigger

Description

@mrigger

Consider the following statement:

CREATE TABLE t0(c0 BOOL AS (NOT c1), c1 BOOL AS (c0)); -- General error: "java.lang.NullPointerException"

Unexpectedly, the CREATE TABLE statement results in an error with the following stack trace:

Caused by: java.lang.NullPointerException
    at org.h2.expression.ExpressionColumn.getNotIfPossible(ExpressionColumn.java:409)
    at org.h2.expression.condition.ConditionNot.optimize(ConditionNot.java:50)
    at org.h2.table.Column.prepareExpressions(Column.java:473)
    at org.h2.command.ddl.CreateTable.update(CreateTable.java:127)
    at org.h2.command.CommandContainer.update(CommandContainer.java:173)
    at org.h2.command.Command.executeUpdate(Command.java:250)

I found this based on commit 30f0187.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions