Exception on UDT => CLR mapping of collection property which has null value
CSHARP-801
CqlReader.GetSchemaTable - NotSupportedException
CSHARP-658
Cassandra.InvalidQueryException: 'Invalid remaining data after end of UDT value'
CSHARP-603
Is dse support solr search? If yes, Can you please provide some sample? So i can go through with them and implement the full text search. Thanks
CSHARP-600
Unable to cast object of type 'System.Reflection.RuntimePropertyInfo' to type 'System.Reflection.FieldInfo'. var table = session.GetTable<Foo>(); table.where(x => x.NodeAddress.CompanyName.Equals(address.CompanyName)).Execute(); //NodeAddress is class.
CSHARP-588
None of the hosts tried for query are available
CSHARP-573
TimeoutException on all requests (async deadlock ?)
CSHARP-553
LZ4 decompression buffer pooling bug
CSHARP-403
NuGet Package is corrupt
CSHARP-389
Connect throws TimeoutException in certain async contexts
CSHARP-369
Calling Socket.ConnectAsync() can result in uncaught exception
CSHARP-344
New bug in C# driver 2.5 for partition keys
CSHARP-249
moderately-reproducible hang: client failing to awaken after response received
CSHARP-225
Exception when retrieving tables metadata
CSHARP-157
Strong Name the NuGet Assemblies
CSHARP-143
Uncaught exception in finalizer crashes web server
CSHARP-98
Invalid or unsupported protocol version (0)
CSHARP-777
I am running a script to create keyspaces and tables but i am getting schema issues after sometime while it creating some tables
CSHARP-656
Support partially specified writes from case classes
CSHARP-628
Non-Batch Statements Have Incorrect Write Time
CSHARP-610
Heartbeat query leaked into blob column value
CSHARP-499
cluster.Metadata.GetTable(KS,TB).TableColumns KeyType returns None instead of Partition.
CSHARP-475
NullReferenceException at Cassandra.Connection.ReadParse
CSHARP-455
Update tests setup to use "allow_scan" according to DSP-8981
CSHARP-454
Following reconnection attempts may be not be scheduled depending on timer precision
CSHARP-386
Cassandra inconsistencies in batch inserts/updates. Error shows Consistency One, but Quorum was chosen.
CSHARP-307
Default QueryAbortTimeout value should not be Infinite
CSHARP-260
TaskHelper.Continue() calls to SynchronizationContext.Post can cause deadlocks
CSHARP-241
Unexpected client timeout when server touches corrupted SSTable
CSHARP-212
Cassandra C# driver errors on virtual properties when using CreateIfNotExists method
CSHARP-189
java.lang.OutOfMemoryException response to PreparedStatement Insert of very small data
CSHARP-179
Cannot get metadata of CF with composite partition key
CSHARP-94
Out of memory with batch execute
CSHARP-55
CqlExpressionVisitor does not support MemberAccess ExpressionTypes for Condition and SelectBinding phase
CSHARP-16
Linq2Cql and Mapper should generate CQL statements in a deterministic way
CSHARP-840
Mapper and Linq2Cql causes re-prepare warnings in scenarios with high concurrency
CSHARP-839
Fix test failures when running against C* 4.0
CSHARP-838
Serializer protocol version is changed after init, causing current active connections to fail
CSHARP-837
CASSANDRA_VERSION is empty if using a cassandra branch build
CSHARP-836
BatchStatement error message uses short.MaxValue instead of ushort.MaxValue
CSHARP-835
KeyspaceMetadata.ExportAsString API docs incorrectly state that it exports the table creation statements
CSHARP-833
Some graph related classes depend on the current culture
CSHARP-832
Cluster Builder.Builder() throws Exception under Powershell
CSHARP-830
Refine connection errors for connecting to cloud instance that may have been parked
CSHARP-829
Include test with node changing address
CSHARP-828
Policies.NewDefaultLoadBalancingPolicy and Policies.DefaultLoadBalancingPolicy return the default OSS default
CSHARP-821
Support using the same POCO and mappings in multiple keyspaces
CSHARP-820
Add option to keep contact points unresolved and always re-resolve when there's total connectivity loss
CSHARP-819
Reduce integration tests execution time
CSHARP-818
App.Metrics snapshot fails when timer metrics don't have any recorded values
CSHARP-817
issue 1 of 738

