Blazebit / blaze-persistence

Rich Criteria API for JPA providers
https://persistence.blazebit.com
Apache License 2.0
697 stars 85 forks source link

SQL Server Dialect should use varchar(max) instead of varchar #1870

Closed Aniket-Singla closed 3 months ago

Aniket-Singla commented 3 months ago

Description

While using Blaze Persistence, it was found that CAST_STRING function is casting the columns to varchar instead of varchar(max). The problem is varchar datatype in Sql Server is just 30 characters by default and hence rest of the value from column will be trimmed after the first 30 characters.

Expected behavior

CAST_STRING , or any other String reference should use larger values and probably varchar(max).

Actual behavior

CAST_STRING , or any other String dependent function is using varchar(30).

Steps to reproduce

Just use any function like CAST_STRING to validate the current behavour. More Details at : https://github.com/Blazebit/blaze-persistence/discussions/1868

Version:
JPA-Provider: Spring Data JPA (Hibernate 6.2 as ORM) DBMS: Sql Server Application Server: Spring