-
Notifications
You must be signed in to change notification settings - Fork 1.4k
sqlserver database error #2311
Copy link
Copy link
Open
Labels
type: bugA general bugA general bug
Description
Describe the bug
When using SQL Server, the JdbcOAuth2AuthorizationService throws an error:
"The string is not in a valid hex format"
Root Cause
SQL Server does NOT support BLOB type (2004).
It only supports VARBINARY(MAX) which maps to JDBC type -3 (Types.VARBINARY).
But in the mapping code:
(Types.BLOB == columnMetadata.getDataType()
It only checks for BLOB(2004), not VARBINARY(-3).
So SQL Server binary fields get STRING values instead of byte[] → hex format error.
Expected behavior
The framework should support SQL Server by checking Types.VARBINARY(-3) in addition to Types.BLOB(2004).
Fix code suggestion
Change:
Types.BLOB → Types.VARBINARY
Or support both:
(Types.BLOB == type || Types.VARBINARY == type)
Environment
Spring Authorization Server version: 1.5.6 或 spring-security-oauth2-authorization-server
Database: SQL Server
Table schema: VARBINARY(MAX) for token fields
Error message: The string is not in a valid hex formatReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug