@@ -12389,8 +12389,8 @@ fn parse_create_table_with_bit_types() {
12389
12389
fn parse_composite_access_expr ( ) {
12390
12390
assert_eq ! (
12391
12391
verified_expr( "f(a).b" ) ,
12392
- Expr :: CompositeAccess {
12393
- expr : Box :: new( Expr :: Function ( Function {
12392
+ Expr :: CompoundFieldAccess {
12393
+ root : Box :: new( Expr :: Function ( Function {
12394
12394
name: ObjectName ( vec![ Ident :: new( "f" ) ] ) ,
12395
12395
uses_odbc_syntax: false ,
12396
12396
parameters: FunctionArguments :: None ,
@@ -12406,41 +12406,41 @@ fn parse_composite_access_expr() {
12406
12406
over: None ,
12407
12407
within_group: vec![ ]
12408
12408
} ) ) ,
12409
- key : Ident :: new( "b" )
12409
+ access_chain : vec! [ AccessExpr :: Dot ( Expr :: Identifier ( Ident :: new( "b" ) ) ) ]
12410
12410
}
12411
12411
) ;
12412
12412
12413
12413
// Nested Composite Access
12414
12414
assert_eq ! (
12415
12415
verified_expr( "f(a).b.c" ) ,
12416
- Expr :: CompositeAccess {
12417
- expr : Box :: new( Expr :: CompositeAccess {
12418
- expr : Box :: new( Expr :: Function ( Function {
12419
- name : ObjectName ( vec! [ Ident :: new ( "f" ) ] ) ,
12420
- uses_odbc_syntax : false ,
12421
- parameters : FunctionArguments :: None ,
12422
- args : FunctionArguments :: List ( FunctionArgumentList {
12423
- duplicate_treatment : None ,
12424
- args : vec! [ FunctionArg :: Unnamed ( FunctionArgExpr :: Expr (
12425
- Expr :: Identifier ( Ident :: new ( "a" ) )
12426
- ) ) ] ,
12427
- clauses : vec! [ ] ,
12428
- } ) ,
12429
- null_treatment : None ,
12430
- filter : None ,
12431
- over : None ,
12432
- within_group : vec! [ ]
12433
- } ) ) ,
12434
- key : Ident :: new( "b" )
12435
- } ) ,
12436
- key : Ident :: new ( "c" )
12416
+ Expr :: CompoundFieldAccess {
12417
+ root : Box :: new( Expr :: Function ( Function {
12418
+ name : ObjectName ( vec! [ Ident :: new( "f" ) ] ) ,
12419
+ uses_odbc_syntax : false ,
12420
+ parameters : FunctionArguments :: None ,
12421
+ args : FunctionArguments :: List ( FunctionArgumentList {
12422
+ duplicate_treatment : None ,
12423
+ args : vec! [ FunctionArg :: Unnamed ( FunctionArgExpr :: Expr (
12424
+ Expr :: Identifier ( Ident :: new ( "a" ) )
12425
+ ) ) ] ,
12426
+ clauses : vec! [ ] ,
12427
+ } ) ,
12428
+ null_treatment : None ,
12429
+ filter : None ,
12430
+ over : None ,
12431
+ within_group : vec! [ ]
12432
+ } ) ) ,
12433
+ access_chain : vec! [
12434
+ AccessExpr :: Dot ( Expr :: Identifier ( Ident :: new( "b" ) ) ) ,
12435
+ AccessExpr :: Dot ( Expr :: Identifier ( Ident :: new ( "c" ) ) ) ,
12436
+ ]
12437
12437
}
12438
12438
) ;
12439
12439
12440
12440
// Composite Access in Select and Where Clauses
12441
12441
let stmt = verified_only_select ( "SELECT f(a).b FROM t WHERE f(a).b IS NOT NULL" ) ;
12442
- let expr = Expr :: CompositeAccess {
12443
- expr : Box :: new ( Expr :: Function ( Function {
12442
+ let expr = Expr :: CompoundFieldAccess {
12443
+ root : Box :: new ( Expr :: Function ( Function {
12444
12444
name : ObjectName ( vec ! [ Ident :: new( "f" ) ] ) ,
12445
12445
uses_odbc_syntax : false ,
12446
12446
parameters : FunctionArguments :: None ,
@@ -12456,14 +12456,15 @@ fn parse_composite_access_expr() {
12456
12456
over : None ,
12457
12457
within_group : vec ! [ ] ,
12458
12458
} ) ) ,
12459
- key : Ident :: new ( "b" ) ,
12459
+ access_chain : vec ! [ AccessExpr :: Dot ( Expr :: Identifier ( Ident :: new( "b" ) ) ) ] ,
12460
12460
} ;
12461
12461
12462
12462
assert_eq ! ( stmt. projection[ 0 ] , SelectItem :: UnnamedExpr ( expr. clone( ) ) ) ;
12463
12463
assert_eq ! ( stmt. selection. unwrap( ) , Expr :: IsNotNull ( Box :: new( expr) ) ) ;
12464
12464
12465
- // Composite Access with quoted identifier
12466
- verified_only_select ( "SELECT f(a).\" an id\" " ) ;
12465
+ // Compound access with quoted identifier.
12466
+ all_dialects_where ( |d| d. is_delimited_identifier_start ( '"' ) )
12467
+ . verified_only_select ( "SELECT f(a).\" an id\" " ) ;
12467
12468
12468
12469
// Composite Access in struct literal
12469
12470
all_dialects_where ( |d| d. supports_struct_literal ( ) ) . verified_stmt (
0 commit comments