Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site tellab2.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!tellab1!tellab2!steve
From: steve@tellab2.UUCP (Steve Harpster)
Newsgroups: net.bugs.4bsd
Subject: Ingres bug in 4.2 BSD
Message-ID: <220@tellab2.UUCP>
Date: Tue, 12-Feb-85 14:39:49 EST
Article-I.D.: tellab2.220
Posted: Tue Feb 12 14:39:49 1985
Date-Received: Wed, 13-Feb-85 04:29:17 EST
Reply-To: steve@tellab3.UUCP (& Harpster)
Organization: Tellabs, Inc., Lisle, IL
Lines: 37


Subject: Retrieving long relation returns bad character count
Index:	~ingres/source/libq/IIn_ret.c 4.2BSD

Description:
	Occasionally, a C program (run through equel) which is trying to
	retrieve tuples from an Ingres database returns the message
	"IIn_ret: bad pb_get-1 <# bytes read>".
Repeat-By:
	Create a relation with a character domain of length 255 (the
	maximum). Now have a C program try and retrieve a tuple from it.
Fix:
	Simple type conflicts. Casts fix the problem. The diffs are below:

*** /tmp/old_IIn_ret.c	Tue Feb 12 13:22:31 1985
--- /user2/ingres/source/libq/IIn_ret.c	Tue Feb 12 12:50:28 1985
***************
*** 46,53
          ret = &IIr_sym;
  
  	if (ret->len &= 0377)
! 		if (IIpb_get(&IIpb, temp, ret->len & 0377) != ret->len & 0377)
! 			IIsyserr("IIn_ret: bad pb_get-1 %d", ret->len & 0377);
  
  
  #	ifdef xETR1

--- 46,54 -----
          ret = &IIr_sym;
  
  	if (ret->len &= 0377)
! 		if ((length = IIpb_get(&IIpb, temp, ret->len & 0377)) != (int) (ret->len & 0377))
! 			IIsyserr("IIn_ret: bad pb_get-1, wanted %d got %d",
! 				(int) (ret->len & 0377), length);
  
  
  #	ifdef xETR1