PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: mpeppler (Michael Peppler)
Subject: Patch 0a to Sybperl 2.0
Date: Dec 13 1995 8:57AM

This is patch 0a to Sybperl 2.0.

It corrects the following bugs:

BugId	    Description

130	    CTlib/t/ctlib.t test fails on AIX
136	    CTlib fails test on an Onyx running Irix
137	    dbnextrow core dumps when retrieve row with binary
	    length > 140
135	    Behaviour change of DBlib::sql not documented in README
133	    MakeMaker 5.03 doesn't work with Sybperl.

Additional functionality:

DBlib::DBDEAD and DBlib::remove_xact have been added (thanks to Joel
Truher).

To install the patch, cd to the sybperl source directory and say:

patch -p1  'Sybase::CTlib',
!     'VERSION'	=> $VERSION,
!     'LIBS'	=> [$lib_string],   # e.g., '-lm' 
!     'DEFINE'	=> $def_string,     # e.g., '-DHAVE_SOMETHING' 
!     'INC'	=> $inc_string,     # e.g., '-I/usr/include/other'
! );
  
  sub MY::staticmake
  {
--- 33,49 ----
      print MF "# Empty Makefile to keep make happy\n\nall:\n\nconfig:\n\ntest:\n\ninstall:\n\n";
      print MF "clean realclean:\n	mv Makefile Makefile.old\n";
      close(MF);
  }
