Skip to content

Commit

Permalink
Can't read text column, if it exceeds 255 chars. #1029
Browse files Browse the repository at this point in the history
  • Loading branch information
Tapac committed Aug 31, 2020
1 parent e0a7e63 commit 4acdfbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Op.kt
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ fun floatLiteral(value: Float): LiteralOp<Float> = LiteralOp(FloatColumnType(),
fun doubleLiteral(value: Double): LiteralOp<Double> = LiteralOp(DoubleColumnType(), value)

/** Returns the specified [value] as a string literal. */
fun stringLiteral(value: String): LiteralOp<String> = LiteralOp(VarCharColumnType(), value)
fun stringLiteral(value: String): LiteralOp<String> = LiteralOp(TextColumnType(), value)

/** Returns the specified [value] as a decimal literal. */
fun decimalLiteral(value: BigDecimal) : LiteralOp<BigDecimal> = LiteralOp(DecimalColumnType(value.precision(), value.scale()), value.setScale(1))
Expand Down Expand Up @@ -537,7 +537,7 @@ fun floatParam(value: Float): Expression<Float> = QueryParameter(value, FloatCol
fun doubleParam(value: Double): Expression<Double> = QueryParameter(value, DoubleColumnType())

/** Returns the specified [value] as a string query parameter. */
fun stringParam(value: String): Expression<String> = QueryParameter(value, VarCharColumnType())
fun stringParam(value: String): Expression<String> = QueryParameter(value, TextColumnType())

/** Returns the specified [value] as a decimal query parameter. */
fun decimalParam(value: BigDecimal) : Expression<BigDecimal> = QueryParameter(value, DecimalColumnType(value.precision(), value.scale()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ interface ISqlExpressionBuilder {
is ULong -> ulongParam(value)
is Float -> floatParam(value)
is Double -> doubleParam(value)
is String -> stringParam(value)
is String -> QueryParameter(value, columnType) // String value should inherit from column
else -> QueryParameter(value, columnType)
} as QueryParameter<T>

Expand Down

0 comments on commit 4acdfbd

Please sign in to comment.