DBIx::Class::Storage::DBI::NoBindVars failing on custom data types

6 messages Options
Embed this post
Permalink
Robert Heinzmann

DBIx::Class::Storage::DBI::NoBindVars failing on custom data types

Reply Threaded More More options
Print post
Permalink
Hello,

we use DBIx::Class on Sybase and have custom types (based on Numeric) on
Sybase.

The Standard DBIx::Class::Storage::DBI::Sybase uses
DBIx::Class::Storage::DBI::NoBindVars because auf the "poor quote
support" for DBI.

However when trying to issue numeric queries, an integer value is quoted
to '1234' and this fails on the server.

I tried to define the data type manually:

  __PACKAGE__->add_columns(
          'host_id' => { data_type => "integer" },
  );

However this setting is ignored -> values still quoted with "'".

099_07 seems to address  this issue, however it is not ready yet. I also
tested this release by replacing
/usr/share/perl5/DBIx/Class/Storage/DBI/NoBindVars.pm and
/usr/share/perl5/DBIx/Class/Storage/DBI/Sybase.pm of Debian Lenny Stable
with the once from 99_07 - issue not fixed.  I also updated to testing
release of libdbix-class-perl - no success.

I changed /usr/share/perl5/DBIx/Class/Storage/DBI/Sybase.pm to:

  use base qw/DBIx::Class::Storage::DBI/;

And now the query seems to work.

Is the "poor quote support in prepare" of DBD::Sybase still true ?

ii  libdbix-class-perl                         0.08103-1
extensible and flexible object <-> relationa
ii  libdbd-sybase-perl                         1.00-3+b2
Sybase/MS SQL database driver for the DBI mo
ii  libct4                                     0.82-4
libraries for connecting to MS SQL and Sybas
ii  freetds-common                             0.82-4
configuration files for FreeTDS SQL client l

cat /etc/debian_version
5.0.1

Regards,
Robert



---
Robert Heinzmann

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Peter Rabbitson-2

Re: DBIx::Class::Storage::DBI::NoBindVars failing on custom data types

Reply Threaded More More options
Print post
Permalink
Robert Heinzmann wrote:

> Hello,
>
> we use DBIx::Class on Sybase and have custom types (based on Numeric) on
> Sybase.
>
> The Standard DBIx::Class::Storage::DBI::Sybase uses
> DBIx::Class::Storage::DBI::NoBindVars because auf the "poor quote
> support" for DBI.
>
> However when trying to issue numeric queries, an integer value is quoted
> to '1234' and this fails on the server.
>
> I tried to define the data type manually:
>
>   __PACKAGE__->add_columns(
>           'host_id' => { data_type => "integer" },
>   );
>
> However this setting is ignored -> values still quoted with "'".
>
> 099_07 seems to address  this issue, however it is not ready yet. I also
> tested this release by replacing
> /usr/share/perl5/DBIx/Class/Storage/DBI/NoBindVars.pm and
> /usr/share/perl5/DBIx/Class/Storage/DBI/Sybase.pm of Debian Lenny Stable
> with the once from 99_07 - issue not fixed.  I also updated to testing
> release of libdbix-class-perl - no success.
>
> I changed /usr/share/perl5/DBIx/Class/Storage/DBI/Sybase.pm to:
>
>   use base qw/DBIx::Class::Storage::DBI/;
>
> And now the query seems to work.
>
> Is the "poor quote support in prepare" of DBD::Sybase still true ?
>
> ii  libdbix-class-perl                         0.08103-1
> extensible and flexible object <-> relationa
> ii  libdbd-sybase-perl                         1.00-3+b2
> Sybase/MS SQL database driver for the DBI mo
> ii  libct4                                     0.82-4
> libraries for connecting to MS SQL and Sybas
> ii  freetds-common                             0.82-4
> configuration files for FreeTDS SQL client l
>
> cat /etc/debian_version
> 5.0.1
>

Try this branch:

http://dev.catalyst.perl.org/repos/bast/DBIx-Class/0.08/branches/sybase/

It is not released yet, but will be very soon if we get input from
users like yourself.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Robert Heinzmann

