From 41b75c0eee7108d958351a118edae93a37616394 Mon Sep 17 00:00:00 2001 From: ilnar Date: Thu, 23 Apr 2020 01:53:17 +0300 Subject: [PATCH 1/2] fixed binary protocol changes --- src/progaudi.tarantool/Model/Enums/Key.cs | 6 +++--- src/progaudi.tarantool/ResponseReader.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/progaudi.tarantool/Model/Enums/Key.cs b/src/progaudi.tarantool/Model/Enums/Key.cs index 08edf82f..35c6bb4d 100644 --- a/src/progaudi.tarantool/Model/Enums/Key.cs +++ b/src/progaudi.tarantool/Model/Enums/Key.cs @@ -17,7 +17,7 @@ public enum Key : uint Username = 0x23, Expression = 0x27, Ops = 0x28, - FieldName = 0x29, + FieldName = 0x00, // Response keys Data = 0x30, @@ -29,8 +29,8 @@ public enum Key : uint SqlQueryText = 0x40, SqlParameters = 0x41, SqlOptions = 0x42, - SqlInfo = 0x43, - SqlRowCount = 0x44, + SqlInfo = 0x42, + SqlRowCount = 0x00, // Replication keys ServerId = 0x02, diff --git a/src/progaudi.tarantool/ResponseReader.cs b/src/progaudi.tarantool/ResponseReader.cs index 93d15334..c17eb6a6 100644 --- a/src/progaudi.tarantool/ResponseReader.cs +++ b/src/progaudi.tarantool/ResponseReader.cs @@ -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)); } } From 7a485ccb42f110ee31bc2b6adf20363ee299271c Mon Sep 17 00:00:00 2001 From: Maxim Kuzmin Date: Sat, 24 Apr 2021 14:30:32 +0300 Subject: [PATCH 2/2] Support of old values --- .../Converters/ResponsePacketConverter.cs | 12 ++++++++++++ src/progaudi.tarantool/Model/Enums/Key.cs | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/progaudi.tarantool/Converters/ResponsePacketConverter.cs b/src/progaudi.tarantool/Converters/ResponsePacketConverter.cs index e626cec6..a27fc157 100644 --- a/src/progaudi.tarantool/Converters/ResponsePacketConverter.cs +++ b/src/progaudi.tarantool/Converters/ResponsePacketConverter.cs @@ -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); } @@ -66,6 +69,9 @@ internal static SqlInfo ReadSqlInfo(IMsgPackReader reader, IMsgPackConverter IMsgPackConverter>.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); } @@ -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; diff --git a/src/progaudi.tarantool/Model/Enums/Key.cs b/src/progaudi.tarantool/Model/Enums/Key.cs index 35c6bb4d..178aa076 100644 --- a/src/progaudi.tarantool/Model/Enums/Key.cs +++ b/src/progaudi.tarantool/Model/Enums/Key.cs @@ -17,7 +17,8 @@ public enum Key : uint Username = 0x23, Expression = 0x27, Ops = 0x28, - FieldName = 0x00, + FieldName_2_0_4 = 0x29, + FieldName = 0x0, // Response keys Data = 0x30, @@ -30,7 +31,9 @@ public enum Key : uint SqlParameters = 0x41, SqlOptions = 0x42, SqlInfo = 0x42, - SqlRowCount = 0x00, + SqlInfo_2_0_4 = 0x43, + SqlRowCount_2_0_4 = 0x44, + SqlRowCount = 0x0, // Replication keys ServerId = 0x02,