@@ -2692,4 +2692,51 @@ mod tests {
26922692 BuiltinTypeCheckErrorKind :: UdtError ( UdtTypeCheckErrorKind :: NoSuchFieldInUdt { .. } )
26932693 ) ) ;
26942694 }
2695+
2696+ #[ derive( SerializeCql , Debug ) ]
2697+ #[ scylla( crate = crate , flavor = "enforce_order" , skip_name_checks) ]
2698+ struct TestUdtWithSkippedFields {
2699+ a : String ,
2700+ b : i32 ,
2701+ #[ scylla( skip) ]
2702+ #[ allow( dead_code) ]
2703+ skipped : Vec < String > ,
2704+ c : Vec < i64 > ,
2705+ }
2706+
2707+ #[ test]
2708+ fn test_row_serialization_with_skipped_field ( ) {
2709+ let typ = ColumnType :: UserDefinedType {
2710+ type_name : "typ" . to_string ( ) ,
2711+ keyspace : "ks" . to_string ( ) ,
2712+ field_types : vec ! [
2713+ ( "a" . to_string( ) , ColumnType :: Text ) ,
2714+ ( "b" . to_string( ) , ColumnType :: Int ) ,
2715+ (
2716+ "c" . to_string( ) ,
2717+ ColumnType :: List ( Box :: new( ColumnType :: BigInt ) ) ,
2718+ ) ,
2719+ ] ,
2720+ } ;
2721+
2722+ let reference = do_serialize (
2723+ TestUdtWithFieldSorting {
2724+ a : "Ala ma kota" . to_owned ( ) ,
2725+ b : 42 ,
2726+ c : vec ! [ 1 , 2 , 3 ] ,
2727+ } ,
2728+ & typ,
2729+ ) ;
2730+ let row = do_serialize (
2731+ TestUdtWithSkippedFields {
2732+ a : "Ala ma kota" . to_owned ( ) ,
2733+ b : 42 ,
2734+ skipped : vec ! [ "abcd" . to_owned( ) , "efgh" . to_owned( ) ] ,
2735+ c : vec ! [ 1 , 2 , 3 ] ,
2736+ } ,
2737+ & typ,
2738+ ) ;
2739+
2740+ assert_eq ! ( reference, row) ;
2741+ }
26952742}
0 commit comments