! else
! {
!     WriteMakefile(
! 		  'NAME'	=> 'Sybase::CTlib',
! 		  'VERSION'	=> $VERSION,
! 		  'LIBS'	=> [$lib_string],   # e.g., '-lm' 
! 		  'DEFINE'	=> $def_string,     # e.g., '-DHAVE_SOMETHING' 
! 		  'INC'	=> $inc_string,     # e.g., '-I/usr/include/other'
! 		  );
! }
  
  sub MY::staticmake
  {
Index: DBlib/DBlib.xs
Prereq: 1.22
*** sybperl-2.0/DBlib/DBlib.xs	Tue Oct 31 14:27:44 1995
--- sybperl-2.0a/DBlib/DBlib.xs	Wed Dec 13 09:21:08 1995
***************
*** 1,5 ****
  /* -*-C-*-
!  *	@(#)DBlib.xs	1.22	9/28/95
   */	
  
  
--- 1,5 ----
  /* -*-C-*-
!  *	@(#)DBlib.xs	1.23	12/13/95
   */	
  
  
***************
*** 122,127 ****
--- 122,141 ----
  static CallBackInfo err_callback 	= { 0 } ;
  static CallBackInfo msg_callback 	= { 0 } ;
  
+ static SV **my_hv_fetch _((HV*, hash_key_id, int));
+ static SV **my_hv_store _((HV*, hash_key_id, SV*, int));
+ static DBPROCESS *getDBPROC _((SV*));
+ static int err_handler _((DBPROCESS*, int, int, int, char*, char*));
+ static int msg_handler _((DBPROCESS*, DBINT, int, int, char*, char*, char*, int));
+ static void initialize _((void));
+ #if DBLIBVS >= 461
+ static void new_mny4tochar _((DBPROCESS*, DBMONEY4*, DBCHAR*));
+ static void new_mnytochar _((DBPROCESS*, DBMONEY*, DBCHAR*));
+ #endif
+ static int not_here _((char*));
+ static double constant _((char*, int));
+ 
+ 
  /* A couple of simplifyed calls for our own use... */
  
  static SV **my_hv_fetch(hv, id, flag)
***************
*** 237,243 ****
      char *msgtext;
      char *srvname;
      char *procname;
!     DBUSMALLINT line;
  {
  
      if(msg_callback.sub)	/* a perl error handler has been installed */
--- 251,257 ----
      char *msgtext;
      char *srvname;
      char *procname;
!     int line;
  {
  
      if(msg_callback.sub)	/* a perl error handler has been installed */
***************
*** 349,355 ****
  	if((sv = perl_get_sv("Sybase::DBlib::Version", TRUE)))
  	{
  	    char buff[256];
! 	    sprintf(buff, "This is sybperl, version %s\n\nSybase::DBlib version 1.22 9/28/95\n\nCopyright (c) 1991-1995 Michael Peppler\n\n",
  		    SYBPLVER);
  	    sv_setnv(sv, atof(SYBPLVER));
  	    sv_setpv(sv, buff);
--- 363,369 ----
  	if((sv = perl_get_sv("Sybase::DBlib::Version", TRUE)))
  	{
  	    char buff[256];
! 	    sprintf(buff, "This is sybperl, version %s\n\nSybase::DBlib version 1.23 12/13/95\n\nCopyright (c) 1991-1995 Michael Peppler\n\n",
  		    SYBPLVER);
  	    sv_setnv(sv, atof(SYBPLVER));
  	    sv_setpv(sv, buff);
***************
*** 2802,2808 ****
  PPCODE:
  {
      int retval, ComputeId = 0;
!     char buff[260], *p = NULL, *t;
      BYTE *data;
      int col, type, numcols = 0;
      int len;
--- 2816,2822 ----
  PPCODE:
  {
      int retval, ComputeId = 0;
!     char buff[520], *p = NULL, *t;
      BYTE *data;
      int col, type, numcols = 0;
      int len;
***************
*** 2933,2939 ****
  	      case SYBMONEY:
  		dbconvert(dbproc, SYBMONEY, (BYTE *)data, len,
  			  SYBMONEY, (BYTE*)&tv_money, -1);
! 		new_mnytochar(dbp, &tv_money, buff);
  		break;
  #else
  	      case SYBMONEY:
--- 2947,2953 ----
  	      case SYBMONEY:
  		dbconvert(dbproc, SYBMONEY, (BYTE *)data, len,
  			  SYBMONEY, (BYTE*)&tv_money, -1);
! 		new_mnytochar(dbproc, &tv_money, buff);
  		break;
  #else
  	      case SYBMONEY:
***************
*** 3045,3051 ****
  	int	doAssoc
  PPCODE:
  {
!     char buff[260], *p = NULL, *t;
      BYTE *data;
      int col, type, numcols;
      int len;
--- 3059,3065 ----
  	int	doAssoc
  PPCODE:
  {
!     char buff[520], *p = NULL, *t;
      BYTE *data;
      int col, type, numcols;
      int len;
***************
*** 3151,3157 ****
  	      case SYBMONEY:
  		dbconvert(dbproc, SYBMONEY, data, len,
  			  SYBMONEY, (BYTE*)&tv_money, -1);
! 		new_mnytochar(dbp, &tv_money, buff);
  		break;
  #else
  	      case SYBMONEY:
--- 3165,3171 ----
  	      case SYBMONEY:
  		dbconvert(dbproc, SYBMONEY, data, len,
  			  SYBMONEY, (BYTE*)&tv_money, -1);
! 		new_mnytochar(dbproc, &tv_money, buff);
  		break;
  #else
  	      case SYBMONEY:
***************
*** 4279,4284 ****
--- 4293,4310 ----
   OUTPUT:
  RETVAL
  
+ int
+ DBDEAD(dbp)
+       SV *    dbp
+   CODE:
+ {
+     DBPROCESS *dbproc = getDBPROC(dbp);
+ 
+     RETVAL = (DBBOOL)DBDEAD(dbproc);
+ }
+   OUTPUT:
+ RETVAL
+ 
  void
  open_commit(package="Sybase::DBlib",user=NULL,pwd=NULL,server=NULL,appname=NULL)
  	char *	package
***************
*** 4333,4338 ****
--- 4359,4366 ----
  
      RETVAL = start_xact(dbproc, app_name, xact_name, site_count);
  }
+   OUTPUT:
+ RETVAL
  
  int
  stat_xact(dbp, id)
***************
*** 4344,4349 ****
--- 4372,4379 ----
  
      RETVAL = stat_xact(dbproc, id);
  }
+   OUTPUT:
+ RETVAL
  
  int
  scan_xact(dbp, id)
***************
*** 4355,4360 ****
--- 4385,4392 ----
  
      RETVAL = scan_xact(dbproc, id);
  }
+   OUTPUT:
+ RETVAL
  
  int
  commit_xact(dbp, id)
***************
*** 4366,4371 ****
--- 4398,4405 ----
  
      RETVAL = commit_xact(dbproc, id);
  }
+   OUTPUT:
+ RETVAL
  
  void
  close_commit(dbp)
***************
*** 4388,4393 ****
--- 4422,4429 ----
  
      RETVAL = abort_xact(dbproc, id);
  }
+   OUTPUT:
+ RETVAL
  
  void
  build_xact_string(xact_name, service_name, commid)
***************
*** 4406,4411 ****
--- 4442,4461 ----
  
      Safefree(buf);
  }
+ 
+ int
+ remove_xact(dbp, id, site_count)
+         SV *    dbp
+         int     id
+         int     site_count
+   CODE:
+ {
+     DBPROCESS *dbproc = getDBPROC(dbp);
+ 
+     RETVAL = remove_xact(dbproc, id, site_count);
+ }
+   OUTPUT:
+ RETVAL
  
  int
  dbrpcinit(dbp, rpcname, opt)
Index: DBlib/Makefile.PL
Prereq: 1.9
*** sybperl-2.0/DBlib/Makefile.PL	Tue Oct 31 14:27:46 1995
--- sybperl-2.0a/DBlib/Makefile.PL	Wed Dec 13 09:21:10 1995
***************
*** 1,5 ****
  # -*-Perl-*-
! #	@(#)Makefile.PL	1.9	10/18/95
  
  use ExtUtils::MakeMaker;
  
--- 1,5 ----
  # -*-Perl-*-
! #	@(#)Makefile.PL	1.10	12/13/95
  
  use ExtUtils::MakeMaker;
  
***************
*** 27,42 ****
      print MF "# Empty Makefile to keep make happy\n\nall:\n\nconfig:\n\ntest:\n\ninstall:\n\n";
      print MF "clean realclean:\n	mv Makefile Makefile.old\n";
      close(MF);
-     exit(0);
  }
! 
! WriteMakefile("LIBS" => [$lib_string],
! 	      "NAME" => "Sybase::DBlib",
! 	      "INC" => $inc_string,
! 	      "VERSION" => "$$sattr{VERSION}",
! 	      "DEFINE" => $def_string,
! 	      "MAP_TARGET" => '../perl'
! 	      );
  
  sub MY::staticmake
  {
--- 27,43 ----
      print MF "# Empty Makefile to keep make happy\n\nall:\n\nconfig:\n\ntest:\n\ninstall:\n\n";
      print MF "clean realclean:\n	mv Makefile Makefile.old\n";
      close(MF);
  }
! else
! {
!     WriteMakefile("LIBS" => [$lib_string],
! 		  "NAME" => "Sybase::DBlib",
! 		  "INC" => $inc_string,
! 		  "VERSION" => "$$sattr{VERSION}",
! 		  "DEFINE" => $def_string,
! 		  "MAP_TARGET" => '../perl'
! 		  );
! }
  
  sub MY::staticmake
  {
Index: FAQ
Prereq: 1.4
*** sybperl-2.0/FAQ	Tue Oct 31 14:27:51 1995
--- sybperl-2.0a/FAQ	Wed Dec 13 09:21:14 1995
***************
*** 1,6 ****
  		  SYBPERL Frequently Asked Questions
  
! 		  @(#)FAQ	1.4	10/27/95
  
  NOTE: This FAQ is still very much under construction!!!
  
--- 1,6 ----
  		  SYBPERL Frequently Asked Questions
  
! 		  @(#)FAQ	1.5	11/2/95
  
  NOTE: This FAQ is still very much under construction!!!
  
***************
*** 69,82 ****
  
  1.2) Where can I get Sybperl?
  
!    See above :-)
  
!    Version 1.x: ftp://ftp.demon.co.uk/pub/perl/db/perl4/sybperl
!    Version 2.x: ftp://ftp.demon.co.uk/pub/perl/db/mod/Sybase
  
!    These directories are mirrored on Delphi Internet:
!    ftp://ftp.delphi.com/pub/mirrors/packages/perl/db/...
!    (Although it appears that the mirroring is not done very often)
     
     Version 2.x is also available on Sybase's Web page:
     http://www.sybase.com/WWW/Sybperl/index.html. I try to make sure
--- 69,112 ----
  
  1.2) Where can I get Sybperl?
  
!    Sybperl is available from CPAN (the Comprehensive Perl Archive Network)
  
!    The CPAN master is at
!        ftp://ftp.funet.fi/pub/languages/perl/CPAN
  
!    and Sybperl is archived in
!        "CPAN"/authors/id/MEWP/sybperl-2.0.tar.gz
! 
!    CPAN is mirrored widely, please select the CPAN site nearest you to
!    keep the networks happy. At the moment the registered CPAN sites are:
! 
! 	Africa
! 
! 	ftp://ftp.is.co.za/programming/perl/CPAN/
! 
! 	Australasia
! 
! 	ftp://coombs.anu.edu.au/pub/perl/
! 	ftp://ftp.mame.mu.oz.au/pub/perl/CPAN/
! 
! 	Europe
! 
! 	ftp://ftp.funet.fi/pub/languages/perl/CPAN/
! 	ftp://ftp.sunet.se/pub/lang/perl/CPAN/
! 	ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
! 	ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/
! 	ftp://ftp.pasteur.fr/pub/computing/unix/perl/CPAN/
! 	ftp://ftp.rz.ruhr-uni-bochum.de/pub/programming/languages/perl/CPAN/
! 	ftp://ftp.switch.ch/mirror/CPAN/
! 	ftp://orpheu.ci.uminho.pt/pub/lang/perl/
! 
! 	North America
! 
! 	ftp://ftp.cis.ufl.edu/pub/perl/CPAN/
! 	ftp://uiarchive.cso.uiuc.edu/pub/lang/perl/CPAN/
! 	ftp://ftp.delphi.com/pub/mirrors/packages/perl/CPAN/
! 	ftp://ftp.sedl.org/pub/mirrors/CPAN/
! 	ftp://ftp.sterling.com/programming/languages/perl/
     
     Version 2.x is also available on Sybase's Web page:
     http://www.sybase.com/WWW/Sybperl/index.html. I try to make sure
Index: Makefile.PL
*** sybperl-2.0/Makefile.PL	Tue Oct 31 14:27:48 1995
--- sybperl-2.0a/Makefile.PL	Wed Dec 13 09:21:12 1995
***************
*** 1,5 ****
  # -*-Perl-*-
! #	%W%	%G%
  use ExtUtils::MakeMaker qw(WriteMakefile $Verbose %att);
  require 5.001;
  
--- 1,5 ----
  # -*-Perl-*-
! #	@(#)Makefile.PL	1.13	12/13/95
  use ExtUtils::MakeMaker qw(WriteMakefile $Verbose %att);
  require 5.001;
  
Index: README-2.0
*** sybperl-2.0/README-2.0	Tue Oct 31 14:27:45 1995
--- sybperl-2.0a/README-2.0	Wed Dec 13 09:21:09 1995
***************
*** 16,21 ****
--- 16,30 ----
        NUMERIC/DECIMAL datatypes. This is done transparently, using
        operator overloading.
  
+ !!Behaviour change!!
+ 
+    - The behaviour of the Sybase::DBlib::sql subroutine changed in
+      2b3. In 2b2 (and before) saying @data = $d->sql(...) returned an
+      array of rows, where each row is joined into a single line using
+      a separator. In 2b3 (and later), @data is an array of references
+      to rows, and each row is now an array, as returned by
+      dbnextrow().
+      
  Do you need to upgrade?
  
     - If you have 2b3, and you are using the DBlib &/or Sybperl
Index: Sybperl/Makefile.PL
Prereq: 1.7
*** sybperl-2.0/Sybperl/Makefile.PL	Tue Oct 31 14:27:50 1995
--- sybperl-2.0a/Sybperl/Makefile.PL	Wed Dec 13 09:21:14 1995
***************
*** 1,5 ****
  # -*-Perl-*-
! #	@(#)Makefile.PL	1.7	10/18/95
  
  use ExtUtils::MakeMaker;
  
--- 1,5 ----
  # -*-Perl-*-
! #	@(#)Makefile.PL	1.8	12/13/95
  
  use ExtUtils::MakeMaker;
  
***************
*** 21,35 ****
      print MF "# Empty Makefile to keep make happy\n\nall:\n\nconfig:\n\ntest:\n\ninstall:\n\n";
      print MF "clean realclean:\n	mv Makefile Makefile.old\n";
      close(MF);
-     exit(0);
  }
! 
! 
! WriteMakefile("NAME" => "Sybase::Sybperl",
! 	      "VERSION" => "$$sattr{VERSION}",
! 	      "SKIP" => [qw(static dynamic)],
! 	      "MAP_TARGET" => '../perl'
! 	      );
  
  sub MY::postamble {
  	'
--- 21,35 ----
      print MF "# Empty Makefile to keep make happy\n\nall:\n\nconfig:\n\ntest:\n\ninstall:\n\n";
      print MF "clean realclean:\n	mv Makefile Makefile.old\n";
      close(MF);
  }
! else
! {
!     WriteMakefile("NAME" => "Sybase::Sybperl",
! 		  "VERSION" => "$$sattr{VERSION}",
! 		  "SKIP" => [qw(static dynamic)],
! 		  "MAP_TARGET" => '../perl'
! 		  );
! }
  
  sub MY::postamble {
  	'
Index: pod/sybperl.pod
Prereq: 1.10
*** sybperl-2.0/pod/sybperl.pod	Tue Oct 31 14:27:48 1995
--- sybperl-2.0a/pod/sybperl.pod	Wed Dec 13 09:21:12 1995
***************
*** 1,4 ****
! @(#)sybperl.pod	1.10	10/27/95
  
  
  =head1 NAME
--- 1,4 ----
! @(#)sybperl.pod	1.11	12/13/95
  
  
  =head1 NAME
***************
*** 104,109 ****
--- 104,113 ----
  Force the closing of a connection. Note that connections are
  automatically closed when the $dbh goes out of scope.
  
+ =item $dbh->DBDEAD
+ 
+ Returns TRUE if the B has been marked I by I.
+ 
  =item $status = $dbh->DBCURCMD
  
  Returns the number of the currently executing command in the command
***************
*** 245,251 ****
  It is necessary to call BCP_SETL(TRUE) before opening the
  connection with which one wants to run a BCP IN operation.
  
! =item $state = bcp_getl()
  
  Retrieve the current BCP flag status.
  
--- 249,255 ----
  It is necessary to call BCP_SETL(TRUE) before opening the
  connection with which one wants to run a BCP IN operation.
  
! =item $state = bcp_getl
  
  Retrieve the current BCP flag status.
  
***************
*** 384,390 ****
  
  Set the password for connecting to a remote server.
  
! =item dbrpwclr()
  
  Clear all remote server passwords.
  
--- 388,394 ----
  
  Set the password for connecting to a remote server.
  
! =item dbrpwclr
  
  Clear all remote server passwords.
  
***************
*** 410,415 ****
--- 414,421 ----
  
  =item $string = Sybase::DBlib::build_xact_string($xact_name, $service_name, $id)
  
+ =item $status = $dbh->remove_xact($id, $site_count)
+ 
  Please see the Sybase documentation for this.
  
  B These routines have not been thouroughly tested!
***************
*** 444,450 ****
  For DB-library 10.0+, determines which behaviour to adopt relative to
  new datatypes (such as NUMERIC, DECIMAL).
  
! =item dbversion()
  
  Returns a string identifying the version of DBlibrary that this copy
  of Sybperl was built with.
--- 450,456 ----
  For DB-library 10.0+, determines which behaviour to adopt relative to
  new datatypes (such as NUMERIC, DECIMAL).
  
! =item dbversion
  
  Returns a string identifying the version of DBlibrary that this copy
  of Sybperl was built with.
***************
*** 453,459 ****
  
  =item DBSETLNATLANG($language)
  
! =item $time = DBGETTIME()
  
  =item $time = dbsettime($seconds)
  
--- 459,465 ----
  
  =item DBSETLNATLANG($language)
  
! =item $time = DBGETTIME
  
  =item $time = dbsettime($seconds)
  
***************
*** 462,468 ****
  These utility routines are probably very seldom used. See the
  DB-library manual for an explanation of their use.
  
! =item dbexit()
  
  Tell DB-library that we're done. Once this call has been made, no
  further activity requiring DB-library can be performed in the current
--- 468,474 ----
  These utility routines are probably very seldom used. See the
  DB-library manual for an explanation of their use.
  
! =item dbexit
  
  Tell DB-library that we're done. Once this call has been made, no
  further activity requiring DB-library can be performed in the current
***************
*** 638,644 ****
  if you want to do RPCs or cursor operations. For straight queries you
  should use ct_execute() or ct_sql() instead.
  
! =item $status = $dbh->ct_send()
  
  Send the current command buffer to the server for execution.
  
--- 644,650 ----
  if you want to do RPCs or cursor operations. For straight queries you
  should use ct_execute() or ct_sql() instead.
  
! =item $status = $dbh->ct_send
  
  Send the current command buffer to the server for execution.
  
***************
*** 661,667 ****
  The $status value takes the following values: CS_SUCCEED,
  CS_END_RESULTS, CS_FAIL, CS_CANCELED.
  
! =item @names = $dbh->ct_col_names()
  
  Retrieve the column names of the current query. If the current query
  is not a select statement, then an empty array is returned.
--- 667,673 ----
  The $status value takes the following values: CS_SUCCEED,
  CS_END_RESULTS, CS_FAIL, CS_CANCELED.
  
! =item @names = $dbh->ct_col_names
  
  Retrieve the column names of the current query. If the current query
  is not a select statement, then an empty array is returned.