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

ExecuteNonQuery always returns 0 #13

Open
YuriyIvon opened this issue Dec 28, 2022 · 0 comments
Open

ExecuteNonQuery always returns 0 #13

YuriyIvon opened this issue Dec 28, 2022 · 0 comments
Assignees

Comments

@YuriyIvon
Copy link

ExecuteNonQuery must return the number of affected records, but it always returns 0. Further investigation shows that RecordsAffected of QueryResponseInfo is never populated.

By debugging the code I found that the number of affected records can be captured in ResultsEnumerator.cs (the last line in the example below was added by me):

 case '&':
                        var responseArray = this.temp.Substring(1).Split(' ');
                        this.socket.ProcessId = responseArray.Length > 3 ? long.Parse(responseArray[4]) : 0;
                        recordsAffected = responseArray.Length > 1 ? int.Parse(responseArray[1]) : 0;

and then passed in the following piece of code:

yield return new QueryResponseInfo
                                {
                                    Data = new List<List<string>>(),
                                    Columns = new List<MonetDbColumnInfo>(),
                                    RecordsAffected = recordsAffected
                                };

But I am not sure this fix takes into account all possible nuances of the protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants