-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sqlcmd hangs for select query with null XML values #1591
sqlcmd hangs for select query with null XML values #1591
Conversation
Previously the sqlcmd hangs for select query which has XML columns. This commit fixes by sending NbcRowToken when nullMapSize is equal to simpleRowSize. And for older clients of TDS 7.2 where NbcRowToken doesn't exist should send 0xffffffffffffffff specially for XML. Task: BABEL-4196 Signed-off-by: vasavi suthapalli <[email protected]>
It is not clear in the description that we are fixing sender side for XML NULL values. So please update it accordingly |
case TDS_TYPE_XML: | ||
|
||
/* | ||
* In case of TDS version lower than or equal to 7.3A, | ||
* we need to send 0xffffffffffffffff (PLP_NULL) | ||
*/ | ||
TdsPutUInt64LE(0xffffffffffffffff); | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code where we calculate simpleRowSize needs to be updated according to this. And do we have existing test cases for this? if so please put a reference here and if not then plz add some
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no existing tests for this case, adding them in TestXML
test file
@@ -27,3 +27,15 @@ xml | |||
~~END~~ | |||
|
|||
DROP TABLE XML_dt; | |||
|
|||
CREATE TABLE [dbo].[notification_definition]([id] [bigint] NOT NULL,[name_tx] [nvarchar](200) NOT NULL,[description_tx] [nvarchar](max) NULL,[schedule_xml] [xml] NULL,[default_sender_tx] [nvarchar](200) NULL,[lock_id] [tinyint] NOT NULL,[settings_xml] [xml] NULL,[agency_id] [bigint] NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a test to insert NULL through prep-exec also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added tests which insert NULL through prep-exec in the next revision
…tgresql#1591) Previously the sqlcmd hangs for select query which has XML columns. This commit fixes by sending NBCRowToken when nullMapSize is equal to simpleRowSize. And for older clients of TDS 7.2 where NbcRowToken doesn't exist should send 0xffffffffffffffff specially for XML NULL values. Task: BABEL-4196 Signed-off-by: vasavi suthapalli <[email protected]>
…tgresql#1591) Previously the sqlcmd hangs for select query which has XML columns. This commit fixes by sending NBCRowToken when nullMapSize is equal to simpleRowSize. And for older clients of TDS 7.2 where NbcRowToken doesn't exist should send 0xffffffffffffffff specially for XML NULL values. Task: BABEL-4196 Signed-off-by: vasavi suthapalli <[email protected]>
…tgresql#1591) Previously the sqlcmd hangs for select query which has XML columns. This commit fixes by sending NBCRowToken when nullMapSize is equal to simpleRowSize. And for older clients of TDS 7.2 where NbcRowToken doesn't exist should send 0xffffffffffffffff specially for XML NULL values. Task: BABEL-4196 Signed-off-by: vasavi suthapalli <[email protected]>
…tgresql#1591) Previously the sqlcmd hangs for select query which has XML columns. This commit fixes by sending NBCRowToken when nullMapSize is equal to simpleRowSize. And for older clients of TDS 7.2 where NbcRowToken doesn't exist should send 0xffffffffffffffff specially for XML NULL values. Task: BABEL-4196 Signed-off-by: vasavi suthapalli <[email protected]>
…tgresql#1591) Previously the sqlcmd hangs for select query which has XML columns. This commit fixes by sending NBCRowToken when nullMapSize is equal to simpleRowSize. And for older clients of TDS 7.2 where NbcRowToken doesn't exist should send 0xffffffffffffffff specially for XML NULL values. Task: BABEL-4196 Signed-off-by: vasavi suthapalli <[email protected]>
Previously the sqlcmd hangs for select query which has XML columns. This commit fixes by sending NBCRowToken when nullMapSize is equal to simpleRowSize. And for older clients of TDS 7.2 where NbcRowToken doesn't exist should send 0xffffffffffffffff specially for XML NULL values. Task: BABEL-4196 Signed-off-by: vasavi suthapalli <[email protected]>
sqlcmd hangs for select query with null XML values (#1591) Previously the sqlcmd hangs for select query which has XML columns. This commit fixes by sending NBCRowToken when nullMapSize is equal to simpleRowSize. And for older clients of TDS 7.2 where NbcRowToken doesn't exist should send 0xffffffffffffffff specially for XML NULL values. Task: BABEL-4196 Signed-off-by: vasavi suthapalli <[email protected]>
Description
Previously the sqlcmd hangs for select query which has null XML value. This commit fixes by sending NbcRowToken when nullMapSize and simpleRowSize are equal. And for older clients of TDS 7.2 where NbcRowToken doesn't exist, sending PLP_NULL(0xffffffffffffffff) specially for variables of type XML.
Issues Resolved
BABEL-4196
Test Scenarios Covered
Use case based - Added select queries which contain NULL xml. Inserted values through INSERT command and through prep-exec.
Boundary conditions -
Arbitrary inputs - Inserted NULL and some value for XML variables.
Negative test cases - N/A
Minor version upgrade tests - N/A
Major version upgrade tests - N/A
Performance tests -
Tooling impact -
Client tests -
Check List
By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.