Skip to content
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

[Release 1.1] Fix stored procedure issues introduced in v1.1.2 #545

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2855,11 +2855,11 @@ private bool TryProcessDone(SqlCommand cmd, SqlDataReader reader, ref RunBehavio
}
}

// _attentionSent set by 'SendAttention'
// HasReceivedAttention set above
// _pendingData set by e.g. 'TdsExecuteSQLBatch'
// _hasOpenResult always set to true by 'WriteMarsHeader'
//
if (!stateObj._attentionSent && !stateObj.HasPendingData && stateObj.HasOpenResult)
if (!stateObj.HasReceivedAttention && !stateObj.HasPendingData && stateObj.HasOpenResult)
{
/*
Debug.Assert(!((sqlTransaction != null && _distributedTransaction != null) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3324,11 +3324,11 @@ private bool TryProcessDone(SqlCommand cmd, SqlDataReader reader, ref RunBehavio
}
}

// _attentionSent set by 'SendAttention'
// _attentionReceived set above
// _pendingData set by e.g. 'TdsExecuteSQLBatch'
// _hasOpenResult always set to true by 'WriteMarsHeader'
//
if (!stateObj._attentionSent && !stateObj._pendingData && stateObj._hasOpenResult)
if (!stateObj._attentionReceived && !stateObj._pendingData && stateObj._hasOpenResult)
{
/*
Debug.Assert(!((sqlTransaction != null && _distributedTransaction != null) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,30 @@ public static void TimeOutDuringRead()
TimeOutDuringRead(s_connStr);
}

[CheckConnStrSetupFact]
public static void TCPAttentionPacketTest()
{
CancelFollowedByTransaction(s_connStr);
}

private static void CancelFollowedByTransaction(string constr)
{
using (SqlConnection connection = new SqlConnection(constr))
{
connection.Open();
using (SqlCommand cmd = connection.CreateCommand())
{
cmd.CommandText = @"SELECT @@VERSION";
using (var r = cmd.ExecuteReader())
{
cmd.Cancel();
}
}
using (var transaction = connection.BeginTransaction())
{ }
}
}

private static void MultiThreadedCancel(string constr, bool async)
{
using (SqlConnection con = new SqlConnection(constr))
Expand Down