Skip to content

ExecuteNonQuery always returns 0 #13

@YuriyIvon

Description

@YuriyIvon

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions