From 3deb8a546713618cf2933cecf41edaf4163b8cba Mon Sep 17 00:00:00 2001 From: Gavin King Date: Thu, 31 Oct 2024 15:42:56 +0100 Subject: [PATCH] Sybase also strips trailing spaces Signed-off-by: Gavin King --- .../src/main/java/org/hibernate/dialect/Dialect.java | 2 +- .../src/main/java/org/hibernate/dialect/SybaseDialect.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java index 5a4181fac6..940f69b6ee 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java @@ -582,7 +582,7 @@ public abstract class Dialect implements ConversionContext, TypeContributor, Fun /** * Does this dialect strip trailing spaces from values stored * in columns of type {@code char(n)}? - * MySQL is the main offender here. + * MySQL and Sybase are the main offenders here. */ public boolean stripsTrailingSpacesFromChar() { return false; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java index faf05c4c0f..dcb1ffe227 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java @@ -257,6 +257,11 @@ public class SybaseDialect extends AbstractTransactSQLDialect { return driverKind == SybaseDriverKind.JTDS ? NationalizationSupport.IMPLICIT : super.getNationalizationSupport(); } + @Override + public boolean stripsTrailingSpacesFromChar() { + return true; + } + @Override public void initializeFunctionRegistry(FunctionContributions functionContributions) { super.initializeFunctionRegistry( functionContributions );