]
Work on TEIID-5396 started by Steven Hawkins.
---------------------------------------------
Querying SQL Server variant type for a string fails
---------------------------------------------------
Key: TEIID-5396
URL:
https://issues.jboss.org/browse/TEIID-5396
Project: Teiid
Issue Type: Bug
Components: JDBC Connector
Affects Versions: 8.12.14.6_4
Reporter: Andrej Šmigala
Assignee: Steven Hawkins
Priority: Critical
Fix For: 11.0
Table on SQL Server source created as
{code:sql}CREATE TABLE table_with_variant(id INT, var SQL_VARIANT){code}
and loaded with int, float and string data.
Running the following query against a dynamic VDB with metadata import
{code:sql}SELECT cast(var AS string) FROM table_with_variant WHERE id = 1{code}
fails with
{noformat}java.sql.SQLException: Remote com.microsoft.sqlserver.jdbc.SQLServerException:
The "variant" data type is not supported.{noformat}
This query used to work with DV 6.4.2, it appears it is a further regression from
TEIID-5313 . Querying rows with non-string data works as expected.
SOURCE SRC command with 6.4.2 (working):
{code:sql}SELECT cast(g_0."var" AS varchar(4000)) FROM
"dballo05"."dbo"."table_with_variant" g_0 WHERE
g_0."id" = 1{code}
SOURCE SRC command with 6.4.3 (not working), note missing cast to varchar:
{code:sql}SELECT g_0."var" FROM
"dballo06"."dbo"."table_with_variant" g_0 WHERE
g_0."id" = 1{code}