8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.289 2009/08/12 20:53:30 tgl Exp $
11
+ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.290 2009/08/30 17:18:52 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -3502,7 +3502,8 @@ load_relcache_init_file(bool shared)
3502
3502
bool has_not_null ;
3503
3503
3504
3504
/* first read the relation descriptor length */
3505
- if ((nread = fread (& len ,1 ,sizeof (len ),fp ))!= sizeof (len ))
3505
+ nread = fread (& len ,1 ,sizeof (len ),fp );
3506
+ if (nread != sizeof (len ))
3506
3507
{
3507
3508
if (nread == 0 )
3508
3509
break ;/* end of file */
@@ -3523,15 +3524,15 @@ load_relcache_init_file(bool shared)
3523
3524
rel = rels [num_rels ++ ]= (Relation )palloc (len );
3524
3525
3525
3526
/* then, read the Relation structure */
3526
- if (( nread = fread (rel ,1 ,len ,fp ) )!= len )
3527
+ if (fread (rel ,1 ,len ,fp )!= len )
3527
3528
gotoread_failed ;
3528
3529
3529
3530
/* next read the relation tuple form */
3530
- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3531
+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
3531
3532
gotoread_failed ;
3532
3533
3533
3534
relform = (Form_pg_class )palloc (len );
3534
- if (( nread = fread (relform ,1 ,len ,fp ) )!= len )
3535
+ if (fread (relform ,1 ,len ,fp )!= len )
3535
3536
gotoread_failed ;
3536
3537
3537
3538
rel -> rd_rel = relform ;
@@ -3548,23 +3549,23 @@ load_relcache_init_file(bool shared)
3548
3549
has_not_null = false;
3549
3550
for (i = 0 ;i < relform -> relnatts ;i ++ )
3550
3551
{
3551
- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3552
+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
3552
3553
gotoread_failed ;
3553
3554
if (len != ATTRIBUTE_FIXED_PART_SIZE )
3554
3555
gotoread_failed ;
3555
- if (( nread = fread (rel -> rd_att -> attrs [i ],1 ,len ,fp ) )!= len )
3556
+ if (fread (rel -> rd_att -> attrs [i ],1 ,len ,fp )!= len )
3556
3557
gotoread_failed ;
3557
3558
3558
3559
has_not_null |=rel -> rd_att -> attrs [i ]-> attnotnull ;
3559
3560
}
3560
3561
3561
3562
/* next read the access method specific field */
3562
- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3563
+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
3563
3564
gotoread_failed ;
3564
3565
if (len > 0 )
3565
3566
{
3566
3567
rel -> rd_options = palloc (len );
3567
- if (( nread = fread (rel -> rd_options ,1 ,len ,fp ) )!= len )
3568
+ if (fread (rel -> rd_options ,1 ,len ,fp )!= len )
3568
3569
gotoread_failed ;
3569
3570
if (len != VARSIZE (rel -> rd_options ))
3570
3571
gotoread_failed ;/* sanity check */
@@ -3600,23 +3601,23 @@ load_relcache_init_file(bool shared)
3600
3601
nailed_indexes ++ ;
3601
3602
3602
3603
/* next, read the pg_index tuple */
3603
- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3604
+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
3604
3605
gotoread_failed ;
3605
3606
3606
3607
rel -> rd_indextuple = (HeapTuple )palloc (len );
3607
- if (( nread = fread (rel -> rd_indextuple ,1 ,len ,fp ) )!= len )
3608
+ if (fread (rel -> rd_indextuple ,1 ,len ,fp )!= len )
3608
3609
gotoread_failed ;
3609
3610
3610
3611
/* Fix up internal pointers in the tuple -- see heap_copytuple */
3611
3612
rel -> rd_indextuple -> t_data = (HeapTupleHeader ) ((char * )rel -> rd_indextuple + HEAPTUPLESIZE );
3612
3613
rel -> rd_index = (Form_pg_index )GETSTRUCT (rel -> rd_indextuple );
3613
3614
3614
3615
/* next, read the access method tuple form */
3615
- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3616
+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
3616
3617
gotoread_failed ;
3617
3618
3618
3619
am = (Form_pg_am )palloc (len );
3619
- if (( nread = fread (am ,1 ,len ,fp ) )!= len )
3620
+ if (fread (am ,1 ,len ,fp )!= len )
3620
3621
gotoread_failed ;
3621
3622
rel -> rd_am = am ;
3622
3623
@@ -3632,50 +3633,50 @@ load_relcache_init_file(bool shared)
3632
3633
rel -> rd_indexcxt = indexcxt ;
3633
3634
3634
3635
/* next, read the vector of opfamily OIDs */
3635
- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3636
+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
3636
3637
gotoread_failed ;
3637
3638
3638
3639
opfamily = (Oid * )MemoryContextAlloc (indexcxt ,len );
3639
- if (( nread = fread (opfamily ,1 ,len ,fp ) )!= len )
3640
+ if (fread (opfamily ,1 ,len ,fp )!= len )
3640
3641
gotoread_failed ;
3641
3642
3642
3643
rel -> rd_opfamily = opfamily ;
3643
3644
3644
3645
/* next, read the vector of opcintype OIDs */
3645
- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3646
+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
3646
3647
gotoread_failed ;
3647
3648
3648
3649
opcintype = (Oid * )MemoryContextAlloc (indexcxt ,len );
3649
- if (( nread = fread (opcintype ,1 ,len ,fp ) )!= len )
3650
+ if (fread (opcintype ,1 ,len ,fp )!= len )
3650
3651
gotoread_failed ;
3651
3652
3652
3653
rel -> rd_opcintype = opcintype ;
3653
3654
3654
3655
/* next, read the vector of operator OIDs */
3655
- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3656
+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
3656
3657
gotoread_failed ;
3657
3658
3658
3659
operator = (Oid * )MemoryContextAlloc (indexcxt ,len );
3659
- if (( nread = fread (operator ,1 ,len ,fp ) )!= len )
3660
+ if (fread (operator ,1 ,len ,fp )!= len )
3660
3661
gotoread_failed ;
3661
3662
3662
3663
rel -> rd_operator = operator ;
3663
3664
3664
3665
/* next, read the vector of support procedures */
3665
- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3666
+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
3666
3667
gotoread_failed ;
3667
3668
support = (RegProcedure * )MemoryContextAlloc (indexcxt ,len );
3668
- if (( nread = fread (support ,1 ,len ,fp ) )!= len )
3669
+ if (fread (support ,1 ,len ,fp )!= len )
3669
3670
gotoread_failed ;
3670
3671
3671
3672
rel -> rd_support = support ;
3672
3673
3673
3674
/* finally, read the vector of indoption values */
3674
- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3675
+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
3675
3676
gotoread_failed ;
3676
3677
3677
3678
indoption = (int16 * )MemoryContextAlloc (indexcxt ,len );
3678
- if (( nread = fread (indoption ,1 ,len ,fp ) )!= len )
3679
+ if (fread (indoption ,1 ,len ,fp )!= len )
3679
3680
gotoread_failed ;
3680
3681
3681
3682
rel -> rd_indoption = indoption ;