/
NikolayIvkin
/
sqlancer2
Обзор
Документация
Войти
/
NikolayIvkin
/
sqlancer2
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/sqlancer/postgres/ast/PostgresCastOperation.java
45 строк
1 KB
Manuel Rigger
[Postgres] Let getExpectedValue() return null when no PQS implementation is available
25 авг 2020, 14:08
25 авг 2020, 14:08
205b394
Код
Авторство
О чём код?
package sqlancer.postgres.ast; import sqlancer.postgres.PostgresCompoundDataType; import sqlancer.postgres.PostgresSchema.PostgresDataType; public class PostgresCastOperation implements PostgresExpression { private final PostgresExpression expression; private final PostgresCompoundDataType type; public PostgresCastOperation(PostgresExpression expression, PostgresCompoundDataType type) { if (expression == null) { throw new AssertionError(); } this.expression = expression; this.type = type; } @Override public PostgresDataType getExpressionType() { return type.getDataType(); } @Override public PostgresConstant getExpectedValue() { PostgresConstant expectedValue = expression.getExpectedValue(); if (expectedValue == null) { return null; } return expectedValue.cast(type.getDataType()); } public PostgresExpression getExpression() { return expression; } public PostgresDataType getType() { return type.getDataType(); } public PostgresCompoundDataType getCompoundType() { return type; } }