Skip Menu |

This queue is for tickets about the DBD-Sybase CPAN distribution.

Report information
The Basics
Id: 92163
Status: open
Priority: 0/
Queue: DBD-Sybase

People
Owner: Nobody in particular
Requestors: sferencik [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.15
Fixed in: (no value)



Subject: Makefile.PL: fix the semantics of the --chained option
Currently you can call - Makefile.PL --chained - Makefile.PL --chained 1 - Makefile.PL --chained y All are accepted but surprisingly, only the last option results in the chained being set to true. The patch below fixes it to make --chained a binary/negatable option (so you can pass --chained or --nochained). Also, the prompt is only printed if this option was omitted. --- c:\temp\p4v\PRGDWM355382_qaperforce_1666\depot\QA\Toolbox\main.br\CPAN\DBD-Sybase\1.15\src\Makefile#3.PL 2014-01-15 14:00:08.000000000 +-0100 +++ c:\temp\p4v\PRGDWM355382_qaperforce_1666\depot\QA\Toolbox\main.br\CPAN\DBD-Sybase\1.15\src\Makefile@=9267234.PL 2014-01-15 14:00:08.000000000 +-0100 @@ -23,13 +23,13 @@ my $file; my $chained; my $threaded_libs; my $accept_test_defaults; GetOptions( '--file' => \$file, - '--chained:s' => \$chained, + '--chained!' => \$chained, '--threaded_libs:s' => \$threaded_libs, '--accept_test_defaults' => \$accept_test_defaults ); select(STDOUT); $| = 1; @@ -30,36 +30,37 @@ '--threaded_libs:s' => \$threaded_libs, '--accept_test_defaults' => \$accept_test_defaults ); select(STDOUT); $| = 1; print OUT "$_=$pwd{$_}\n"; } close(OUT); } sub checkChainedAutoCommit { - print <<EOF; + my $ans; + if ( defined($chained) ) { + $ans = $chained ? 'y' : 'n'; + } + else { + print <<EOF; By default DBD::Sybase 1.05 and later use the 'CHAINED' mode (where available) when 'AutoCommit' is turned off. Versions 1.04 and older instead managed the transactions explicitly with a 'BEGIN TRAN' before the first DML statement. Using the 'CHAINED' mode is preferable as it is the way that Sybase implements AutoCommit handling for both its ODBC and JDBC drivers. EOF - print "Use 'CHAINED' mode by default (Y/N) [Y]: "; - my $ans; - if ( defined($chained) ) { - $ans = $chained; - } - else { + print "Use 'CHAINED' mode by default (Y/N) [Y]: "; $ans = getAns(0); } if ( $ans and $ans !~ /^y/i ) { + print "Avoiding 'CHAINED' mode.\n"; $inc_string .= " -DNO_CHAINED_TRAN=1"; } print "\n"; } sub checkForThreadedLibs {
From: sferencik [...] gmail.com
Same for the --threaded_libs and --accept_test_defaults options; both are binary. --- c:\temp\p4v\PRGDWM355382_qaperforce_1666\depot\QA\Toolbox\main.br\CPAN\DBD-Sybase\1.15\src\Makefile#4.PL 2014-01-15 14:15:40.000000000 +-0100 +++ c:\p4_ws\0toolbox\main.br\CPAN\DBD-Sybase\1.15\src\Makefile.PL 2014-01-15 14:15:23.000000000 +-0100 @@ -22,16 +22,16 @@ my $file; my $chained; my $threaded_libs; my $accept_test_defaults; GetOptions( - '--file' => \$file, - '--chained!' => \$chained, - '--threaded_libs:s' => \$threaded_libs, - '--accept_test_defaults' => \$accept_test_defaults + '--file' => \$file, + '--chained!' => \$chained, + '--threaded_libs!' => \$threaded_libs, + '--accept_test_defaults!' => \$accept_test_defaults ); select(STDOUT); $| = 1; configure(); @@ -32,19 +32,19 @@ ); select(STDOUT); $| = 1; configure(); # Logic to replace normal libs with _r (re-entrant) libs if # usethreads is defined provided by W. Phillip Moore (wpm@ms.com) # I have no idea if this works on Win32 systems (probably not!) if ( $Config{usethreads} ) { print "Running in threaded mode - looking for _r libraries...\n"; - if ( checkForThreadedLibs() ) { + if ( avoidThreadedLibs() ) { my $found = 0; foreach ( split( /\s+/, $lib_string ) ) { next unless /^-l(\S+)/; my $oldname = $1; my $newname = $1 . "_r"; next unless exists $libname{$newname}; @@ -242,44 +242,45 @@ my $found = 0; foreach ( split( /\s+/, $lib_string ) ) { next unless /^-l(\S+)/; my $oldname = $1; my $newname = $1 . "_r"; next unless exists $libname{$newname}; print "Avoiding 'CHAINED' mode.\n"; $inc_string .= " -DNO_CHAINED_TRAN=1"; } print "\n"; } -sub checkForThreadedLibs { +sub avoidThreadedLibs { my $ret = 1; if ( $] >= 5.008 ) { $ret = 0; - print <<EOF; + my $ans; + + if ( defined($threaded_libs) ) { + $ans = $threaded_libs ? 'y' : 'n'; + } + else { + print <<EOF; ***NOTE*** There is an incompatibility between perl (5.8.x or later) built in threaded mode and Sybase's threaded libraries, which means that signals delivered to the perl process result in a segment violation. I suggest building DBD::Sybase with the normal libraries in this case to get reasonable behavior for signal handling. EOF - print "Use the threaded (lib..._r) libraries [N]: "; - my $ans; - - if ( defined($threaded_libs) ) { - $ans = $threaded_libs; - } - else { + print "Use the threaded (lib..._r) libraries [N]: "; $ans = getAns(0); } if ( $ans and $ans =~ /^y/i ) { + print "Avoiding the threaded libraries.\n"; $ret = 1; } print "\n"; } return $ret;