microsoft / mssql-jdbc

The Microsoft JDBC Driver for SQL Server is a Type 4 JDBC driver that provides database connectivity with SQL Server through the standard JDBC application program interfaces (APIs).
MIT License
1.04k stars 424 forks source link

org.apache.ddlutils.DatabaseOperationException: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'change_streams_destination_type'. #2461

Closed lucaszarzur closed 1 week ago

lucaszarzur commented 2 weeks ago

Driver version

We tried:

SQL Server version

Azure SQL Database

Client Operating System

JAVA/JVM version

1.8.0

Table schema

'DECLARE @mssqljdbc_temp_sp_columns_result TABLE(TABLE_QUALIFIER SYSNAME, TABLE_OWNER SYSNAME,TABLE_NAME SYSNAME, COLUMN_NAME SYSNAME, DATA_TYPE SMALLINT, TYPE_NAME SYSNAME, PRECISION INT,LENGTH INT, SCALE SMALLINT, RADIX SMALLINT, NULLABLE SMALLINT, REMARKS VARCHAR(254), COLUMN_DEF NVARCHAR(4000),SQL_DATA_TYPE SMALLINT, SQL_DATETIME_SUB SMALLINT, CHAR_OCTET_LENGTH INT, ORDINAL_POSITION INT,IS_NULLABLE VARCHAR(254), SS_IS_SPARSE SMALLINT, SS_IS_COLUMN_SET SMALLINT, SS_IS_COMPUTED SMALLINT,SS_IS_IDENTITY SMALLINT, SS_UDT_CATALOG_NAME NVARCHAR(128), SS_UDT_SCHEMA_NAME NVARCHAR(128),SS_UDT_ASSEMBLY_TYPE_NAME NVARCHAR(max), SS_XML_SCHEMACOLLECTION_CATALOG_NAME NVARCHAR(128),SS_XML_SCHEMACOLLECTION_SCHEMA_NAME NVARCHAR(128), SS_XML_SCHEMACOLLECTION_NAME NVARCHAR(128),SS_DATA_TYPE TINYINT);

INSERT INTO @mssqljdbc_temp_sp_columns_result EXEC sp_columns_100 @P0,@P1,@P2,@P3,@P4,@P5;

SELECT TABLE_QUALIFIER AS TABLE_CAT, TABLE_OWNER AS TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, DATA_TYPE,TYPE_NAME, PRECISION AS COLUMN_SIZE, LENGTH AS BUFFER_LENGTH, SCALE AS DECIMAL_DIGITS, RADIX AS NUM_PREC_RADIX,NULLABLE, REMARKS, COLUMN_DEF, SQL_DATA_TYPE, SQL_DATETIME_SUB, CHAR_OCTET_LENGTH, ORDINAL_POSITION, IS_NULLABLE,NULL AS SCOPE_CATALOG, NULL AS SCOPE_SCHEMA, NULL AS SCOPE_TABLE, SS_DATA_TYPE AS SOURCE_DATA_TYPE,CASE SS_IS_IDENTITY WHEN 0 THEN ''NO'' WHEN 1 THEN ''YES'' WHEN '''' THEN '''' END AS IS_AUTOINCREMENT,CASE SS_IS_COMPUTED WHEN 0 THEN ''NO'' WHEN 1 THEN ''YES'' WHEN '''' THEN '''' END AS IS_GENERATEDCOLUMN, SS_IS_SPARSE, SS_IS_COLUMN_SET, SS_UDT_CATALOG_NAME, SS_UDT_SCHEMA_NAME, SS_UDT_ASSEMBLY_TYPE_NAME,SS_XML_SCHEMACOLLECTION_CATALOG_NAME, SS_XML_SCHEMACOLLECTION_SCHEMA_NAME, SS_XML_SCHEMACOLLECTION_NAME FROM @mssqljdbc_temp_sp_columns_result;',N'@P0 nvarchar(4000),@P1 nvarchar(4000),@P2 nvarchar(4000),@P3 nvarchar(4000),@P4 int,@P5 int',N'change_streams_destination_type',

Problem description

We are facing an Invalid object name 'change_streams_destination_type' problem, but we are not aware of this object as its manipulation is not ours.

We have been using an Azure database for our SAP Commerce instance (also known as Hybris) for a few years, which was working very well until 05/24/2024 (however, we don't know if the error started shortly after that date) or a certain time later).

In SAP Commerce (Hybris) we carry out what we call "UpdateSystem", which in practice are a series of SQL statements for creating and/or updating Database table structures.

Some facts:

So we asked, could this 'change_streams_destination_type' object be created/manipulated by Azure, considering that the same origin system (SAP Commerce), with the same "UpdateSystem" process, does not occur in MySQL and SQL Server even with the copy of database of Azure in SQL Server?

Expected behavior

It shouldn't create this object, or it should pass through it normally.

Actual behavior

Is there an attempt at creation(?) or at least manipulation of that object

Error message/stack trace

org.apache.ddlutils.DatabaseOperationException: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'change_streams_destination_type'.

Any other details that can be helpful

Jeffery-Wasty commented 2 weeks ago

Hi @lucaszarzur,

I'm not sure what you're asking from the JDBC team with this issue. For confirmation, this object is not created by the MSSQL-JDBC driver. Reading what you have tried above, it looks like this issue only comes up when using Azure Db. Therefore, we recommend you reach out to the Azure support team for further help.

Jeffery-Wasty commented 1 week ago

Hi @lucaszarzur,

We'll be closing this issue in a few days if there are no further questions.