Skip Menu |
 

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

Report information
The Basics
Id: 100186
Status: resolved
Priority: 0/
Queue: DBD-ODBC

People
Owner: Nobody in particular
Requestors: july [...] imperia.bg
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.51_1



MIME-Version: 1.0
X-Spam-Status: No, score=-2.568 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.668] autolearn=ham
X-Spam-Flag: NO
content-type: text/plain; charset="utf-8"; format="flowed"
Message-ID: <545D00C9.7090002 [...] imperia.bg>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Virus-Scanned: amavisd-new at imperia.bg
X-Spam-Score: -2.568
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 7363924068C for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Fri, 7 Nov 2014 12:27:03 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m6FGgbnQyuT6 for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Fri, 7 Nov 2014 12:27:02 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id BD2FC24063F for <bug-DBD-ODBC [...] rt.cpan.org>; Fri, 7 Nov 2014 12:27:01 -0500 (EST)
Received: (qmail 29492 invoked by alias); 7 Nov 2014 17:27:00 -0000
Received: from smtp.imperia.bg (HELO smtp.imperia.bg) (213.130.73.86) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 07 Nov 2014 09:26:57 -0800
Received: from localhost (git.imperia.bg [127.0.0.1]) by smtp.imperia.bg (Postfix) with ESMTP id 4159C1467246 for <bug-DBD-ODBC [...] rt.cpan.org>; Fri, 7 Nov 2014 19:26:51 +0200 (EET)
Received: from smtp.imperia.bg ([127.0.0.1]) by localhost (git.imperia.bg [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YDUMlUY-5VhG for <bug-DBD-ODBC [...] rt.cpan.org>; Fri, 7 Nov 2014 19:26:33 +0200 (EET)
Received: from [10.29.0.18] (gw.imperia.bg [213.130.73.194]) by smtp.imperia.bg (Postfix) with ESMTPSA id 3EE3F1467247 for <bug-DBD-ODBC [...] rt.cpan.org>; Fri, 7 Nov 2014 19:26:33 +0200 (EET)
Delivered-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
Subject: Invalid precision value error
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
Return-Path: <julian.lishev [...] imperia.bg>
X-RT-Mail-Extension: dbd-odbc
X-Original-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Date: Fri, 07 Nov 2014 19:26:33 +0200
X-Spam-Level:
To: bug-DBD-ODBC [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Julian <july [...] imperia.bg>
X-RT-Original-Encoding: utf-8
X-RT-Interface: Email
Content-Length: 1926
Download (untitled) / with headers
text/plain 1.8k
Hello, I'm getting the following error: [Microsoft][ODBC Driver 11 for SQL Server]Invalid precision value (SQL-HY104) This happens for: INSERT into binary_meta VALUES (?, ?, ?, ?, ?, ?) EOF where the problematic column is of type VARBINARY(MAX). The setup is Linux (x64bit Ubuntu 14.04 and CentOS 5.9) client with SQL Server 2008 R2 SP2. The linux driver is the one officially provided by Microsoft: libmsodbcsql-11.0.so.2270.0 (Microsoft ODBC Driver 11 for SQL Server) http://www.microsoft.com/en-us/download/details.aspx?id=36437 plus unixODBC 2.3.0 (prerequirement). Perl versions (5.18.2 and 5.8.8) DBD::ODBC version 1.50 My workaround for this issue is by adding the following code at: dbdimp.c:4180: if (phs->sql_type == SQL_VARBINARY && phs->param_size == 0 && phs->requested_type == 0 && imp_dbh->driver_type == DT_DONT_CARE && strstr(imp_dbh->odbc_driver_name, "libmsodbcsql-11") == imp_dbh->odbc_driver_name && strcmp(imp_dbh->odbc_dbms_name, "Microsoft SQL Server") == 0 ) { /* printf("Driver name: %s\n", imp_dbh->odbc_driver_name); printf("Driver type: %d\n", imp_dbh->driver_type); printf("ODBC DBMS: %s\n", imp_dbh->odbc_dbms_name); printf("Request type: %d\n", phs->requested_type); printf("Param size: %d\n", phs->param_size); # Driver name: libmsodbcsql-11.0.so.2270.0 # Driver type: 0 # ODBC DBMS: Microsoft SQL Server # Request type: 0 # Param size: 0 */ column_size = 0; } This fix is tested against our (software) complete test suits and it looks ok. However I'm not sure whether the DBD::ODBC driver should also take extra care of other column types. Also it seems that the official ODBC driver for Linux, released by Microsoft is not exactly supported by the DBD::ODBC, since the driver_type is DT_DONT_CARE :) Regards, Julian Lishev
MIME-Version: 1.0
In-Reply-To: <545D00C9.7090002 [...] imperia.bg>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <545D00C9.7090002 [...] imperia.bg>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-32219-1415625175-1767.100186-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 2707
Download (untitled) / with headers
text/plain 2.6k
On Fri Nov 07 12:27:04 2014, july@imperia.bg wrote: Show quoted text
> Hello, > > I'm getting the following error: > > [Microsoft][ODBC Driver 11 for SQL Server]Invalid precision value > (SQL-HY104) > > This happens for: > INSERT into binary_meta > VALUES (?, ?, ?, ?, ?, ?) > EOF > > where the problematic column is of type VARBINARY(MAX). > > The setup is Linux (x64bit Ubuntu 14.04 and CentOS 5.9) client with SQL > Server 2008 R2 SP2. > The linux driver is the one officially provided by Microsoft: > libmsodbcsql-11.0.so.2270.0 (Microsoft ODBC Driver 11 for SQL Server) > http://www.microsoft.com/en-us/download/details.aspx?id=36437 > plus unixODBC 2.3.0 (prerequirement). > > Perl versions (5.18.2 and 5.8.8) > DBD::ODBC version 1.50 > > My workaround for this issue is by adding the following code at: > > dbdimp.c:4180: > > if (phs->sql_type == SQL_VARBINARY > && phs->param_size == 0 && phs->requested_type == 0 > && imp_dbh->driver_type == DT_DONT_CARE > && strstr(imp_dbh->odbc_driver_name, "libmsodbcsql-11") > == imp_dbh->odbc_driver_name > && strcmp(imp_dbh->odbc_dbms_name, "Microsoft SQL Server") == 0 > ) { > /* > printf("Driver name: %s\n", imp_dbh->odbc_driver_name); > printf("Driver type: %d\n", imp_dbh->driver_type); > printf("ODBC DBMS: %s\n", imp_dbh->odbc_dbms_name); > printf("Request type: %d\n", phs->requested_type); > printf("Param size: %d\n", phs->param_size); > > # Driver name: libmsodbcsql-11.0.so.2270.0 > # Driver type: 0 > # ODBC DBMS: Microsoft SQL Server > # Request type: 0 > # Param size: 0 > */ > > column_size = 0; > } > > This fix is tested against our (software) complete test suits and it > looks ok. However I'm not sure whether the DBD::ODBC driver should also > take extra care of other column types. > Also it seems that the official ODBC driver for Linux, released by > Microsoft is not exactly supported by the DBD::ODBC, since the > driver_type is DT_DONT_CARE :) > > Regards, > Julian Lishev
Julian, Thanks for reporting this issue. Is all of that code an addition? You are right wrt areas in the code which are MS SQL Server specific - the driver you are using should not be DT_DONT_CARE. I don't have that driver so I'm assuming from the above your driver name is libmsodbcsql-11.0.so.2270.0 and I will need to make sure that sets either DT_SQL_SERVER_NATIVE_CLIENT or DT_SQL_SERVER. I'm guessing the latter as that is the newer one. Could you provide a small self contained script I can use to reproduce then I will check it out and make the changes. Martin -- Martin J. Evans Wetherby, UK
MIME-Version: 1.0
X-Spam-Status: No, score=-4.568 tagged_above=-99.9 required=10 tests=[AWL=2.000, BAYES_00=-1.9, FROM_OUR_RT=-4, RP_MATCHES_RCVD=-0.668] autolearn=ham
In-Reply-To: <rt-4.0.18-32219-1415625175-1924.100186-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-100186 [...] rt.cpan.org> <545D00C9.7090002 [...] imperia.bg> <rt-4.0.18-32219-1415625175-1924.100186-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Virus-Scanned: amavisd-new at imperia.bg
Message-ID: <5462171E.6040901 [...] imperia.bg>
content-type: text/plain; charset="utf-8"; format="flowed"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -4.568
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 930D7240635 for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Tue, 11 Nov 2014 13:50:27 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZWqtdDU8mL5a for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Tue, 11 Nov 2014 13:50:26 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id E7258240324 for <bug-DBD-ODBC [...] rt.cpan.org>; Tue, 11 Nov 2014 13:50:25 -0500 (EST)
Received: (qmail 15589 invoked by alias); 11 Nov 2014 18:50:25 -0000
Received: from smtp.imperia.bg (HELO smtp.imperia.bg) (213.130.73.86) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Tue, 11 Nov 2014 10:50:21 -0800
Received: from localhost (git.imperia.bg [127.0.0.1]) by smtp.imperia.bg (Postfix) with ESMTP id BF104146CED8 for <bug-DBD-ODBC [...] rt.cpan.org>; Tue, 11 Nov 2014 16:03:26 +0200 (EET)
Received: from smtp.imperia.bg ([127.0.0.1]) by localhost (git.imperia.bg [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9BZcAmj7-6uZ for <bug-DBD-ODBC [...] rt.cpan.org>; Tue, 11 Nov 2014 16:03:09 +0200 (EET)
Received: from [10.29.0.18] (gw.imperia.bg [213.130.73.194]) by smtp.imperia.bg (Postfix) with ESMTPSA id E622C146C805 for <bug-DBD-ODBC [...] rt.cpan.org>; Tue, 11 Nov 2014 16:03:08 +0200 (EET)
Delivered-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
Subject: Re: [rt.cpan.org #100186] Invalid precision value error
Return-Path: <julian.lishev [...] imperia.bg>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
X-RT-Mail-Extension: dbd-odbc
Date: Tue, 11 Nov 2014 16:03:10 +0200
X-Spam-Level:
To: bug-DBD-ODBC [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Julian <july [...] imperia.bg>
RT-Message-ID: <rt-4.0.18-4310-1415731828-1508.100186-0-0 [...] rt.cpan.org>
Content-Length: 4490
Download (untitled) / with headers
text/plain 4.3k
Hi Martin, Here is the patch file: ---------------------------- --- dbdimp2.c 2014-11-11 14:08:26.739154650 +0200 +++ dbdimp.c 2014-11-11 15:29:08.419093790 +0200 @@ -4177,6 +4177,25 @@ * sloi = -500100 ps=0 sqlt=-3 (SQL_VARBINARY) * sloi = 4001 ps=0 sqlt=-9 (SQL_WVARCHAR) <--- this one fails without above */ + if (phs->sql_type == SQL_VARBINARY && phs->param_size == 0 + && phs->requested_type == 0 && imp_dbh->driver_type == DT_DONT_CARE + && strstr(imp_dbh->odbc_driver_name, "libmsodbcsql-11") + == imp_dbh->odbc_driver_name + && strcmp(imp_dbh->odbc_dbms_name, "Microsoft SQL Server") == 0 ) { + /* + printf("Driver name: %s\n", imp_dbh->odbc_driver_name); + printf("Driver type: %d\n", imp_dbh->driver_type); + printf("ODBC DBMS: %s\n", imp_dbh->odbc_dbms_name); + printf("Request type: %d\n", phs->requested_type); + printf("Param size: %d\n", phs->param_size); + # Driver name: libmsodbcsql-11.0.so.2270.0 + # Driver type: 0 + # ODBC DBMS: Microsoft SQL Server + # Request type: 0 + # Param size: 0 + */ + column_size = 0; + } /*printf("sloi = %d ps=%d sqlt=%d\n", strlen_or_ind, phs->param_size, phs->sql_type);*/ My /etc/odbc.ini config: ---------------------------- [VirtualODBC] Description = VirtualODBC Driver = /opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0 Database = imperia_i10 Server = 10.29.0.184,1433 AutoTranslate = No My /etc/odbcinst.ini config: ---------------------------- [VirtualODBC] Description=Microsoft ODBC Driver 11 for SQL Server Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0 Threading=1 UsageCount=1 The test script: ---------------------------- #!/usr/bin/perl use strict; use warnings; use DBI; use Storable qw (thaw); my ($dsn, $user, $pwd) = ($ARGV[0], $ARGV[1], $ARGV[2]); print "Connecting to the ODBC database.\n"; my $h = DBI->connect("dbi:ODBC:$dsn", $user, $pwd, { AutoCommit => 0, PrintError => 1, RaiseError => 1, }); eval { local $h->{'PrintError'} = 0; local $h->{'RaiseError'} = 0; $h->do(q/drop table metavarbin/); $h->commit; }; print "Create 'metavarbin' test table.\n"; $h->do(<<EOF); CREATE TABLE "metavarbin" ( "doc_id" INTEGER, "meta_name" VARCHAR (255), "meta_value" VARBINARY(MAX), "meta_idx" INTEGER, "from_ver" BIGINT, "to_ver" BIGINT, PRIMARY KEY("doc_id", "meta_name", "meta_idx", "from_ver", "to_ver")); EOF $h->commit; $h->do(<<EOF); CREATE INDEX "metavarbin_idx" ON "metavarbin"("doc_id"); EOF $h->commit; my $sth = $h->prepare('INSERT into metavarbin VALUES (?, ?, ?, ?, ?, ?)'); my @args = (1234, 'name', " " x 8001, 0, '1234567890', '1234567899'); print "Insert VARBINARY data over 8k.\n"; $sth->execute(@args); # Changing the data to prevent errors due PK constraint. $args[0] = $args[0] . '1'; print "Insert VARBINARY data up to 8k.\n"; $args[2] = " " x 8000; $sth->execute(@args); $args[0] = $args[0] . '1'; print "Insert VARBINARY data over 8k again.\n"; $args[2] = " " x 8001; #use DBI ':sql_types'; #$sth->bind_param(3, undef, {TYPE => SQL_VARBINARY}); $sth->execute(@args); $h->commit; # $ perl odbc.pl VirtualODBC user password I've spent some time writing this script since it wasn't obvious what is actually happening. In our software we (re)use prepared statements for performance reasons. The problem is related to the 8000 size limit, but it does not affect the first execute() call, but rather the second one that exceed the 8k limit. I've tried all types of bind_param variations to overcome and rebind the params for the second call, but no luck. Additionally, in our software we use "bytes" over "utf-8", so we have disabled every conversion setting to utf that exists, but it seems this is not related to this problem after all, at least this is still reproducible with the perl script. Another issue I'm not sure what is the origin - if I uncomment the 'bind_param' lines at the end of the script I still receive the "[Microsoft][ODBC Driver 11 for SQL Server]Invalid precision value (SQL-HY104)" which probably means I don't know how to properly bind, by hand, that problematic column (VARBINARY(MAX)) with or without my patch. Probably that is another bug or some kind of knowledge lack on my side. Regards, Julian Lishev
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-4310-1415731828-1508.100186-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <RT-Ticket-100186 [...] rt.cpan.org> <545D00C9.7090002 [...] imperia.bg> <rt-4.0.18-32219-1415625175-1924.100186-6-0 [...] rt.cpan.org> <5462171E.6040901 [...] imperia.bg> <rt-4.0.18-4310-1415731828-1508.100186-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-24168-1415744282-109.100186-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 5896
Download (untitled) / with headers
text/plain 5.7k
On Tue Nov 11 13:50:28 2014, july@imperia.bg wrote: Show quoted text
> Hi Martin, > > Here is the patch file: > ---------------------------- > > --- dbdimp2.c 2014-11-11 14:08:26.739154650 +0200 > +++ dbdimp.c 2014-11-11 15:29:08.419093790 +0200 > @@ -4177,6 +4177,25 @@ > * sloi = -500100 ps=0 sqlt=-3 (SQL_VARBINARY) > * sloi = 4001 ps=0 sqlt=-9 (SQL_WVARCHAR) <--- this one fails > without above > */ > + if (phs->sql_type == SQL_VARBINARY && phs->param_size == 0 > + && phs->requested_type == 0 && imp_dbh->driver_type == DT_DONT_CARE > + && strstr(imp_dbh->odbc_driver_name, "libmsodbcsql-11") > + == imp_dbh->odbc_driver_name > + && strcmp(imp_dbh->odbc_dbms_name, "Microsoft SQL Server") == 0 ) { > + /* > + printf("Driver name: %s\n", imp_dbh->odbc_driver_name); > + printf("Driver type: %d\n", imp_dbh->driver_type); > + printf("ODBC DBMS: %s\n", imp_dbh->odbc_dbms_name); > + printf("Request type: %d\n", phs->requested_type); > + printf("Param size: %d\n", phs->param_size); > + # Driver name: libmsodbcsql-11.0.so.2270.0 > + # Driver type: 0 > + # ODBC DBMS: Microsoft SQL Server > + # Request type: 0 > + # Param size: 0 > + */ > + column_size = 0; > + } > > /*printf("sloi = %d ps=%d sqlt=%d\n", strlen_or_ind, > phs->param_size, phs->sql_type);*/ > > > My /etc/odbc.ini config: > ---------------------------- > > [VirtualODBC] > Description = VirtualODBC > Driver = /opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0 > Database = imperia_i10 > Server = 10.29.0.184,1433 > AutoTranslate = No > > > My /etc/odbcinst.ini config: > ---------------------------- > > [VirtualODBC] > Description=Microsoft ODBC Driver 11 for SQL Server > Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0 > Threading=1 > UsageCount=1 > > > The test script: > ---------------------------- > > #!/usr/bin/perl > > use strict; > use warnings; > use DBI; > use Storable qw (thaw); > > my ($dsn, $user, $pwd) = ($ARGV[0], $ARGV[1], $ARGV[2]); > > print "Connecting to the ODBC database.\n"; > my $h = DBI->connect("dbi:ODBC:$dsn", $user, $pwd, > { > AutoCommit => 0, > PrintError => 1, > RaiseError => 1, > }); > > eval { > local $h->{'PrintError'} = 0; > local $h->{'RaiseError'} = 0; > $h->do(q/drop table metavarbin/); > $h->commit; > }; > > print "Create 'metavarbin' test table.\n"; > $h->do(<<EOF); > CREATE TABLE "metavarbin" ( > "doc_id" INTEGER, > "meta_name" VARCHAR (255), > "meta_value" VARBINARY(MAX), > "meta_idx" INTEGER, > "from_ver" BIGINT, > "to_ver" BIGINT, > PRIMARY KEY("doc_id", "meta_name", "meta_idx", "from_ver", "to_ver")); > EOF > $h->commit; > > $h->do(<<EOF); > CREATE INDEX "metavarbin_idx" ON "metavarbin"("doc_id"); > EOF > $h->commit; > > my $sth = $h->prepare('INSERT into metavarbin VALUES (?, ?, ?, ?, ?, ?)'); > > my @args = (1234, 'name', " " x 8001, 0, '1234567890', '1234567899'); > > print "Insert VARBINARY data over 8k.\n"; > $sth->execute(@args); > > # Changing the data to prevent errors due PK constraint. > $args[0] = $args[0] . '1'; > print "Insert VARBINARY data up to 8k.\n"; > $args[2] = " " x 8000; > $sth->execute(@args); > > $args[0] = $args[0] . '1'; > print "Insert VARBINARY data over 8k again.\n"; > $args[2] = " " x 8001; > > #use DBI ':sql_types'; > #$sth->bind_param(3, undef, {TYPE => SQL_VARBINARY}); > > $sth->execute(@args); > > $h->commit; > > > # $ perl odbc.pl VirtualODBC user password > > I've spent some time writing this script since it wasn't obvious what is > actually happening. In our software we (re)use prepared statements for > performance reasons. The problem is related to the 8000 size limit, but > it does not affect the first execute() call, but rather the second one > that exceed the 8k limit. > > I've tried all types of bind_param variations to overcome and rebind the > params for the second call, but no luck. > > Additionally, in our software we use "bytes" over "utf-8", so we have > disabled every conversion setting to utf that exists, but it seems this > is not related to this problem after all, at least this is still > reproducible with the perl script. > > Another issue I'm not sure what is the origin - if I uncomment the > 'bind_param' lines at the end of the script I still receive the > "[Microsoft][ODBC Driver 11 for SQL Server]Invalid precision value > (SQL-HY104)" which probably means I don't know how to properly bind, by > hand, that problematic column (VARBINARY(MAX)) with or without my patch. > Probably that is another bug or some kind of knowledge lack on my side. > > Regards, > Julian Lishev
Wow Julian, I wish everyone who reported an issue did as much work to help identify the problem. Since my first reply I've tried to reproduce your problem with our MS SQL Server driver and could not so in the hope you would provide a reproducible script I've downloaded and installed the MS driver you are using. I'll look into your solution and also the issues you have when uncommented the bind params at the end of the script. Hopefully, I'll be in a position to provide a new version you can try by the weekend. BTW, the driver you are using is the same codebase as the Windows MS native client driver so I've already fixed the issue of the workarounds in DBD::ODBC for MS SQL Server not working with the linux driver. Any column which uses MAX is a PITA because the driver does not report a size for the parameter. This seems to be the case that MS added max support to MS SQL Server before realising it didn't fit into ODBC too well. Rhanks again for the detailed info - I'll get back to you soon. Martin -- Martin J. Evans Wetherby, UK
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-24168-1415744282-109.100186-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <RT-Ticket-100186 [...] rt.cpan.org> <545D00C9.7090002 [...] imperia.bg> <rt-4.0.18-32219-1415625175-1924.100186-6-0 [...] rt.cpan.org> <5462171E.6040901 [...] imperia.bg> <rt-4.0.18-4310-1415731828-1508.100186-0-0 [...] rt.cpan.org> <rt-4.0.18-24168-1415744282-109.100186-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-32126-1415745134-1033.100186-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 497
Download (untitled) / with headers
text/plain 497b
First interesting point is that script works perfectly on Windows using the SQL Server ODBC Driver or the native client driver without your patch. It also works with the bind_param uncommented at the end of the script. So it would seem the linux driver is different from the native client windows driver in some way or there is a difference due to the sql server databases we are using. Will try again tomorrow with the linux driver I installed at work. Martin -- Martin J. Evans Wetherby, UK
MIME-Version: 1.0
X-Spam-Status: No, score=-5.568 tagged_above=-99.9 required=10 tests=[AWL=1.000, BAYES_00=-1.9, FROM_OUR_RT=-4, RP_MATCHES_RCVD=-0.668] autolearn=ham
In-Reply-To: <rt-4.0.18-32126-1415745134-362.100186-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-100186 [...] rt.cpan.org> <545D00C9.7090002 [...] imperia.bg> <rt-4.0.18-32219-1415625175-1924.100186-6-0 [...] rt.cpan.org> <5462171E.6040901 [...] imperia.bg> <rt-4.0.18-4310-1415731828-1508.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-24168-1415744282-109.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-32126-1415745134-362.100186-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Virus-Scanned: amavisd-new at imperia.bg
Message-ID: <54634900.9000008 [...] imperia.bg>
content-type: text/plain; charset="utf-8"; format="flowed"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -5.568
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id E777F240392 for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Wed, 12 Nov 2014 06:48:45 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jsAtSYWl-HaJ for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Wed, 12 Nov 2014 06:48:44 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 58FA7240324 for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 12 Nov 2014 06:48:42 -0500 (EST)
Received: (qmail 939 invoked by alias); 12 Nov 2014 11:48:42 -0000
Received: from smtp.imperia.bg (HELO smtp.imperia.bg) (213.130.73.86) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 12 Nov 2014 03:48:39 -0800
Received: from localhost (git.imperia.bg [127.0.0.1]) by smtp.imperia.bg (Postfix) with ESMTP id 6D325146DCBD for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 12 Nov 2014 13:48:32 +0200 (EET)
Received: from smtp.imperia.bg ([127.0.0.1]) by localhost (git.imperia.bg [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id niRuanl_kX7w for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 12 Nov 2014 13:48:14 +0200 (EET)
Received: from [10.29.0.18] (gw.imperia.bg [213.130.73.194]) by smtp.imperia.bg (Postfix) with ESMTPSA id 09515146DCBC for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 12 Nov 2014 13:48:14 +0200 (EET)
Delivered-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
Subject: Re: [rt.cpan.org #100186] Invalid precision value error
Return-Path: <julian.lishev [...] imperia.bg>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
X-RT-Mail-Extension: dbd-odbc
Date: Wed, 12 Nov 2014 13:48:16 +0200
X-Spam-Level:
To: bug-DBD-ODBC [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Julian <july [...] imperia.bg>
RT-Message-ID: <rt-4.0.18-31149-1415792927-1411.100186-0-0 [...] rt.cpan.org>
Content-Length: 628
Download (untitled) / with headers
text/plain 628b
Hi Martin, Thanks for the feedback. I'm using SQL Server 2008 R2 SP2 (Express Edition). But indeed, that worked quite well before with both Windows client and server. When I had a Windows based test machine, I've successfully run all the tests, by using DSN with "SQL Server" or "SQL Server Native Client" ODBC driver and DBD-ODBC 1.35 (the latest version of the StateAactive's repository for my older Perl). So, yes. I guess the problem is with the Linux driver, compiled by the Microsoft. Let me know if you need tips how to install their package (I can forward you my documentation to your personal email). Julian
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-31149-1415792927-1411.100186-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <RT-Ticket-100186 [...] rt.cpan.org> <545D00C9.7090002 [...] imperia.bg> <rt-4.0.18-32219-1415625175-1924.100186-6-0 [...] rt.cpan.org> <5462171E.6040901 [...] imperia.bg> <rt-4.0.18-4310-1415731828-1508.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-24168-1415744282-109.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-32126-1415745134-362.100186-6-0 [...] rt.cpan.org> <54634900.9000008 [...] imperia.bg> <rt-4.0.18-31149-1415792927-1411.100186-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-26584-1415798334-1356.100186-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 994
Download (untitled) / with headers
text/plain 994b
On Wed Nov 12 06:48:47 2014, july@imperia.bg wrote: Show quoted text
> Hi Martin, > > Thanks for the feedback. > > I'm using SQL Server 2008 R2 SP2 (Express Edition). > > But indeed, that worked quite well before with both Windows client and > server. When I had a Windows based test machine, I've successfully run > all the tests, by using > DSN with "SQL Server" or "SQL Server Native Client" ODBC driver and > DBD-ODBC 1.35 (the latest version of the StateAactive's repository for > my older Perl). > > So, yes. I guess the problem is with the Linux driver, compiled by the > Microsoft. Let me know if you need tips how to install their package (I > can forward you my documentation to your personal email). > > Julian
The machine I was installing the MS linux driver on is not accessible to me today unfortunately. I have an ubuntu machine I could use. If you think your notes might work for ubuntu send them to my cpan address please - mjevans@cpan.org. Martin -- Martin J. Evans Wetherby, UK
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-26584-1415798334-1356.100186-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <RT-Ticket-100186 [...] rt.cpan.org> <545D00C9.7090002 [...] imperia.bg> <rt-4.0.18-32219-1415625175-1924.100186-6-0 [...] rt.cpan.org> <5462171E.6040901 [...] imperia.bg> <rt-4.0.18-4310-1415731828-1508.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-24168-1415744282-109.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-32126-1415745134-362.100186-6-0 [...] rt.cpan.org> <54634900.9000008 [...] imperia.bg> <rt-4.0.18-31149-1415792927-1411.100186-0-0 [...] rt.cpan.org> <rt-4.0.18-26584-1415798334-1356.100186-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-31904-1415812090-501.100186-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 178
Download (untitled) / with headers
text/plain 178b
This driver even segfaults in 2nd connect call in 02simple.t test! Issue reproduced at last so now I can start looking for a workaround. Martin -- Martin J. Evans Wetherby, UK
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-31904-1415812090-501.100186-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-4310-1415731828-1508.100186-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-26889-1415812483-1573.100186-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 3889
Download (untitled) / with headers
text/plain 3.7k
On Wed Nov 12 12:08:10 2014, MJEVANS wrote: Show quoted text
> This driver even segfaults in 2nd connect call in 02simple.t test! > > Issue reproduced at last so now I can start looking for a workaround. > > Martin
OOPS, your test code works (with last bind_param still commented out) without your patch. It still continues to work when I make the following change to recognise it: diff --git a/dbdimp.c b/dbdimp.c index 35dd369..d56dec1 100644 --- a/dbdimp.c +++ b/dbdimp.c @@ -29,9 +29,8 @@ * http://perldoc.perl.org/perlguts.html#Formatted-Printing-of-IVs,-UVs,-and-NVs * http://cpansearch.perl.org/src/RURBAN/illguts-0.44/index.html * Internal replacements for standard C library functions: - * http://search.cpan.org/~jesse/perl-5.12.1/pod/perlclib.pod + * http://perldoc.perl.org/perlclib.html * http://search.cpan.org/dist/Devel-PPPort/PPPort.pm - * * MS ODBC 64 bit: * http://msdn.microsoft.com/en-us/library/ms716287%28v=vs.85%29.aspx */ @@ -6541,7 +6540,8 @@ static int post_connect( if (strcmp(imp_dbh->odbc_driver_name, "SQLSRV32.DLL") == 0) { imp_dbh->driver_type = DT_SQL_SERVER; } else if ((strcmp(imp_dbh->odbc_driver_name, "sqlncli10.dll") == 0) || - (strcmp(imp_dbh->odbc_driver_name, "SQLNCLI.DLL") == 0)) { + (strcmp(imp_dbh->odbc_driver_name, "SQLNCLI.DLL") == 0) || + (strcasestr(imp_dbh->odbc_driver_name, "libmsodbcsql") == 0)) { imp_dbh->driver_type = DT_SQL_SERVER_NATIVE_CLIENT; } else if (strcmp(imp_dbh->odbc_driver_name, "odbcjt32.dll") == 0) { imp_dbh->driver_type = DT_MS_ACCESS_JET; Last bind_param (when uncommented) does still fail. So it appears I have not reproduced it after all. perl rt100186.pl Connecting to the ODBC database. Create 'metavarbin' test table. Insert VARBINARY data over 8k. Insert VARBINARY data up to 8k. Insert VARBINARY data over 8k again. use strict; use warnings; use DBI; use Storable qw (thaw); print "Connecting to the ODBC database.\n"; my $h = DBI->connect("dbi:ODBC:xxx", "xxx", "xxx", { AutoCommit => 0, PrintError => 1, RaiseError => 1, }); eval { local $h->{'PrintError'} = 0; local $h->{'RaiseError'} = 0; $h->do(q/drop table metavarbin/); $h->commit; }; print "Create 'metavarbin' test table.\n"; $h->do(<<EOF); CREATE TABLE "metavarbin" ( "doc_id" INTEGER, "meta_name" VARCHAR (255), "meta_value" VARBINARY(MAX), "meta_idx" INTEGER, "from_ver" BIGINT, "to_ver" BIGINT, PRIMARY KEY("doc_id", "meta_name", "meta_idx", "from_ver", "to_ver")); EOF $h->commit; $h->do(<<EOF); CREATE INDEX "metavarbin_idx" ON "metavarbin"("doc_id"); EOF $h->commit; my $sth = $h->prepare('INSERT into metavarbin VALUES (?, ?, ?, ?, ?, ?)'); my @args = (1234, 'name', " " x 8001, 0, '1234567890', '1234567899'); print "Insert VARBINARY data over 8k.\n"; $sth->execute(@args); # Changing the data to prevent errors due PK constraint. $args[0] = $args[0] . '1'; print "Insert VARBINARY data up to 8k.\n"; $args[2] = " " x 8000; $sth->execute(@args); $args[0] = $args[0] . '1'; print "Insert VARBINARY data over 8k again.\n"; $args[2] = " " x 8001; #use DBI ':sql_types'; #$sth->bind_param(3, undef, {TYPE => SQL_VARBINARY}); #$sth->execute(@args); $h->commit; uncomment last few lines and I do get: Connecting to the ODBC database. Create 'metavarbin' test table. Insert VARBINARY data over 8k. Insert VARBINARY data up to 8k. Insert VARBINARY data over 8k again. DBD::ODBC::st execute failed: [Microsoft][ODBC Driver 11 for SQL Server]Invalid precision value (SQL-HY104) at rt100186.pl line 37. DBD::ODBC::st execute failed: [Microsoft][ODBC Driver 11 for SQL Server]Invalid precision value (SQL-HY104) at rt100186.pl line 37. Issuing rollback() due to DESTROY without explicit disconnect() of DBD::ODBC::db handle gangrad at rt100186.pl line 37. Martin -- Martin J. Evans Wetherby, UK
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-26889-1415812483-1573.100186-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-4310-1415731828-1508.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-26889-1415812483-1573.100186-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-14063-1415812924-1608.100186-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 437
Download (untitled) / with headers
text/plain 437b
# osname=linux, osvers=3.13.0-32-generic, archname=x86_64-linux # Using DBI 1.632 # Using DBD::ODBC 1.50 # Using DBMS_NAME 'Microsoft SQL Server' # Using DBMS_VER '11.00.2100' # Using DRIVER_NAME 'libmsodbcsql-11.0.so.2270.0' # Using DRIVER_VER '11.00.2270' # odbc_has_unicode 0 Also tried with odbc_has_unicode=1 Test script runs fine. I'm using SQL Server Express 64bit version 11.0.2100.60 Martin -- Martin J. Evans Wetherby, UK
MIME-Version: 1.0
X-Spam-Status: No, score=-5.901 tagged_above=-99.9 required=10 tests=[AWL=0.667, BAYES_00=-1.9, FROM_OUR_RT=-4, RP_MATCHES_RCVD=-0.668] autolearn=ham
In-Reply-To: <rt-4.0.18-26889-1415812483-1301.100186-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-100186 [...] rt.cpan.org> <rt-4.0.18-4310-1415731828-1508.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-26889-1415812483-1301.100186-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Virus-Scanned: amavisd-new at imperia.bg
Message-ID: <54639984.7030307 [...] imperia.bg>
content-type: text/plain; charset="utf-8"; format="flowed"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -5.901
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 740402406AE for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Wed, 12 Nov 2014 12:32:05 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9ajphcwaZjTm for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Wed, 12 Nov 2014 12:32:04 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id C2FBF2406AD for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 12 Nov 2014 12:32:03 -0500 (EST)
Received: (qmail 5854 invoked by alias); 12 Nov 2014 17:32:02 -0000
Received: from smtp.imperia.bg (HELO smtp.imperia.bg) (213.130.73.86) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 12 Nov 2014 09:31:59 -0800
Received: from localhost (git.imperia.bg [127.0.0.1]) by smtp.imperia.bg (Postfix) with ESMTP id E6C06146EA3B for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 12 Nov 2014 19:31:52 +0200 (EET)
Received: from smtp.imperia.bg ([127.0.0.1]) by localhost (git.imperia.bg [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y1iryfbklflm for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 12 Nov 2014 19:31:43 +0200 (EET)
Received: from [10.29.0.18] (gw.imperia.bg [213.130.73.194]) by smtp.imperia.bg (Postfix) with ESMTPSA id 451B8146EA2F for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 12 Nov 2014 19:31:43 +0200 (EET)
Delivered-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
Subject: Re: [rt.cpan.org #100186] Invalid precision value error
Return-Path: <julian.lishev [...] imperia.bg>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
X-RT-Mail-Extension: dbd-odbc
Date: Wed, 12 Nov 2014 19:31:48 +0200
X-Spam-Level:
To: bug-DBD-ODBC [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Julian <july [...] imperia.bg>
RT-Message-ID: <rt-4.0.18-23136-1415813526-1751.100186-0-0 [...] rt.cpan.org>
Content-Length: 446
Download (untitled) / with headers
text/plain 446b
Hi Martin, I've noticed that you have commented out the last execute() statement: #$sth->execute(@args); That last one is always needed to reproduce the issue. Running the first execute() should be ok, although it passes the limit of 8k. The second execute() should be ok, becuase it is exactly 8k and the third one should fail because it runs with data bigger than 8k. The other reported issue what if uncomment the "bind_param". Julian
MIME-Version: 1.0
X-Spam-Status: No, score=-6.068 tagged_above=-99.9 required=10 tests=[AWL=0.500, BAYES_00=-1.9, FROM_OUR_RT=-4, RP_MATCHES_RCVD=-0.668] autolearn=ham
In-Reply-To: <rt-4.0.18-14063-1415812924-1465.100186-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-100186 [...] rt.cpan.org> <rt-4.0.18-4310-1415731828-1508.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-26889-1415812483-1573.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-14063-1415812924-1465.100186-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Virus-Scanned: amavisd-new at imperia.bg
Message-ID: <54639DDB.60804 [...] imperia.bg>
content-type: text/plain; charset="utf-8"; format="flowed"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -6.068
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 50CA32406AA for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Wed, 12 Nov 2014 12:50:35 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8g6G9E1lpIo4 for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Wed, 12 Nov 2014 12:50:34 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 57FA9240566 for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 12 Nov 2014 12:50:34 -0500 (EST)
Received: (qmail 7448 invoked by alias); 12 Nov 2014 17:50:33 -0000
Received: from smtp.imperia.bg (HELO smtp.imperia.bg) (213.130.73.86) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 12 Nov 2014 09:50:31 -0800
Received: from localhost (git.imperia.bg [127.0.0.1]) by smtp.imperia.bg (Postfix) with ESMTP id 03D2A146EA33 for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 12 Nov 2014 19:50:25 +0200 (EET)
Received: from smtp.imperia.bg ([127.0.0.1]) by localhost (git.imperia.bg [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P7qaUOhDg-wt for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 12 Nov 2014 19:50:14 +0200 (EET)
Received: from [10.29.0.18] (gw.imperia.bg [213.130.73.194]) by smtp.imperia.bg (Postfix) with ESMTPSA id F31C8146EA2B for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 12 Nov 2014 19:50:13 +0200 (EET)
Delivered-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
Subject: Re: [rt.cpan.org #100186] Invalid precision value error
Return-Path: <julian.lishev [...] imperia.bg>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
X-RT-Mail-Extension: dbd-odbc
Date: Wed, 12 Nov 2014 19:50:19 +0200
X-Spam-Level:
To: bug-DBD-ODBC [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Julian <july [...] imperia.bg>
RT-Message-ID: <rt-4.0.18-23136-1415814635-1361.100186-0-0 [...] rt.cpan.org>
Content-Length: 827
Download (untitled) / with headers
text/plain 827b
I can reproduce it on two different machines: CentOS 5.9: Linux xxxxx 2.6.18-348.el5 #1 SMP Tue Jan 8 17:53:53 EST 2013 x86_64 x86_64 x86_64 GNU/Linux Here, without need for any "hacks", i.e. library dependencies to satisfy, so I guess there is no room for a big configuration mistakes on our server. Also the DBD::ODBC tests fails when I run them. Ubuntu 14.04: Linux yyyyy 3.13.0-39-generic #66-Ubuntu SMP Tue Oct 28 13:30:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux That is my primary dev machine and I had to do a small tweaks (as you saw in my installation tips). The common ground between those two is the SQL Server (2008 R2 Express Edition) : Product: Microsoft SQL Server Express Edition with Advanced Services (64-bit) Version: 10.50.1600.1 Server Collation: SQL_Latin1_General_CP1_CI_AS Regards, Julian
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-23136-1415813526-1751.100186-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <RT-Ticket-100186 [...] rt.cpan.org> <rt-4.0.18-4310-1415731828-1508.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-26889-1415812483-1301.100186-6-0 [...] rt.cpan.org> <54639984.7030307 [...] imperia.bg> <rt-4.0.18-23136-1415813526-1751.100186-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-20312-1415816379-648.100186-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 801
Download (untitled) / with headers
text/plain 801b
On Wed Nov 12 12:32:06 2014, july@imperia.bg wrote: Show quoted text
> Hi Martin, > > I've noticed that you have commented out the last execute() statement: > > #$sth->execute(@args); > > That last one is always needed to reproduce the issue. Running the first > execute() should be ok, although it passes the limit of 8k. The second > execute() should be ok, becuase it is exactly 8k and the third one > should fail because it runs with data bigger than 8k. > > The other reported issue what if uncomment the "bind_param". > > Julian
ok, sorry, I misunderstood. It is probably reproduced then but I'll have to check tomorrow. I put it on a virtual box which is using nat and cannot get at it from here. I did run with no lines commented out on Windows and it was ok. Martin -- Martin J. Evans Wetherby, UK
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-20312-1415816379-648.100186-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <RT-Ticket-100186 [...] rt.cpan.org> <rt-4.0.18-4310-1415731828-1508.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-26889-1415812483-1301.100186-6-0 [...] rt.cpan.org> <54639984.7030307 [...] imperia.bg> <rt-4.0.18-23136-1415813526-1751.100186-0-0 [...] rt.cpan.org> <rt-4.0.18-20312-1415816379-648.100186-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-1274-1415965443-817.100186-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 448
Download (untitled) / with headers
text/plain 448b
I have actually found a native client driver on Windows which your script fails with. I also have this reproduced in Linux with MS's linux driver. I have fixed the issue as can be seen in the following git diff. https://github.com/perl5-dbi/DBD-ODBC/commit/cdddb4f8e8dc3d8a7cd7aad481e22aa24e0c5d2d If I did a delveopment release (1.51_1) which incorporated this change would you be prepared to try it out? Martin -- Martin J. Evans Wetherby, UK
MIME-Version: 1.0
X-Spam-Status: No, score=-6.168 tagged_above=-99.9 required=10 tests=[AWL=0.400, BAYES_00=-1.9, FROM_OUR_RT=-4, RP_MATCHES_RCVD=-0.668] autolearn=ham
In-Reply-To: <rt-4.0.18-1274-1415965444-980.100186-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-100186 [...] rt.cpan.org> <rt-4.0.18-4310-1415731828-1508.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-26889-1415812483-1301.100186-6-0 [...] rt.cpan.org> <54639984.7030307 [...] imperia.bg> <rt-4.0.18-23136-1415813526-1751.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-20312-1415816379-648.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-1274-1415965444-980.100186-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Virus-Scanned: amavisd-new at imperia.bg
Message-ID: <5465F0D3.7070200 [...] imperia.bg>
content-type: text/plain; charset="utf-8"; format="flowed"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -6.168
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 01F502402F4 for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Fri, 14 Nov 2014 07:09:18 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UI5EpuyfJXQe for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Fri, 14 Nov 2014 07:09:16 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 679652400B8 for <bug-DBD-ODBC [...] rt.cpan.org>; Fri, 14 Nov 2014 07:09:15 -0500 (EST)
Received: (qmail 19761 invoked by alias); 14 Nov 2014 12:09:14 -0000
Received: from smtp.imperia.bg (HELO smtp.imperia.bg) (213.130.73.86) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 14 Nov 2014 04:09:11 -0800
Received: from localhost (git.imperia.bg [127.0.0.1]) by smtp.imperia.bg (Postfix) with ESMTP id 849AF20FFF5 for <bug-DBD-ODBC [...] rt.cpan.org>; Fri, 14 Nov 2014 14:09:03 +0200 (EET)
Received: from smtp.imperia.bg ([127.0.0.1]) by localhost (git.imperia.bg [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2gkHVCBIgJVx for <bug-DBD-ODBC [...] rt.cpan.org>; Fri, 14 Nov 2014 14:08:45 +0200 (EET)
Received: from [10.29.0.18] (gw.imperia.bg [213.130.73.194]) by smtp.imperia.bg (Postfix) with ESMTPSA id ADD7F1470DC3 for <bug-DBD-ODBC [...] rt.cpan.org>; Fri, 14 Nov 2014 14:08:45 +0200 (EET)
Delivered-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
Subject: Re: [rt.cpan.org #100186] Invalid precision value error
Return-Path: <julian.lishev [...] imperia.bg>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
X-RT-Mail-Extension: dbd-odbc
Date: Fri, 14 Nov 2014 14:08:51 +0200
X-Spam-Level:
To: bug-DBD-ODBC [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Julian <july [...] imperia.bg>
RT-Message-ID: <rt-4.0.18-14833-1415966958-906.100186-0-0 [...] rt.cpan.org>
Content-Length: 576
Download (untitled) / with headers
text/plain 576b
On 14/11/14 13:44, Martin J Evans via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=100186 > > > I have actually found a native client driver on Windows which your script fails with. I also have this reproduced in Linux with MS's linux driver. I have fixed the issue as can be seen in the following git diff. > > https://github.com/perl5-dbi/DBD-ODBC/commit/cdddb4f8e8dc3d8a7cd7aad481e22aa24e0c5d2d > > If I did a delveopment release (1.51_1) which incorporated this change would you be prepared to try it out? > > Martin
Sure, I'll try it when you are ready.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-14833-1415966958-906.100186-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <RT-Ticket-100186 [...] rt.cpan.org> <rt-4.0.18-4310-1415731828-1508.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-26889-1415812483-1301.100186-6-0 [...] rt.cpan.org> <54639984.7030307 [...] imperia.bg> <rt-4.0.18-23136-1415813526-1751.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-20312-1415816379-648.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-1274-1415965444-980.100186-6-0 [...] rt.cpan.org> <5465F0D3.7070200 [...] imperia.bg> <rt-4.0.18-14833-1415966958-906.100186-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-12940-1415970037-1229.100186-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 807
Download (untitled) / with headers
text/plain 807b
On Fri Nov 14 07:09:18 2014, july@imperia.bg wrote: Show quoted text
> > On 14/11/14 13:44, Martin J Evans via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=100186 > > > > > I have actually found a native client driver on Windows which your > > script fails with. I also have this reproduced in Linux with MS's > > linux driver. I have fixed the issue as can be seen in the following > > git diff. > > > > https://github.com/perl5-dbi/DBD- > > ODBC/commit/cdddb4f8e8dc3d8a7cd7aad481e22aa24e0c5d2d > > > > If I did a delveopment release (1.51_1) which incorporated this > > change would you be prepared to try it out? > > > > Martin
> Sure, I'll try it when you are ready.
It is on its way to the CPAN - may take a while to be seen on whatever mirror you are using. Martin -- Martin J. Evans Wetherby, UK
MIME-Version: 1.0
X-Spam-Status: No, score=-6.235 tagged_above=-99.9 required=10 tests=[AWL=0.333, BAYES_00=-1.9, FROM_OUR_RT=-4, RP_MATCHES_RCVD=-0.668] autolearn=ham
In-Reply-To: <rt-4.0.18-12940-1415970037-543.100186-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-100186 [...] rt.cpan.org> <rt-4.0.18-4310-1415731828-1508.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-26889-1415812483-1301.100186-6-0 [...] rt.cpan.org> <54639984.7030307 [...] imperia.bg> <rt-4.0.18-23136-1415813526-1751.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-20312-1415816379-648.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-1274-1415965444-980.100186-6-0 [...] rt.cpan.org> <5465F0D3.7070200 [...] imperia.bg> <rt-4.0.18-14833-1415966958-906.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-12940-1415970037-543.100186-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Virus-Scanned: amavisd-new at imperia.bg
Message-ID: <54660E65.5020004 [...] imperia.bg>
content-type: text/plain; charset="utf-8"; format="flowed"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -6.235
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 38F512402F4 for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Fri, 14 Nov 2014 09:15:36 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0ApM3mNYo1-2 for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Fri, 14 Nov 2014 09:15:33 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id DF02B2400B8 for <bug-DBD-ODBC [...] rt.cpan.org>; Fri, 14 Nov 2014 09:15:32 -0500 (EST)
Received: (qmail 1100 invoked by alias); 14 Nov 2014 14:15:31 -0000
Received: from smtp.imperia.bg (HELO smtp.imperia.bg) (213.130.73.86) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 14 Nov 2014 06:15:24 -0800
Received: from localhost (git.imperia.bg [127.0.0.1]) by smtp.imperia.bg (Postfix) with ESMTP id 8BDB11470F7A for <bug-DBD-ODBC [...] rt.cpan.org>; Fri, 14 Nov 2014 16:15:16 +0200 (EET)
Received: from smtp.imperia.bg ([127.0.0.1]) by localhost (git.imperia.bg [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EdX7Sq5C6IbO for <bug-DBD-ODBC [...] rt.cpan.org>; Fri, 14 Nov 2014 16:14:58 +0200 (EET)
Received: from [10.29.0.18] (gw.imperia.bg [213.130.73.194]) by smtp.imperia.bg (Postfix) with ESMTPSA id B03221470601 for <bug-DBD-ODBC [...] rt.cpan.org>; Fri, 14 Nov 2014 16:14:58 +0200 (EET)
Delivered-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
Subject: Re: [rt.cpan.org #100186] Invalid precision value error
Return-Path: <julian.lishev [...] imperia.bg>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
X-RT-Mail-Extension: dbd-odbc
Date: Fri, 14 Nov 2014 16:15:01 +0200
X-Spam-Level:
To: bug-DBD-ODBC [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Julian <july [...] imperia.bg>
RT-Message-ID: <rt-4.0.18-14129-1415974537-1577.100186-0-0 [...] rt.cpan.org>
Content-Length: 475
Download (untitled) / with headers
text/plain 475b
On 14/11/14 15:00, Martin J Evans via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=100186 > > > It is on its way to the CPAN - may take a while to be seen on whatever mirror you are using. > > Martin
It seems that the new version works well on both CentOS and Ubuntu. Our test suits are running without errors. My pl script works as expected too. The only thing that still fails are the DBD::ODBC own tests, but I guess you'll handle them later :) Julian
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-14129-1415974537-1577.100186-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-23136-1415813526-1751.100186-6-0 [...] rt.cpan.org> <rt-4.0.18-20312-1415816379-648.100186-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-25182-1415975794-656.100186-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 798
Download (untitled) / with headers
text/plain 798b
On Fri Nov 14 09:15:37 2014, july@imperia.bg wrote: Show quoted text
> On 14/11/14 15:00, Martin J Evans via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=100186 > > > > > It is on its way to the CPAN - may take a while to be seen on > > whatever mirror you are using. > > > > Martin
> > It seems that the new version works well on both CentOS and Ubuntu. > Our > test suits are running without errors. My pl script works as expected > too. > The only thing that still fails are the DBD::ODBC own tests, but I > guess > you'll handle them later :) > > Julian
Thanks Julian. Your efforts are much appreciated. I will look at the test failures but some are going to be a real pain as I get a segfault during one test. I'll mark this issue fixed in 1.51_1. Martin -- Martin J. Evans Wetherby, UK


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.