Skip Menu |

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

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

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

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.30_3



Subject: Allow SQLDescribeParam to be disabled in DBD::ODBC
Date: Wed, 11 May 2011 16:09:41 -0400
To: bug-DBD-ODBC [...] rt.cpan.org
From: "Peter C. Norton" <pedrinho [...] gmail.com>
While transitioning from the FreeTDS odbc driver to the easysoft odbc sql server driver, we discovered that some date/datetime strings that are legal SQL formats are not also legal ODBC formats, and are therefore causing errors. Our current code (lots of it) relies on dates like '20100101' to be inferred as YYYYMMDD and if it's passed to SQL Server as a string then the server will DTRT (perhaps dependent on locale, I'm not sure). This works for Sybase and SQL Server with FreeTDS. However, when using the easysoft driver and DBD::ODBC, the migration processes runs into a kink: '20100101' can't be converted in the driver into a date type, and the query fails when using prepared statements. To disable this, I've added an option, "odbc_force_default_bind_type" that will disable imp_dbh->odbc_sqldescribeparam_supported. For our purposes, I've only allowed this to be disabled and not have it re-enabled. If this has a place in the upstream driver let me know and I'll send you the patch. Thanks, -Peter
On Wed May 11 16:09:51 2011, pedrinho@gmail.com wrote: Show quoted text
> While transitioning from the FreeTDS odbc driver to the easysoft odbc > sql server driver, we discovered that some date/datetime strings that > are legal SQL formats are not also legal ODBC formats, and are > therefore causing errors. > > Our current code (lots of it) relies on dates like '20100101' to be > inferred as YYYYMMDD and if it's passed to SQL Server as a string then > the server will DTRT (perhaps dependent on locale, I'm not sure). This > works > for Sybase and SQL Server with FreeTDS. > > However, when using the easysoft driver and DBD::ODBC, the migration > processes runs into a kink: '20100101' can't be converted in the
driver into Show quoted text
> a date type, and the query fails when using prepared statements. > > To disable this, I've added an option, "odbc_force_default_bind_type" that > will > disable imp_dbh->odbc_sqldescribeparam_supported. For our purposes, > I've only allowed this to be disabled and not have it re-enabled. If this > has > a place in the upstream driver let me know and I'll send you the patch. > > > Thanks, > > -Peter
I understand the issue you are describing and to some extent I can see why you have ended up with the solution you have picked. I've personally never come across the problem the way around you describe as normally it is a problem NOT supporting SQLDescribeParam. I appreciate if you've got a lot of code which is written to a driver which does not support SQLDescribeParam and so it would be annoying to change it but by disabling SQLDescribeParam you are inevitably going to hit another issue in the future e.g., I sincerely hope you have not got any varchar(max) columns or you are in a world of pain. Just so you realise the implications. I have no problem with adding a flag to disable SQLDescribeParam and I don't need any patch from you to do it. Are you offering the patch on the basis that you'd like this added to DBD::ODBC for the future (as a supported feature) or are you offering this idea on the basis that you think it might be useful for others. It is a slim difference I agree, but if you are happy as you are and don't think it would benefit others I'd leave it. If you'd like it as a supported feature I'll add it so long as you are prepared to test it. Martin -- Martin J. Evans Wetherby, UK
Subject: Re: [rt.cpan.org #68123] Allow SQLDescribeParam to be disabled in DBD::ODBC
Date: Fri, 13 May 2011 16:21:06 -0400
To: bug-DBD-ODBC [...] rt.cpan.org
From: "Peter C. Norton" <pedrinho [...] gmail.com>
If you can add it to DBD::ODBC then I will be happy to test it. -Peter On Wed, May 11, 2011 at 4:48 PM, Martin J Evans via RT < bug-DBD-ODBC@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=68123 > > > On Wed May 11 16:09:51 2011, pedrinho@gmail.com wrote:
> > While transitioning from the FreeTDS odbc driver to the easysoft odbc > > sql server driver, we discovered that some date/datetime strings that > > are legal SQL formats are not also legal ODBC formats, and are > > therefore causing errors. > > > > Our current code (lots of it) relies on dates like '20100101' to be > > inferred as YYYYMMDD and if it's passed to SQL Server as a string then > > the server will DTRT (perhaps dependent on locale, I'm not sure). This > > works > > for Sybase and SQL Server with FreeTDS. > > > > However, when using the easysoft driver and DBD::ODBC, the migration > > processes runs into a kink: '20100101' can't be converted in the
> driver into
> > a date type, and the query fails when using prepared statements. > > > > To disable this, I've added an option, "odbc_force_default_bind_type"
> that
> > will > > disable imp_dbh->odbc_sqldescribeparam_supported. For our purposes, > > I've only allowed this to be disabled and not have it re-enabled. If
> this
> > has > > a place in the upstream driver let me know and I'll send you the patch. > > > > > > Thanks, > > > > -Peter
> > I understand the issue you are describing and to some extent I can see > why you have ended up with the solution you have picked. I've personally > never come across the problem the way around you describe as normally it > is a problem NOT supporting SQLDescribeParam. I appreciate if you've got > a lot of code which is written to a driver which does not support > SQLDescribeParam and so it would be annoying to change it but by > disabling SQLDescribeParam you are inevitably going to hit another issue > in the future e.g., I sincerely hope you have not got any varchar(max) > columns or you are in a world of pain. Just so you realise the > implications. > > I have no problem with adding a flag to disable SQLDescribeParam and I > don't need any patch from you to do it. Are you offering the patch on > the basis that you'd like this added to DBD::ODBC for the future (as a > supported feature) or are you offering this idea on the basis that you > think it might be useful for others. It is a slim difference I agree, > but if you are happy as you are and don't think it would benefit others > I'd leave it. If you'd like it as a supported feature I'll add it so > long as you are prepared to test it. > > Martin > -- > Martin J. Evans > Wetherby, UK >
On Fri May 13 16:21:15 2011, pedrinho@gmail.com wrote: Show quoted text
> If you can add it to DBD::ODBC then I will be happy to test it. > > -Peter
I've just uploaded DBD::ODBC 1.30_2 to PAUSE. You should be able to see it in an hour or two. It adds odbc_describe_parameters attribute (documented but I missed off the Changes file by mistake). I believe it does what you wanted. Please let me know how you get on. Martin -- Martin J. Evans Wetherby, UK
On Mon May 16 05:06:58 2011, MJEVANS wrote: Show quoted text
> On Fri May 13 16:21:15 2011, pedrinho@gmail.com wrote:
> > If you can add it to DBD::ODBC then I will be happy to test it. > > > > -Peter
> > I've just uploaded DBD::ODBC 1.30_2 to PAUSE. You should be able to see > it in an hour or two. It adds odbc_describe_parameters attribute > (documented but I missed off the Changes file by mistake). I believe it > does what you wanted. > > Please let me know how you get on. > > Martin
Correction, it is working in 1.30_3. Martin -- Martin J. Evans Wetherby, UK
Subject: Re: [rt.cpan.org #68123] Allow SQLDescribeParam to be disabled in DBD::ODBC
Date: Tue, 17 May 2011 11:01:25 -0400
To: bug-DBD-ODBC [...] rt.cpan.org
From: "Peter C. Norton" <pedrinho [...] gmail.com>
OK, I'm not familiar with PAUSE, so I'll get an account and download 1.30_3. -Peter On Tue, May 17, 2011 at 5:35 AM, Martin J Evans via RT < bug-DBD-ODBC@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=68123 > > > On Mon May 16 05:06:58 2011, MJEVANS wrote:
> > On Fri May 13 16:21:15 2011, pedrinho@gmail.com wrote:
> > > If you can add it to DBD::ODBC then I will be happy to test it. > > > > > > -Peter
> > > > I've just uploaded DBD::ODBC 1.30_2 to PAUSE. You should be able to see > > it in an hour or two. It adds odbc_describe_parameters attribute > > (documented but I missed off the Changes file by mistake). I believe it > > does what you wanted. > > > > Please let me know how you get on. > > > > Martin
> > Correction, it is working in 1.30_3. > > Martin > -- > Martin J. Evans > Wetherby, UK >
On Tue May 17 11:01:33 2011, pedrinho@gmail.com wrote: Show quoted text
> OK, I'm not familiar with PAUSE, so I'll get an account and download
1.30_3. Show quoted text
> > -Peter
You don't need one. Just go to http://search.cpan.org and enter DBD::ODBC in the search box. Click on the resultant link and it should get you to: http://search.cpan.org/~mjevans/DBD-ODBC-1.29/ where you can download 1.30_3. Martin -- Martin J. Evans Wetherby, UK
Subject: Re: [rt.cpan.org #68123] Allow SQLDescribeParam to be disabled in DBD::ODBC
Date: Tue, 17 May 2011 18:25:06 -0400
To: bug-DBD-ODBC [...] rt.cpan.org
From: "Peter C. Norton" <pedrinho [...] gmail.com>
OK, I've run the basic functionality tests and the flag works as we need. We're going to run further in-house tests to see how this driver works for us. Thanks, -Peter On Tue, May 17, 2011 at 11:19 AM, Martin J Evans via RT < bug-DBD-ODBC@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=68123 > > > On Tue May 17 11:01:33 2011, pedrinho@gmail.com wrote:
> > OK, I'm not familiar with PAUSE, so I'll get an account and download
> 1.30_3.
> > > > -Peter
> > You don't need one. Just go to http://search.cpan.org and enter > DBD::ODBC in the search box. Click on the resultant link and it should > get you to: > > http://search.cpan.org/~mjevans/DBD-ODBC-1.29/ > > where you can download 1.30_3. > > Martin > -- > Martin J. Evans > Wetherby, UK >