#7 dbdimp.c does not accept blessed scalar as SQL_TYPE_DATE

closed
Edwin Pratomo
None
7
2005-08-30
2004-11-18
Dietrich
No

Running on v5.6.1 built for i86pc-solaris-64int anb
fbserver 1.5.1.

Assigning a scalar value a valid date in german format
leads to a blessed scalar eg.

my $date = '18.11.2004';
$sth->bind_param(1, $date);

for unknown reasons.

In dbdimp.c the assignment to the sqlda structure fails
because the test at line 2571

case SQL_TIMESTAMP:
case SQL_TYPE_TIME:
case SQL_TYPE_DATE:
#endif
if (SvPOK(value))
{

fails because SvPOK(value) fails.

Assigning the string directly in bind_param works correct:

$sth->bind_param(1, '18.11.2004');

The resolution would be to test additionally if value
is a blessed scalar:

if (SvPOK(value) || SvTYPE(value)==SVt_PVMG)

with this fix it works in both cases above.

The patch is against dbdimp.c version 1.106 from CVS

Discussion

  • Dietrich
    Dietrich
    2004-11-18

    Patch against dbdimp.c v1.106 from CVS

     
    Attachments
  • Dietrich
    Dietrich
    2004-11-18

    • priority: 5 --> 7
     
  • Dietrich
    Dietrich
    2005-02-08

    Logged In: YES
    user_id=1115632

    Any plans to apply the patch?

    Please have a look at this bug/patch/problem.

    Thank you

     
  • Dietrich
    Dietrich
    2005-02-08

    • assigned_to: nobody --> edpratomo
     
  • Edwin Pratomo
    Edwin Pratomo
    2005-08-30

    Logged In: YES
    user_id=47221

    patch applied. thanks.

     
  • Edwin Pratomo
    Edwin Pratomo
    2005-08-30

    • status: open --> closed