AW: DBIx::Class::Storage::DBI::NoBindVars failing oncustom data types

Reply Threaded More More options
Print post
Permalink
Hi,

tried it - could not cleanly compile the stuff on Debian Lenny.

After installing additional dependencies, the Tests fail:

t/67pager........................................Can't locate object
method "load_optional_class" via package "DBIx::Class::Storage::DBI" at
/home/builder/BUILD/libdbix-class-perl/libdbix-class-perl-0.08010sybase6
715/blib/lib/DBIx/Class/Storage/DBI.pm line 645.

Grep shows:

builder@my-dev:~/BUILD/libdbix-class-perl/sybase$ grep -R
load_optional_class *
Changes:        - move load_optional_class from
DBIx::Class::Componentised to
Changes:          load_optional_class
lib/DBIx/Class/Storage/.svn/text-base/DBI.pm.svn-base:    if
($self->load_optional_class("DBIx::Class::Storage::DBI::${driver}")) {
lib/DBIx/Class/Storage/DBI.pm:    if
($self->load_optional_class("DBIx::Class::Storage::DBI::${driver}")) {
lib/DBIx/Class/Storage/DBI/Sybase.pm:    if (!$exception && $dbtype &&
$self->load_optional_class($subclass)) {
lib/DBIx/Class/Storage/DBI/.svn/text-base/Sybase.pm.svn-base:    if
(!$exception && $dbtype && $self->load_optional_class($subclass)) {
t/90ensure_class_loaded.t:# Test load_optional_class
t/90ensure_class_loaded.t:my $retval = eval {
$schema->load_optional_class('ANOTHER::FAKE::PACKAGE') };
t/90ensure_class_loaded.t:ok( !$@, 'load_optional_class on a nonexistent
class did not throw' );
t/90ensure_class_loaded.t:$retval = eval {
$schema->load_optional_class('DBICTest::OptionalComponent') };
t/90ensure_class_loaded.t:ok( !$@, 'load_optional_class on an existing
class did not throw' );
t/90ensure_class_loaded.t:eval {
$schema->load_optional_class('DBICTest::ErrorComponent') };
t/90ensure_class_loaded.t:  $retval = eval {
$schema->load_optional_class('FAKE::PAR::PACKAGE') };
t/90ensure_class_loaded.t:  ok( !$@, 'load_optional_class on a
nonexistent PAR class did not throw' );
t/90ensure_class_loaded.t:  $retval = eval {
$schema->load_optional_class('VIRTUAL::PAR::PACKAGE') };
t/90ensure_class_loaded.t:  ok( $@, 'load_optional_class of a
no-true-returning PAR module did throw' );
t/90ensure_class_loaded.t:  $retval = eval {
$schema->load_optional_class('VIRTUAL::PAR::PACKAGE') };
t/90ensure_class_loaded.t:  ok( !$@, 'load_optional_class of a PAR
module did not throw' );
t/90ensure_class_loaded.t:  $retval = eval {
$schema->load_optional_class('DBIx::Class::ResultClass::HashRefInflator'
) };
t/90ensure_class_loaded.t:  ok( !$@, 'load_optional_class did not throw'
) || diag $@;
t/90ensure_class_loaded.t:  eval {
$schema->load_optional_class('DBICTest::SyntaxErrorComponent2') };
t/90ensure_class_loaded.t:
'load_optional_class(DBICTest::SyntaxErrorComponent2) threw ok' );
t/.svn/text-base/90ensure_class_loaded.t.svn-base:# Test
load_optional_class
t/.svn/text-base/90ensure_class_loaded.t.svn-base:my $retval = eval {
$schema->load_optional_class('ANOTHER::FAKE::PACKAGE') };
t/.svn/text-base/90ensure_class_loaded.t.svn-base:ok( !$@,
'load_optional_class on a nonexistent class did not throw' );
t/.svn/text-base/90ensure_class_loaded.t.svn-base:$retval = eval {
$schema->load_optional_class('DBICTest::OptionalComponent') };
t/.svn/text-base/90ensure_class_loaded.t.svn-base:ok( !$@,
'load_optional_class on an existing class did not throw' );
t/.svn/text-base/90ensure_class_loaded.t.svn-base:eval {
$schema->load_optional_class('DBICTest::ErrorComponent') };
t/.svn/text-base/90ensure_class_loaded.t.svn-base:  $retval = eval {
$schema->load_optional_class('FAKE::PAR::PACKAGE') };
t/.svn/text-base/90ensure_class_loaded.t.svn-base:  ok( !$@,
'load_optional_class on a nonexistent PAR class did not throw' );
t/.svn/text-base/90ensure_class_loaded.t.svn-base:  $retval = eval {
$schema->load_optional_class('VIRTUAL::PAR::PACKAGE') };
t/.svn/text-base/90ensure_class_loaded.t.svn-base:  ok( $@,
'load_optional_class of a no-true-returning PAR module did throw' );
t/.svn/text-base/90ensure_class_loaded.t.svn-base:  $retval = eval {
$schema->load_optional_class('VIRTUAL::PAR::PACKAGE') };
t/.svn/text-base/90ensure_class_loaded.t.svn-base:  ok( !$@,
'load_optional_class of a PAR module did not throw' );
t/.svn/text-base/90ensure_class_loaded.t.svn-base:  $retval = eval {
$schema->load_optional_class('DBIx::Class::ResultClass::HashRefInflator'
) };
t/.svn/text-base/90ensure_class_loaded.t.svn-base:  ok( !$@,
'load_optional_class did not throw' ) || diag $@;
t/.svn/text-base/90ensure_class_loaded.t.svn-base:  eval {
$schema->load_optional_class('DBICTest::SyntaxErrorComponent2') };
t/.svn/text-base/90ensure_class_loaded.t.svn-base:
'load_optional_class(DBICTest::SyntaxErrorComponent2) threw ok' );

Seems somethins is missing ....
...
Changes:        - move load_optional_class from
DBIx::Class::Componentised to
Changes:          load_optional_class
... However noting in C3 ..


Robert

>
> Try this branch:
>
> http://dev.catalyst.perl.org/repos/bast/DBIx-Class/0.08/branch
> es/sybase/
>
> It is not released yet, but will be very soon if we get input
> from users like yourself.
>

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Peter Rabbitson-2

Re: AW: DBIx::Class::Storage::DBI::NoBindVars failing oncustom data types

Reply Threaded More More options
Print post
Permalink
Robert Heinzmann wrote:

> Hi,
>
> tried it - could not cleanly compile the stuff on Debian Lenny.
>
> After installing additional dependencies, the Tests fail:
>
> t/67pager........................................Can't locate object
> method "load_optional_class" via package "DBIx::Class::Storage::DBI" at
> /home/builder/BUILD/libdbix-class-perl/libdbix-class-perl-0.08010sybase6
> 715/blib/lib/DBIx/Class/Storage/DBI.pm line 645.

This means your Class::C3::Componentised is old. Re-check.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Robert Heinzmann

AW: AW: DBIx::Class::Storage::DBI::NoBindVars failingoncustom data types

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
AW: AW: [Dbix-class] DBIx::Class::Storage::DBI::NoBindVars failingoncustom data types

Hi, general question:

Is the branch tree you mention standalone (aka works as "svn checkout" without addidional packages ?) or does it require offiical base version ?

I did a "svn checkout" and all files are there. So maybe the "current" Class::C3::Componentised is missing in the repository.

Robert

> This means your Class::C3::Componentised is old. Re-check.



_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Peter Rabbitson-2

Re: AW: AW: DBIx::Class::Storage::DBI::NoBindVars failingoncustom data types

Reply Threaded More More options
Print post
Permalink
Robert Heinzmann wrote:
> Hi, general question:
>
> Is the branch tree you mention standalone (aka works as "svn checkout"
> without addidional packages ?) or does it require offiical base version ?
>
> I did a "svn checkout" and all files are there. So maybe the "current"
> Class::C3::Componentised is missing in the repository.
>

No, it requires modules off CPAN. Run perl Makefile.PL and observe the
output.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...