Skip to content

Commit

Permalink
Merge pull request #154 from AuthenticEshkinKot/master
Browse files Browse the repository at this point in the history
  • Loading branch information
aensidhe authored May 17, 2021
2 parents c046b68 + 7a485cc commit c783473
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
12 changes: 12 additions & 0 deletions src/progaudi.tarantool/Converters/ResponsePacketConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public DataResponse Read(IMsgPackReader reader)
case Key.SqlInfo:
sqlInfo = ReadSqlInfo(reader, _keyConverter, _intConverter);
break;
case Key.SqlInfo_2_0_4:
sqlInfo = ReadSqlInfo(reader, _keyConverter, _intConverter);
break;
default:
throw ExceptionHelper.UnexpectedKey(dataKey, Key.Data, Key.Metadata);
}
Expand All @@ -66,6 +69,9 @@ internal static SqlInfo ReadSqlInfo(IMsgPackReader reader, IMsgPackConverter<Key
case Key.SqlRowCount:
result = new SqlInfo(intConverter.Read(reader));
break;
case Key.SqlRowCount_2_0_4:
result = new SqlInfo(intConverter.Read(reader));
break;
default:
reader.SkipToken();
break;
Expand Down Expand Up @@ -124,6 +130,9 @@ DataResponse<T> IMsgPackConverter<DataResponse<T>>.Read(IMsgPackReader reader)
case Key.SqlInfo:
sqlInfo = ResponsePacketConverter.ReadSqlInfo(reader, _keyConverter, _intConverter);
break;
case Key.SqlInfo_2_0_4:
sqlInfo = ResponsePacketConverter.ReadSqlInfo(reader, _keyConverter, _intConverter);
break;
default:
throw ExceptionHelper.UnexpectedKey(dataKey, Key.Data, Key.Metadata);
}
Expand Down Expand Up @@ -162,6 +171,9 @@ private FieldMetadata[] ReadMetadata(IMsgPackReader reader)
case Key.FieldName:
result[i] = new FieldMetadata(_stringConverter.Read(reader));
continue;
case Key.FieldName_2_0_4:
result[i] = new FieldMetadata(_stringConverter.Read(reader));
continue;
default:
reader.SkipToken();
break;
Expand Down
9 changes: 6 additions & 3 deletions src/progaudi.tarantool/Model/Enums/Key.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public enum Key : uint
Username = 0x23,
Expression = 0x27,
Ops = 0x28,
FieldName = 0x29,
FieldName_2_0_4 = 0x29,
FieldName = 0x0,

// Response keys
Data = 0x30,
Expand All @@ -29,8 +30,10 @@ public enum Key : uint
SqlQueryText = 0x40,
SqlParameters = 0x41,
SqlOptions = 0x42,
SqlInfo = 0x43,
SqlRowCount = 0x44,
SqlInfo = 0x42,
SqlInfo_2_0_4 = 0x43,
SqlRowCount_2_0_4 = 0x44,
SqlRowCount = 0x0,

// Replication keys
ServerId = 0x02,
Expand Down
2 changes: 1 addition & 1 deletion src/progaudi.tarantool/ResponseReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private void MatchResult(byte[] result)
else
{
_clientOptions.LogWriter?.WriteLine($"Match for request with id {header.RequestId} found.");
tcs.SetResult(resultStream);
Task.Run(() => tcs.SetResult(resultStream));
}
}

Expand Down

0 comments on commit c783473

Please sign in to comment.