File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed
spannerlib/wrappers/spannerlib-dotnet
spannerlib-dotnet-grpc-impl Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ public static GrpcChannel ForUnixSocket(string fileName)
4545 throw ;
4646 }
4747 }
48- }
48+ } ,
49+ MaxReceiveMessageSize = null ,
4950 } ) ;
5051 }
5152
@@ -56,7 +57,8 @@ public static GrpcChannel ForTcpSocket(string address)
5657 HttpHandler = new SocketsHttpHandler
5758 {
5859 EnableMultipleHttp2Connections = true ,
59- }
60+ } ,
61+ MaxReceiveMessageSize = null ,
6062 } ) ;
6163 }
6264
Original file line number Diff line number Diff line change @@ -77,6 +77,28 @@ public void TestRandomResults([Values] LibType libType)
7777 var request = Fixture . SpannerMock . Requests . OfType < ExecuteSqlRequest > ( ) . First ( ) ;
7878 Assert . That ( request . Transaction ? . SingleUse ? . ReadOnly ? . HasStrong ?? false ) ;
7979 }
80+
81+ [ Test ]
82+ public void TestLargeStringValue ( [ Values ] LibType libType )
83+ {
84+ const string sql = "select large_value from my_table" ;
85+ var value = TestUtils . GenerateRandomString ( 10_000_000 ) ;
86+ Fixture . SpannerMock . AddOrUpdateStatementResult ( sql , StatementResult . CreateSingleColumnResultSet (
87+ new Spanner . V1 . Type { Code = TypeCode . String } , "large_value" , value ) ) ;
88+
89+ using var pool = Pool . Create ( SpannerLibDictionary [ libType ] , ConnectionString ) ;
90+ using var connection = pool . CreateConnection ( ) ;
91+ using var rows = connection . Execute ( new ExecuteSqlRequest { Sql = sql } ) ;
92+ var numRows = 0 ;
93+ while ( rows . Next ( ) is { } row )
94+ {
95+ numRows ++ ;
96+ Assert . That ( row . Values . Count , Is . EqualTo ( 1 ) ) ;
97+ Assert . That ( row . Values [ 0 ] . HasStringValue ) ;
98+ Assert . That ( row . Values [ 0 ] . StringValue , Is . EqualTo ( value ) ) ;
99+ }
100+ Assert . That ( numRows , Is . EqualTo ( 1 ) ) ;
101+ }
80102
81103 [ Test ]
82104 public void TestStopHalfway ( [ Values ] LibType libType )
Original file line number Diff line number Diff line change 1+ namespace Google . Cloud . SpannerLib . Tests ;
2+
3+ public static class TestUtils
4+ {
5+ private const string Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ;
6+
7+ public static string GenerateRandomString ( int length )
8+ {
9+ return new string ( Enumerable . Repeat ( Chars , length )
10+ . Select ( s => s [ Random . Shared . Next ( s . Length ) ] ) . ToArray ( ) ) ;
11+ }
12+ }
You can’t perform that action at this time.
0 commit comments