Skip Menu |

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

Report information
The Basics
Id: 63081
Status: resolved
Priority: 0/
Queue: DBD-Sybase

People
Owner: mpeppler [...] peppler.org
Requestors: jh.cpan [...] plonk.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.10
  • 1.11
Fixed in: (no value)



Subject: error_handler: Data-conversion resulted in overflow.
A perl script with this in it: my ($col) = $dbh->selectrow_array(q(SELECT col FROM table WHERE key=?), undef, $key); prints this ($col is empty afterwards): error_handler: Data-conversion resulted in overflow. "col" is defined as Type_name: TypID Storage_type: numeric Length: 6 Prec: 10 Scale: 0 Nulls: 0 Default_name: NULL Rule_name: NULL Access_Rule_name: NULL Identity: 0 With 1.09, everything is fine. This is perl v5.12.2 with DBI 1.613 on Fedora 14 (kernel 2.6.34.7- 61.fc13.x86_64).
On Wed Nov 17 07:27:58 2010, http://jhirsch.myopenid.com/ wrote: Show quoted text
> A perl script with this in it: > > my ($col) = $dbh->selectrow_array(q(SELECT col FROM table WHERE key=?), > undef, $key); > > prints this ($col is empty afterwards): > > error_handler: Data-conversion resulted in overflow. > > "col" is defined as > Type_name: TypID > Storage_type: numeric > Length: 6 > Prec: 10 > Scale: 0 > Nulls: 0 > Default_name: NULL > Rule_name: NULL > Access_Rule_name: NULL > Identity: 0 > > With 1.09, everything is fine. > > This is perl v5.12.2 with DBI 1.613 on Fedora 14 (kernel 2.6.34.7- > 61.fc13.x86_64).
Hi, Could you please send me an sp_help output for the table? And is this with the Sybase client, or with FreeTDS? Thanks.
From: Jakob
On Wed Nov 17 15:21:23 2010, MEWP wrote: Show quoted text
> > This is perl v5.12.2 with DBI 1.613 on Fedora 14 (kernel 2.6.34.7- > > 61.fc13.x86_64).
> Could you please send me an sp_help output for the table?
Um, ok, if you think this will help you. (I had to anonymize some col names, though.) Name: access Owner: dbo Object_type: user table Data_located_on_segment: default When_created: Jun 11 2002 10:33:55:837PM Column_name: access_id Type: TypID Length: 6 Prec: 10 Scale: 0 Nulls: 0 Default_name: NULL Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: username Type: TypUsername Length: 20 Prec: NULL Scale: NULL Nulls: 0 Default_name: NULL Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: password Type: TypLongPassword Length: 255 Prec: NULL Scale: NULL Nulls: 0 Default_name: NULL Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: xxxxxx Type: int Length: 4 Prec: NULL Scale: NULL Nulls: 1 Default_name: NULL Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: xxxxxxxxx Type: int Length: 4 Prec: NULL Scale: NULL Nulls: 1 Default_name: NULL Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: multiprovider Type: TypBool Length: 1 Prec: NULL Scale: NULL Nulls: 0 Default_name: Falsch Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: xxxxxxxxx Type: TypBool Length: 1 Prec: NULL Scale: NULL Nulls: 0 Default_name: Falsch Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: xxxxxxx_id Type: TypID Length: 6 Prec: 10 Scale: 0 Nulls: 1 Default_name: NULL Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: xxxxxxx_xxxxxxxxxxx Type: TypBool Length: 1 Prec: NULL Scale: NULL Nulls: 0 Default_name: Falsch Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: xxxx_xxxxxxxx Type: int Length: 4 Prec: NULL Scale: NULL Nulls: 1 Default_name: NULL Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: lastchange Type: datetime Length: 8 Prec: NULL Scale: NULL Nulls: 1 Default_name: NULL Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: changedby Type: TypChangedBy Length: 40 Prec: NULL Scale: NULL Nulls: 1 Default_name: NULL Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: xxxxx_xxxxxx_xxxxxxxx Type: varchar Length: 65 Prec: NULL Scale: NULL Nulls: 1 Default_name: NULL Rule_name: NULL Access_Rule_name: NULL Identity: 0 Column_name: xxxxxxx_id Type: TypID Length: 6 Prec: 10 Scale: 0 Nulls: 1 Default_name: NULL Rule_name: NULL Access_Rule_name: NULL Identity: 0 index_name: access_PK index_description: clustered, unique located on default index_keys: access_id index_max_rows_per_page: 0 index_fillfactor: 0 index_reservepagegap: 0 index_created: Apr 21 2007 6:32AM index_name: access_U1 index_description: nonclustered, unique located on default index_keys: username index_max_rows_per_page: 0 index_fillfactor: 0 index_reservepagegap: 0 index_created: Apr 21 2007 6:32AM No defined keys for this object. Object is not partitioned. Lock scheme Datarows (2 rows affected) exp_row_size: 0 reservepagegap: NULL fillfactor: NULL max_rows_per_page: 0 identity_gap: 0 concurrency_opt_threshold: 15 optimistic_index_lock: 0 dealloc_first_txtpg: 0 (return status = 0) Show quoted text
> And is this with the Sybase client, or with FreeTDS?
I'm using freetds 0.82 (Fedora package freetds-0.82-6). btw, I tried compiling it with SYB_NATIVE_NUM defined, but that error remains.
It looks like that particular piece of code (handling numeric() data in a result set) has not changed. In addition, I can't reproduce the problem with Sybase OpenClient. If you can send me the output of a run with DBI->trace(5) turned on then I might be able to figure out where the issue is. Thanks.
From: Jakob
Am So 28. Nov 2010, 03:40:36, MEWP schrieb: Show quoted text
> If you can send me the output of a run with DBI->trace(5) turned on then > I might be able to figure out where the issue is.
I'm happy to do that. See the attached trace output.
Subject: trace5.txt
DBI 1.613-ithread default trace level set to 0x0/5 (pid 23598 pi 1018010) at dbd-sybase-issue-63081.pl line 18 -> selectrow_array for DBD::Sybase::db (DBI::db=HASH(0x12d5510)~0x1112df8 'SELECT access_id FROM access WHERE username=?' undef 'xxXXXX-XXX') thr#1018010 1 -> prepare for DBD::Sybase::db (DBI::db=HASH(0x1112df8)~INNER 'SELECT access_id FROM access WHERE username=?' undef) thr#1018010 New 'DBI::st' (for DBD::Sybase::st, parent=DBI::db=HASH(0x1112df8), id=undef) dbih_setup_handle(DBI::st=HASH(0x12d5978)=>DBI::st=HASH(0x1037e58), DBD::Sybase::st, 12d59d8, Null!) dbih_make_com(DBI::db=HASH(0x1112df8), 12d64b0, DBD::Sybase::st, 544, 0) thr#1018010 dbih_setup_attrib(DBI::st=HASH(0x1037e58), Err, DBI::db=HASH(0x1112df8)) SCALAR(0x11e1248) (already defined) dbih_setup_attrib(DBI::st=HASH(0x1037e58), State, DBI::db=HASH(0x1112df8)) SCALAR(0x11e1308) (already defined) dbih_setup_attrib(DBI::st=HASH(0x1037e58), Errstr, DBI::db=HASH(0x1112df8)) SCALAR(0x11e12a8) (already defined) dbih_setup_attrib(DBI::st=HASH(0x1037e58), TraceLevel, DBI::db=HASH(0x1112df8)) 0 (already defined) dbih_setup_attrib(DBI::st=HASH(0x1037e58), FetchHashKeyName, DBI::db=HASH(0x1112df8)) 'NAME' (already defined) dbih_setup_attrib(DBI::st=HASH(0x1037e58), HandleSetErr, DBI::db=HASH(0x1112df8)) undef (not defined) dbih_setup_attrib(DBI::st=HASH(0x1037e58), HandleError, DBI::db=HASH(0x1112df8)) undef (not defined) dbih_setup_attrib(DBI::st=HASH(0x1037e58), ReadOnly, DBI::db=HASH(0x1112df8)) undef (not defined) dbih_setup_attrib(DBI::st=HASH(0x1037e58), Profile, DBI::db=HASH(0x1112df8)) undef (not defined) syb_st_prepare() -> inUse = 0 dbd_preparse parameter :p1 () dbd_preparse scanned 1 distinct placeholders dyn_prepare: ct_dynamic(CS_PREPARE) for DBD1 syb_alloc_cmd() -> CS_COMMAND 12ecdf0 for CS_CONNECTION 1041420 dyn_prepare: ct_dynamic(CS_DESCRIBE_INPUT) for DBD1 dyn_prepare: ct_results(CS_DESCRIBE_INPUT) for DBD1 - restype 4051 dyn_prepare: ct_res_info(CS_DESCRIBE_INPUT) statement has 1 parameters dyn_prepare: ct_describe(CS_DESCRIBE_INPUT) col 1, type 0, name , status 0, length 20 dyn_prepare: ct_results(CS_DESCRIBE_INPUT) for DBD1 - restype 4046 syb_st_prepare() -> set inUse 1 <- prepare= ( DBI::st=HASH(0x12d5978) ) [1 items] at ./dbd-sybase-issue-63081.pl line 20 bind :p1 <== 'xxXXXX-XXX' (attribs: ) bind :p1 () <== 'xxXXXX-XXX' (size 10/16/0, ptype 4, otype 0) bind :p1 <== 'xxXXXX-XXX' (size 15, ok 1) datafmt: type=0, name=, status=0, len=10 saved type: 0 cmd_execute() -> ct_send() OK cmd_execute() -> set inUse flag st_next_result() -> ct_results(4040) == 1 ct_res_info() returns 1 columns STORE DBI::st=HASH(0x1037e58) 'NUM_OF_FIELDS' => 1 ct_describe(0): type = 16, maxlen = 6 describe() -> col 0, type 0, realtype 16 describe() retcode = 1 st_next_result() -> lasterr = 0, lastsev = 0 error_handler: Data-conversion resulted in overflow. dbih_setup_fbav alloc for 1 fields syb_st_fetch() -> ct_fetch() = -203 (0 rows, 1 cols) syb_st_fetch() -> ct_fetch() = -204 (0 rows, 1 cols) st_next_result() -> ct_results(4046) == 1 st_next_result() -> ct_results(4047) == 1 st_next_result() -> ct_results(4046) == 1 ct_results(4046) final retcode = -205 st_next_result() -> lasterr = 0, lastsev = 0 st_next_result() -> got CS_CMD_DONE: resetting ACTIVE, moreResults, dyn_execed, exec_done clear_sth_flags() -> resetting ACTIVE, moreResults, dyn_execed, exec_done clear_sth_flags() -> reset inUse flag syb_st_fetch() -> st_next_results() == 4046 clear_sth_flags() -> resetting ACTIVE, moreResults, dyn_execed, exec_done clear_sth_flags() -> reset inUse flag <- selectrow_array= ( ) [0 items] at ./dbd-sybase-issue-63081.pl line 20 <> DESTROY(DBI::st=HASH(0x12d5978)) ignored for outer handle (inner DBI::st=HASH(0x1037e58) has ref cnt 1) -> DESTROY for DBD::Sybase::st (DBI::st=HASH(0x1037e58)~INNER) thr#1018010 syb_st_destroy: called on 12ea360... dealloc_dynamic: ct_dynamic(CS_DEALLOC) for DBD1 syb_st_destroy(): freeing imp_sth->statement ct_cmd_drop() -> CS_COMMAND 12ecdf0 syb_st_destroy(): cmd dropped: 1 <- DESTROY= ( undef ) [1 items] at ./dbd-sybase-issue-63081.pl line 21 via at ./dbd-sybase-issue-63081.pl line 21 dbih_clearcom 0x1037e58 (com 0x12ea360, type 3) done. <> DESTROY(DBI::db=HASH(0x12d5510)) ignored for outer handle (inner DBI::db=HASH(0x1112df8) has ref cnt 1) -> DESTROY for DBD::Sybase::db (DBI::db=HASH(0x1112df8)~INNER) thr#1018010 syb_db_disconnect() -> ct_close() <- DESTROY= ( undef ) [1 items] at ./dbd-sybase-issue-63081.pl line 21 via at ./dbd-sybase-issue-63081.pl line 21 dbih_clearcom 0x1112df8 (com 0x12d64b0, type 2) done. -- DBI::END ($@: , $!: ) -> disconnect_all for DBD::Sybase::dr (DBI::dr=HASH(0x1112090)~0x1112108) thr#1018010 <- disconnect_all= ( 1 ) [1 items] at /usr/lib64/perl5/DBI.pm line 740 via at ./dbd-sybase-issue-63081.pl line 21 ! -> DESTROY in DBD::_::common for DBD::Sybase::dr (DBI::dr=HASH(0x1112108)~INNER) thr#1018010 ! <- DESTROY= ( undef ) [1 items] during global destruction dbih_clearcom 0x1112090 (com 0x12a41d0, type 1) done. ! <> DESTROY for DBI::dr=HASH(0x1112090) ignored (inner handle gone)
It looks to me to be an issue with FreeTDS. You get: STORE DBI::st=HASH(0x1037e58) 'NUM_OF_FIELDS' => 1 ct_describe(0): type = 16, maxlen = 6 describe() -> col 0, type 0, realtype 16 I get a maxlen of 35 with Sybase OpenClient and a Sybase 15.5 back-end.
Am So 28. Nov 2010, 14:38:28, MEWP schrieb: Show quoted text
> It looks to me to be an issue with FreeTDS.
ok. 0.82 is the stable version, but it's rather old. I could try freetds current. Show quoted text
> You get: > > STORE DBI::st=HASH(0x1037e58) 'NUM_OF_FIELDS' => 1 > ct_describe(0): type = 16, maxlen = 6 > describe() -> col 0, type 0, realtype 16 > > I get a maxlen of 35 with Sybase OpenClient and a Sybase 15.5 back-
end. Isn't that the size inside the database, i.e. a 6-byte integer? The string representation can be larger, of course (e.g. unsigned int(6): 2^(6*8)-1 -> 281474976710655 -> 15 chars). Strange thing is, with DBD::Sybase it looks similar, but works just fine (see attached trace). Relevent differences are only after the error_handler, AFAICS.
Subject: trace5.109.txt
DBI 1.613-ithread default trace level set to 0x0/5 (pid 25023 pi 1215010) at dbd-sybase-issue-63081.pl line 18 -> selectrow_array for DBD::Sybase::db (DBI::db=HASH(0x14cd618)~0x14cd540 'SELECT access_id FROM access WHERE username=?' undef 'xxXXXX-XXX') thr#1215010 1 -> prepare for DBD::Sybase::db (DBI::db=HASH(0x14cd540)~INNER 'SELECT access_id FROM access WHERE username=?' undef) thr#1215010 New 'DBI::st' (for DBD::Sybase::st, parent=DBI::db=HASH(0x14cd540), id=undef) dbih_setup_handle(DBI::st=HASH(0x14cda80)=>DBI::st=HASH(0x1234e58), DBD::Sybase::st, 14cdae0, Null!) dbih_make_com(DBI::db=HASH(0x14cd540), 14ce4e0, DBD::Sybase::st, 544, 0) thr#1215010 dbih_setup_attrib(DBI::st=HASH(0x1234e58), Err, DBI::db=HASH(0x14cd540)) SCALAR(0x13de248) (already defined) dbih_setup_attrib(DBI::st=HASH(0x1234e58), State, DBI::db=HASH(0x14cd540)) SCALAR(0x13de308) (already defined) dbih_setup_attrib(DBI::st=HASH(0x1234e58), Errstr, DBI::db=HASH(0x14cd540)) SCALAR(0x13de2a8) (already defined) dbih_setup_attrib(DBI::st=HASH(0x1234e58), TraceLevel, DBI::db=HASH(0x14cd540)) 0 (already defined) dbih_setup_attrib(DBI::st=HASH(0x1234e58), FetchHashKeyName, DBI::db=HASH(0x14cd540)) 'NAME' (already defined) dbih_setup_attrib(DBI::st=HASH(0x1234e58), HandleSetErr, DBI::db=HASH(0x14cd540)) undef (not defined) dbih_setup_attrib(DBI::st=HASH(0x1234e58), HandleError, DBI::db=HASH(0x14cd540)) undef (not defined) dbih_setup_attrib(DBI::st=HASH(0x1234e58), ReadOnly, DBI::db=HASH(0x14cd540)) undef (not defined) dbih_setup_attrib(DBI::st=HASH(0x1234e58), Profile, DBI::db=HASH(0x14cd540)) undef (not defined) syb_st_prepare() -> inUse = 0 dbd_preparse parameter :p1 () dbd_preparse scanned 1 distinct placeholders dyn_prepare: ct_dynamic(CS_PREPARE) for DBD1 syb_alloc_cmd() -> CS_COMMAND 14e4ca0 for CS_CONNECTION 123e490 dyn_prepare: ct_dynamic(CS_DESCRIBE_INPUT) for DBD1 dyn_prepare: ct_results(CS_DESCRIBE_INPUT) for DBD1 - restype 4051 dyn_prepare: ct_res_info(CS_DESCRIBE_INPUT) statement has 1 parameters dyn_prepare: ct_describe(CS_DESCRIBE_INPUT) col 1, type 0, name , status 0, length 20 dyn_prepare: ct_results(CS_DESCRIBE_INPUT) for DBD1 - restype 4046 syb_st_prepare() -> set inUse 1 <- prepare= ( DBI::st=HASH(0x14cda80) ) [1 items] at ./dbd-sybase-issue-63081.pl line 20 bind :p1 <== 'xxXXXX-XXX' (attribs: ) bind :p1 () <== 'xxXXXX-XXX' (size 10/16/0, ptype 4, otype 0) bind :p1 <== 'xxXXXX-XXX' (size 15, ok 1) datafmt: type=0, name=, status=0, len=10 saved type: 0 cmd_execute() -> ct_send() OK cmd_execute() -> set inUse flag st_next_result() -> ct_results(4040) == 1 ct_res_info() returns 1 columns STORE DBI::st=HASH(0x1234e58) 'NUM_OF_FIELDS' => 1 ct_describe(0): type = 16, maxlen = 6 describe() -> col 0, type 0, realtype 16 describe() retcode = 1 st_next_result() -> lasterr = 0, lastsev = 0 dbih_setup_fbav alloc for 1 fields syb_st_fetch() -> ct_fetch() = 1 (1 rows, 1 cols) syb_st_fetch() -> 0/9/0 syb_st_finish() -> ct_cancel(CS_CANCEL_ALL) clear_sth_flags() -> resetting ACTIVE, moreResults, dyn_execed, exec_done clear_sth_flags() -> reset inUse flag <- selectrow_array= ( '215304424' ) [1 items] at ./dbd-sybase-issue-63081.pl line 20 <> DESTROY(DBI::st=HASH(0x14cda80)) ignored for outer handle (inner DBI::st=HASH(0x1234e58) has ref cnt 1) -> DESTROY for DBD::Sybase::st (DBI::st=HASH(0x1234e58)~INNER) thr#1215010 syb_st_destroy: called on 14e2210... dealloc_dynamic: ct_dynamic(CS_DEALLOC) for DBD1 syb_st_destroy(): freeing imp_sth->statement ct_cmd_drop() -> CS_COMMAND 14e4ca0 syb_st_destroy(): cmd dropped: 1 <- DESTROY= ( undef ) [1 items] at ./dbd-sybase-issue-63081.pl line 21 via at ./dbd-sybase-issue-63081.pl line 21 dbih_clearcom 0x1234e58 (com 0x14e2210, type 3) done. <> DESTROY(DBI::db=HASH(0x14cd618)) ignored for outer handle (inner DBI::db=HASH(0x14cd540) has ref cnt 1) -> DESTROY for DBD::Sybase::db (DBI::db=HASH(0x14cd540)~INNER) thr#1215010 syb_db_disconnect() -> ct_close() <- DESTROY= ( undef ) [1 items] dbih_clearcom 0x14cd540 (com 0x14ce4e0, type 2) done. -- DBI::END ($@: , $!: ) -> disconnect_all for DBD::Sybase::dr (DBI::dr=HASH(0x130f5d0)~0x130f648) thr#1215010 <- disconnect_all= ( 1 ) [1 items] at /usr/lib64/perl5/DBI.pm line 740 via at ./dbd-sybase-issue-63081.pl line 0 ! -> DESTROY in DBD::_::common for DBD::Sybase::dr (DBI::dr=HASH(0x130f648)~INNER) thr#1215010 ! <- DESTROY= ( undef ) [1 items] during global destruction dbih_clearcom 0x130f5d0 (com 0x14b8650, type 1) done. ! <> DESTROY for DBI::dr=HASH(0x130f5d0) ignored (inner handle gone)
Am So 28. Nov 2010, 16:12:07, http://jhirsch.myopenid.com/ schrieb: Show quoted text
> > You get: > > > > STORE DBI::st=HASH(0x1037e58) 'NUM_OF_FIELDS' => 1 > > ct_describe(0): type = 16, maxlen = 6 > > describe() -> col 0, type 0, realtype 16 > > > > I get a maxlen of 35 with Sybase OpenClient and a Sybase 15.5 back-
> end.
FWIW, when I use $sth->syb_describe I get this: DBD::Sybase 1.09: 'NAME' => 'access_id', 'STATUS' => '', 'SCALE' => 0, 'TYPE' => 0, 'SYBMAXLENGTH' => 6, 'MAXLENGTH' => 80, 'PRECISION' => 10, 'SYBTYPE' => 16 DBD::Sybase 1.11: 'NAME' => 'access_id', 'STATUS' => '', 'SCALE' => 0, 'TYPE' => 0, 'SYBMAXLENGTH' => 6, 'MAXLENGTH' => 7, 'PRECISION' => 10, 'SYBTYPE' => 16 MAXLENGTH 7 is definitely to small...
This is definitely an issue with FreeTDS. I get correct results with Sybase OpenClient.