Exception on UDT => CLR mapping of collection property which has null value

Description

Exception on mapping collection in UDT to CLR collection, if value in DB is null

Example:
DB
CREATE TYPE IF NOT EXISTS settings (
ids frozen<list<int>>
);

CREATE TABLE IF NOT EXISTS test_users (
user_id int,
settings frozen<settings>,
PRIMARY KEY (user_id)
);

INSERT INTO test_users (user_id, settings) VALUES (1, { "ids": null });
SELECT * FROM test_users;

user_id | languages
--------+------------
1 | {ids: null}

C# Code to reproduce the bug:

using System;
using System.Collections.Generic;
using System.Linq;
using Cassandra;

namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
var cluster = Cluster.Builder()
.WithConnectionString("Contact Points=127.0.0.1;Port=9042")
.Build();

var connection = cluster.ConnectAsync().GetAwaiter().GetResult();
connection.UserDefinedTypes.Define(UdtMap.For<Settings>("settings", "users").Map(clr => clr.Ids, "ids"));
var rowSet = connection.Execute("SELECT settings FROM users.test_users WHERE user_id=1");
var user = rowSet.First();
var settings = user.GetValue<Settings>("settings");

Console.WriteLine($"Settings: {settings.Ids}");
Console.ReadLine();
}
}

public class Settings
{
public IList<int> Ids { get; set; }
}
}

--------------------------------------
An unhandled exception has occurred while executing the request.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: collection
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at Cassandra.Mapping.TypeConversion.TypeConverter.ConvertToList[T](IEnumerable`1 list)
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at Cassandra.Mapping.TypeConversion.TypeConverter.ConvertToUdtFieldFromDbValue(Type dbType, Type valueType, Object value)
at Cassandra.UdtMap.ToObject(Object[] values)
at Cassandra.Serialization.UdtSerializer.Deserialize(UInt16 protocolVersion, Byte[] buffer, Int32 offset, Int32 length, IColumnInfo typeInfo)
at Cassandra.Serialization.Serializer.Deserialize(Byte[] buffer, Int32 offset, Int32 length, ColumnTypeCode typeCode, IColumnInfo typeInfo)
at Cassandra.Serialization.CollectionSerializer.Deserialize(UInt16 protocolVersion, Byte[] buffer, Int32 offset, Int32 length, IColumnInfo typeInfo)
at Cassandra.Serialization.Serializer.Deserialize(Byte[] buffer, Int32 offset, Int32 length, ColumnTypeCode typeCode, IColumnInfo typeInfo)
at Cassandra.FrameReader.ReadFromBytes(Byte[] buffer, Int32 offset, Int32 length, ColumnTypeCode typeCode, IColumnInfo typeInfo)
at Cassandra.OutputRows.ProcessRowItem(FrameReader reader)
at Cassandra.OutputRows.ProcessRows(RowSet rs, FrameReader reader)
at Cassandra.OutputRows..ctor(FrameReader reader, Nullable`1 traceId)
at Cassandra.Responses.ResultResponse..ctor(Frame frame)
at Cassandra.Responses.ResultResponse.Create(Frame frame)
at Cassandra.FrameParser.Parse(Frame frame)

int[] failures like the IList but with a bit different exception
{System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector)
at Cassandra.Mapping.TypeConversion.TypeConverter.ConvertToArrayFromDb[TSource,TResult](IEnumerable`1 listFromDatabase)

IEnumerable<int> does not fail in case of null, but does not map in case of value, but it's a different story.

Why, I believe, the issue is blocker:
1. The same driver enables writing null in collection inside UDT;
2. Once null has been written, it cannot be read again. Besides, system failures on an attempt of reading such data. That's critical. Fortunately, I noticed such behavior before going into production. If it had been revealed in prod, it would be a catastrophe.
3. I haven't found a workaround: no hooks in mapping pipeline to inject some fixes into; no alternatives.

Environment

None

Pull Requests

None

Status

Assignee

Unassigned

Reporter

Andrey Braynin

Labels

Reproduced in

3.11.0

PM Priority

None

Fix versions

None

External issue ID

None

Doc Impact

None

Reviewer

None

Pull Request

None

Epic Link

None

Sprint

Size

None

Components

Affects versions

Priority

Blocker
Configure